/* ═══════════════════════════════════════════════════
   NEXPRO CENTRAL — style.css
   Same design tokens / component system as NexPro
   Documents: navy sidebar, gold accent, Inter font.
═══════════════════════════════════════════════════ */

:root {
  --sidebar-bg:        #0A2A3E;
  --sidebar-border:    #F5C518;
  --accent:            #F5C518;
  --accent-hover:      #D4A817;
  --accent-dim:        rgba(245, 197, 24, 0.13);
  --accent-text:       #0A2A3E;

  --body-bg:           #EEF2F6;
  --card-bg:           #FFFFFF;
  --card-bg-alt:       #F7FAFC;

  --text-primary:      #1A2B3C;
  --text-secondary:    #5A7186;
  --text-muted:        #8A9BB0;
  --text-placeholder:  #B0C0CF;

  --border:            #E0E8F0;
  --border-focus:      rgba(245, 197, 24, 0.55);

  --topbar-bg:         #0A2A3E;
  --topbar-border:     #F5C518;

  --nav-hover:         rgba(255, 255, 255, 0.06);
  --nav-active-bg:     rgba(245, 197, 24, 0.14);
  --nav-active-color:  #F5C518;
  --nav-text:          rgba(255, 255, 255, 0.80);
  --nav-icon:          rgba(255, 255, 255, 0.50);

  --success:           #22C55E;
  --success-bg:        rgba(34, 197, 94, 0.10);
  --success-text:      #15803D;

  --warning:           #F59E0B;
  --warning-bg:        rgba(245, 158, 11, 0.12);
  --warning-text:      #B45309;

  --danger:            #EF4444;
  --danger-bg:         rgba(239, 68, 68, 0.10);
  --danger-text:       #B91C1C;

  --info:              #3B82F6;
  --info-bg:           rgba(59, 130, 246, 0.10);
  --info-text:         #1D4ED8;

  --draft-bg:          rgba(138, 155, 176, 0.12);
  --draft-text:        #5A7186;

  --purple:            #6a4c93;
  --purple-bg:         rgba(106, 76, 147, 0.10);

  --font:              'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:         'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --font-size-xs:      11px;
  --font-size-sm:      12.5px;
  --font-size-base:    13px;
  --font-size-md:      14px;
  --font-size-lg:      16px;
  --font-size-xl:      20px;
  --font-size-2xl:     24px;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;

  --radius-sm: 5px; --radius-md: 7px; --radius-lg: 10px; --radius-xl: 14px; --radius-pill: 20px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);

  --sidebar-width: 228px;
  --topbar-height: 52px;
  --content-padding: 20px;

  --transition-fast: 0.15s ease;
  --transition-med: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--font-size-base);
  background: var(--body-bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.hidden { display: none !important; }
.accent { color: var(--accent); }
td, th { font-variant-numeric: tabular-nums; }

/* ═══ APP SHELL / SIDEBAR / TOPBAR ═══ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width);
  background: var(--sidebar-bg); border-right: 3px solid var(--sidebar-border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 20px 16px 18px; border-bottom: 1px solid rgba(255,255,255,0.07); flex-shrink: 0; }
.sidebar-full-logo { max-width: 100%; height: 48px; width: auto; object-fit: contain; display: block; }
.brand-mark { width: 52px; height: 52px; border-radius: 8px; background: transparent; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: var(--accent-text); flex-shrink: 0; overflow: hidden; }
.brand-mark.text-fallback { background: var(--accent); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.15; }
.brand-sub { font-size: 10px; color: rgba(255,255,255,0.30); letter-spacing: 0.5px; text-transform: uppercase; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 10px 14px; cursor: pointer; color: var(--nav-text); font-size: var(--font-size-sm); font-weight: 500; transition: background var(--transition-fast); border: none; background: none; width: 100%; text-align: left; }
.nav-item:hover { background: var(--nav-hover); }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-color); }
.nav-item.active .nav-icon { stroke: var(--nav-active-color); }
.nav-icon { width: 16px; height: 16px; stroke: var(--nav-icon); stroke-width: 2; fill: none; flex-shrink: 0; transition: stroke var(--transition-fast); }
.nav-item:hover .nav-icon { stroke: rgba(255,255,255,0.85); }

.sidebar-footer { padding: 0; }
.storage-pill { display: block; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.07); color: rgba(255,255,255,0.35); font-size: 10.5px; font-weight: 500; line-height: 1.5; }

.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { background: var(--topbar-bg); border-bottom: 3px solid var(--topbar-border); padding: 0 20px; height: var(--topbar-height); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-page { color: #fff; font-size: var(--font-size-md); font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb-user { display: flex; align-items: center; color: rgba(255,255,255,0.75); font-size: 12px; font-weight: 600; padding-right: 14px; margin-right: 14px; border-right: 1px solid rgba(255,255,255,0.15); }
.tb-user-item { white-space: nowrap; }
.tb-user-label { color: rgba(255,255,255,0.4); font-weight: 500; margin-right: 3px; }
.tb-user-sep { width: 1px; height: 12px; background: rgba(255,255,255,0.15); margin: 0 10px; }
.tb-storage { color: rgba(255,255,255,0.40); font-size: 11.5px; display: flex; align-items: center; gap: 6px; }
.tb-live { color: #22C55E; font-weight: 700; }
.tb-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,0.25); }
.tb-storage svg { width: 13px; height: 13px; stroke: rgba(255,255,255,0.40); stroke-width: 2; fill: none; }

.main-content { flex: 1; overflow-y: auto; padding: var(--content-padding); }

/* ═══ PAGE HEADER ═══ */
.page { display: none; }
.page.active { display: block; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: var(--font-size-xl); font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.page-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ═══ BUTTONS ═══ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: var(--radius-md); padding: 9px 16px; font-family: var(--font); font-size: var(--font-size-sm); font-weight: 600; cursor: pointer; transition: background var(--transition-fast), opacity var(--transition-fast), transform 0.1s; white-space: nowrap; }
.btn:active { transform: scale(0.98); }
.btn svg { width: 14px; height: 14px; stroke-width: 2; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary svg { stroke: var(--accent-text); fill: none; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--border); }
.btn-outline svg { stroke: var(--text-secondary); fill: none; }
.btn-outline:hover { background: var(--body-bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-text); }
.btn-sm { padding: 6px 12px; font-size: var(--font-size-xs); }
.btn-full { width: 100%; }

/* ═══ BADGES ═══ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: var(--font-size-xs); font-weight: 600; white-space: nowrap; line-height: 1.4; }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text); }
.badge-draft   { background: var(--draft-bg);   color: var(--draft-text); }
.badge-info    { background: var(--info-bg);    color: var(--info-text); }

/* ═══ CARDS ═══ */
.card { background: var(--card-bg); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: var(--space-4); margin-bottom: 20px; }
.card h2 { font-size: var(--font-size-md); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-4); display: flex; align-items: center; gap: 8px; }
.card h2.no-margin { margin-bottom: 0; }

