:root {
    --portal-bg: #f3f6fb;
    --portal-surface: #ffffff;
    --portal-surface-soft: #f8fafc;
    --portal-line: #d9e1ea;
    --portal-line-strong: #c7d2de;
    --portal-text: #0f172a;
    --portal-muted: #64748b;
    --portal-primary-top: #B8FF47;
    --portal-primary-mid: #7ED321;
    --portal-primary-mid-2: #39A81E;
    --portal-primary-bottom: #1D7718;
    --portal-primary-border: #8BEA2A;
    --portal-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --portal-shadow-md: 0 8px 24px rgba(15, 23, 42, .06);
    --portal-radius-sm: 10px;
    --portal-radius-md: 14px;
    --portal-radius-lg: 18px;
}

body {
    background: var(--portal-bg);
    color: var(--portal-text);
}

.topbar {
    background: linear-gradient(180deg, #1f2a37 0%, #17212d 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}

.topbar .container {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.nav[hidden] {
    display: none !important;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav a {
    color: rgba(255,255,255,.94);
    text-decoration: none;
}

.nav a:hover {
    color: #fff;
}

.nav-logout-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.94);
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.nav-logout-btn:hover {
    color: #fff;
}

.brand-link-text {
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    text-decoration: none;
}

.card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-line);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow-sm);
}

.card:hover {
    box-shadow: var(--portal-shadow-md);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--portal-surface-soft);
    border: 1px solid var(--portal-line);
    color: var(--portal-text);
    font-size: 14px;
    line-height: 1.2;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

thead th {
    background: var(--portal-surface-soft);
    color: var(--portal-muted);
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid var(--portal-line);
    padding: 14px 16px;
    white-space: nowrap;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--portal-line);
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: rgba(248, 250, 252, .7);
}

.button,
button,
input[type="submit"] {
    border-radius: 999px;
}

.button.secondary {
    background: #fff;
    border: 1px solid var(--portal-line-strong);
    color: var(--portal-text);
    text-decoration: none;
    padding: 10px 18px;
    font-weight: 600;
    box-shadow: var(--portal-shadow-sm);
}

.button.secondary:hover {
    background: var(--portal-surface-soft);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--portal-line-strong);
    border-radius: var(--portal-radius-sm);
    background: #fff;
    color: var(--portal-text);
    padding: 10px 12px;
    outline: none;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: #7ED321;
    box-shadow: 0 0 0 3px rgba(126, 211, 33, .18);
}

label {
    font-weight: 600;
}

.message {
    border-radius: var(--portal-radius-md);
    border: 1px solid var(--portal-line);
    background: #fff;
    box-shadow: var(--portal-shadow-sm);
}

.message.success {
    background: #ecfdf3;
    border-color: #b7ebc6;
}

.message.warning {
    background: #fff7ed;
    border-color: #fed7aa;
}

.message.error {
    background: #fef2f2;
    border-color: #fecaca;
}

.status-new { background:#eef4ff; color:#1d4ed8; border-color:#bfd3ff; }
.status-processing { background:#eff6ff; color:#2563eb; border-color:#bfdbfe; }
.status-draft { background:#f8fafc; color:#475569; border-color:#dbe3ec; }
.status-paid { background:#ecfdf3; color:#027a48; border-color:#b7ebc6; }
.status-overdue { background:#fff7ed; color:#c2410c; border-color:#fed7aa; }
.status-shipped { background:#ecfdf3; color:#027a48; border-color:#b7ebc6; }
.status-completed { background:#f0fdf4; color:#166534; border-color:#bbf7d0; }
.status-cancelled { background:#fef2f2; color:#b42318; border-color:#fecaca; }

.page-head,
.data-table-header,
.table-toolbar,
.summary-total-row,
.summary-row,
.order-meta-row {
    gap: 16px;
}

@media (max-width: 960px) {
    .topbar .container {
        min-height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
        align-items: flex-start;
    }

    .nav {
        gap: 12px;
    }

    thead th,
    tbody td {
        padding: 12px 12px;
    }
}


html, body {
    margin: 0;
    padding: 0;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

main.container {
    padding-top: 24px;
    padding-bottom: 32px;
}

.row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 16px;
}

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

.sidebar-layout {
    display: grid;
    gap: 20px;
    grid-template-columns: 280px 1fr;
}

.muted {
    color: var(--portal-muted);
}

.messages {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.message {
    padding: 14px 16px;
}

.kpi {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    padding: 14px;
    border: 1px solid var(--portal-line);
    border-radius: var(--portal-radius-md);
    background: #fff;
}

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.product-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    background: #fff;
    border: 1px solid var(--portal-line);
    border-radius: var(--portal-radius-md);
}

@media (max-width: 960px) {
    .sidebar-layout {
        grid-template-columns: 1fr;
    }

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

    .between {
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 20px, 100%);
    }

    .stats {
        grid-template-columns: 1fr;
    }

    main.container {
        padding-top: 18px;
        padding-bottom: 24px;
    }
}


.table-stack-mobile {
    width: 100%;
}

@media (max-width: 760px) {
    .table-stack-mobile thead {
        display: none;
    }

    .table-stack-mobile,
    .table-stack-mobile tbody,
    .table-stack-mobile tr,
    .table-stack-mobile td {
        display: block;
        width: 100%;
    }

    .table-stack-mobile tbody tr {
        background: #fff;
        border: 1px solid var(--portal-line);
        border-radius: 14px;
        box-shadow: var(--portal-shadow-sm);
        margin: 0 0 14px;
        padding: 10px 12px;
    }

    .table-stack-mobile tbody td {
        border: none;
        padding: 8px 0;
        background: transparent !important;
    }

    .table-stack-mobile tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 13px;
        font-weight: 700;
        color: var(--portal-muted);
        margin-bottom: 4px;
    }

    .table-stack-mobile tbody td[data-label=""]::before {
        display: none;
    }

    .table-stack-mobile tbody tr:hover td {
        background: transparent !important;
    }
}

html {
    -webkit-text-size-adjust: 100%;
}

h1 {
    font-size: clamp(28px, 4.8vw, 40px);
    line-height: 1.12;
}

h2 {
    font-size: clamp(22px, 3.8vw, 30px);
    line-height: 1.18;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
}

.nav-toggle:hover {
    background: rgba(255,255,255,.12);
}

@media (max-width: 760px) {
    .topbar .container {
        flex-wrap: wrap;
        align-items: center;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        background: rgba(255,255,255,.04);
        border: 1px solid rgba(255,255,255,.10);
        border-radius: 16px;
        padding: 12px;
    }

    .nav.is-open {
        display: flex;
    }

    .nav a,
    .nav form {
        width: 100%;
    }

    .nav a {
        display: block;
        padding: 10px 12px;
        background: rgba(255,255,255,.04);
        border-radius: 12px;
    }

    .nav-logout-btn {
        width: 100%;
        text-align: left;
        padding: 10px 12px;
        background: rgba(255,255,255,.04);
        border-radius: 12px;
    }
}
