:root {
    --bg: #090c0f;
    --sidebar: #0c1014;
    --surface: #10151a;
    --surface-2: #141a20;
    --surface-3: #181f26;
    --input: #0b1014;

    --border: #242d36;
    --border-strong: #313c47;

    --text: #f4f7f9;
    --text-soft: #c8d0d7;
    --muted: #7f8b96;
    --muted-2: #5f6b76;

    --accent: #bbff68;
    --accent-hover: #c8ff85;
    --accent-soft: rgba(187, 255, 104, .10);

    --danger: #ff7676;
    --danger-soft: rgba(255, 118, 118, .09);

    --info: #8ed8ff;
    --info-soft: rgba(142, 216, 255, .08);

    --sidebar-width: 248px;
    --radius: 14px;
    --radius-sm: 10px;

    --shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        Montserrat,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

body.drawer-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    color: inherit;
}

.admin-layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;

    display: flex;
    flex-direction: column;

    width: var(--sidebar-width);
    padding: 22px 16px;

    border-right: 1px solid var(--border);
    background: var(--sidebar);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    min-height: 46px;
    margin: 0 4px 28px;
}

.brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;

    width: 42px;
    height: 42px;

    border-radius: 12px;
    background: var(--accent);
    color: #0a0e08;

    font-size: 19px;
    font-weight: 900;
}

.brand-copy {
    min-width: 0;
}

.brand-copy strong,
.login-brand strong {
    display: block;
    font-size: 14px;
    letter-spacing: -.01em;
}

.brand-copy small,
.login-brand small {
    display: block;
    margin-top: 2px;

    color: var(--muted);
    font-size: 11px;
}

.sidebar-label {
    margin: 0 12px 8px;

    color: var(--muted-2);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}

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

.nav-item {
    position: relative;

    display: flex;
    align-items: center;
    gap: 10px;

    min-height: 42px;
    padding: 0 12px;

    border: 1px solid transparent;
    border-radius: 10px;

    color: #aeb8c1;
    font-weight: 650;

    transition:
        color .15s ease,
        background .15s ease,
        border-color .15s ease;
}

.nav-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .025);
}

.nav-item.active {
    border-color: #28323b;
    background: #151b21;
    color: var(--text);
}

.nav-indicator {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #3d4751;
}

.nav-item.active .nav-indicator {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(187, 255, 104, .08);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 6px 13px;
}

.sidebar-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.sidebar-status strong {
    display: block;
    font-size: 12px;
}

.sidebar-status small {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
}

.logout-button {
    width: 100%;
    height: 39px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: transparent;
    color: var(--muted);

    cursor: pointer;

    transition:
        border-color .15s ease,
        color .15s ease,
        background .15s ease;
}

.logout-button:hover {
    border-color: var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
}

.content {
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 34px 30px 60px;
}

.page-shell {
    width: min(100%, 1540px);
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 22px;
}

.page-header h1 {
    margin: 3px 0 5px;
    font-size: 30px;
    line-height: 1.12;
    letter-spacing: -.035em;
}

.page-header p {
    margin: 0;
    color: var(--muted);
}

.eyebrow,
.section-kicker {
    color: var(--accent);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.inline-count {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-left: 8px;
    padding: 0 8px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface);
    color: var(--text-soft);

    font-size: 11px;
    font-weight: 700;
}

.header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.back-link {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
}

.back-link:hover {
    color: var(--accent);
}

.flash {
    margin-bottom: 18px;
    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: var(--surface);
}

.flash.success {
    border-color: rgba(187, 255, 104, .22);
    background: rgba(187, 255, 104, .06);
    color: #d7ffad;
}

.flash.error {
    border-color: rgba(255, 118, 118, .22);
    background: rgba(255, 118, 118, .06);
    color: #ffaaaa;
}

.panel,
.table-card,
.filter-panel,
.metric-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.panel {
    padding: 20px;
    margin-bottom: 16px;
}

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

.panel-head h2 {
    margin: 3px 0 0;
    font-size: 17px;
    letter-spacing: -.015em;
}

.panel-value {
    color: var(--accent);
    font-size: 20px;
}

