/* ============================================================
   GOVERNMENT ENGAGEMENT — style.css
   Font: Prompt (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ══════════════════════════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════════════════════════ */
:root {
  /* Background — dark slate */
  --bg:          #0F172A;
  --surface:     #1E293B;
  --surface2:    #162032;
  --surface3:    #0F172A;

  /* Border */
  --border:      #334155;
  --border2:     #475569;

  /* Brand — keep Toyota blue but lighter for dark bg */
  --primary:     #1E40AF;
  --primary-md:  #3B82F6;
  --primary-lt:  rgba(59,130,246,.15);
  --primary-dim: rgba(59,130,246,.08);

  /* Text */
  --text:        #F1F5F9;
  --text-sub:    #94A3B8;
  --text-muted:  #475569;

  /* Semantic */
  --success:     #22C55E;
  --danger:      #EF4444;
  --warning:     #F59E0B;
  --info:        #38BDF8;

  /* Misc */
  --radius:      8px;
  --sidebar-w:   224px;
  --font:        'Prompt', system-ui, sans-serif;
}

/* ══════════════════════════════════════════════════════════════
   LIGHT THEME
══════════════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg:          #F1F5F9;
  --surface:     #FFFFFF;
  --surface2:    #F8F9FA;
  --surface3:    #F1F5F9;

  --border:      #E2E8F0;
  --border2:     #CBD5E1;

  --primary:     #1E3A8A;
  --primary-md:  #2563EB;
  --primary-lt:  #EEF2FF;
  --primary-dim: rgba(30,58,138,.06);

  --text:        #334155;
  --text-sub:    #475569;
  --text-muted:  #94A3B8;

  --success:     #16A34A;
  --danger:      #DC2626;
  --warning:     #D97706;
  --info:        #0284C7;
}

[data-theme="light"] .btn-danger    { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
[data-theme="light"] .btn-danger:hover { background: #FEE2E2; }
[data-theme="light"] .btn-success   { background: #F0FDF4; color: var(--success); border: 1px solid #BBF7D0; }
[data-theme="light"] .btn-success:hover { background: #DCFCE7; }
[data-theme="light"] .btn-primary:hover { background: #163172; }

[data-theme="light"] .badge-green  { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }
[data-theme="light"] .badge-blue   { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }
[data-theme="light"] .badge-amber  { background: #FFFBEB; color: #D97706; border: 1px solid #FDE68A; }
[data-theme="light"] .badge-red    { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
[data-theme="light"] .badge-purple { background: #FAF5FF; color: #9333EA; border: 1px solid #E9D5FF; }

[data-theme="light"] .import-result.success { background: #F0FDF4; border-color: #BBF7D0; }
[data-theme="light"] .import-result.warning { background: #FFFBEB; border-color: #FDE68A; }
[data-theme="light"] .import-result.error   { background: #FEF2F2; border-color: #FECACA; }
[data-theme="light"] .import-result.info    { background: #EFF6FF; border-color: #BFDBFE; }

[data-theme="light"] .verify-month-header:hover { background: #EEF2FF; }
[data-theme="light"] .notif-clear-btn:hover { color: var(--danger); background: #FEF2F2; }
[data-theme="light"] .notif-item.unread { background: #F0F7FF; }
[data-theme="light"] .notif-item.unread:hover { background: #E0EFFF; }


body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════
   SHARED — TOPBAR
══════════════════════════════════════════════════════════════ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 0 0;
  height: 50px;
  background: var(--primary);
  position: sticky; top: 0; z-index: 40; flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; height: 100%; }

.topbar-back {
  display: flex; align-items: center; gap: 7px;
  padding: 0 16px; height: 100%;
  font-size: 12px; color: rgba(255,255,255,.6);
  text-decoration: none;
  border-right: 1px solid rgba(255,255,255,.12);
  transition: all .15s;
}
.topbar-back:hover { color: #fff; background: rgba(255,255,255,.08); }

.topbar-project {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px; height: 100%;
}
.topbar-project-name { font-size: 14px; font-weight: 600; color: #fff; }

.topbar-breadcrumb {
  font-size: 12px; color: rgba(255,255,255,.45);
  padding: 0 16px; height: 100%;
  display: flex; align-items: center;
  border-left: 1px solid rgba(255,255,255,.12);
}
.topbar-breadcrumb span { color: rgba(255,255,255,.75); }

.topbar-right { display: flex; align-items: center; gap: 6px; }

.topbar-icon-btn {
  width: 32px; height: 32px; border-radius: 6px;
  background: none; border: none;
  color: rgba(255,255,255,.55);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s; position: relative;
}
.topbar-icon-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.topbar-icon-btn .notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: #EF4444; border-radius: 50%;
  border: 1.5px solid var(--primary);
}

.topbar-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff; cursor: pointer;
}

/* GE topbar logo (home page only) */
.ge-logo {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  border: 1px solid rgba(255,255,255,.2);
}
.ge-brand { display: flex; align-items: center; gap: 10px; }
.ge-brand-name { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: .01em; }
.ge-brand-name span { color: rgba(255,255,255,.55); font-weight: 400; }

