:root {
    --green: #159447;
    --green-dark: #0f7a38;
    --blue: #075985;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f3f7f5;
    --card: #ffffff;
    --sidebar: #0b1220;
    --danger: #dc2626;
    --warn: #d97706;
    --ok: #159447;
    --radius: 16px;
    --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    --font: "Manrope", "Segoe UI", sans-serif;
    --display: "Sora", "Manrope", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.admin-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
    color: #e5e7eb;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 18px 14px 28px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 16px;
    position: relative;
}

.sidebar-brand img {
    width: auto;
    height: 42px;
    max-width: 140px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 4px 6px;
}

.sidebar-brand strong {
    display: block;
    font-family: var(--display);
    font-size: 15px;
}

.sidebar-brand span {
    font-size: 12px;
    color: #94a3b8;
}

.sidebar-close {
    display: none;
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.is-visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-link,
.nav-group-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    color: #cbd5e1;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-weight: 650;
    font-size: 13.5px;
}

.nav-link:hover,
.nav-group-btn:hover,
.nav-link.active {
    background: rgba(21, 148, 71, 0.18);
    color: #fff;
}

.nav-ico {
    width: 22px;
    text-align: center;
    opacity: 0.9;
}

.nav-group .chev {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.nav-group.open .chev { transform: rotate(180deg); }

.nav-sub {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 8px 34px;
}

.nav-group.open .nav-sub { display: flex; }

.nav-sub a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
}

.nav-sub a:hover,
.nav-sub a.active {
    background: rgba(255,255,255,0.06);
    color: #86efac;
}

.nav-badge {
    min-width: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
}

.admin-main { min-width: 0; }

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-topbar h1 {
    font-family: var(--display);
    font-size: 22px;
    letter-spacing: -0.03em;
}

.admin-topbar p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.sidebar-toggle {
    display: none;
    border: 1px solid var(--line);
    background: #fff;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
}

.admin-content { padding: 24px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 0;
    font-weight: 750;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green), var(--blue));
    color: #fff;
}

.btn-ghost {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
}

.btn-danger {
    background: #fee2e2;
    color: var(--danger);
}

.btn:hover { transform: translateY(-1px); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stats-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    background: linear-gradient(145deg, #159447 0%, #0f7a38 45%, #075985 100%);
    color: #fff;
    border-radius: 18px;
    padding: 22px 20px;
    box-shadow: var(--shadow);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -20px;
    top: -20px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
}

.stat-card .label {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.92;
    position: relative;
    z-index: 1;
}

.stat-card .value {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    font-family: var(--display);
    font-size: 17px;
}

.panel-body { padding: 16px 18px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data,
table.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    table-layout: auto;
}

table.data th,
table.data td,
table.data-table th,
table.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 13.5px;
    vertical-align: middle;
}

table.data th,
table.data-table th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

table.data tbody tr:hover,
table.data-table tbody tr:hover {
    background: #fafdfb;
}

table.data tbody tr:last-child td,
table.data-table tbody tr:last-child td {
    border-bottom: 0;
}

table.data .col-actions,
table.data-table .col-actions {
    min-width: 220px;
    white-space: nowrap;
}

table.data .col-price,
table.data-table .col-price {
    white-space: nowrap;
    font-weight: 800;
    color: var(--blue);
}

table.data .col-order,
table.data-table .col-order {
    min-width: 170px;
}

table.data .col-customer,
table.data-table .col-customer {
    min-width: 140px;
}

table.data .col-category,
table.data-table .col-category {
    min-width: 130px;
}

table.data .col-date,
table.data-table .col-date {
    min-width: 150px;
    white-space: nowrap;
    color: var(--muted);
    font-size: 13px;
}

.table-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #f8fafc;
    display: block;
}

.table-product-name {
    display: block;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 2px;
}