.compact-panel {
    padding: 14px;
}

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

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 148px;
    padding: 20px;
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: auto -30px -60px auto;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: rgba(187, 255, 104, .035);
}

.metric-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 12px;

    font-size: 32px;
    line-height: 1;
    letter-spacing: -.04em;
}

.metric-card small {
    display: block;
    margin-top: 12px;
    color: var(--muted-2);
}

.dashboard-note {
    min-height: 130px;
    display: flex;
    align-items: center;
}

.dashboard-note h2 {
    margin: 4px 0 7px;
}

.dashboard-note p {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
}

.field {
    min-width: 0;
}

.field-grow {
    flex: 1 1 360px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: #aeb8c1;
    font-size: 11px;
    font-weight: 750;
}

.field small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
}

input[type="text"],
input[type="search"],
input[type="password"],
select,
textarea {
    width: 100%;

    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;

    background: var(--input);
    color: var(--text);

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}

input[type="text"],
input[type="search"],
input[type="password"],
select {
    height: 42px;
    padding: 0 12px;
}

textarea {
    min-height: 120px;
    padding: 11px 12px;
    resize: vertical;
    line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
    color: #56616c;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #738d55;
    background: #0c1217;
    box-shadow: 0 0 0 3px rgba(187, 255, 104, .07);
}

.filter-panel {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;

    padding: 14px;
    margin-bottom: 14px;
}

.products-status-field,
.support-status-field {
    flex: 0 0 230px;
}

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

.stack-form {
    display: grid;
    gap: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 40px;
    padding: 0 14px;

    border: 1px solid transparent;
    border-radius: 9px;

    cursor: pointer;

    font-size: 12px;
    font-weight: 800;
    line-height: 1;

    transition:
        transform .12s ease,
        border-color .15s ease,
        background .15s ease,
        color .15s ease,
        opacity .15s ease;
}

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

.btn:disabled {
    opacity: .38;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #0a0e08;
}

.btn-primary:not(:disabled):hover {
    background: var(--accent-hover);
}

.btn-secondary {
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--text-soft);
}

.btn-secondary:not(:disabled):hover,
.btn-ghost:not(:disabled):hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-ghost {
    border-color: var(--border);
    background: transparent;
    color: var(--muted);
}

.btn-success-soft {
    border-color: rgba(187, 255, 104, .18);
    background: rgba(187, 255, 104, .08);
    color: #cfff98;
}

.btn-success-soft:not(:disabled):hover {
    border-color: rgba(187, 255, 104, .35);
    background: rgba(187, 255, 104, .12);
}

.btn-danger-soft {
    border-color: rgba(255, 118, 118, .18);
    background: rgba(255, 118, 118, .07);
    color: #ff9e9e;
}

.btn-danger-soft:not(:disabled):hover {
    border-color: rgba(255, 118, 118, .34);
    background: rgba(255, 118, 118, .11);
}

.btn-small {
    min-height: 34px;
    padding: 0 11px;
    font-size: 11px;
}

.full-width {
    width: 100%;
}

