/* ============================================
   HS4 Assessment System - Main Stylesheet
   v2.0 | รองรับระบบปีงบประมาณ
   ============================================ */

   :root {
    --hs4-primary:       #0A5C9E;
    --hs4-primary-light: #1a7dca;
    --hs4-secondary:     #00897B;
    --hs4-accent:        #F57C00;
    --hs4-danger:        #d32f2f;
    --hs4-success:       #2e7d32;
    --hs4-bg:            #f0f4f8;
    --hs4-surface:       #ffffff;
    --hs4-border:        #e2e8f0;
    --hs4-text:          #1a202c;
    --hs4-text-muted:    #64748b;
    --hs4-shadow:        0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --hs4-shadow-md:     0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --hs4-shadow-lg:     0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius:            12px;
    --radius-sm:         8px;
    --radius-xs:         6px;
    --fy-gold:           #f59e0b;
    --fy-gold-light:     rgba(245,158,11,0.12);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
    background-color: var(--hs4-bg);
    color: var(--hs4-text);
    font-size: 15px;
    line-height: 1.7;
}

/* ============ Navbar ============ */
#mainNav {
    background: linear-gradient(135deg, var(--hs4-primary) 0%, #073d69 100%);
    box-shadow: 0 2px 20px rgba(10,92,158,0.3);
    padding: 0.5rem 0;
    z-index: 1030;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
    overflow: hidden;
}
.brand-title { font-size: 0.95rem; font-weight: 700; color: #fff; letter-spacing: 0.3px; line-height: 1.2; }
.brand-sub   { font-size: 0.68rem; color: rgba(255,255,255,0.65); line-height: 1; }

/* Logo Image in brand-icon */
.brand-logo-img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    display: block;
}

/* FY Switcher in Navbar */
.fy-select-nav {
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #fff !important;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.82rem !important;
    font-weight: 600;
    padding: 0.2rem 2rem 0.2rem 0.65rem;
    border-radius: var(--radius-xs) !important;
    cursor: pointer;
    min-width: 90px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
}
.fy-select-nav:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25) !important;
    outline: none;
}
.fy-select-nav option { background: #073d69; color: #fff; }
.fy-nav-switcher { gap: 0.25rem !important; }

/* ============ Hero Banner ============ */
.hero-banner {
    background: linear-gradient(135deg, #073d69 0%, var(--hs4-primary) 45%, #1565C0 100%);
    position: relative; overflow: hidden;
}
.hero-banner::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='40' cy='40' r='35'/%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.hero-badge {
    display: inline-flex; align-items: center;
    background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.9);
    padding: 0.35rem 0.85rem; border-radius: 50px;
    font-size: 0.78rem; font-weight: 500;
    border: 1px solid rgba(255,255,255,0.18);
    letter-spacing: 0.3px;
}
.hero-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800; color: #fff; line-height: 1.3;
}
.hero-desc { color: rgba(255,255,255,0.75); font-size: 0.9rem; }