.table-product-meta {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.table-actions form {
    margin: 0;
}

.panel-head-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.panel-head-row p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

.panel-head-row .panel-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.panel-submeta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.panel-submeta code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
}

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.badge-ok,
.badge-success { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-muted { background: #f1f5f9; color: #64748b; }
.badge-featured { background: linear-gradient(135deg, #159447, #075985); color: #fff; }

.btn-sm {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.form-actions .btn {
    align-self: flex-start;
    white-space: nowrap;
}

.form-inline-action {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.form-group label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
}

.form-group textarea { min-height: 120px; resize: vertical; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(21,148,71,0.12);
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 650;
    font-size: 14px;
}

.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #e0f2fe; color: #075985; }

.empty {
    text-align: center;
    color: var(--muted);
    padding: 36px 16px;
}

.admin-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-inline-input {
    min-width: 160px;
    max-width: 220px;
    border: 1px solid #d7e0ea;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    background: #fff;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.filters input,
.filters select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 20%, rgba(21,148,71,0.16), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(7,89,133,0.14), transparent 42%),
        #f3f7f5;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: var(--shadow);
}

.login-card .brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 18px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    width: auto;
    max-width: none;
}

.login-card .brand img {
    display: block;
    width: 140px;
    height: 140px;
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
}

.login-card h1 {
    font-family: var(--display);
    font-size: 24px;
    margin-bottom: 6px;
    text-align: center;
}

.login-card .sub {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.login-card .btn { width: 100%; margin-top: 8px; }

.hint {
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px 12px;
}

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1000;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        width: min(280px, 86vw);
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto;
        touch-action: manipulation;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-sidebar .nav-link,
    .admin-sidebar .nav-group-btn,
    .admin-sidebar .nav-sub a,
    .admin-sidebar .sidebar-close {
        position: relative;
        z-index: 1;
        pointer-events: auto;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
    }
    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 30;
    }
    .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
    body.sidebar-open {
        overflow: hidden;
    }
    body.sidebar-open .admin-main {
        pointer-events: none;
    }
    body.sidebar-open .admin-sidebar,
    body.sidebar-open .admin-sidebar * {
        pointer-events: auto;
    }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stats-grid-4 { grid-template-columns: 1fr; }
    .admin-content { padding: 16px; }
    .topbar-actions .btn-ghost { display: none; }
}

/* Dashboard analytics */
.dash-page { display: flex; flex-direction: column; gap: 22px; }

.dash-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 26px 28px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(135deg, #0f766e 0%, #159447 35%, #075985 70%, #4f46e5 100%);
    box-shadow: 0 18px 40px rgba(7, 89, 133, 0.22);
    flex-wrap: wrap;
}

.dash-hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.22);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.dash-hero-copy h2 {
    font-family: var(--display);
    font-size: 28px;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.dash-hero-copy p {
    color: rgba(255,255,255,0.88);
    font-size: 14px;
    max-width: 560px;
    line-height: 1.6;
}

.dash-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 12px;
}

.dash-hero-metric {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: center;
}

.dash-hero-metric span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
    margin-bottom: 6px;
}

.dash-hero-metric strong {
    font-family: var(--display);
    font-size: 24px;
}