.topbar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 6px;
  font-size: 12px; color: rgba(255,255,255,.7);
  background: none; border: none; cursor: pointer; transition: all .15s;
  font-family: var(--font);
}
.topbar-btn:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ══════════════════════════════════════════════════════════════
   GE HOME — PROJECT CARDS
══════════════════════════════════════════════════════════════ */
.ge-main {
  flex: 1; padding: 44px 32px;
  max-width: 1060px; margin: 0 auto; width: 100%;
}

.ge-hero { margin-bottom: 36px; }
.ge-hero-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--primary-md); margin-bottom: 8px;
}
.ge-hero-title {
  font-size: 26px; font-weight: 600;
  color: var(--primary); margin-bottom: 6px; letter-spacing: -.01em;
}
.ge-hero-sub { font-size: 14px; color: var(--text-sub); }

.ge-section-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 14px;
}

.ge-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-bottom: 48px;
}

.ge-project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; cursor: pointer;
  transition: all .2s; text-decoration: none;
  display: block; position: relative; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ge-project-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--card-accent, var(--primary));
}
.ge-project-card:hover {
  border-color: var(--card-accent, var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30,58,138,.08);
}

.ge-project-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--primary-lt);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 14px;
}
.ge-project-name { font-size: 15px; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.ge-project-desc { font-size: 13px; color: var(--text-sub); line-height: 1.55; margin-bottom: 16px; }
.ge-project-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-muted); }
.ge-status-dot { display: flex; align-items: center; gap: 5px; }
.ge-status-dot .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.ge-project-arrow {
  position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 16px; transition: all .2s;
}
.ge-project-card:hover .ge-project-arrow { color: var(--primary); right: 16px; }

.ge-future-card {
  background: transparent;
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius); padding: 24px;
  display: flex; align-items: center; justify-content: center;
  min-height: 130px; color: var(--text-muted); font-size: 13px; gap: 8px;
}

/* ══════════════════════════════════════════════════════════════
   GE HOME — BOTTOM BAR
══════════════════════════════════════════════════════════════ */
.ge-bottom {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 32px;
  display: flex; align-items: center; gap: 2px;
}
.ge-bottom-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 6px;
  font-size: 12px; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  transition: all .15s; font-family: var(--font);
}
.ge-bottom-btn:hover { color: var(--text-sub); background: var(--surface2); }

/* ══════════════════════════════════════════════════════════════
   TH AUTO — APP LAYOUT
══════════════════════════════════════════════════════════════ */
.app-body {
  display: flex; flex: 1; overflow: hidden;
  min-height: 0;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease, min-width 0.2s ease;
  height: 100%;
  overflow: hidden;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}



/* Sidebar collapsed — managed by JS _applySidebar() */

.sidebar-section {
  padding: 16px 14px 4px;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
  display: flex; align-items: center; justify-content: space-between;
}

/* scroll area — เฉพาะส่วน items */
.sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; cursor: pointer; font-size: 13px;
  color: var(--text-sub);
  border-left: 2px solid transparent;
  transition: all .12s; user-select: none;
}
.sidebar-item:hover { color: var(--text); background: var(--surface2); }
.sidebar-item.active {
  color: var(--primary);
  background: var(--primary-lt);
  border-left-color: var(--primary);
  font-weight: 500;
}