.table-card {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

.embedded-table {
    margin: 0 -20px -20px;
    border-top: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.data-table th {
    height: 44px;
    padding: 0 13px;

    border-bottom: 1px solid var(--border);

    color: #74818d;

    font-size: 10px;
    font-weight: 850;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .08em;

    white-space: nowrap;
}

.data-table td {
    padding: 12px 13px;
    border-bottom: 1px solid #202832;
    vertical-align: middle;
}

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

.data-table tbody tr {
    transition: background .12s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, .018);
}

.product-table-row.selected {
    background: rgba(187, 255, 104, .045);
}

.product-table-row.selected:hover {
    background: rgba(187, 255, 104, .065);
}

.check-cell {
    width: 46px;
    min-width: 46px;
    text-align: center !important;
}

.table-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.table-primary-link {
    color: var(--text);
    font-weight: 750;
}

.table-primary-link:hover {
    color: var(--accent);
}

.product-name-cell {
    min-width: 220px;
}

.table-secondary {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.mono {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    font-size: 12px;
}

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

.wrap-anywhere {
    overflow-wrap: anywhere;
}

.price-cell {
    white-space: nowrap;
    font-weight: 750;
}

.price-cell span {
    margin-left: 3px;
    color: var(--muted);
    font-size: 10px;
}

.action-cell {
    width: 1%;
    text-align: right !important;
}

.message-preview {
    max-width: 420px;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;

    min-height: 25px;
    padding: 0 8px;

    border: 1px solid transparent;
    border-radius: 999px;

    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-success {
    border-color: rgba(187, 255, 104, .16);
    background: rgba(187, 255, 104, .07);
    color: #cfff98;
}

.badge-danger {
    border-color: rgba(255, 118, 118, .16);
    background: rgba(255, 118, 118, .07);
    color: #ff9c9c;
}

.badge-info {
    border-color: rgba(142, 216, 255, .15);
    background: var(--info-soft);
    color: var(--info);
}

.badge-muted {
    border-color: rgba(255, 255, 255, .06);
    background: rgba(255, 255, 255, .03);
    color: #8b97a2;
}

.empty-state {
    height: 140px;
    text-align: center !important;
}

.empty-state strong,
.empty-state span {
    display: block;
}

.empty-state span {
    margin-top: 5px;
    color: var(--muted);
}

.pagination-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.pagination-bar > div:last-child {
    text-align: right;
}

.pagination-bar > span {
    color: var(--muted);
    font-size: 11px;
}

.pagination-bar strong {
    color: var(--text-soft);
}

.bulk-action-bar {
    position: fixed;
    z-index: 25;
    right: 28px;
    bottom: 22px;
    left: calc(var(--sidebar-width) + 28px);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 10px 12px 10px 14px;

    border: 1px solid #39444e;
    border-radius: 13px;

    background: rgba(18, 24, 30, .96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);

    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);

    transition:
        opacity .18s ease,
        transform .18s ease;
}

.bulk-action-bar.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.bulk-summary {
    display: flex;
    align-items: center;
    gap: 11px;
}

.bulk-count {
    display: grid;
    place-items: center;
    min-width: 35px;
    height: 35px;
    padding: 0 8px;

    border-radius: 9px;

    background: var(--accent);
    color: #0b0f09;

    font-weight: 900;
}

.bulk-summary strong {
    display: block;
    font-size: 12px;
}

.bulk-summary small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.drawer-backdrop {
    position: fixed;
    z-index: 39;
    inset: 0;

    background: rgba(0, 0, 0, .54);

    opacity: 0;
    pointer-events: none;

    transition: opacity .18s ease;
}

.drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    z-index: 40;
    top: 0;
    right: 0;
    bottom: 0;

    width: min(520px, 100vw);

    border-left: 1px solid var(--border);
    background: #0e1318;
    box-shadow: -20px 0 70px rgba(0, 0, 0, .38);

    transform: translateX(100%);

    transition: transform .22s ease;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    padding: 22px 22px 18px;

    border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
    margin: 4px 0 5px;
    font-size: 21px;
}

.drawer-header p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.drawer-close {
    display: grid;
    place-items: center;

    width: 36px;
    height: 36px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface);
    color: var(--muted);

    cursor: pointer;

    font-size: 22px;
    line-height: 1;
}

.drawer-close:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.drawer-body {
    height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 18px 22px 30px;
}

.scope-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;

    padding: 4px;
    margin-bottom: 18px;

    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input);
}

.scope-switch label {
    position: relative;
    cursor: pointer;
}

.scope-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.scope-switch span {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;

    border-radius: 7px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 800;
}

.scope-switch input:checked + span {
    background: #202830;
    color: #d6ffa8;
}

.drawer-section {
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.drawer-section:first-of-type {
    border-top: 0;
}

.drawer-section-head {
    margin-bottom: 10px;
}

.drawer-section h3 {
    margin: 0;
    font-size: 14px;
}

.drawer-section p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.drawer-section-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.two-column-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 16px;
    margin-bottom: 16px;
}

.details-list {
    margin: 0;
}

