﻿/* Shared spacing and column adjustments for authenticated portal pages. */
/* Shared scale and spacing for a comfortable, normal-size application layout. */
:root {
    font-size: 100%;
    --density-card-padding: 1.3rem;
    --density-card-gap: 1.25rem;
    --density-control-padding: .8rem 1rem;
    --report-status-success-bg: #e8f5ed;
    --report-status-success-text: #17643a;
    --report-status-warning-bg: #fff3d6;
    --report-status-warning-text: #7a4b00;
    --report-status-info-bg: #eaf1fb;
    --report-status-info-text: #24549a;
    --report-status-danger-bg: #fce8e8;
    --report-status-danger-text: #8c2525;
    --report-status-neutral-bg: #efefef;
    --report-status-neutral-text: #454545;
    --report-status-purple-bg: #f3e8ff;
    --report-status-purple-text: #6b21a8;
    --report-table-muted: #6b5d55;
}

/* Shared page header, KPI, table, and status components. */
.portal-page-header { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; margin-bottom:1.5rem; }
.portal-page-header h2 { margin:0 0 .25rem; color:var(--foreground); font:600 2rem/1.2 'Fraunces',Georgia,serif; }
.portal-page-header p { color:var(--report-table-muted); font-size:1rem; line-height:1.5; }
.portal-page-header .page-header-date { color:var(--report-table-muted); font-size:.9375rem; font-weight:400; white-space:nowrap; }
.kpi-card { min-height:132px; padding:24px; border:1px solid var(--card-border); border-radius:16px; background:var(--card); }
.kpi-card .label { margin-bottom:.5rem; color:var(--report-table-muted); font-size:1rem; font-weight:500; line-height:1.35; }
.kpi-card .value { color:var(--primary); font:600 2rem/1.2 'DM Sans',Arial,sans-serif; font-variant-numeric:tabular-nums; }
.kpi-card .sub { display:flex; align-items:center; gap:.4rem; margin-top:.5rem; color:var(--report-table-muted); font-size:.875rem; line-height:1.4; }
.kpi-card .sub :is(i,svg) { width:14px; height:14px; flex:0 0 14px; color:var(--report-table-muted); }
.kpi-card .sub.tone-warning :is(i,svg) { color:var(--report-status-warning-text); }
.kpi-card .sub.tone-danger :is(i,svg) { color:var(--report-status-danger-text); }
.data-table { width:100%; table-layout:fixed; border-collapse:collapse; color:var(--foreground); background:var(--card); }
.data-table th { padding:8px 16px!important; border-bottom:1px solid var(--card-border); background:var(--background); color:var(--report-table-muted)!important; font-size:13px!important; font-weight:600; letter-spacing:normal!important; text-align:left; text-transform:none!important; white-space:nowrap; }
.data-table td { height:52px; padding:8px 16px!important; border-bottom:1px solid var(--card-border); color:var(--foreground); font-size:15px!important; font-weight:400; vertical-align:middle; white-space:nowrap; }
.data-table tbody tr:nth-child(even) td { background:transparent!important; }
.data-table tbody tr:hover td { background:var(--background)!important; }
.data-table .col-numeric { text-align:left; font-variant-numeric:tabular-nums; }
.data-table .data-table-item-name { display:block; overflow:hidden; color:var(--primary); font-size:16px; font-weight:400; text-overflow:ellipsis; white-space:nowrap; }
.data-table .data-table-empty { padding:24px!important; color:var(--report-table-muted); text-align:center; white-space:normal; }
.status-badge { display:inline-flex; align-items:center; gap:.4rem; min-height:1.75rem; padding:.25rem .625rem; border-radius:999px; font-size:.8125rem; font-weight:600; line-height:1; white-space:nowrap; }
.status-dot { width:.4rem; height:.4rem; flex:0 0 .4rem; border-radius:50%; background:currentColor; }
.status-success { background:var(--report-status-success-bg); color:var(--report-status-success-text); }
.status-warning { background:var(--report-status-warning-bg); color:var(--report-status-warning-text); }
.status-danger { background:var(--report-status-danger-bg); color:var(--report-status-danger-text); }
.status-info { background:var(--report-status-info-bg); color:var(--report-status-info-text); }
.status-neutral { background:var(--report-status-neutral-bg); color:var(--report-status-neutral-text); }
html body main .kpi-card .label { font-size:1rem!important; }
html body main .kpi-card .value { font-size:2rem!important; }
html body main .kpi-card .sub { font-size:.875rem!important; }
html body main .portal-page-header h2 { font:600 2rem/1.2 'Fraunces',Georgia,serif!important; }
@media(max-width:760px) { .portal-page-header { align-items:flex-start; flex-direction:column; } .portal-page-header .page-header-date { white-space:normal; } }

