
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --bg: #0a0a0f;
    --bg2: #111118;
    --bg3: #1a1a26;
    --bg4: #22222f;
    --border: rgba(255,255,255,0.07);
    --border2: rgba(255,255,255,0.12);
    --text: #f0f0f8;
    --muted: #888899;
    --accent: #7c6fff;
    --accent2: #a78bfa;
    --green: #22d3a5;
    --green2: #0f9e75;
    --red: #f87171;
    --amber: #fbbf24;
    --blue: #60a5fa;
    --pink: #f472b6;
    --font-head: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --r: 12px;
    --r2: 8px;
  }

  body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
  }

  /* SIDEBAR */
  .sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
  }

  .logo {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border);
  }
  .logo-mark {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 20px;
    color: var(--text);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .logo-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
  }
  .logo-sub { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 3px; letter-spacing: 1px; }

  .nav { padding: 16px 12px; flex: 1; }
  .nav-label { font-size: 10px; letter-spacing: 2px; color: var(--muted); padding: 8px 12px 4px; font-family: var(--font-mono); text-transform: uppercase; }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r2);
    font-size: 14px; font-weight: 400;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
    user-select: none;
  }
  .nav-item:hover { background: var(--bg3); color: var(--text); }
  .nav-item.active { background: rgba(124,111,255,0.15); color: var(--accent2); font-weight: 500; }
  .nav-item .icon { width: 16px; text-align: center; font-size: 15px; }
  .nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-family: var(--font-mono);
    padding: 1px 7px;
    border-radius: 20px;
  }

  .sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
  }
  .user-info {
    display: flex; align-items: center; gap: 10px;
    padding: 10px;
    border-radius: var(--r2);
    cursor: pointer;
  }
  .user-info:hover { background: var(--bg3); }
  .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: #fff;
  }
  .user-name { font-size: 13px; font-weight: 500; }
  .user-role { font-size: 11px; color: var(--muted); }

  /* MAIN */
  .main {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
  }

  .topbar {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0;
    background: var(--bg);
    z-index: 50;
    backdrop-filter: blur(10px);
  }
  .page-title {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
  }
  .page-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

  .topbar-actions { display: flex; align-items: center; gap: 12px; }
  .btn {
    padding: 8px 16px;
    border-radius: var(--r2);
    font-size: 13px;
    font-family: var(--font-body);
    font-weight: 500;
    border: 1px solid var(--border2);
    background: var(--bg3);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; gap: 6px;
  }
  .btn:hover { background: var(--bg4); border-color: rgba(255,255,255,0.2); }
  .btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  .btn-accent:hover { background: #6b5fe6; border-color: #6b5fe6; }
  .btn-danger { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.3); color: var(--red); }
  .btn-danger:hover { background: rgba(248,113,113,0.25); }
  .btn-success { background: rgba(34,211,165,0.15); border-color: rgba(34,211,165,0.3); color: var(--green); }
  .btn-success:hover { background: rgba(34,211,165,0.25); }
  .btn-sm { padding: 5px 10px; font-size: 12px; }

  .content { padding: 32px; }

  /* STATS GRID */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
  }

  .stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
  }
  .stat-card:hover { border-color: var(--border2); transform: translateY(-1px); }
  .stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
  }
  .stat-card.c-purple::before { background: linear-gradient(90deg, var(--accent), var(--pink)); }
  .stat-card.c-green::before { background: linear-gradient(90deg, var(--green), #34d399); }
  .stat-card.c-blue::before { background: linear-gradient(90deg, var(--blue), #818cf8); }
  .stat-card.c-amber::before { background: linear-gradient(90deg, var(--amber), #f97316); }
  .stat-card.c-pink::before { background: linear-gradient(90deg, var(--pink), var(--red)); }

  .stat-label {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
  }
  .stat-value {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
  }
  .stat-change {
    font-size: 12px;
    font-family: var(--font-mono);
    display: flex; align-items: center; gap: 4px;
  }
  .stat-change.up { color: var(--green); }
  .stat-change.down { color: var(--red); }
  .stat-icon {
    position: absolute;
    top: 18px; right: 18px;
    font-size: 22px;
    opacity: 0.15;
  }

  /* SECTION */
  .section { margin-bottom: 32px; }
  .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }
  .section-title {
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 600;
  }
  .section-meta { font-size: 13px; color: var(--muted); }

  /* FILTERS */
  .filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }
  .filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-family: var(--font-mono);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
  }
  .filter-btn:hover { border-color: var(--border2); color: var(--text); }
  .filter-btn.active { background: rgba(124,111,255,0.2); border-color: var(--accent); color: var(--accent2); }

  .search-box {
    padding: 7px 14px;
    border-radius: var(--r2);
    border: 1px solid var(--border);
    background: var(--bg2);
    color: var(--text);
    font-size: 13px;
    font-family: var(--font-body);
    width: 220px;
    transition: all 0.15s;
  }
  .search-box:focus { outline: none; border-color: var(--accent); background: var(--bg3); }
  .search-box::placeholder { color: var(--muted); }

  /* TABLE */
  .table-wrap {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
  }
  table { width: 100%; border-collapse: collapse; }
  thead { background: var(--bg3); }
  th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    font-weight: 400;
  }
  td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }
  tr:last-child td { border-bottom: none; }
  tbody tr {
    transition: background 0.1s;
    cursor: pointer;
  }
  tbody tr:hover { background: var(--bg3); }
  tbody tr.deleting { opacity: 0; transform: translateX(-20px); transition: all 0.3s; }

  .order-id {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent2);
  }
  .customer-info { display: flex; align-items: center; gap: 10px; }
  .mini-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--bg4);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 500;
    flex-shrink: 0;
    color: var(--muted);
  }
  .customer-name { font-weight: 500; font-size: 13px; }
  .customer-email { font-size: 11px; color: var(--muted); }

  .amount {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text);
  }

  .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 500;
    white-space: nowrap;
  }
  .status-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    display: block;
  }
  .badge-pending { background: rgba(251,191,36,0.15); color: var(--amber); border: 1px solid rgba(251,191,36,0.25); }
  .badge-pending::before { background: var(--amber); }
  .badge-confirmed { background: rgba(34,211,165,0.15); color: var(--green); border: 1px solid rgba(34,211,165,0.25); }
  .badge-confirmed::before { background: var(--green); }
  .badge-cancelled { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid rgba(248,113,113,0.25); }
  .badge-cancelled::before { background: var(--red); }
  .badge-shipped { background: rgba(96,165,250,0.15); color: var(--blue); border: 1px solid rgba(96,165,250,0.25); }
  .badge-shipped::before { background: var(--blue); }
  .badge-delivered { background: rgba(167,139,250,0.15); color: var(--accent2); border: 1px solid rgba(167,139,250,0.25); }
  .badge-delivered::before { background: var(--accent2); }

  .actions { display: flex; gap: 6px; align-items: center; }

  /* MODAL */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
  }
  .modal-overlay.show { display: flex; }
  .modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 16px;
    padding: 28px;
    width: 440px;
    max-width: 90vw;
    animation: modal-in 0.2s ease;
  }
  @keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }
  .modal-icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
  }
  .modal-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
  .modal-body { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
  .modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
  .modal-detail {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 14px;
    margin-bottom: 20px;
    font-size: 13px;
  }
  .modal-detail-row { display: flex; justify-content: space-between; padding: 4px 0; }
  .modal-detail-label { color: var(--muted); }
  .modal-detail-val { font-family: var(--font-mono); font-weight: 500; }

  /* TOAST */
  #toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .toast {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--r);
    padding: 14px 18px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    animation: toast-in 0.25s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  }
  .toast.toast-success { border-left: 3px solid var(--green); }
  .toast.toast-error { border-left: 3px solid var(--red); }
  .toast.toast-info { border-left: 3px solid var(--blue); }
  .toast.removing { animation: toast-out 0.25s ease forwards; }
  @keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
  @keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }
  .toast-icon { font-size: 16px; }

  /* CHART BAR */
  .mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 48px;
    padding: 4px 0;
  }
  .bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    background: rgba(124,111,255,0.4);
    transition: all 0.3s;
    cursor: pointer;
    min-height: 4px;
  }
  .bar:hover { background: var(--accent); }

  /* VIEWS */
  .view { display: none; }
  .view.active { display: block; }

  /* PAGINATION */
  .pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
  }
  .page-btns { display: flex; gap: 6px; }
  .page-btn {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    font-family: var(--font-mono);
  }
  .page-btn:hover { background: var(--bg3); color: var(--text); }
  .page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

  /* DETAIL PANEL */
  .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }

  .empty-state {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
  }
  .empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.4; }
