/* ═══════════════════════════════════════════════════════════════════════════
   Dashboard Design System — Dark + Light Mode
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Light Mode (default) ─────────────────────────────────────────────────── */
:root {
  --bg-base:        #f8fafc;
  --bg-surface:     #ffffff;
  --bg-card:        #ffffff;
  --bg-elevated:    #f1f5f9;
  --bg-hover:       #e2e8f0;
  --bg-topbar:      rgba(255, 255, 255, 0.85);

  --border-subtle:  #e2e8f0;
  --border-light:   #cbd5e1;

  --accent-primary: #4f46e5;
  --accent-hover:   #4338ca;
  --accent-glow:    rgba(79,70,229,0.12);

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #64748b;
  --text-link:      #4f46e5;

  --badge-report-bg: #e0e7ff;
  --badge-report-text: #4338ca;

  --status-pending:       #b45309;
  --status-pending-bg:    #fef3c7;
  --status-processing:    #1d4ed8;
  --status-processing-bg: #dbeafe;
  --status-success:       #15803d;
  --status-success-bg:    #dcfce7;
  --status-failed:        #b91c1c;
  --status-failed-bg:     #fee2e2;
  --status-initiated:     #475569;
  --status-initiated-bg:  #f1f5f9;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.08);
  --shadow-glow:0 0 24px rgba(79,70,229,0.12);
}

/* ── Dark Mode overrides ───────────────────────────────────────────────────── */
body.dark-mode {
  --bg-base:        #0a0c10;
  --bg-surface:     #0f1117;
  --bg-card:        #151820;
  --bg-elevated:    #1c2030;
  --bg-hover:       #222840;
  --bg-topbar:      rgba(10,12,16,0.85);

  --border-subtle:  rgba(255,255,255,0.07);
  --border-light:   rgba(255,255,255,0.12);

  --accent-primary: #6366f1;
  --accent-hover:   #7c3aed;
  --accent-glow:    rgba(99,102,241,0.25);

  --text-primary:   #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-link:      #818cf8;

  --badge-report-bg: rgba(99,102,241,0.12);
  --badge-report-text: #818cf8;

  --status-pending:       #fbbf24;
  --status-pending-bg:    rgba(245,158,11,0.15);
  --status-processing:    #60a5fa;
  --status-processing-bg: rgba(59,130,246,0.15);
  --status-success:       #4ade80;
  --status-success-bg:    rgba(34,197,94,0.15);
  --status-failed:        #f87171;
  --status-failed-bg:     rgba(239,68,68,0.15);
  --status-initiated:     #94a3b8;
  --status-initiated-bg:  rgba(100,116,139,0.15);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow:0 0 32px rgba(99,102,241,0.15);
}

/* ── Smooth theme transition ────────────────────────────────────────────────── */
*, *::before, *::after {
  transition:
    background-color 0.25s ease,
    border-color     0.25s ease,
    color            0.2s ease,
    box-shadow       0.25s ease;
}

/* ── Reset & Base ───────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-primary), #a855f7);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 10px;
  box-shadow: var(--shadow-glow);
}
.sidebar-logo h1 { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.sidebar-logo span { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.2s ease;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active {
  background: rgba(99,102,241,0.12);
  color: var(--accent-primary);
  border-right: 2px solid var(--accent-primary);
}
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Main Content ──────────────────────────────────────────────────────────── */
.main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 90;
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; }
.topbar-title span { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; margin-left: 8px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.btn-refresh {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.2s ease;
}
.btn-refresh:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-refresh.spinning .refresh-icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-theme {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.btn-theme:hover { background: var(--bg-hover); transform: rotate(20deg); }

.btn-logout {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-logout:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.5); }


/* ── Page Body ─────────────────────────────────────────────────────────────── */
.page-body { padding: 24px 28px; flex: 1; }

/* ── KPI Cards ─────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  border-radius: 2px 2px 0 0;
}
.stat-card.total::before    { background: linear-gradient(90deg, var(--accent-primary), #a855f7); }
.stat-card.pending::before  { background: var(--status-pending); }
.stat-card.processing::before { background: var(--status-processing); }
.stat-card.success::before  { background: var(--status-success); }
.stat-card.failed::before   { background: var(--status-failed); }
.stat-card.initiated::before{ background: var(--status-initiated); }

.stat-card .stat-label {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.stat-card .stat-value {
  font-size: 2rem; font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}
.stat-card .stat-icon {
  position: absolute; right: 14px; top: 16px;
  font-size: 1.4rem; opacity: 0.15;
}

/* ── Toolbar ───────────────────────────────────────────────────────────────── */
.toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

.search-wrap {
  flex: 1; min-width: 200px;
  position: relative;
}
.search-wrap .search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.9rem; pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 34px;
  color: var(--text-primary);
  font-size: 0.85rem; font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent-primary); }

.filter-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 0.85rem; font-family: inherit;
  outline: none; cursor: pointer;
  transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--accent-primary); }

.toolbar-count {
  font-size: 0.78rem; color: var(--text-muted);
  white-space: nowrap; margin-left: auto;
}