.sidebar-sub { padding-left: 30px; font-size: 12px; }




/* ── Main area ── */
.main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.page-title { font-size: 15px; font-weight: 600; color: var(--primary); }
.page-actions { display: flex; align-items: center; gap: 8px; }

.content { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: var(--radius);
  font-size: 12px; font-weight: 500;
  cursor: pointer; border: none; transition: all .15s;
  white-space: nowrap; font-family: var(--font);
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: var(--surface); color: var(--text-sub); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--surface2); color: var(--text); }
.btn-danger    { background: rgba(239,68,68,.12); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-success   { background: rgba(34,197,94,.12); color: var(--success); border: 1px solid rgba(34,197,94,.3); }
.btn-success:hover { background: rgba(34,197,94,.2); }
.btn-sm { padding: 4px 9px; font-size: 11px; }

/* ══════════════════════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════════════════════ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* transaction tables get a fixed height + scroll */
.table-wrap.scrollable {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

.table-wrap.scrollable thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface2);
}

table { width: 100%; border-collapse: collapse; font-size: 12px; }

thead tr { background: var(--surface2); }
th {
  padding: 9px 14px; text-align: left;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 14px; color: var(--text-sub);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface3); }
td strong { color: var(--text); font-weight: 500; }
.action-cell { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Toolbar + Search ── */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 12px;
}
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 7px 12px;
  flex: 1; max-width: 300px;
}
.search-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.search-wrap input {
  background: none; border: none; color: var(--text);
  font-size: 13px; outline: none; width: 100%; font-family: var(--font);
}
.search-wrap input::placeholder { color: var(--text-muted); }

.toolbar-right { display: flex; align-items: center; gap: 8px; }

.refresh-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-muted);
  cursor: pointer; padding: 5px 8px; border-radius: 6px;
  transition: all .15s; background: none; border: none;
  font-family: var(--font);
}
.refresh-btn:hover { color: var(--text-sub); background: var(--surface2); }

/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 500;
}
.badge-green  { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.25); }
.badge-blue   { background: rgba(59,130,246,.12); color: #60a5fa; border: 1px solid rgba(59,130,246,.25); }
.badge-amber  { background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
.badge-red    { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.badge-purple { background: rgba(168,85,247,.12); color: #c084fc; border: 1px solid rgba(168,85,247,.25); }
.badge-gray   { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 100; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; width: 520px; max-width: 95vw; max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(15,23,42,.18);
}
.modal.modal-wide {
  width: 1200px; max-width: 95vw; max-height: 90vh;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 14px; font-weight: 600; color: var(--primary); }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ══════════════════════════════════════════════════════════════
   FORM
══════════════════════════════════════════════════════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }

label { font-size: 11px; font-weight: 500; color: var(--text-sub); }

input, select, textarea {
  width: 100%; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text);
  font-size: 13px; outline: none; font-family: var(--font);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary-md);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

/* ══════════════════════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat-label {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}
.stat-value { font-size: 22px; font-weight: 600; color: var(--primary); }

/* ══════════════════════════════════════════════════════════════
   UTILITY
══════════════════════════════════════════════════════════════ */
.loading {
  display: flex; align-items: center; justify-content: center;
  height: 120px; color: var(--text-muted); font-size: 13px; gap: 8px;
}
.empty { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-icon { font-size: 32px; margin-bottom: 12px; }
.empty-title { font-size: 14px; font-weight: 500; color: var(--text-sub); margin-bottom: 6px; }
.empty-sub { font-size: 12px; }

/* ══════════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 16px;
  font-size: 13px; color: var(--text);
  opacity: 0; transform: translateY(8px);
  transition: all .2s; z-index: 200;
  pointer-events: none; max-width: 320px;
  box-shadow: 0 4px 16px rgba(15,23,42,.1);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }

/* ══════════════════════════════════════════════════════════════
   VERIFY INBOX
══════════════════════════════════════════════════════════════ */
.verify-inbox { display: flex; flex-direction: column; gap: 10px; }

.verify-month-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.verify-month-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--surface2);
  border-bottom: 1px solid transparent;
  transition: background .12s;
  user-select: none;
}
.verify-month-header:hover { background: var(--primary-lt); }

.verify-month-left  { display: flex; align-items: center; }
.verify-month-right { display: flex; align-items: center; gap: 12px; }
.verify-month-label { font-size: 14px; font-weight: 600; color: var(--primary); }
.verify-chevron     { font-size: 13px; color: var(--text-muted); transition: transform .15s; }

.verify-month-body { border-top: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════════
   ETL / VERIFICATION
══════════════════════════════════════════════════════════════ */
.etl-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.etl-box-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.etl-box-title { font-size: 13px; font-weight: 500; color: var(--text); }
.aic-val { color: var(--primary-md); font-weight: 500; }
.jcc-val { color: var(--warning); font-weight: 500; }

/* ══════════════════════════════════════════════════════════════
   IMPORT UI
══════════════════════════════════════════════════════════════ */

/* tabs */
.import-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.import-tab {
  padding: 10px 20px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s; white-space: nowrap;
}
.import-tab:hover { color: var(--text-sub); background: var(--surface2); }
.import-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface); }