.dash-metric-groups {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.dash-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dash-section-head h3 {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.dash-section-head p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.dash-metric-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.dash-kpi-grid.dash-kpi-grid-six {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.dash-stat-card {
    --stat-color: #2563eb;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 132px;
    padding: 16px 12px 14px;
    border-radius: 14px;
    background: #fff !important;
    color: #0f172a !important;
    text-decoration: none;
    border: 1px solid #e8edf3;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.dash-stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--stat-color);
}

.dash-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
    border-color: #d7e0ea;
    color: #0f172a !important;
}

.dash-stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
}

.dash-stat-title {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    line-height: 1.35;
}

.dash-stat-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1;
    color: #fff;
    background: var(--stat-color);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.dash-stat-value {
    display: block;
    font-family: var(--display);
    font-size: clamp(18px, 1.35vw, 26px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--stat-color) !important;
    word-break: break-word;
}

.dash-stat-hint {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    margin-top: auto;
    padding-top: 2px;
}

.dash-stat-card.tone-blue { --stat-color: #2563eb; }
.dash-stat-card.tone-green { --stat-color: #16a34a; }
.dash-stat-card.tone-orange { --stat-color: #ea580c; }
.dash-stat-card.tone-purple { --stat-color: #7c3aed; }
.dash-stat-card.tone-teal { --stat-color: #0d9488; }
.dash-stat-card.tone-rose { --stat-color: #e11d48; }
.dash-stat-card.tone-indigo { --stat-color: #4f46e5; }
.dash-stat-card.tone-amber { --stat-color: #d97706; }
.dash-stat-card.tone-slate { --stat-color: #64748b; }
.dash-stat-card.tone-emerald { --stat-color: #059669; }
.dash-stat-card.tone-cyan { --stat-color: #0891b2; }
.dash-stat-card.tone-fuchsia { --stat-color: #c026d3; }

.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dash-kpi-grid-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-kpi-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 18px 18px 16px;
    color: #fff;
    min-height: 132px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
}

.dash-kpi-card::after {
    content: "";
    position: absolute;
    right: -24px;
    top: -24px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
}

.dash-kpi-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.dash-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.18);
    font-size: 18px;
}

.dash-kpi-label {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.95;
}

.dash-kpi-value {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

.dash-kpi-hint {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.88;
    position: relative;
    z-index: 1;
}

.dash-kpi-card.tone-blue { background: linear-gradient(145deg, #2563eb, #1d4ed8 55%, #1e40af); }
.dash-kpi-card.tone-green { background: linear-gradient(145deg, #16a34a, #159447 55%, #0f766e); }
.dash-kpi-card.tone-orange { background: linear-gradient(145deg, #f97316, #ea580c 55%, #c2410c); }
.dash-kpi-card.tone-purple { background: linear-gradient(145deg, #8b5cf6, #7c3aed 55%, #6d28d9); }
.dash-kpi-card.tone-teal { background: linear-gradient(145deg, #14b8a6, #0d9488 55%, #0f766e); }
.dash-kpi-card.tone-rose { background: linear-gradient(145deg, #f43f5e, #e11d48 55%, #be123c); }
.dash-kpi-card.tone-indigo { background: linear-gradient(145deg, #6366f1, #4f46e5 55%, #4338ca); }
.dash-kpi-card.tone-amber { background: linear-gradient(145deg, #f59e0b, #d97706 55%, #b45309); }
.dash-kpi-card.tone-slate { background: linear-gradient(145deg, #64748b, #475569 55%, #334155); }
.dash-kpi-card.tone-emerald { background: linear-gradient(145deg, #10b981, #059669 55%, #047857); }
.dash-kpi-card.tone-cyan { background: linear-gradient(145deg, #06b6d4, #0891b2 55%, #0e7490); }
.dash-kpi-card.tone-fuchsia { background: linear-gradient(145deg, #d946ef, #c026d3 55%, #a21caf); }

.dash-analytics-grid,
.dash-tables-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dash-panel { box-shadow: var(--shadow); }

.dash-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dash-chip-green { background: #dcfce7; color: #166534; }
.dash-chip-blue { background: #dbeafe; color: #1d4ed8; }
.dash-chip-orange { background: #ffedd5; color: #c2410c; }
.dash-chip-teal { background: #ccfbf1; color: #0f766e; }

.dash-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    font-size: 13px;
}

.dash-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    min-height: 220px;
    padding-top: 10px;
}

.dash-bar-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dash-bar-track {
    width: 100%;
    max-width: 54px;
    height: 160px;
    border-radius: 14px 14px 8px 8px;
    background: #f1f5f9;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.dash-bar-fill {
    width: 100%;
    border-radius: 14px 14px 8px 8px;
}

.dash-bar-fill-green {
    background: linear-gradient(180deg, #34d399, #059669);
}

.dash-bar-value {
    font-size: 12px;
    font-weight: 800;
    color: #0f766e;
}

.dash-bar-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.dash-donut-wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.dash-donut {
    --active: 50;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: conic-gradient(#16a34a 0 calc(var(--active) * 1%), #e2e8f0 calc(var(--active) * 1%) 100%);
    display: grid;
    place-items: center;
    position: relative;
}

.dash-donut::before {
    content: "";
    position: absolute;
    inset: 22px;
    background: #fff;
    border-radius: 50%;
}

.dash-donut-center {
    position: relative;
    z-index: 1;
    text-align: center;
}

.dash-donut-center strong {
    display: block;
    font-family: var(--display);
    font-size: 28px;
    color: #0f766e;
}

.dash-donut-center span {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
}

.dash-legend { display: grid; gap: 14px; }

.dash-legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-legend-item strong {
    display: block;
    font-size: 18px;
}

.dash-legend-item span {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green { background: #16a34a; }
.dot-slate { background: #cbd5e1; }

.dash-progress-list { display: grid; gap: 14px; }

.dash-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 13px;
}

.dash-progress-meta span { color: var(--muted); font-weight: 600; }
.dash-progress-meta strong { color: var(--ink); }

.dash-progress-track {
    height: 10px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.dash-progress-fill {
    height: 100%;
    border-radius: 999px;
}

.dash-progress-fill-orange { background: linear-gradient(90deg, #fb923c, #ea580c); }
.dash-progress-fill-teal { background: linear-gradient(90deg, #2dd4bf, #0f766e); }

.dash-table { min-width: 100%; }

.dash-link {
    font-size: 13px;
    font-weight: 700;
    color: #0f766e;
}

.dash-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: capitalize;
}

.dash-status-pending { background: #fef3c7; color: #92400e; }
.dash-status-confirmed,
.dash-status-processing { background: #dbeafe; color: #1d4ed8; }
.dash-status-shipped { background: #cffafe; color: #0e7490; }
.dash-status-delivered,
.dash-status-active { background: #dcfce7; color: #166534; }
.dash-status-cancelled,
.dash-status-inactive { background: #fee2e2; color: #b91c1c; }

.dash-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.dash-action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 700;
    font-size: 14px;
    transition: 0.2s ease;
}

.dash-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.dash-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.qa-blue .dash-action-icon { background: #dbeafe; }
.qa-orange .dash-action-icon { background: #ffedd5; }
.qa-green .dash-action-icon { background: #dcfce7; }
.qa-rose .dash-action-icon { background: #ffe4e6; }
.qa-purple .dash-action-icon { background: #ede9fe; }
.qa-slate .dash-action-icon { background: #f1f5f9; }

@media (max-width: 992px) {
    .dash-metric-grid,
    .dash-kpi-grid.dash-kpi-grid-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
    .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-kpi-grid-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .dash-analytics-grid,
    .dash-tables-grid,
    .dash-actions-grid,
    .dash-hero-metrics { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .dash-kpi-grid,
    .dash-kpi-grid-secondary,
    .dash-kpi-grid.dash-kpi-grid-six,
    .dash-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-hero-copy h2 { font-size: 24px; }
    .dash-stat-value { font-size: 18px; }
}

@media (max-width: 480px) {
    .dash-kpi-grid,
    .dash-kpi-grid-secondary,
    .dash-kpi-grid.dash-kpi-grid-six,
    .dash-metric-grid { grid-template-columns: 1fr; }
}