/* ── Fiscal Year Hero Selector ── */
.fy-hero-selector { /* wrapper */ }
.fy-selector-label {
    color: rgba(255,255,255,0.7); font-size: 0.8rem; font-weight: 500;
    display: flex; align-items: center;
}
.fy-tabs-wrapper {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.fy-tab {
    position: relative;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    font-family: 'Sarabun', sans-serif;
    font-size: 0.82rem; font-weight: 700;
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.18s;
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.fy-tab:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}
.fy-tab.active {
    background: var(--fy-gold);
    border-color: var(--fy-gold);
    color: #1a1a1a;
    box-shadow: 0 2px 12px rgba(245,158,11,0.5);
}
.fy-tab.is-current:not(.active) {
    border-color: rgba(245,158,11,0.5);
    color: rgba(255,255,255,0.95);
}
.fy-tab-add {
    background: rgba(255,255,255,0.06);
    border: 1.5px dashed rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    padding: 0.25rem 0.65rem;
}
.fy-tab-add:hover { background: rgba(255,255,255,0.15); color:#fff; border-style:solid; }

.fy-current-dot {
    width: 7px; height: 7px;
    background: var(--fy-gold);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(245,158,11,0.7);
}
.fy-active-chip {
    display: inline-flex; align-items: center;
    background: rgba(255,255,255,0.15);
    color: #fff; font-size: 0.78rem; font-weight: 600;
    padding: 0.2rem 0.7rem; border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2);
}
.fy-current-text { color: var(--fy-gold); font-weight: 700; }
.fy-date-range   { color: rgba(255,255,255,0.55); font-size: 0.76rem; }

/* ── Hero Stats Grid ── */
.hero-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.hstat-card {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    backdrop-filter: blur(8px);
    transition: background 0.2s;
}
.hstat-card:hover { background: rgba(255,255,255,0.16); }
.hstat-card.hstat-highlight {
    background: rgba(245,158,11,0.15);
    border-color: rgba(245,158,11,0.3);
}
.hstat-icon { font-size: 1.2rem; color: rgba(255,255,255,0.6); margin-bottom: 0.4rem; }
.hstat-card.hstat-highlight .hstat-icon { color: var(--fy-gold); }
.hstat-val { font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1; }
.hstat-card.hstat-highlight .hstat-val { color: var(--fy-gold); }
.hstat-label { font-size: 0.72rem; color: rgba(255,255,255,0.65); margin-top: 0.2rem; }
.hstat-trend {
    font-size: 0.7rem; font-weight: 700; margin-top: 0.3rem;
    display: flex; align-items: center; gap: 0.2rem;
}
.hstat-trend.up   { color: #4ade80; }
.hstat-trend.down { color: #f87171; }

.hero-wave {
    height: 40px; background: var(--hs4-bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}

/* ── FY Progress Bar (index) ── */
.fy-progress-bar-wrap {
    background: var(--hs4-surface);
    border-radius: var(--radius); border: 1px solid var(--hs4-border);
    padding: 1rem 1.25rem;
    box-shadow: var(--hs4-shadow);
}
.fy-progress-info {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 0.5rem;
    font-size: 0.88rem;
}
.fy-progress { border-radius: 50px; }
.fy-progress-fill {
    background: linear-gradient(90deg, var(--hs4-primary), var(--fy-gold));
    border-radius: 50px;
}

/* ============ Main Content ============ */
.main-content { min-height: calc(100vh - 340px); }
.section-heading { font-size: 1rem; font-weight: 700; color: var(--hs4-text); }

/* ============ Area Cards ============ */
.area-card {
    background: var(--hs4-surface);
    border-radius: var(--radius);
    border: 1px solid var(--hs4-border);
    overflow: hidden; transition: all 0.2s ease;
    display: flex; flex-direction: column;
}
.area-card:hover {
    box-shadow: var(--hs4-shadow-lg);
    border-color: rgba(10,92,158,0.2);
    transform: translateY(-2px);
}
.area-card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem 1.1rem 0;
}
.area-num {
    font-size: 0.73rem; font-weight: 700; color: var(--hs4-primary);
    text-transform: uppercase; letter-spacing: 0.8px;
    background: rgba(10,92,158,0.08); padding: 0.25rem 0.65rem; border-radius: 50px;
}
.area-card-body { padding: 0.6rem 1.1rem 0.8rem; flex-grow: 1; }
.area-name  { font-size: 1.05rem; font-weight: 700; color: var(--hs4-text); margin-bottom: 0; line-height: 1.4; }
.area-desc  { font-size: 0.83rem; color: var(--hs4-text-muted); margin-top: 0.35rem; margin-bottom: 0; }

/* Area progress */
.area-progress-wrap { }
.area-progress { border-radius: 50px; background: #f1f5f9; }

.area-meta  { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.meta-badge {
    font-size: 0.75rem; background: #f1f5f9; color: var(--hs4-text-muted);
    padding: 0.2rem 0.6rem; border-radius: 50px; font-weight: 500;
}
.meta-badge-success { background: rgba(22,163,74,0.1); color: #15803d; }

.area-card-footer {
    padding: 0.85rem 1.1rem;
    border-top: 1px solid var(--hs4-border);
    background: #fafafa;
}
.btn-icon {
    background: none; border: none; padding: 0.3rem; color: var(--hs4-text-muted);
    cursor: pointer; border-radius: var(--radius-xs); transition: all 0.15s;
    font-size: 0.9rem; line-height: 1;
}
.btn-icon:hover { background: #f1f5f9; color: var(--hs4-text); }
.btn-icon.text-danger:hover { background: #fef2f2; color: #dc2626; }
.area-actions { display: flex; gap: 0.25rem; }

/* ============ Breadcrumb / Page Header ============ */
.page-header-bar {
    background: var(--hs4-surface);
    border-bottom: 1px solid var(--hs4-border);
}
.btn-back {
    background: #f1f5f9; border: 1px solid var(--hs4-border);
    color: var(--hs4-text); font-size: 0.82rem; padding: 0.3rem 0.8rem;
    border-radius: var(--radius-xs); transition: all 0.15s; font-weight: 500; text-decoration: none;
}
.btn-back:hover { background: #e2e8f0; color: var(--hs4-text); }
.breadcrumb { font-size: 0.8rem; }
.breadcrumb-item a { color: var(--hs4-primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--hs4-text-muted); }

/* ============ Area Detail Banner ============ */
.area-banner {
    background: linear-gradient(135deg, #073d69 0%, var(--hs4-primary) 60%, #1565C0 100%);
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.area-num-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.9);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.8px;
    padding: 0.2rem 0.7rem; border-radius: 50px; margin-bottom: 0.4rem;
    text-transform: uppercase; border: 1px solid rgba(255,255,255,0.2);
}
.area-banner-title { color: #fff; font-size: 1.5rem; font-weight: 800; }

/* ── FY Area Tabs ── */
.fy-area-tabs-label { color: rgba(255,255,255,0.6); font-size: 0.78rem; font-weight: 500; }
.fy-area-tab {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.75);
    font-family: 'Sarabun', sans-serif;
    font-size: 0.8rem; font-weight: 700;
    padding: 0.25rem 0.75rem; border-radius: 50px;
    text-decoration: none; transition: all 0.15s;
}
.fy-area-tab:hover {
    background: rgba(255,255,255,0.2); color: #fff;
    border-color: rgba(255,255,255,0.45);
}
.fy-area-tab.active {
    background: var(--fy-gold); border-color: var(--fy-gold);
    color: #1a1a1a;
    box-shadow: 0 2px 10px rgba(245,158,11,0.4);
}
.fy-dot {
    width: 6px; height: 6px;
    background: var(--fy-gold); border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 5px rgba(245,158,11,0.8);
}
.fy-area-tab.active .fy-dot { background: #1a1a1a; box-shadow: none; }

/* ── Area Stats Row ── */
.area-stat-row {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.1); border-radius: var(--radius);
    padding: 0.85rem 1rem; flex-wrap: wrap;
    border: 1px solid rgba(255,255,255,0.12);
}
.area-stat-item { text-align: center; flex: 1; min-width: 60px; }
.as-val { font-size: 1.4rem; font-weight: 800; color: #fff; line-height: 1; }
.as-highlight { color: var(--fy-gold); }
.as-label { font-size: 0.68rem; color: rgba(255,255,255,0.6); margin-top: 0.1rem; }
.area-stat-sep { width: 1px; height: 36px; background: rgba(255,255,255,0.15); flex-shrink: 0; }

/* ── File modal FY badge ── */
.fy-modal-badge {
    background: var(--fy-gold-light); color: #92400e;
    border: 1px solid rgba(245,158,11,0.3);
    font-size: 0.75rem; font-weight: 700;
    padding: 0.3rem 0.7rem; border-radius: 50px;
}

/* ── FY Table in manage modal ── */
.fy-table { font-size: 0.87rem; }
.fy-table thead th {
    background: #f8fafc; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--hs4-text-muted);
    border-bottom: 1px solid var(--hs4-border); padding: 0.65rem 1rem;
}
.fy-table tbody td { padding: 0.75rem 1rem; vertical-align: middle; }
.fy-table .table-primary td { background: rgba(10,92,158,0.06); }

/* ============ Summary Cards (area page) ============ */
.summary-card {
    background: var(--hs4-surface);
    border-radius: var(--radius); border: 1px solid var(--hs4-border);
    padding: 1rem 1.1rem; display: flex; align-items: center; gap: 0.85rem;
    box-shadow: var(--hs4-shadow);
}
.sum-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; flex-shrink: 0;
}
.bg-blue-soft   { background: rgba(10,92,158,0.1); }
.bg-purple-soft { background: rgba(124,58,237,0.1); }
.bg-green-soft  { background: rgba(22,163,74,0.1); }
.bg-orange-soft { background: rgba(245,124,0,0.1); }
.text-purple    { color: #7c3aed; }
.sum-val   { font-size: 1.5rem; font-weight: 800; line-height: 1; color: var(--hs4-text); }
.sum-label { font-size: 0.72rem; color: var(--hs4-text-muted); font-weight: 500; }

/* ============ Criteria Section ============ */
.criteria-section {
    background: var(--hs4-surface);
    border-radius: var(--radius); border: 1px solid var(--hs4-border);
    overflow: hidden; box-shadow: var(--hs4-shadow);
}
.criteria-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--hs4-border);
}
.criteria-code-badge {
    background: var(--hs4-primary); color: #fff;
    font-size: 0.82rem; font-weight: 800; padding: 0.35rem 0.75rem;
    border-radius: var(--radius-xs); font-family: 'Courier New', monospace;
    white-space: nowrap; flex-shrink: 0;
}
.criteria-name { font-size: 1rem; font-weight: 700; color: var(--hs4-text); }
.criteria-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.meta-chip {
    font-size: 0.72rem; background: rgba(10,92,158,0.08); color: var(--hs4-primary);
    padding: 0.15rem 0.55rem; border-radius: 50px; font-weight: 600;
}
.meta-chip-success { background: rgba(22,163,74,0.1) !important; color: #15803d !important; }
.criteria-body { padding: 0.5rem 0; }

/* Sub Criteria Table */
.sub-table { margin-bottom: 0; font-size: 0.87rem; }
.sub-table thead th {
    background: #f8fafc; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--hs4-text-muted);
    border-bottom: 1px solid var(--hs4-border); padding: 0.65rem 1rem;
}
.sub-table tbody td { padding: 0.75rem 1rem; border-color: #f1f5f9; }
.sub-table tbody tr:hover td { background: #f8fafc; }
.sub-code-badge {
    background: #f1f5f9; color: var(--hs4-text);
    font-size: 0.78rem; font-weight: 700; padding: 0.2rem 0.55rem;
    border-radius: var(--radius-xs); font-family: 'Courier New', monospace; white-space: nowrap;
}
.sub-name { font-weight: 500; color: var(--hs4-text); line-height: 1.4; }

/* ============ Upload Zone ============ */
.upload-zone {
    border: 2px dashed #cbd5e1; border-radius: var(--radius);
    padding: 2.5rem 1.5rem; text-align: center; cursor: pointer;
    transition: all 0.2s ease; background: #fafcff;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--hs4-primary); background: rgba(10,92,158,0.04);
}
.upload-icon { font-size: 2.5rem; color: var(--hs4-primary); display: block; margin-bottom: 0.75rem; opacity: 0.7; }
.upload-text  { font-size: 0.95rem; font-weight: 600; color: var(--hs4-text); margin-bottom: 0.35rem; }
.upload-hint  { font-size: 0.78rem; color: var(--hs4-text-muted); }
.file-type-badges { display: flex; justify-content: center; gap: 0.5rem; }
.ft-badge { font-size: 0.68rem; font-weight: 800; padding: 0.2rem 0.55rem; border-radius: 4px; letter-spacing: 0.5px; }
.ft-pdf   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.ft-word  { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.ft-excel { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* Upload Preview */
.upload-preview { background: #f8fafc; }
.file-preview-icon {
    width: 46px; height: 46px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.3px; flex-shrink: 0;
}

/* File Item */
.file-item { background: #fafcff; transition: all 0.15s; }
.file-item:hover { background: #f0f4f8; }
.file-item-icon {
    width: 42px; height: 42px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 800; flex-shrink: 0; letter-spacing: 0.3px;
}
.icon-pdf     { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.icon-word    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.icon-excel   { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.icon-generic { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

/* ============ Utilities ============ */
.bg-primary-soft    { background: rgba(10,92,158,0.1) !important; }
.bg-success-subtle  { background: rgba(22,163,74,0.1) !important; }
.bg-secondary-subtle{ background: rgba(100,116,139,0.1) !important; }
.min-w-0            { min-width: 0; }
.empty-state i      { opacity: .35; }

/* ============ Footer ============ */
.site-footer { background: var(--hs4-surface); border-top: 1px solid var(--hs4-border); }

/* ============ Modal ============ */
.modal-content { border: none; border-radius: var(--radius); }
.modal-header  { padding: 1.1rem 1.3rem 0.75rem; }
.modal-body    { padding: 0.75rem 1.3rem; }
.modal-footer  { padding: 0.75rem 1.3rem 1.1rem; }

.form-control, .form-select {
    border-color: #e2e8f0; border-radius: var(--radius-xs);
    font-family: 'Sarabun', sans-serif; font-size: 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--hs4-primary);
    box-shadow: 0 0 0 3px rgba(10,92,158,0.12);
}
.form-label { font-size: 0.85rem; margin-bottom: 0.35rem; color: var(--hs4-text); }

/* ============ Buttons ============ */
.btn {
    font-family: 'Sarabun', sans-serif; font-weight: 600;
    font-size: 0.87rem; border-radius: var(--radius-xs); transition: all 0.15s ease;
}
.btn-primary { background: var(--hs4-primary); border-color: var(--hs4-primary); }
.btn-primary:hover {
    background: var(--hs4-primary-light); border-color: var(--hs4-primary-light);
    box-shadow: 0 4px 12px rgba(10,92,158,0.3);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .criteria-header { padding: 0.85rem; }
    .hero-stats-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .hstat-val { font-size: 1.4rem; }
    .fy-tabs-wrapper .fy-tab { font-size: 0.78rem; padding: 0.25rem 0.65rem; }
    .area-stat-row { gap: 0.35rem; padding: 0.65rem 0.75rem; }
    .as-val { font-size: 1.2rem; }
    .area-stat-sep { height: 28px; }
}
@media (max-width: 576px) {
    .hero-stats-grid { grid-template-columns: 1fr 1fr; }
    .criteria-header { flex-direction: column; align-items: flex-start !important; }
    .area-name { font-size: 0.95rem; }
    .fy-tabs-wrapper { gap: 0.3rem; }
}

/* ============ Animations ============ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.area-card, .criteria-section { animation: fadeInUp 0.3s ease both; }
.area-card:nth-child(2) { animation-delay: 0.05s; }
.area-card:nth-child(3) { animation-delay: 0.1s; }
.area-card:nth-child(4) { animation-delay: 0.15s; }
.criteria-section:nth-child(2) { animation-delay: 0.05s; }
.criteria-section:nth-child(3) { animation-delay: 0.1s; }

/* ============ SweetAlert2 Thai ============ */
.swal2-popup { font-family: 'Sarabun', 'Noto Sans Thai', sans-serif !important; border-radius: 12px !important; }
.swal2-title { font-size: 1.2rem !important; }
.swal2-html-container { font-size: 0.9rem !important; }

/* ================================================================
   AUTH / STAFF MODE STYLES
   ================================================================ */

/* ── ปุ่ม "เฉพาะเจ้าหน้าที่" (View Mode) ─────────────────────── */
.btn-staff-login {
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.35);
    color: #fff;
    border-radius: 8px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.btn-staff-login:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.6);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.btn-staff-login i {
    color: #fbbf24;
}

/* ── Staff Mode Indicator Bar ─────────────────────────────────── */
.staff-mode-bar {
    background: linear-gradient(90deg, #064e3b 0%, #065f46 100%);
    border-bottom: 1px solid rgba(52, 211, 153, 0.3);
    font-family: 'Sarabun', sans-serif;
}
.staff-mode-bar .badge {
    font-size: 0.7rem;
    padding: 0.3em 0.6em;
}

/* ── Staff Badge (Navbar ตอน Login แล้ว) ─────────────────────── */
.staff-badge {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
}
.staff-avatar {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}
.staff-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}
.staff-role {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.6);
    line-height: 1;
}

/* ── Login Modal ─────────────────────────────────────────────── */
.login-shield-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0A5C9E 0%, #1d4ed8 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(10, 92, 158, 0.35);
}
#loginModal .modal-content {
    border-radius: 16px;
    overflow: hidden;
}
#loginModal .form-control:focus,
#loginModal .input-group-text + .form-control:focus {
    border-color: #0A5C9E;
    box-shadow: 0 0 0 3px rgba(10,92,158,0.12);
}
#loginModal .input-group .form-control {
    border-left: none;
}
#loginModal .input-group-text {
    border-right: none;
}
#loginModal .btn-primary {
    border-radius: 8px;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

/* ── Schema SQL note ─────────────────────────────────────────── */
.bg-success-subtle  { background-color: rgba(25,135,84,0.1) !important; }
.bg-primary-soft    { background-color: rgba(10,92,158,0.1) !important; }

/* ================================================================
   COPY URL — Toast Notification
   ================================================================ */
.copy-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #22c55e;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 0.75rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 9999;
    font-family: 'Sarabun', sans-serif;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
    min-width: 240px;
    max-width: 340px;
    pointer-events: none;
}
.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Copy URL button */
.btn-copy-url {
    white-space: nowrap;
}
.btn-copy-url:hover {
    background: #f0f9ff;
    border-color: #0ea5e9;
    color: #0284c7;
}