/* body */
.import-body { display: flex; flex-direction: column; gap: 16px; }

/* date picker */
.import-datepicker {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
}
.import-datepicker label { font-size: 12px; font-weight: 500; color: var(--text-sub); white-space: nowrap; }
.import-datepicker select { width: auto; min-width: 120px; }

/* form row */
.import-form-row {
  display: flex; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
}
.import-form-row .form-field { flex: 1; }

/* upload — drag & drop */
.import-upload-area {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all .2s;
  cursor: pointer;
}
.import-upload-area:hover,
.import-upload-area.dragover {
  border-color: var(--primary-md);
  background: var(--primary-lt);
}
.import-upload-area.dragover .import-upload-icon { transform: scale(1.2); }

.import-upload-box {
  padding: 32px;
  text-align: center;
  pointer-events: none;
}
.import-upload-icon {
  font-size: 32px; margin-bottom: 8px;
  transition: transform .15s;
  display: block;
}
.import-upload-text { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.import-upload-sub  { font-size: 12px; color: var(--text-muted); }

/* result cards */
.import-result {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.import-result.success { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.3); }
.import-result.warning { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.3); }
.import-result.error   { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.3); }
.import-result.info    { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.3); }

.import-result-icon  { font-size: 20px; flex-shrink: 0; }
.import-result-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.import-result-sub   { font-size: 12px; color: var(--text-sub); }

.import-unknown-section { margin-top: 8px; }
.import-unknown-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }

/* section cards (AIC multi-flow) */
.import-section-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.import-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.import-section-label { font-size: 12px; font-weight: 600; color: var(--text); }

/* preview */
.import-preview { padding: 12px 0 0; }
.import-preview-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 8px; padding: 0 14px;
}

/* ── Import Preview ── */
.import-preview-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.import-preview-title {
  font-size: 14px; font-weight: 600; color: var(--primary);
  margin-bottom: 14px; display: flex; align-items: center;
}

.import-sheet-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}