.details-list > div {
    display: grid;
    grid-template-columns: minmax(130px, .8fr) minmax(0, 1.2fr);
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.details-list > div:last-child {
    border-bottom: 0;
}

.details-list dt {
    color: var(--muted);
}

.details-list dd {
    margin: 0;
    text-align: right;
    color: var(--text-soft);
    font-weight: 700;
}

.switch-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
    align-items: center;

    margin-top: 16px;
    padding-top: 16px;

    border-top: 1px solid var(--border);

    cursor: pointer;
}

.switch-row > input {
    position: absolute;
    opacity: 0;
}

.switch-ui {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: #303943;
    transition: background .15s ease;
}

.switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;

    width: 14px;
    height: 14px;

    border-radius: 999px;
    background: #8d98a3;

    transition:
        transform .15s ease,
        background .15s ease;
}

.switch-row > input:checked + .switch-ui {
    background: rgba(187, 255, 104, .25);
}

.switch-row > input:checked + .switch-ui::after {
    transform: translateX(14px);
    background: var(--accent);
}

.switch-row strong {
    display: block;
    font-size: 12px;
}

.switch-row small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.price-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 18px;
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--input);
}

.price-preview span {
    color: var(--muted);
    font-size: 11px;
}

.price-preview strong {
    color: var(--accent);
    font-size: 17px;
}

.provider-details {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input);
}

.provider-details summary {
    padding: 11px 13px;
    cursor: pointer;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
}

.provider-details pre,
.provider-details p {
    margin: 0;
    padding: 0 13px 13px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
}

.sticky-save {
    position: sticky;
    z-index: 15;
    bottom: 16px;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;

    width: fit-content;
    margin-left: auto;
    padding: 9px 9px 9px 13px;

    border: 1px solid var(--border-strong);
    border-radius: 12px;

    background: rgba(18, 24, 30, .95);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.sticky-save span {
    color: var(--muted);
    font-size: 10px;
}

.ticket-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.ticket-side {
    position: sticky;
    top: 20px;
}

.conversation-panel {
    min-width: 0;
}

.conversation {
    display: grid;
    gap: 10px;
}

.message-card {
    max-width: 82%;
    padding: 12px 13px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--input);
}

.message-user {
    justify-self: start;
}

.message-admin {
    justify-self: end;
    border-color: rgba(187, 255, 104, .16);
    background: rgba(187, 255, 104, .045);
}

.message-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 7px;
}

.message-head strong {
    font-size: 11px;
}

.message-head time {
    color: var(--muted-2);
    font-size: 9px;
}

.message-body {
    color: var(--text-soft);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 12px;
}

.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;

    background:
        radial-gradient(circle at 50% 0%, rgba(187, 255, 104, .055), transparent 34%),
        var(--bg);
}

.login-shell {
    width: min(100%, 420px);
}

.login-card {
    padding: 26px;

    border: 1px solid var(--border);
    border-radius: 18px;

    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 26px;
}

.login-heading {
    margin-bottom: 22px;
}

.login-heading h1 {
    margin: 5px 0 5px;
    font-size: 26px;
    letter-spacing: -.035em;
}

.login-heading p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 1150px) {
    :root {
        --sidebar-width: 220px;
    }

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

    .ticket-layout {
        grid-template-columns: 1fr;
    }

    .ticket-side {
        position: static;
    }
}

@media (max-width: 850px) {
    :root {
        --sidebar-width: 190px;
    }

    .content {
        padding: 26px 20px 56px;
    }

    .two-column-grid {
        grid-template-columns: 1fr;
    }

    .bulk-action-bar {
        right: 16px;
        left: calc(var(--sidebar-width) + 16px);
    }
}