/* ── Table ─────────────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.845rem;
}

.orders-table thead tr {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}
.orders-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em;
  white-space: nowrap;
  cursor: pointer; user-select: none;
}
.orders-table th:hover { color: var(--text-primary); }
.orders-table th.sorted { color: var(--accent-primary); }
.sort-indicator { margin-left: 4px; opacity: 0.6; }

.orders-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}
.orders-table tbody tr:last-child { border-bottom: none; }
.orders-table tbody tr:hover { background: var(--bg-hover); }

.orders-table td { padding: 13px 14px; vertical-align: middle; }

.order-id-cell { font-family: monospace; font-size: 0.78rem; color: var(--text-muted); }

.customer-cell .customer-name { font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.customer-cell .customer-email { font-size: 0.775rem; color: var(--text-muted); }

.report-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.72rem; font-weight: 600;
  background: var(--badge-report-bg);
  color: var(--badge-report-text);
  white-space: nowrap;
}

/* ── Status Badge ──────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.72rem; font-weight: 600;
  white-space: nowrap;
}
.status-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
}
.status-badge.pending    { background: var(--status-pending-bg); color: var(--status-pending); }
.status-badge.pending .dot    { background: var(--status-pending); box-shadow: 0 0 6px var(--status-pending); }
.status-badge.processing { background: var(--status-processing-bg); color: var(--status-processing); }
.status-badge.processing .dot { background: var(--status-processing); box-shadow: 0 0 6px var(--status-processing); animation: pulse-blue 1.5s ease infinite; }
.status-badge.success    { background: var(--status-success-bg); color: var(--status-success); }
.status-badge.success .dot    { background: var(--status-success); }
.status-badge.failed     { background: var(--status-failed-bg); color: var(--status-failed); }
.status-badge.failed .dot     { background: var(--status-failed); }
.status-badge.initiated  { background: var(--status-initiated-bg); color: var(--status-initiated); }
.status-badge.initiated .dot  { background: var(--status-initiated); }

@keyframes pulse-blue {
  0%,100% { opacity: 1; } 50% { opacity: 0.4; }
}

/* ── Action Buttons ────────────────────────────────────────────────────────── */
.actions-cell { display: flex; align-items: center; gap: 6px; }

.btn-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem;
  transition: all 0.18s ease;
  position: relative;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-light); }
.btn-icon.edit:hover   { color: #818cf8; border-color: rgba(99,102,241,0.4); }
.btn-icon.pdf:hover    { color: #f97316; border-color: rgba(249,115,22,0.4); }
.btn-icon.resend:hover { color: #22c55e; border-color: rgba(34,197,94,0.4); }
.btn-icon:disabled     { opacity: 0.35; cursor: not-allowed; }

/* Tooltip */
.btn-icon::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  color: var(--text-primary); font-size: 0.72rem; white-space: nowrap;
  padding: 4px 8px; border-radius: var(--radius-sm);
  opacity: 0; pointer-events: none; transition: opacity 0.18s;
}
.btn-icon:hover::after { opacity: 1; }

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem; color: var(--text-muted);
}
.pagination-controls { display: flex; gap: 6px; }
.page-btn {
  min-width: 32px; height: 32px;
  padding: 0 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer; font-size: 0.8rem; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s ease;
}
.page-btn:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.page-btn.active { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

/* ── Loading Skeleton ──────────────────────────────────────────────────────── */
.skeleton-row td { padding: 13px 14px; }
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  height: 14px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ══════════════════════════════════════════════════════════════════════════════
   MODAL / DRAWER
   ══════════════════════════════════════════════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex; align-items: flex-start; justify-content: flex-end;
}
.overlay.open { opacity: 1; pointer-events: all; }

.drawer {
  width: 520px; max-width: 100vw;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
}
.overlay.open .drawer { transform: translateX(0); }

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.drawer-header h2 { font-size: 1rem; font-weight: 700; }
.drawer-header .order-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.drawer-close {
  width: 32px; height: 32px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s ease;
}
.drawer-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }

.drawer-section { margin-bottom: 24px; }
.drawer-section h3 {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 0.78rem; font-weight: 500; color: var(--text-secondary); }

.form-input, .form-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 0.85rem; font-family: inherit;
  outline: none; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:read-only { opacity: 0.5; cursor: not-allowed; }

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-shrink: 0;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
  color: #fff;
  box-shadow: 0 0 20px rgba(99,102,241,0.3);
}
.btn-primary:hover { box-shadow: 0 0 28px rgba(99,102,241,0.5); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-success {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
}
.btn-success:hover { background: rgba(34,197,94,0.22); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ── Toast Notification ────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease;
  max-width: 340px;
}
.toast.success { border-left: 3px solid var(--status-success); }
.toast.error   { border-left: 3px solid var(--status-failed); }
.toast.info    { border-left: 3px solid var(--accent-primary); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}

/* ── Confirm Dialog ────────────────────────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }

.confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 380px; max-width: 90vw;
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-lg);
}
.confirm-overlay.open .confirm-box { transform: scale(1); }

.confirm-box .confirm-icon { font-size: 2.5rem; margin-bottom: 12px; text-align: center; }
.confirm-box h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; text-align: center; }
.confirm-box p  { font-size: 0.85rem; color: var(--text-secondary); text-align: center; margin-bottom: 20px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ── PDF Modal ─────────────────────────────────────────────────────────────── */
.pdf-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 400;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}
.pdf-overlay.open { opacity: 1; pointer-events: all; }

.pdf-toolbar {
  width: 100%; max-width: 900px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.pdf-toolbar span { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.pdf-toolbar a {
  color: var(--text-link); font-size: 0.8rem; font-weight: 500;
  text-decoration: none; display: flex; align-items: center; gap: 4px;
}
.pdf-toolbar a:hover { text-decoration: underline; }

.pdf-frame {
  width: 100%; max-width: 900px;
  height: calc(100vh - 140px);
  border: none;
  border-radius: var(--radius-lg);
  background: #fff;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
}
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  .page-body { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .orders-table th:nth-child(n+5),
  .orders-table td:nth-child(n+5) { display: none; }
}