.import-sheet-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.import-sheet-card.skipped { opacity: .5; }
.import-sheet-name  { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.import-sheet-rows  { font-size: 18px; font-weight: 600; color: var(--primary); }

.import-unknown-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.import-unknown-section {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.import-unknown-section:last-child { border-bottom: none; }
.import-unknown-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.import-unknown-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.import-unknown-hint  { font-size: 11px; color: var(--text-muted); }

.import-action-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 0;
}

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION PANEL
══════════════════════════════════════════════════════════════ */
.notif-count {
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px;
  background: #EF4444; border-radius: 8px;
  border: 1.5px solid var(--primary);
  font-size: 9px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.notif-panel {
  position: absolute; top: 50px; right: 12px;
  width: 360px; max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(15,23,42,.15);
  z-index: 200;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}

.notif-panel-title {
  font-size: 13px; font-weight: 600; color: var(--primary);
}

.notif-clear-btn {
  font-size: 11px; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  padding: 3px 6px; border-radius: 4px;
  font-family: var(--font);
  transition: all .15s;
}
.notif-clear-btn:hover { color: var(--danger); background: rgba(239,68,68,.1); }

.notif-list {
  overflow-y: auto; flex: 1;
}

.notif-empty {
  padding: 32px 16px; text-align: center;
  font-size: 13px; color: var(--text-muted);
}

.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  cursor: default;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: rgba(59,130,246,.08); }
.notif-item.unread:hover { background: rgba(59,130,246,.14); }

.notif-icon {
  font-size: 18px; flex-shrink: 0; margin-top: 1px;
}

.notif-body { flex: 1; min-width: 0; }

.notif-title {
  font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: 2px;
}

.notif-detail {
  font-size: 11px; color: var(--text-sub);
  line-height: 1.5; word-break: break-word;
}

.notif-time {
  font-size: 10px; color: var(--text-muted);
  margin-top: 4px;
}

.notif-error   .notif-title { color: var(--danger); }
.notif-success .notif-title { color: var(--success); }
.notif-warning .notif-title { color: var(--warning); }
.notif-info    .notif-title { color: var(--info); }

/* ══════════════════════════════════════════════════════════════
   IMPORT CORNER TOAST (แบบรูป)
══════════════════════════════════════════════════════════════ */
.import-toast-corner {
  position: fixed;
  bottom: 28px; right: 24px;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(15,23,42,.15);
  z-index: 300;
  overflow: hidden;
  opacity: 0; transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}

.import-toast-corner.show {
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}

.import-toast-corner.collapsed .itc-detail,
.import-toast-corner.collapsed .itc-footer {
  display: none;
}

.itc-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 8px;
}

.itc-icon { font-size: 16px; flex-shrink: 0; }

.itc-title {
  flex: 1; font-size: 13px; font-weight: 600;
  color: var(--text); min-width: 0;
}

.itc-collapse, .itc-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px;
  padding: 2px 4px; border-radius: 4px;
  transition: all .12s; line-height: 1; flex-shrink: 0;
}
.itc-collapse:hover, .itc-close:hover {
  color: var(--text); background: var(--surface2);
}

.itc-detail {
  padding: 0 12px 8px;
  font-size: 11px; color: var(--text-sub);
  line-height: 1.5;
}

.itc-footer {
  padding: 0 12px 10px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}

.itc-progress-bar {
  height: 3px; background: var(--success);
  border-radius: 2px; flex: 1;
  transition: width 1s linear;
  width: 100%;
}

.itc-timer {
  font-size: 10px; color: var(--text-muted); white-space: nowrap;
}

.itc-stop {
  color: var(--primary-md); cursor: pointer; text-decoration: underline;
  font-size: 10px;
}
.itc-stop:hover { color: var(--primary); }

/* ── Import File Confirm ── */
.import-file-confirm {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.import-file-icon { font-size: 28px; flex-shrink: 0; }

.import-file-info { flex: 1; min-width: 0; }

.import-file-name {
  font-size: 14px; font-weight: 600; color: var(--primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}

.import-file-meta { font-size: 12px; color: var(--text-muted); }

.import-file-actions { display: flex; gap: 8px; flex-shrink: 0; }
/* ══════════════════════════════════════════════════════════════
   THEME TOGGLE PANEL
══════════════════════════════════════════════════════════════ */
.theme-panel {
  position: fixed; top: 54px; right: 80px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  z-index: 999; min-width: 180px;
  display: none;
}
.theme-panel.open { display: block; }
.theme-panel-title {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px;
}
.theme-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-sub);
  transition: background .15s;
}
.theme-option:hover { background: var(--primary-dim); color: var(--text); }
.theme-option.active { background: var(--primary-lt); color: var(--primary-md); font-weight: 600; }
.theme-option-icon { font-size: 16px; }


/* ── Query Filter ── */
.qf-row {
  display: flex; flex-direction: column; gap: 4px;
}
.qf-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
/* ── Animations ── */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}