@media (max-width: 680px) {
    :root {
        --sidebar-width: 150px;
    }

    .sidebar {
        padding: 16px 10px;
    }

    .brand-copy,
    .sidebar-label,
    .sidebar-status {
        display: none;
    }

    .brand {
        justify-content: center;
        margin-bottom: 20px;
    }

    .nav-item {
        justify-content: center;
        padding: 0 8px;
        font-size: 11px;
    }

    .nav-indicator {
        display: none;
    }

    .content {
        padding: 22px 14px 50px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header h1 {
        font-size: 25px;
    }

    .header-badges {
        justify-content: flex-start;
    }

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

    .filter-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .products-status-field,
    .support-status-field {
        flex: 1 1 auto;
    }

    .filter-actions {
        width: 100%;
    }

    .filter-actions .btn {
        flex: 1 1 auto;
    }

    .pagination-bar {
        grid-template-columns: 1fr 1fr;
    }

    .pagination-bar > span {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
    }

    .bulk-action-bar {
        right: 10px;
        bottom: 10px;
        left: calc(var(--sidebar-width) + 10px);

        align-items: flex-start;
        flex-direction: column;
    }

    .bulk-actions {
        width: 100%;
        justify-content: stretch;
    }

    .bulk-actions .btn {
        flex: 1 1 auto;
    }

    .sticky-save {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .sticky-save .btn {
        width: 100%;
    }

    .details-list > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .details-list dd {
        text-align: left;
    }

    .message-card {
        max-width: 95%;
    }
}

/* ===== MAINTENANCE MODE ===== */

.maintenance-panel {
    position: relative;
    overflow: hidden;
}

.maintenance-panel::after {
    content: "";
    position: absolute;
    top: -90px;
    right: -90px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: rgba(187, 255, 104, .025);
    pointer-events: none;
}

.maintenance-panel.maintenance-active {
    border-color: rgba(187, 255, 104, .28);
}

.maintenance-panel-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.maintenance-panel-head h2 {
    margin: 4px 0 7px;
}

.maintenance-panel-head p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.maintenance-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.maintenance-state-on {
    border-color: rgba(187, 255, 104, .22);
    background: rgba(187, 255, 104, .08);
    color: #cfff98;
}

.maintenance-warning {
    margin-bottom: 16px;
    padding: 11px 12px;
    border: 1px solid rgba(255, 173, 92, .22);
    border-radius: 10px;
    background: rgba(255, 173, 92, .06);
    color: #ffc384;
    font-size: 11px;
}

.maintenance-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 17px;
}

.maintenance-switch {
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 16px;
}

.maintenance-switch input:disabled + .switch-ui,
.maintenance-switch input:disabled ~ span {
    opacity: .45;
    cursor: not-allowed;
}

.maintenance-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.maintenance-live-note {
    color: #cfff98;
    font-size: 11px;
}

@media (max-width: 680px) {
    .maintenance-panel-head {
        flex-direction: column;
    }

    .maintenance-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .maintenance-actions .btn {
        width: 100%;
    }
}


/* Dashboard analytics + order center */
.dashboard-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card-wide .metric-money,
.metric-money {
    font-size: 24px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.dashboard-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-two-column > .panel {
    min-width: 0;
}

.finance-summary,
.catalog-summary {
    display: grid;
    gap: 10px;
}

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

.catalog-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-summary > div,
.catalog-summary > div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--input);
}

.finance-summary span,
.catalog-summary span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.finance-summary strong,
.catalog-summary strong {
    display: block;
    margin-top: 7px;
    font-size: 18px;
    overflow-wrap: anywhere;
}

.orders-status-field {
    flex: 0 0 210px;
}

.orders-table td {
    white-space: nowrap;
}

.orders-table .product-name-cell {
    white-space: normal;
}

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

.order-detail-grid > .panel {
    min-width: 0;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: minmax(120px, .65fr) minmax(0, 1.35fr);
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.detail-list > div:first-child {
    padding-top: 0;
}

.detail-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.detail-list dd {
    min-width: 0;
    margin: 0;
    text-align: right;
    color: var(--text-soft);
}

.code-card {
    display: grid;
    gap: 8px;
}

.code-card > div {
    display: grid;
    grid-template-columns: minmax(120px, .45fr) minmax(0, 1.55fr);
    gap: 16px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input);
}

.code-card span {
    color: var(--muted);
    font-size: 11px;
}

.code-card strong {
    min-width: 0;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    font-size: 12px;
    font-weight: 650;
    text-align: right;
}

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

    .dashboard-two-column,
    .order-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    .finance-summary,
    .catalog-summary {
        grid-template-columns: 1fr;
    }

    .orders-status-field {
        flex: 1 1 100%;
    }

    .detail-list > div,
    .code-card > div {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .detail-list dd,
    .code-card strong {
        text-align: left;
    }
}