/* ═══ STAT CARDS ═══ */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card { border-radius: var(--radius-lg); padding: 16px 18px; color: #fff; position: relative; overflow: hidden; }
.stat-card .stat-label { font-size: 10.5px; letter-spacing: 0.6px; opacity: 0.9; font-weight: 700; text-transform: uppercase; }
.stat-card .stat-value { font-size: 25px; font-weight: 800; margin: 8px 0 2px; }
.stat-card .stat-sub { font-size: 11.5px; opacity: 0.85; }
.stat-navy   { background: #16324a; }
.stat-blue   { background: #2f6fa8; }
.stat-green  { background: var(--success); }
.stat-gold   { background: var(--accent-hover); }
.stat-red    { background: var(--danger); }

/* ═══ CHART ROW ═══ */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-wrap { position: relative; height: 220px; }
.chart-wrap-wide { height: 200px; }

/* status bars (analytics) */
.status-bar-item { margin-bottom: 16px; }
.status-bar-item:last-child { margin-bottom: 0; }
.status-bar-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.status-bar-top .left { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.status-bar-top .count-pill { background: var(--card-bg-alt); color: var(--text-secondary); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px; }
.status-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.status-track { height: 7px; border-radius: 6px; background: var(--card-bg-alt); overflow: hidden; }
.status-fill { height: 100%; border-radius: 6px; }

/* ═══ TABLE TOOLBAR ═══ */
.table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.table-toolbar-actions { display: flex; gap: 10px; align-items: center; }
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-select { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 10px; font-size: var(--font-size-sm); background: var(--card-bg); color: var(--text-primary); font-family: var(--font); }
.filter-sep { font-size: 12px; color: var(--text-muted); }

/* ═══ CONFIRM MODAL ═══ */
.confirm-modal-box { width: 380px; text-align: center; padding: 28px 26px 24px; }
.confirm-modal-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--danger-bg); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.confirm-modal-icon svg { width: 24px; height: 24px; stroke: var(--danger-text); fill: none; stroke-width: 2; }
.confirm-modal-icon.info { background: var(--info-bg); }
.confirm-modal-icon.info svg { stroke: var(--info-text); }
.confirm-modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.confirm-modal-message { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 4px; }

/* ═══ STATUS PILL (dot + label, fixed width so all statuses align) ═══ */
.status-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 104px; padding: 5px 8px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.status-pill .status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.status-pill.status-pending    { background: var(--danger-bg);  color: var(--danger-text);  border-color: rgba(239,68,68,0.18); }
.status-pill.status-pending    .status-dot { background: var(--danger); }
.status-pill.status-sent       { background: var(--warning-bg); color: var(--warning-text); border-color: rgba(245,158,11,0.2); }
.status-pill.status-sent       .status-dot { background: var(--warning); }
.status-pill.status-inprogress { background: var(--info-bg);    color: var(--info-text);    border-color: rgba(59,130,246,0.18); }
.status-pill.status-inprogress .status-dot { background: var(--info); }
.status-pill.status-completed  { background: var(--success-bg); color: var(--success-text); border-color: rgba(34,197,94,0.18); }
.status-pill.status-completed  .status-dot { background: var(--success); }
.settings-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
/* ═══ ROW ACTIONS KEBAB MENU ═══ */
.row-menu-wrap { position: relative; display: inline-block; }
.row-menu {
  position: fixed; z-index: 400;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 4px; min-width: 170px; display: none;
}
.row-menu.show { display: block; }
.row-menu-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 500;
  color: var(--text-primary); cursor: pointer; white-space: nowrap;
}
.row-menu-item svg { width: 15px; height: 15px; stroke: var(--text-secondary); fill: none; stroke-width: 2; flex-shrink: 0; }
.row-menu-item:hover { background: var(--body-bg); }
.row-menu-item-danger { color: var(--danger-text); }
.row-menu-item-danger svg { stroke: var(--danger-text); }
.row-menu-item-danger:hover { background: var(--danger-bg); }

/* ═══ RICH TEXT EDITOR (Email Format) ═══ */
/* ═══ FILE VIEWER MODAL ═══ */
.file-viewer-box { width: 90vw; max-width: 900px; height: 88vh; background: #202124; border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.file-viewer-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: #202124; border-bottom: 1px solid rgba(255,255,255,0.08); }
.file-viewer-name { color: #fff; font-size: 13.5px; font-weight: 600; }
.file-viewer-actions { display: flex; gap: 6px; }
.file-viewer-actions .icon-btn { background: rgba(255,255,255,0.08); }
.file-viewer-actions .icon-btn svg { stroke: #fff; }
.file-viewer-actions .icon-btn:hover { background: rgba(255,255,255,0.16); }
.file-viewer-content { flex: 1; background: #525659; display: flex; align-items: center; justify-content: center; overflow: auto; }
.file-viewer-content iframe { width: 100%; height: 100%; border: none; background: #fff; }
.file-viewer-content img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-viewer-content .file-viewer-fallback { color: #fff; text-align: center; font-size: 13.5px; }
.file-viewer-content .file-viewer-fallback a { color: var(--accent); }

.rte-toolbar { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius-md) var(--radius-md) 0 0; padding: 6px; background: var(--card-bg-alt); flex-wrap: wrap; }
.rte-btn { border: none; background: none; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 13px; font-family: var(--font); color: var(--text-primary); cursor: pointer; }
.rte-btn:hover { background: var(--body-bg); }
.rte-btn-accent { background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 11.5px; }
.rte-btn-accent:hover { background: var(--accent-hover); }
.rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.rte-editor { border: 1px solid var(--border); border-radius: 0 0 var(--radius-md) var(--radius-md); padding: 14px; min-height: 220px; font-size: var(--font-size-base); color: var(--text-primary); line-height: 1.6; outline: none; background: var(--card-bg); }
.rte-editor:focus { border-color: var(--border-focus); }
.rte-editor p { margin-bottom: 10px; }
.rte-editor .cta-button-token { display: block; text-align: center; background: var(--sidebar-bg); color: var(--accent); padding: 10px 20px; border-radius: 8px; font-weight: 700; margin: 14px auto; width: fit-content; user-select: none; }

#reportTable thead th { position: sticky; top: 0; background: var(--card-bg-alt); z-index: 5; white-space: nowrap; }
#reportTable tbody tr:nth-child(even) { background: var(--body-bg); }
#reportTable tbody tr:hover { background: var(--card-bg-alt); }
#reportTable td, #reportTable th { padding: 11px 14px; font-size: 13px; }
.reports-main-panel .table-scroll { max-height: 560px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }

/* ═══ REPORTS PAGE ═══ */
.reports-shell { display: flex; flex-direction: column; gap: 16px; }
.reports-list-panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.reports-list-panel .search-input { width: 100%; max-width: 320px; margin-bottom: 12px; }
.reports-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.report-list-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: none; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 14px; cursor: pointer; font-family: var(--font); width: auto; min-width: 200px; flex: 1 1 200px; max-width: 260px; }
.report-list-item span:first-child { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.report-list-item:hover { background: var(--body-bg); }
.report-list-item.active { background: var(--sidebar-bg); border-color: var(--sidebar-bg); }
.report-list-item.active span:first-child { color: var(--accent); }
.report-list-item.active .page-sub { color: rgba(255,255,255,0.55); }

.reports-main-panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.reports-main-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.reports-main-actions { display: flex; align-items: center; gap: 10px; }

.export-dropdown-wrap { position: relative; }
.export-dropdown { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 4px; min-width: 180px; display: none; }
.export-dropdown.show { display: block; }
.export-dropdown-item { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 500; color: var(--text-primary); cursor: pointer; white-space: nowrap; }
.export-dropdown-item svg { width: 15px; height: 15px; stroke: var(--text-secondary); fill: none; stroke-width: 2; }
.export-dropdown-item:hover { background: var(--body-bg); }

@media (max-width: 860px) {
  .report-list-item { min-width: 100%; }
}

.settings-tab { background: none; border: none; padding: 10px 16px; font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }

/* ═══ REMINDER DAY TOGGLES ═══ */
.reminder-days-list { display: flex; flex-direction: column; gap: 2px; }
.reminder-day-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.reminder-day-row:last-child { border-bottom: none; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 24px; transition: 0.2s; }
.switch-slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.settings-tab:hover { color: var(--text-secondary); }
.settings-tab.active { color: var(--sidebar-bg); border-bottom-color: var(--accent); }
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }

/* ═══ LOGO UPLOAD (Settings) ═══ */
.logo-upload-row { display: flex; align-items: center; gap: 16px; }
.logo-preview { width: 56px; height: 56px; border-radius: var(--radius-lg); background: var(--sidebar-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; border: 1px solid var(--border); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview span { color: var(--accent); font-weight: 800; font-size: 16px; }
.logo-upload-actions { display: flex; gap: 8px; }

/* ═══ SUBMISSION DETAIL VIEW (redesigned) ═══ */
.sub-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.sub-detail-header .sdh-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sub-detail-header .sdh-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.detail-section { background: var(--card-bg-alt); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 12px; }
.detail-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.detail-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.detail-item:last-child { border-bottom: none; }
.detail-item .dl { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 3px; }
.detail-item .dv { display: block; font-size: 13.5px; color: var(--text-primary); font-weight: 500; word-break: break-word; line-height: 1.5; }
.detail-item .dv.mono { font-family: var(--font-mono); font-size: 12.5px; }
.detail-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
.detail-section .detail-section-title { grid-column: 1 / -1; }
.detail-item-full { grid-column: 1 / -1; }
.dv-input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 9px; font-family: var(--font); font-size: 13px; color: var(--text-primary); background: var(--card-bg); }
.dv-input:focus { outline: none; border-color: var(--border-focus); }
textarea.dv-input { resize: vertical; }
.search-input { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 12px; font-size: var(--font-size-sm); width: 260px; background: var(--card-bg); }
.search-input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(245,197,24,0.09); }

/* ═══ TABLE ═══ */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--font-size-base); }
th { text-align: left; color: var(--text-secondary); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--body-bg); vertical-align: middle; }
tr:hover td { background: var(--card-bg-alt); }
.col-check { width: 34px; }
.col-actions { width: 90px; }
.cust-name { font-weight: 600; }
.cust-code { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary); background: var(--card-bg-alt); padding: 2px 7px; border-radius: 5px; }
.email-more { font-size: 11px; color: var(--info-text); }
.link-cell { display: flex; align-items: center; gap: 6px; }
.link-cell a { color: var(--info-text); font-size: 12px; text-decoration: none; }
.link-cell a:hover { text-decoration: underline; }
.link-empty { color: var(--text-muted); font-size: 12px; }
.icon-btn { border: 1px solid var(--border); background: var(--card-bg); width: 28px; height: 28px; border-radius: var(--radius-md); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 14px; height: 14px; stroke: var(--text-secondary); stroke-width: 2; fill: none; }
.icon-btn:hover { background: var(--body-bg); }
.icon-btn-delete svg { stroke: var(--danger-text); }
.icon-btn-muted { opacity: 0.4; }
.row-actions { display: flex; gap: 6px; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 12px; color: var(--text-secondary); }

/* ═══ REPORT CARDS ═══ */
.report-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.report-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.report-card .rc-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.report-card .rc-sub { font-size: 11.5px; color: var(--text-muted); margin-bottom: 14px; }
.report-card .rc-btn-row { display: flex; gap: 8px; }

/* ═══ FORMS ═══ */
.common-fields-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.common-fields-row .field { flex: 1; min-width: 160px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: var(--font-size-xs); font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.field input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 12px; font-family: var(--font); font-size: var(--font-size-base); color: var(--text-primary); background: var(--card-bg); outline: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.field input::placeholder { color: var(--text-placeholder); }
.field input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(245,197,24,0.09); }
.field select { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 12px; font-family: var(--font); font-size: var(--font-size-base); color: var(--text-primary); background: var(--card-bg); outline: none; }
.field select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(245,197,24,0.09); }

.email-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.email-row { display: flex; gap: 8px; align-items: center; }
.email-row input { flex: 1; }

.add-row-btn { margin-top: 12px; background: none; border: 1.5px dashed var(--border); border-radius: var(--radius-md); padding: 9px; width: 100%; color: var(--text-secondary); font-family: var(--font); font-weight: 600; font-size: var(--font-size-sm); cursor: pointer; transition: border-color var(--transition-fast), color var(--transition-fast); }
.add-row-btn:hover { border-color: var(--accent); color: var(--text-primary); }

/* ═══ MODAL ═══ */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,42,62,0.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; z-index: 200; overflow-y: auto; }
#fileViewerOverlay { z-index: 300; }
.modal-box { background: var(--card-bg); border-radius: var(--radius-xl); width: 460px; max-width: 100%; padding: 22px 24px; box-shadow: var(--shadow-lg); }
.modal-box-md { width: 560px; }
.modal-box-lg { width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-scroll { max-height: 60vh; overflow-y: auto; padding-right: 2px; }
.modal-close { border: none; background: none; width: 28px; height: 28px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.modal-close svg { width: 16px; height: 16px; stroke: var(--text-secondary); stroke-width: 2; }
.modal-close:hover { background: var(--body-bg); }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ═══ DROPZONE ═══ */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 34px 20px; background: var(--card-bg-alt); cursor: pointer; transition: border-color var(--transition-fast), background var(--transition-fast); }
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: var(--accent-dim); }
.dropzone-icon { width: 30px; height: 30px; stroke: var(--text-secondary); stroke-width: 1.6; fill: none; margin-bottom: 10px; }
.dropzone-title { font-weight: 700; font-size: 13.5px; color: var(--text-primary); }
.dropzone-hint { color: var(--text-muted); font-size: 11.5px; margin-top: 4px; }

/* ═══ TOAST ═══ */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--sidebar-bg); color: #fff; padding: 12px 20px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; line-height: 1.45; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 500; max-width: 420px; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1100px) {
  .stat-grid, .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
  .report-cards { grid-template-columns: 1fr; }
}