/* Shared report pagination used by report and inventory tables. */
.report-pagination { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-top:1rem; padding-top:.75rem; border-top:1px solid var(--card-border); color:var(--report-table-muted); font-size:.9rem; }
.report-pagination[hidden] { display:none; }
.report-pagination-controls { display:flex; flex:0 0 auto; flex-direction:row; align-items:center; justify-content:flex-end; gap:.35rem; width:auto; }
.report-go-page { display:flex; align-items:center; gap:.35rem; margin-right:.25rem; white-space:nowrap; color:var(--report-table-muted); }
.report-go-page input { box-sizing:border-box; width:2.5rem; height:2.5rem; padding:0 .35rem; border:1px solid var(--card-border); border-radius:.5rem; background:white; color:var(--foreground); font:500 1rem/1 'DM Sans',Arial,sans-serif; text-align:center; }
.report-go-page input:focus-visible { outline:2px solid var(--primary-light); outline-offset:2px; }
.report-page-button { box-sizing:border-box; width:2.5rem; min-width:2.5rem; height:2.5rem; padding:0; border:1px solid var(--card-border); border-radius:.5rem; background:white; color:var(--foreground); font:500 1rem/1 'DM Sans',Arial,sans-serif; cursor:pointer; }
.report-page-button:hover:not(:disabled):not(.active) { border-color:var(--primary-light); color:var(--primary); }
.report-page-button.active { border-color:var(--primary); background:var(--primary); color:white; }
.report-page-button:disabled { border:1px solid var(--card-border); opacity:.45; cursor:not-allowed; }
.report-page-button:focus-visible { outline:2px solid var(--primary-light); outline-offset:2px; }
@media(max-width:600px) { .report-pagination { align-items:flex-start; flex-direction:column; } }

/* Neutralize any stale page-level scaling that might survive in a dashboard wrapper. */
html, body, body > main, body main .dashboard-content-zoom {
    zoom: 1 !important;
    transform: none !important;
}

body {
    font-size: 1rem;
    line-height: 1.45;
}

html body > main { padding: 2rem 2.6rem !important; font-size: 1rem !important; line-height: 1.5; }
html body[class] > main { padding: 2rem 2.6rem !important; font-size: 1rem !important; line-height: 1.5; }
main { min-width: 0; }

@media (max-width: 1320px) {
    main {
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }

    main .summary-grid,
    main .stats-grid,
    main .stats-row {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    }

    main > div[style*="grid-template-columns"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 1240px) {
    main .order-container,
    main .page-grid,
    main .profile-container,
    main .profile-grid,
    main .tracking-grid,
    main .returns-container {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1120px) {
    main .content-grid,
    main .grid-layout,
    main .bottom-grid,
    main .report-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    main {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    main .form-grid,
    main .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Shared status-tab tray and count badges for monitoring tables. */
html body main .status-tabs {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: .75rem;
    width: 100%;
    max-width: 100%;
    margin: 0 0 1rem;
    padding: .375rem;
    border: 1px solid var(--card-border);
    border-radius: .75rem;
    background: color-mix(in srgb, var(--primary) 6%, var(--background));
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: thin;
}
html body main .status-tabs .status-tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .55rem;
    min-height: 2.5rem;
    padding: .5rem .85rem;
    border: 1px solid transparent;
    border-radius: .5625rem;
    background: transparent;
    color: var(--muted);
    font: 600 .875rem/1.2 'DM Sans', Arial, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: color .2s, background-color .2s, box-shadow .2s;
}
html body main .status-tabs .status-tab:hover:not(.active) { color: var(--primary); }
html body main .status-tabs .status-tab.active {
    background: white;
    color: var(--foreground);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--foreground) 8%, transparent);
}
html body main .status-tabs .status-tab-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.375rem;
    height: 1.375rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 7%, var(--background));
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    line-height: 1;
}
html body main .status-tabs .status-tab.active .status-tab-count {
    background: var(--primary);
    color: white;
}
html body main .status-tabs .status-tab:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 1px;
}

