/* ══════════════════════════════════════════════════════
   repair_form.css — แบบฟอร์มแจ้งซ่อม วพช.
══════════════════════════════════════════════════════ */

* {
    font-family: 'Kanit', sans-serif;
}

body {
    overflow-x: hidden;
}

/* ── Select2 override ── */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: auto !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    padding: 0.5rem 2rem 0.5rem 0.75rem !important;
    font-size: 0.9rem !important;
    font-family: 'Kanit', sans-serif !important;
    background: #ffffff !important;
    color: #111827 !important;
    transition: border-color .15s, box-shadow .15s, transform .15s, background-color .2s !important;
    box-shadow: none !important;
    outline: none !important;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #111827 !important;
    font-family: 'Kanit', sans-serif !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    padding: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    right: 0.6rem !important;
    top: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6b7280 transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

.select2-container--default.select2-container--open .select2-selection__arrow b {
    border-color: transparent transparent #6b7280 transparent !important;
    border-width: 0 4px 5px 4px !important;
}

.select2-dropdown {
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1) !important;
    font-family: 'Kanit', sans-serif !important;
    font-size: 0.9rem !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #d1d5db !important;
    border-radius: 0.25rem !important;
    font-family: 'Kanit', sans-serif !important;
    font-size: 0.88rem !important;
    padding: 0.35rem 0.6rem !important;
    outline: none !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .1) !important;
}

.select2-container--default .select2-results__option {
    padding: 0.45rem 0.75rem !important;
    font-family: 'Kanit', sans-serif !important;
    color: #374151 !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #2563eb !important;
    color: #fff !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
}

.select2-container:hover .select2-selection--single {
    border-color: #93c5fd !important;
    background-color: #f8faff !important;
    transform: scale(1.005);
}

/* ── Field base ── */
.field {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-family: 'Kanit', sans-serif;
    background: #ffffff;
    color: #111827;
    transition: border-color .2s, box-shadow .2s, transform .15s, background-color .2s;
    outline: none;
}

.field:hover {
    border-color: #93c5fd;
    background-color: #f8faff;
    transform: scale(1.005);
}

.field:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    transform: scale(1.005);
    background-color: #f8faff;
}

.field::placeholder {
    color: #9ca3af;
}

/* ── Section heading ── */
.sec-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6b7280;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ══ PRIORITY PILL ══ */
.priority-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0.6rem 0.5rem;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s ease;
    user-select: none;
}

.priority-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, .08);
}

.priority-pill .pill-icon {
    color: #9ca3af;
    transition: color 0.18s;
}

.priority-pill .pill-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    transition: color 0.18s;
}

/* selected states */
.priority-pill.selected-normal  { border-color: #16a34a; background: #f0fdf4; }
.priority-pill.selected-normal .pill-icon  { color: #16a34a; }
.priority-pill.selected-normal .pill-label { color: #16a34a; }

.priority-pill.selected-urgent  { border-color: #d97706; background: #fffbeb; }
.priority-pill.selected-urgent .pill-icon  { color: #d97706; }
.priority-pill.selected-urgent .pill-label { color: #d97706; }

.priority-pill.selected-critical { border-color: #dc2626; background: #fef2f2; }
.priority-pill.selected-critical .pill-icon  { color: #dc2626; }
.priority-pill.selected-critical .pill-label { color: #dc2626; }

/* ── Priority badge (ใน card) ── */
.badge-normal {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 0.7rem; font-weight: 600;
    background: #f3f4f6; color: #4b5563;
}
.badge-urgent {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 0.7rem; font-weight: 600;
    background: #fef3c7; color: #92400e;
}
.badge-critical {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 0.7rem; font-weight: 600;
    background: #fee2e2; color: #991b1b;
}

/* card border-left สี priority */
.card-normal   { border-left: 3px solid #d1d5db; }
.card-urgent   { border-left: 3px solid #f59e0b; }
.card-critical {
    border-left: 3px solid #ef4444;
    animation: pulseRed 2s ease-in-out infinite;
}

@keyframes pulseRed {
    0%, 100% { border-left-color: #ef4444; }
    50%       { border-left-color: #fca5a5; }
}

/* ── Toastr override ── */
#toast-container > .toast {
    font-family: 'Kanit', sans-serif;
    background: #fff !important;
    color: #374151 !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .12) !important;
    padding: 14px 16px 14px 60px !important;
    min-width: 300px;
    opacity: 1 !important;
    border-left: none !important;
    background-image: none !important;
    position: relative;
}

#toast-container > .toast::before {
    content: '';
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    border-radius: 50%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
}

#toast-container > .toast-success::before {
    background-color: #16a34a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 00-1.414 0L8 12.586 4.707 9.293a1 1 0 00-1.414 1.414l4 4a1 1 0 001.414 0l8-8a1 1 0 000-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
}
#toast-container > .toast-error::before {
    background-color: #dc2626;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v4a1 1 0 102 0V7zm-1 8a1 1 0 100-2 1 1 0 000 2z' clip-rule='evenodd'/%3E%3C/svg%3E");
}
#toast-container > .toast-warning::before {
    background-color: #d97706;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-5a1 1 0 00-1 1v2a1 1 0 102 0V9a1 1 0 00-1-1z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

#toast-container > .toast-success .toast-title { color: #16a34a !important; font-weight: 700; font-size: 15px; font-family: 'Kanit', sans-serif; }
#toast-container > .toast-error   .toast-title { color: #dc2626 !important; font-weight: 700; font-size: 15px; font-family: 'Kanit', sans-serif; }
#toast-container > .toast-warning .toast-title { color: #d97706 !important; font-weight: 700; font-size: 15px; font-family: 'Kanit', sans-serif; }

#toast-container > .toast .toast-message {
    color: #4b5563 !important; font-size: 14px;
    font-family: 'Kanit', sans-serif; line-height: 1.5;
}
#toast-container > .toast .toast-close-button {
    color: #9ca3af !important; font-size: 18px; top: 8px; right: 10px;
}

#toast-container > .toast-success .toast-progress { background: #16a34a !important; }
#toast-container > .toast-error   .toast-progress { background: #dc2626 !important; }
#toast-container > .toast-warning .toast-progress { background: #d97706 !important; }