/* Shared table treatment across portal pages; table controls and row markup stay page-owned. */
html body main table,
html body[class] main table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #2a1f1a;
    background: #fff;
}
html body main table thead th,
html body[class] main table thead th {
    background: #faf8f6;
    color: #6b5d55;
    font-size: .75rem !important;
    font-weight: 600;
    letter-spacing: .055em;
    line-height: 1.35;
    text-align: left;
    text-transform: uppercase;
    border-bottom: 1px solid #e8e0d9;
    white-space: nowrap;
}
html body main table tbody td,
html body[class] main table tbody td {
    border-bottom: 1px solid #eee7e1;
    vertical-align: middle;
}
html body main table tbody tr:nth-child(even) td,
html body[class] main table tbody tr:nth-child(even) td {
    background-color: #fdfbf9;
}
html body main table tbody tr:last-child td,
html body[class] main table tbody tr:last-child td {
    border-bottom: 0;
}
html body main :is(.table-wrap, .table-container, .table-responsive, .inventory-table-wrap, .recent-orders-table-wrap),
html body[class] main :is(.table-wrap, .table-container, .table-responsive, .inventory-table-wrap, .recent-orders-table-wrap) {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #e8e0d9;
    border-radius: 12px;
    background: #fff;
}
@media (max-width: 760px) {
    html body main table thead th,
    html body[class] main table thead th { white-space: normal; }
}

/* Shared native select styling for dropdowns across portal pages. */
html body select:not([multiple]):not([aria-hidden="true"]):not(.report-type-native) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 42px 0 16px !important;
    border: 1px solid var(--card-border, #e8d9ce) !important;
    border-radius: 12px !important;
    background-color: #fff !important;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--primary, #4a2e24) 50%),
        linear-gradient(135deg, var(--primary, #4a2e24) 50%, transparent 50%) !important;
    background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50% !important;
    background-size: 5px 5px !important;
    background-repeat: no-repeat !important;
    color: var(--foreground, #30211c) !important;
    font: 500 14px/1.3 'DM Sans', Arial, sans-serif !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
html body select:not([multiple]):not([aria-hidden="true"]):not(.report-type-native):focus-visible {
    outline: 2px solid var(--primary, #4a2e24);
    outline-offset: 2px;
}
html body select:not([multiple]):not([aria-hidden="true"]):not(.report-type-native) option {
    background: #fff;
    color: var(--foreground, #30211c);
    font-family: 'DM Sans', Arial, sans-serif;
}
html body main :is(.inventory-select-wrap, .filter-select-wrap)::after {
    display: none;
}

/* Keep page titles clear of the small eyebrow labels above them. */
html body main > .header :is(.header-eyebrow, .usage-eyebrow, .page-eyebrow, .queue-eyebrow),
html body main > .queue-page-header .queue-eyebrow,
html body .policy-card > .eyebrow {
    display: none !important;
}

/* New purchase order UI */
.order-form-page {
    --background: #f7f4f0;
    --foreground: #2a1f1a;
    --sidebar-bg: #fff;
    --card-border: #e6dfd8;
    --primary: #4a2c22;
    --primary-light: #3b2219;
    --muted: #6b5d55;
    --success: #1f8a5b;
    font-family: Inter, Arial, sans-serif;
}
.order-form-page aside { width: 248px; background: #fff; border-color: #e6dfd8; padding: 24px 18px; }
.order-form-page .logo-container { margin-bottom: 2rem; }
.order-form-page .logo-text h1,
.order-form-page .header h2,
.order-form-page .modal-box h3,
.order-form-page .summary-header { font-family: Lora, Georgia, serif; }
.order-form-page .nav-item { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.order-form-page .nav-item.active { background: #4a2c22; color: #fff; font-weight: 600; }
.order-form-page .nav-item i { width: 18px; height: 18px; stroke-width: 1.6; }
.order-form-page main { margin-left: 248px; padding: 32px 40px; }
.order-form-page .header { margin-bottom: 24px; }
.order-form-page .header h2 { font-size: 1.85rem; }
.order-form-page .order-container { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
.order-form-page .card { border: 1px solid #e6dfd8; border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.order-form-page .section-title { font-family: Fraunces, Georgia, serif; font-size: 1.25rem; margin-bottom: 1.5rem; }
.order-form-page .form-group { margin-bottom: 0; }
.order-form-page .input-control { height: 40px; padding: 8px 12px; border: 1px solid #d9cfc7; border-radius: 8px; font-size: 14px; }
.order-form-page .form-label { font-size: 12px; color: #6b5d55; }
.order-form-page .summary-panel { position: sticky; top: 24px; }
.order-form-page .summary-panel .card { padding: 20px; }
.order-form-page .summary-header { font-size: 1.15rem; margin-bottom: 16px; }
.order-form-page .summary-empty { text-align: left; font-style: normal; padding: 14px 0; }
.order-form-page .summary-line.total { font-size: 22px; font-weight: 600; }
.order-form-page .btn-submit { min-height: 48px; padding: 12px 16px; border-radius: 10px; background: #4a2c22; font-size: 14px; }
.order-form-page .btn-submit:hover { background: #3b2219; }
.order-form-page .summary-helper { margin-top: 8px; text-align: center; color: #6b5d55; font-size: 12px; }
.order-form-page .delivery-helper { margin: -6px 0 16px; color: #6b5d55; font-size: 13px; }
.order-form-page .pay-icon svg { width: 20px; height: 20px; stroke-width: 1.6; }
.order-form-page .stock-warning-icon { display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; color: #4a2c22; }
.order-form-page .stock-warning-icon svg { width: 32px; height: 32px; stroke-width: 1.6; }
.order-form-page .radio-option { min-width: 0; }
.order-form-page .card > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
.order-form-page .radio-label { min-height: 92px; border: 1px solid #e6dfd8; border-radius: 10px; }
.order-form-page .radio-option input:checked + .radio-label { border: 1px solid #4a2c22; box-shadow: 0 0 0 1px #4a2c22; background: #faf6f3; }
.order-form-page .radio-option input:focus-visible + .radio-label,
.order-form-page .pay-option input:focus-visible + .pay-label { outline: 2px solid #4a2c22; outline-offset: 2px; }
.order-form-page .radio-option.recommended .radio-label::before { content: 'RECOMMENDED'; align-self: flex-start; color: #6b5d55; font-size: 9px; letter-spacing: .04em; font-weight: 600; }
.order-form-page :focus-visible { outline: 2px solid #4a2c22 !important; outline-offset: 2px; }
.order-form-page [hidden] { display: none !important; }
@media (max-width: 1100px) {
    .order-form-page main .order-container { grid-template-columns: minmax(0, 1fr); }
    .order-form-page .summary-panel { position: static; }
}
@media (max-width: 860px) {
    .order-form-page aside { display: none; }
    .order-form-page main { margin-left: 0; padding: 20px 16px; }
}
@media (max-width: 600px) {
    .order-form-page .card { padding: 16px; }
    .order-form-page .radio-group { grid-template-columns: 1fr; }
    .order-form-page .card > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr; }
}

/* One shared content scale based on the Admin Dashboard at 100% browser zoom. */
html body main :is(.card, .stat-card, .summary-card, .metric-card, .info-card, .activity-card, .overview-card),
html body[class] main :is(.card, .stat-card, .summary-card, .metric-card, .info-card, .activity-card, .overview-card) { padding: 1.3rem !important; margin-bottom: 1.25rem !important; }
html body main :is([class*="grid"], .stat-row, .activity-feed, .form-grid, .quick-actions, .radio-group, .pay-options, .usage-actions, .order-container, .profile-container, .tracking-grid, .returns-container, .report-layout) :is(.card, .stat-card, .summary-card, .metric-card, .info-card, .activity-card, .overview-card),
html body[class] main :is([class*="grid"], .stat-row, .activity-feed, .form-grid, .quick-actions, .radio-group, .pay-options, .usage-actions, .order-container, .profile-container, .tracking-grid, .returns-container, .report-layout) :is(.card, .stat-card, .summary-card, .metric-card, .info-card, .activity-card, .overview-card) { margin-bottom: 0 !important; }
html body main :is([class*="grid"], .stat-row, .activity-feed, .form-grid, .quick-actions, .radio-group, .pay-options, .usage-actions, .order-container, .profile-container, .tracking-grid, .returns-container, .report-layout),
html body[class] main :is([class*="grid"], .stat-row, .activity-feed, .form-grid, .quick-actions, .radio-group, .pay-options, .usage-actions, .order-container, .profile-container, .tracking-grid, .returns-container, .report-layout) { gap: 1.25rem !important; }
html body main :is(h1, .header h2, .dashboard-page-header h2, .queue-page-header h2, .greeting h2, .page-title),
html body[class] main :is(h1, .header h2, .dashboard-page-header h2, .queue-page-header h2, .greeting h2, .page-title) { font-size: 2.1rem !important; line-height: 1.2 !important; }
html body main :is(h2), html body[class] main :is(h2) { font-size: 1.4rem !important; line-height: 1.3 !important; }
html body main :is(h3, .section-title, .card-title, .summary-header),
html body[class] main :is(h3, .section-title, .card-title, .summary-header) { font-size: 1.05rem !important; line-height: 1.3 !important; }
html body main h4, html body[class] main h4 { font-size: 1rem !important; line-height: 1.35 !important; }
html body main :is(.header p, .dashboard-page-header p, .greeting > p, .page-subtitle, .section-description),
html body[class] main :is(.header p, .dashboard-page-header p, .greeting > p, .page-subtitle, .section-description) { font-size: .92rem !important; line-height: 1.5 !important; }
html body main :is(p, li), html body[class] main :is(p, li) { font-size: .95rem !important; line-height: 1.5 !important; }
html body main :is(.summary-card .value, .stat-card .value, .stat-value),
html body[class] main :is(.summary-card .value, .stat-card .value, .stat-value) { font-size: 1.55rem !important; line-height: 1.2 !important; }
html body main label, html body[class] main label { font-size: .8rem !important; }
html body main table th, html body[class] main table th { padding: .75rem 1rem !important; font-size: .75rem !important; }
html body main table td, html body[class] main table td { padding: .8rem 1rem !important; font-size: .9rem !important; }
html body main :is(input, select, textarea), html body[class] main :is(input, select, textarea) { padding: .8rem 1rem !important; font-size: 1rem !important; }
html body :is(.modal-content, .modal-body, .modal-box, .order-modal-scroll, .modal-card, .order-modal-card, .order-modal-order-total) { padding: 1.3rem !important; }
/* Preserve custom select and search-field spacing after the broad form-control reset. */
html body[class] main select:not([multiple]):not([aria-hidden="true"]):not(.report-type-native) {
    padding: 0 42px 0 16px !important;
    font: 500 14px/1.3 'DM Sans', Arial, sans-serif !important;
}
html body[class] main .history-search input {
    padding: .8rem 1rem .8rem 3.2rem !important;
}
/* Item Usage submission card: keep its scoped heading and spacing above the global reset. */
html body main .item-usage-summary > .card {
    padding: 24px !important;
    border: 1px solid #e8d9ce !important;
    border-radius: 24px !important;
}
html body main .item-usage-summary .section-title {
    font: 700 24px/1.2 'Fraunces', Georgia, serif !important;
}
html body main .item-usage-summary .summary-note p,
html body main .item-usage-summary .summary-help {
    font-size: 13px !important;
    line-height: 1.5 !important;
}
@media (max-width: 600px) {
    html body main .item-usage-summary > .card { padding: 20px !important; }
}
html body[class] :is(.modal-content, .modal-body, .modal-box, .order-modal-scroll, .modal-card, .order-modal-card, .order-modal-order-total) { padding: 1.3rem !important; }
html body :is(.modal-content, .modal-body, .modal-box, .order-modal-scroll) { font-size: 1rem !important; line-height: 1.5; }
html body[class] :is(.modal-content, .modal-body, .modal-box, .order-modal-scroll) { font-size: 1rem !important; line-height: 1.5; }
html body :is(.modal-content, .modal-body, .modal-box, .order-modal-scroll) :is(h1, h2) { font-size: 1.4rem !important; line-height: 1.3 !important; }
html body[class] :is(.modal-content, .modal-body, .modal-box, .order-modal-scroll) :is(h1, h2) { font-size: 1.4rem !important; line-height: 1.3 !important; }
html body :is(.modal-content, .modal-body, .modal-box, .order-modal-scroll) :is(h3, h4) { font-size: 1.05rem !important; line-height: 1.35 !important; }
html body[class] :is(.modal-content, .modal-body, .modal-box, .order-modal-scroll) :is(h3, h4) { font-size: 1.05rem !important; line-height: 1.35 !important; }
html body :is(.modal-content, .modal-body, .modal-box, .order-modal-scroll) :is(p, li) { font-size: .95rem !important; line-height: 1.5 !important; }
html body[class] :is(.modal-content, .modal-body, .modal-box, .order-modal-scroll) :is(p, li) { font-size: .95rem !important; line-height: 1.5 !important; }
html body :is([id*="Modal"], [id*="modal"]) :is(h1, h2) { font-size: 1.4rem !important; line-height: 1.3 !important; }
html body[class] :is([id*="Modal"], [id*="modal"]) :is(h1, h2) { font-size: 1.4rem !important; line-height: 1.3 !important; }
html body :is([id*="Modal"], [id*="modal"]) :is(h3, h4) { font-size: 1.05rem !important; line-height: 1.35 !important; }
html body[class] :is([id*="Modal"], [id*="modal"]) :is(h3, h4) { font-size: 1.05rem !important; line-height: 1.35 !important; }
html body :is([id*="Modal"], [id*="modal"]) :is(p, li) { font-size: .95rem !important; line-height: 1.5 !important; }
html body[class] :is([id*="Modal"], [id*="modal"]) :is(p, li) { font-size: .95rem !important; line-height: 1.5 !important; }

@media (min-width: 761px) and (max-width: 1320px) {
    html body > main, html body[class] > main { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
}

@media (max-width: 760px) {
    html body > main, html body[class] > main { padding: 1.25rem 1rem !important; }
    html body main :is(.card, .stat-card, .summary-card, .metric-card, .info-card, .activity-card, .overview-card),
    html body[class] main :is(.card, .stat-card, .summary-card, .metric-card, .info-card, .activity-card, .overview-card) { padding: 1rem !important; margin-bottom: 1rem !important; }
    html body main :is([class*="grid"], .stat-row, .activity-feed, .form-grid, .quick-actions, .radio-group, .pay-options, .usage-actions, .order-container, .profile-container, .tracking-grid, .returns-container, .report-layout),
    html body[class] main :is([class*="grid"], .stat-row, .activity-feed, .form-grid, .quick-actions, .radio-group, .pay-options, .usage-actions, .order-container, .profile-container, .tracking-grid, .returns-container, .report-layout) { gap: 1rem !important; }
    html body main :is(h1, .header h2, .dashboard-page-header h2, .queue-page-header h2, .greeting h2, .page-title),
    html body[class] main :is(h1, .header h2, .dashboard-page-header h2, .queue-page-header h2, .greeting h2, .page-title) { font-size: 1.75rem !important; }
}

/* Keep data table headers and cells on the same left edge across portal pages. */
html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) th,
html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) td {
    text-align:left!important;
}
html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) .col-numeric {
    text-align:left!important;
    font-variant-numeric:tabular-nums;
}
html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) td.col-numeric .stock-indicator {
    justify-content:flex-start!important;
}
/* Shared page controls for long data tables. */
.table-pagination { display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.85rem 1rem;border-top:1px solid var(--card-border,#eee8e3);color:var(--muted,#867a72);font-size:.875rem; }
.table-pagination[hidden] { display:none!important; }
.table-pagination-controls { display:flex;align-items:center;gap:.3rem; order:3; }
.table-pagination-controls button { min-width:2.35rem;height:2.35rem;padding:0 .55rem;border:1px solid var(--card-border,#eee8e3);border-radius:.55rem;background:#fff;color:var(--foreground,#30211c);font:500 .9rem 'DM Sans',Arial,sans-serif;cursor:pointer; }
.table-pagination-controls button:hover:not(:disabled):not(.active) { background:#faf7f4;border-color:var(--primary-light,#8b5e3c); }
.table-pagination-controls button.active { background:var(--primary,#5c4033);border-color:var(--primary,#5c4033);color:#fff; }
.table-pagination-controls button:disabled { opacity:.45;cursor:not-allowed; }
.table-pagination-ellipsis { padding:0 .2rem; }
.table-pagination-goto-wrap { display:flex;align-items:center;gap:.45rem;order:2;white-space:nowrap; }
.table-pagination-goto { box-sizing:border-box;width:3.5rem;height:2.35rem;padding:0 .4rem;border:1px solid var(--card-border,#eee8e3);border-radius:.55rem;background:#fff;color:var(--foreground,#30211c);font:500 .9rem 'DM Sans',Arial,sans-serif;text-align:center; }
.table-pagination-goto:focus-visible,.table-pagination-controls button:focus-visible { outline:2px solid var(--primary-light,#8b5e3c);outline-offset:2px; }
@media(max-width:760px){.table-pagination{align-items:center;flex-wrap:wrap;padding:.75rem;}.table-pagination-controls{order:3;width:auto;margin-left:0;justify-content:flex-end;}.table-pagination-goto-wrap{order:2;margin-left:auto;}}

/* One consistent pagination footer across report and transaction pages. */
.pagination-unified { box-sizing:border-box!important; display:flex!important; align-items:center!important; justify-content:space-between!important; gap:1rem!important; flex-wrap:wrap!important; width:100%!important; min-height:60px!important; padding:.65rem 1.15rem!important; border-top:1px solid var(--card-border,#eee8e3)!important; color:var(--muted,#867a72)!important; background:#fff!important; font:400 .78rem 'DM Sans',Arial,sans-serif!important; }
.pagination-unified[hidden] { display:none!important; }
.pagination-unified-summary { order:0!important; margin:0!important; color:var(--muted,#867a72)!important; font:400 .78rem 'DM Sans',Arial,sans-serif!important; }
.pagination-unified-tools { order:1!important; display:flex!important; align-items:center!important; justify-content:flex-end!important; gap:1.35rem!important; margin-left:auto!important; }
.pagination-unified-goto { display:flex!important; align-items:center!important; gap:.45rem!important; color:var(--muted,#867a72)!important; font:400 .78rem 'DM Sans',Arial,sans-serif!important; white-space:nowrap!important; }
.pagination-unified-goto-input { box-sizing:border-box!important; width:3.35rem!important; height:2.25rem!important; padding:0 .4rem!important; border:1px solid var(--card-border,#e5d9d0)!important; border-radius:.5rem!important; background:#fff!important; color:var(--foreground,#30211c)!important; font:500 .88rem 'DM Sans',Arial,sans-serif!important; text-align:center!important; }
.pagination-unified-controls { order:1!important; display:flex!important; align-items:center!important; justify-content:flex-end!important; gap:.3rem!important; width:auto!important; margin:0!important; padding:0!important; overflow:visible!important; }
.pagination-unified-controls button { box-sizing:border-box!important; display:inline-flex!important; align-items:center!important; justify-content:center!important; width:2.25rem!important; min-width:2.25rem!important; height:2.25rem!important; padding:0!important; border:1px solid transparent!important; border-radius:.55rem!important; background:transparent!important; color:var(--foreground,#30211c)!important; font:500 .88rem 'DM Sans',Arial,sans-serif!important; cursor:pointer!important; }
.pagination-unified-controls button.active,.pagination-unified-controls button[aria-current="page"] { border-color:var(--primary,#5c4033)!important; background:var(--primary,#5c4033)!important; color:#fff!important; }
.pagination-unified-controls button:disabled { opacity:.42!important; cursor:not-allowed!important; }
.pagination-unified-controls button:focus-visible,.pagination-unified-goto-input:focus-visible { outline:2px solid var(--primary-light,#8b5e3c)!important; outline-offset:2px!important; }
@media(max-width:650px) { .pagination-unified { align-items:flex-start!important; } .pagination-unified-tools { gap:.55rem!important; flex-wrap:wrap!important; } }
html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) td.col-detail .btn-action {
    margin-left:0!important;
    margin-right:0!important;
}
@media (min-width: 761px) {
    html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) th,
    html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) td {
        padding:12px 16px!important;
    }
    html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) th:first-child,
    html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) td:first-child {
        padding-left:20px!important;
    }
    html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) th:last-child,
    html body main :where(.data-table, .inventory-table, #inventory-table, .report-data-table, #reportTable, .franchise-summary-table, .sales-transactions-table, .returns-history-table, .recent-orders-table) td:last-child {
        padding-right:20px!important;
    }
}
