body {
    font-family: 'Poppins', sans-serif;
}
aside {
    transition: width 0.3s;
}
.low-stock {
    background-color: #fecdca;
}

/*
  IMPORTANT:
  We DO NOT hide sidebar text on mobile.
  Mobile sidebar behavior (slide-in drawer) is handled in views/layouts/main.php
  via the `aside.open` class + transform.
*/

@media (max-width: 768px) {
    aside {
        /* keep full width so menu labels remain visible */
        width: 14rem; /* 224px */
    }
    aside span {
        display: inline; /* ensure labels show on mobile */
    }
    main {
        margin-left: 0;
    }
}

.nav-section {
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.nav-section-title {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    font-weight: 700;
    color: #1f2937;
}
.nav-section-title::-webkit-details-marker {
    display: none;
}
.nav-section-title:hover {
    background: rgba(255, 255, 255, 0.35);
}
.nav-section[open] .nav-section-title {
    background: rgba(255, 255, 255, 0.42);
}
.nav-section-body {
    display: grid;
    gap: 0.25rem;
    padding: 0.25rem 0.35rem 0.5rem;
}
.nav-chevron {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}
.nav-section[open] .nav-chevron {
    transform: rotate(180deg);
}

.dashboard-shell {
    animation: dashboardRise 0.35s ease both;
}
.dashboard-card {
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}
.dashboard-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.dashboard-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.dashboard-card-head h3 {
    font-size: 1rem;
    font-weight: 900;
    color: #0f172a;
}
.dashboard-card-head p {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #64748b;
}
.dashboard-card-head a {
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 800;
    color: #047857;
}
.dashboard-card-head a:hover {
    color: #064e3b;
}
.dashboard-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    padding: 0.8rem;
    transition: background 0.2s ease, transform 0.2s ease;
}
.dashboard-list-row:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}
.dashboard-empty {
    margin-top: 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 1rem;
    color: #64748b;
    background: #f8fafc;
}
.dashboard-table thead {
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
}
.dashboard-table th,
.dashboard-table td {
    padding: 0.85rem 0.75rem;
    text-align: left;
    vertical-align: top;
}
.dashboard-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
}
.dashboard-table tbody tr:hover {
    background: #f8fafc;
}
@keyframes dashboardRise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard command-center styling independent of Tailwind's generated utility set. */
.dashboard-shell {
    color: #0f172a;
}
.dashboard-shell > section:first-child {
    position: relative;
    overflow: hidden;
    border-radius: 1.75rem;
    color: #ffffff;
    background:
        radial-gradient(circle at 10% 0%, rgba(16, 185, 129, 0.38), transparent 32%),
        radial-gradient(circle at 86% 12%, rgba(245, 158, 11, 0.26), transparent 26%),
        linear-gradient(135deg, #07111f 0%, #132417 58%, #261708 100%);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}
.dashboard-shell > section:first-child h1,
.dashboard-shell > section:first-child p,
.dashboard-shell > section:first-child div,
.dashboard-shell > section:first-child span {
    color: inherit;
}
.dashboard-shell .text-slate-200,
.dashboard-shell .text-slate-300 {
    color: #e2e8f0 !important;
}
.dashboard-shell .text-slate-500 {
    color: #64748b !important;
}
.dashboard-shell .text-slate-600 {
    color: #475569 !important;
}
.dashboard-shell .text-slate-700,
.dashboard-shell .text-slate-800 {
    color: #334155 !important;
}
.dashboard-shell .text-slate-900,
.dashboard-shell .text-slate-950 {
    color: #0f172a !important;
}
.dashboard-shell .text-emerald-700 {
    color: #047857 !important;
}
.dashboard-shell .text-rose-700 {
    color: #be123c !important;
}
.dashboard-shell .text-amber-700 {
    color: #b45309 !important;
}
.dashboard-shell .text-sky-100 {
    color: #e0f2fe !important;
}
.dashboard-shell .bg-white\/10,
.dashboard-shell .bg-white\/15 {
    background: rgba(255, 255, 255, 0.1) !important;
}
.dashboard-shell .bg-emerald-400 {
    background: #34d399 !important;
}
.dashboard-shell .bg-emerald-400:hover,
.dashboard-shell .hover\:bg-emerald-300:hover {
    background: #6ee7b7 !important;
}
.dashboard-shell .bg-emerald-50 {
    background: #ecfdf5 !important;
}
.dashboard-shell .bg-rose-50 {
    background: #fff1f2 !important;
}
.dashboard-shell .bg-amber-50 {
    background: #fffbeb !important;
}
.dashboard-shell .bg-slate-100 {
    background: #f1f5f9 !important;
}
.dashboard-shell .border-slate-100 {
    border-color: #f1f5f9 !important;
}
.dashboard-shell .border-white\/10,
.dashboard-shell .border-white\/15 {
    border-color: rgba(255, 255, 255, 0.14) !important;
}
.dashboard-shell .backdrop-blur {
    backdrop-filter: blur(12px);
}
.dashboard-shell .tracking-tight {
    letter-spacing: -0.035em;
}
.dashboard-shell .font-black {
    font-weight: 900;
}
.dashboard-shell .rounded-\[1\.75rem\] {
    border-radius: 1.75rem;
}

/* Shared polish for core operations pages: POS, Inventory, Sales History. */
.ops-page {
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 1.5rem !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96)) !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.07) !important;
    color: #0f172a;
}
.ops-page > .flex:first-child,
.ops-page > .flex.flex-col:first-child {
    border-radius: 1.25rem;
}
.ops-page h2 {
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.025em;
    color: #0f172a;
}
.ops-page h2 i {
    color: #047857;
}
.ops-page input[type="text"],
.ops-page input[type="number"],
.ops-page input[type="date"],
.ops-page select,
.ops-page textarea {
    border-color: #dbe3ef !important;
    border-radius: 0.85rem !important;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.ops-page input:focus,
.ops-page select:focus,
.ops-page textarea:focus {
    outline: none !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12) !important;
}
.ops-page button,
.ops-page a[class*="px-"] {
    font-weight: 800;
}
.ops-page .bg-\[var\(--color-primary\)\],
.ops-page button.bg-\[var\(--color-primary\)\],
.ops-page a.bg-\[var\(--color-primary\)\] {
    background: linear-gradient(135deg, #047857, #16a34a) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 10px 22px rgba(5, 150, 105, 0.18);
}
.ops-page .bg-gray-50,
.ops-page .bg-slate-50,
.ops-page .bg-gray-100 {
    background: #f8fafc !important;
}
.ops-page .border,
.ops-page table th,
.ops-page table td {
    border-color: #e2e8f0 !important;
}
.ops-page table {
    border-collapse: separate !important;
    border-spacing: 0;
}
.ops-page thead tr {
    background: #f8fafc !important;
}
.ops-page th {
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 900;
}
.ops-page tbody tr {
    transition: background 0.16s ease;
}
.ops-page tbody tr:hover {
    background: #f8fafc;
}
.sales-page #grid-view > .product-row,
.sales-page #list-view .overflow-x-auto,
.inventory-page .overflow-x-auto,
.sales-history-page .overflow-x-auto,
.sales-history-page .md\:hidden > div,
.inventory-page .grid > .border,
.sales-history-page .grid > .bg-gray-100,
.sales-page .cart-item {
    border-color: #e2e8f0 !important;
    border-radius: 1.15rem !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}
.sales-page #grid-view > .product-row {
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.sales-page #grid-view > .product-row:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.32) !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.09);
}
.sales-page #grid-view img,
.sales-page #grid-view .h-40 {
    border-radius: 1rem !important;
}
.sales-page #cart-items {
    max-height: 34vh;
    overflow-y: auto;
    padding-right: 0.15rem;
}
.sales-page .lg\:sticky {
    top: 5.5rem !important;
}
.sales-page .w-full.lg\:w-1\/3 > .border {
    border-radius: 1.4rem !important;
    background: linear-gradient(180deg, #f8fafc, #ffffff) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}
.sales-page .w-full.lg\:w-1\/3 h3 {
    font-weight: 900;
    color: #0f172a;
}
.sales-page .pos-cart-header {
    display: block;
}
.sales-page .pos-cart-toggle {
    display: none;
}
.inventory-page > .mb-4.p-3,
.inventory-page > .mb-4.flex,
.sales-history-page .mb-5.border,
.sales-history-page .mb-5.flex {
    border-radius: 1.15rem !important;
}
.inventory-page .low-stock {
    background: #fff1f2 !important;
}
.inventory-page .editable:hover {
    background-color: #ecfdf5 !important;
}
.sales-history-page form[action="/sales-history"] {
    background: linear-gradient(180deg, #f8fafc, #ffffff);
}
.sales-history-page .js-sale-details-toggle {
    font-weight: 900;
    color: #047857 !important;
}
.sales-history-page a[href*="/receipt"] {
    color: #047857 !important;
    font-weight: 800;
}
@media (max-width: 768px) {
    .ops-page {
        padding: 0.75rem !important;
        border-radius: 1.15rem !important;
    }
    .ops-page h2 {
        font-size: 1.15rem !important;
    }
    .sales-page #grid-view {
        gap: 0.85rem !important;
    }
    .sales-page #cart-items {
        max-height: none;
    }
}

@media (max-width: 767px) {
    body {
        overflow-x: hidden;
    }
    header {
        height: 3.5rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    header .text-xl {
        font-size: 0.9rem !important;
    }
    header .profile span {
        max-width: 4.8rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
        font-size: 0.72rem;
    }
    main {
        margin-top: 3.5rem !important;
        padding: 0.45rem !important;
    }
    .dashboard-shell {
        gap: 0.85rem !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }
    .dashboard-shell > section:first-child {
        border-radius: 1.25rem !important;
        padding: 0 !important;
    }
    .dashboard-shell > section:first-child .relative.p-5,
    .dashboard-shell > section:first-child .sm\:p-7,
    .dashboard-shell > section:first-child .lg\:p-8 {
        padding: 0.85rem !important;
    }
    .dashboard-card {
        border-radius: 1rem !important;
        padding: 0.8rem !important;
    }
    .dashboard-card-head {
        gap: 0.5rem;
    }
    .dashboard-table th,
    .dashboard-table td {
        padding: 0.6rem 0.45rem;
    }

    .sales-page {
        padding-bottom: 0.75rem !important;
    }
    .sales-page > .flex {
        gap: 0.9rem !important;
    }
    .sales-page #product-search {
        width: 100% !important;
        min-width: 0 !important;
    }
    .sales-page #products-per-page {
        flex: 1 1 7rem;
    }
    .sales-page #list-view-btn,
    .sales-page #grid-view-btn {
        display: none;
    }
    .sales-page #list-view {
        display: none !important;
    }
    .sales-page #grid-view {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
    }
    .sales-page #grid-view > .product-row {
        padding: 0.55rem !important;
        border-radius: 0.95rem !important;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.055);
    }
    .sales-page #grid-view img,
    .sales-page #grid-view .h-40 {
        height: 6.2rem !important;
        margin-bottom: 0.5rem !important;
        border-radius: 0.75rem !important;
    }
    .sales-page #grid-view .product-name {
        font-size: 0.78rem;
        line-height: 1.1rem;
        min-height: 2.2rem;
    }
    .sales-page #grid-view .text-xs {
        font-size: 0.65rem;
    }
    .sales-page #grid-view select {
        font-size: 0.7rem;
        padding: 0.45rem !important;
    }
    .sales-page #grid-view input[name="quantity"] {
        width: 3.6rem !important;
        padding: 0.45rem !important;
        font-size: 0.75rem;
    }
    .sales-page #grid-view button[type="submit"] {
        padding: 0.48rem 0.45rem !important;
        font-size: 0.72rem;
        border-radius: 0.7rem !important;
    }

    .sales-page .pos-cart-panel {
        position: static !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0.75rem !important;
        border-radius: 1.15rem !important;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06) !important;
        background: #f8fafc !important;
    }
    .sales-page .pos-cart-header {
        display: block;
        position: static;
        background: transparent;
        padding: 0;
    }
    .sales-page .pos-cart-header h3 {
        margin-bottom: 0.75rem !important;
        font-size: 1rem !important;
    }
    .sales-page #cart-items {
        max-height: min(45vh, 30rem) !important;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-right: 0.2rem;
    }
    .sales-page .cart-item {
        padding: 0.65rem !important;
    }
    .sales-page .cart-item input[name="quantity"] {
        width: 4rem !important;
    }
    .sales-page .pos-cart-panel label,
    .sales-page .pos-cart-panel input,
    .sales-page .pos-cart-panel button {
        font-size: 0.8rem;
    }
}

/* SaaS setup/admin pages: product setup, business profile, settings. */
.setup-page {
    color: #0f172a;
}
.setup-page h1,
.setup-page h2 {
    letter-spacing: -0.025em;
    font-weight: 900 !important;
    color: #0f172a !important;
}
.setup-page h1 i,
.setup-page h2 i,
.setup-page h3 i {
    color: #047857;
}
.setup-page p {
    color: #475569;
}
.setup-page section,
.setup-page .bg-white,
.setup-page.product-form-page {
    border-color: #e2e8f0 !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06) !important;
}
.setup-page section,
.setup-page .bg-white.rounded-lg,
.setup-page .bg-white.rounded-2xl,
.setup-page.product-form-page {
    border-radius: 1.5rem !important;
}
.setup-page input[type="text"],
.setup-page input[type="email"],
.setup-page input[type="number"],
.setup-page input[type="file"],
.setup-page input[type="color"],
.setup-page select,
.setup-page textarea {
    border-color: #dbe3ef !important;
    border-radius: 0.85rem !important;
    background-color: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.setup-page input:focus,
.setup-page select:focus,
.setup-page textarea:focus {
    outline: none !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12) !important;
}
.setup-page label {
    font-weight: 800 !important;
    color: #334155 !important;
}
.setup-page .bg-\[var\(--color-primary\)\],
.setup-page button.bg-\[var\(--color-primary\)\],
.setup-page a.bg-\[var\(--color-primary\)\] {
    background: linear-gradient(135deg, #047857, #16a34a) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 10px 22px rgba(5, 150, 105, 0.18);
}
.setup-page button,
.setup-page a[class*="px-"] {
    font-weight: 800;
}
.setup-page .bg-gray-50,
.setup-page .bg-gray-100 {
    background: #f8fafc !important;
}
.setup-page table {
    border-collapse: separate !important;
    border-spacing: 0;
}
.setup-page thead tr {
    background: #f8fafc !important;
}
.setup-page th {
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 900;
}
.setup-page table th,
.setup-page table td,
.setup-page .border {
    border-color: #e2e8f0 !important;
}
.setup-page tbody tr:hover {
    background: #f8fafc;
}
.product-form-page form {
    margin-top: 1.5rem !important;
}
.product-form-page #variants-table {
    min-width: 900px;
}
.product-form-page #variants-table input {
    min-height: 2.6rem;
}
.product-form-page .overflow-x-auto.border {
    border-radius: 1.15rem !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.045);
}
.product-form-page h3 {
    font-weight: 900;
    color: #0f172a;
}
.business-page > .flex:first-child,
.settings-page > .mb-6:first-child {
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, #ecfdf5, #ffffff 62%, #fffbeb);
    border: 1px solid #dbe3ef;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.05);
}
.business-page .grid .bg-white.rounded-xl,
.sales-history-page .grid > .bg-gray-100,
.settings-page .bg-white.rounded-lg {
    border-color: #e2e8f0 !important;
}
.business-page form.bg-gray-50 {
    border: 1px solid #e2e8f0;
}
.settings-page .bg-white.rounded-lg {
    border-radius: 1.5rem !important;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
}
.settings-page input[type="color"] {
    min-height: 3rem;
    padding: 0.35rem !important;
}
.settings-page #system-maintenance,
.settings-page [id*="maintenance"] {
    scroll-margin-top: 6rem;
}
@media (max-width: 768px) {
    .setup-page section,
    .setup-page .bg-white.rounded-lg,
    .setup-page .bg-white.rounded-2xl,
    .setup-page.product-form-page {
        border-radius: 1.15rem !important;
    }
    .business-page > .flex:first-child,
    .settings-page > .mb-6:first-child {
        padding: 1rem;
        border-radius: 1.15rem;
    }
}

/* Remaining admin and staff operations pages. */
.admin-page h2 {
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.025em;
    color: #0f172a;
}
.admin-page h2 i,
.admin-page h3 i {
    color: #047857;
}
.admin-page h3,
.admin-page h4 {
    color: #0f172a;
    font-weight: 900 !important;
}
.admin-page .bg-gray-50,
.admin-page .bg-gray-100 {
    background: #f8fafc !important;
}
.admin-page .bg-red-100 {
    background: #fff1f2 !important;
}
.admin-page .bg-green-100 {
    background: #ecfdf5 !important;
}
.admin-page .bg-yellow-100 {
    background: #fffbeb !important;
}
.admin-page .text-red-800,
.admin-page .text-red-700,
.admin-page .text-red-600 {
    color: #be123c !important;
}
.admin-page .text-green-800,
.admin-page .text-green-700,
.admin-page .text-green-600 {
    color: #047857 !important;
}
.admin-page .text-yellow-800,
.admin-page .text-yellow-700 {
    color: #b45309 !important;
}
.admin-page .overflow-x-auto {
    border-radius: 1.15rem;
}
.admin-page table {
    border-collapse: separate !important;
    border-spacing: 0;
}
.admin-page thead tr {
    background: #f8fafc !important;
}
.admin-page th {
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 900;
}
.admin-page table th,
.admin-page table td,
.admin-page .border {
    border-color: #e2e8f0 !important;
}
.admin-page tbody tr {
    transition: background 0.16s ease;
}
.admin-page tbody tr:hover {
    background: #f8fafc;
}
.admin-page input[type="text"],
.admin-page input[type="password"],
.admin-page input[type="number"],
.admin-page input[type="date"],
.admin-page input[type="datetime-local"],
.admin-page select,
.admin-page textarea {
    border-color: #dbe3ef !important;
    border-radius: 0.85rem !important;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.admin-page input:focus,
.admin-page select:focus,
.admin-page textarea:focus {
    outline: none !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12) !important;
}
.admin-page label {
    font-weight: 800 !important;
    color: #334155 !important;
}
.admin-page .bg-\[var\(--color-primary\)\],
.admin-page button.bg-\[var\(--color-primary\)\],
.admin-page a.bg-\[var\(--color-primary\)\] {
    background: linear-gradient(135deg, #047857, #16a34a) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 10px 22px rgba(5, 150, 105, 0.18);
}
.admin-page button,
.admin-page a[class*="px-"] {
    font-weight: 800;
}
.users-page #userModal > div,
.expenses-page #expModal > div {
    border-radius: 1.5rem !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24) !important;
}
.users-page td:first-child,
.expenses-page td:nth-child(3) {
    font-weight: 800;
    color: #0f172a;
}
.activity-page .mb-5.border,
.clock-page form.bg-gray-50 {
    border-radius: 1.15rem !important;
}
.health-page .grid .border,
.clock-page .grid .bg-gray-100,
.activity-page .grid .bg-gray-100 {
    border-radius: 1.15rem !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}
.clock-page form#clock-form {
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1rem;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.clock-page #geo-status {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    padding: 0.45rem 0.85rem;
}
.expenses-page .editExp,
.users-page a[href*="/users/view"],
.users-page a[href*="/users/edit"] {
    font-weight: 900;
}
@media (max-width: 768px) {
    .admin-page h2 {
        font-size: 1.15rem !important;
    }
    .users-page #userModal > div,
    .expenses-page #expModal > div {
        margin: 1rem;
        border-radius: 1.15rem !important;
    }
}

/* Global button/link contrast guard: keep action text visible across theme colors and cached Tailwind gaps. */
a[class*="bg-slate-900"], button[class*="bg-slate-900"],
a[class*="bg-slate-800"], button[class*="bg-slate-800"],
a[class*="bg-emerald-600"], button[class*="bg-emerald-600"],
a[class*="bg-green-600"], button[class*="bg-green-600"],
a[class*="bg-blue-600"], button[class*="bg-blue-600"],
a[class*="bg-blue-700"], button[class*="bg-blue-700"],
a[class*="bg-red-600"], button[class*="bg-red-600"],
a[class*="bg-rose-600"], button[class*="bg-rose-600"],
a[class*="bg-amber-600"], button[class*="bg-amber-600"],
a[class*="bg-[var(--color-primary)]"], button[class*="bg-[var(--color-primary)]"] {
    color: #ffffff !important;
}

a[class*="bg-white"], button[class*="bg-white"],
a[class*="bg-slate-100"], button[class*="bg-slate-100"],
a[class*="bg-gray-100"], button[class*="bg-gray-100"],
a[class*="bg-gray-200"], button[class*="bg-gray-200"],
a[class*="bg-amber-100"], button[class*="bg-amber-100"] {
    color: #111827 !important;
}

.sale-success-hero {
    color: #ffffff !important;
    background: radial-gradient(circle at 12% 10%, rgba(16,185,129,.34), transparent 36%), linear-gradient(135deg, #047857 0%, #0f172a 100%) !important;
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: .9rem 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.stat-card span { display: block; color: #64748b; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.stat-card strong { display: block; color: #0f172a; font-size: 1.2rem; margin-top: .2rem; }
.field-label { display: block; color: #64748b; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }

button:disabled { cursor: wait; opacity: .7; }

/* Keep report/date filter actions readable against theme contrast overrides. */
.action-filter,
.action-filter:hover,
.action-filter:focus {
    background-color: #0f172a !important;
    color: #ffffff !important;
}
.settings-form { align-items: start; }
.settings-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.5rem; border: 1px solid #dbe3ef; border-radius: 1.5rem; background: radial-gradient(circle at 90% 0%, rgba(16,185,129,.15), transparent 35%), linear-gradient(135deg, #f0fdf4, #ffffff 58%, #fffbeb); box-shadow: 0 18px 45px rgba(15, 23, 42, .05); }
.settings-hero h1 { margin-top: .2rem; color: #0f172a; letter-spacing: -.035em; }
.settings-hero h1 i { color: #047857; font-size: .85em; }
.settings-hero-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; color: #475569; font-size: .72rem; font-weight: 800; }
.settings-hero-meta i { color: #047857; margin-right: .35rem; }
.settings-hero-meta span:last-child i { font-size: .45rem; vertical-align: middle; }
.settings-workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.settings-nav { position: sticky; top: 5.5rem; display: flex; flex-direction: column; gap: .25rem; padding: .75rem; border: 1px solid #dbe3ef; border-radius: 1.25rem; background: #fff; box-shadow: 0 12px 30px rgba(15, 23, 42, .05); }
.settings-nav-heading { padding: .65rem .7rem .8rem; border-bottom: 1px solid #e2e8f0; margin-bottom: .25rem; }
.settings-nav-heading strong { display: block; color: #0f172a; font-size: 1.05rem; }
.settings-nav-heading small { display: block; margin-top: .2rem; color: #64748b; line-height: 1.4; font-size: .72rem; }
.settings-eyebrow { display: block; color: #047857; font-size: .65rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.settings-nav a { display: flex; align-items: center; gap: .65rem; padding: .65rem .7rem; border-radius: .7rem; color: #475569; font-size: .78rem; font-weight: 800; text-decoration: none; transition: background .15s ease, color .15s ease; }
.settings-nav a i { width: 1rem; text-align: center; color: #64748b; }
.settings-nav a:hover, .settings-nav a:focus { background: #ecfdf5; color: #047857; }
.settings-nav a:hover i, .settings-nav a:focus i { color: #047857; }
.settings-content { min-width: 0; }
.settings-scope-banner { display: flex; align-items: flex-start; gap: .7rem; margin-bottom: .85rem; padding: .85rem 1rem; border: 1px solid #bbf7d0; border-radius: 1rem; background: #f0fdf4; color: #166534; font-size: .78rem; }
.settings-scope-banner i { margin-top: .15rem; }
.settings-scope-banner strong, .settings-scope-banner span { display: block; }
.settings-scope-banner span { margin-top: .15rem; color: #3f6212; }
.settings-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.settings-card-heading h2 { margin-top: .1rem; }
.settings-status { white-space: nowrap; padding: .4rem .65rem; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: .7rem; font-weight: 900; }
.settings-status i { margin-right: .25rem; }
.settings-section-title { scroll-margin-top: 6rem; }
.settings-maintenance-card { scroll-margin-top: 6rem; }
.settings-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1rem; margin-bottom: .6rem; padding: .65rem .8rem .8rem; border: 1px solid #e2e8f0; border-radius: 1rem; background: #fff; overflow: hidden; }
.settings-panel .settings-section-title { margin-top: 0; border-left: 0; border-bottom: 1px solid #e2e8f0; border-radius: 0; background: linear-gradient(90deg, #f0fdf4, #f8fafc); cursor: pointer; user-select: none; }
.settings-panel .settings-section-title { grid-column: 1 / -1; margin-left: -.8rem; margin-right: -.8rem; }
.settings-panel .settings-section-title::after { content: '\f078'; margin-left: auto; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .75rem; color: #64748b; transition: transform .2s ease; }
.settings-panel.is-collapsed .settings-section-title::after { transform: rotate(-90deg); }
.settings-panel.is-collapsed > :not(.settings-section-title) { display: none !important; }
.settings-panel > div:not(.settings-section-title):not(.settings-save-area) { min-width: 0; padding: .55rem .65rem; }
.settings-panel > div:not(.settings-section-title):not(.settings-save-area) p { margin-top: .25rem !important; line-height: 1.25; }
.settings-panel:not(.is-collapsed) .settings-section-title { border-bottom-color: #bbf7d0; }
.settings-panel .settings-section-title:focus-visible { outline: 3px solid rgba(16, 185, 129, .25); outline-offset: -3px; }
.settings-nav a.is-active { background: #047857; color: #ffffff; box-shadow: 0 5px 12px rgba(4, 120, 87, .18); }
.settings-nav a.is-active i { color: #ffffff; }
.settings-form-footer { position: sticky; bottom: .75rem; z-index: 5; margin-top: .75rem; }
.settings-form-footer .settings-save-area { border: 1px solid #dbe3ef; border-radius: 1rem; box-shadow: 0 14px 28px rgba(15, 23, 42, .12); }
.settings-form > div:not(.settings-section-title):not(.settings-save-area) { padding: .75rem .85rem; border: 1px solid #edf2f7; border-radius: .9rem; background: rgba(248, 250, 252, .72); }
.settings-form > div:not(.settings-section-title):not(.settings-save-area):focus-within { border-color: #86efac; background: #ffffff; box-shadow: 0 0 0 3px rgba(134, 239, 172, .2); }
.settings-form label { font-weight: 800; color: #334155 !important; }
.settings-form input:not([type="color"]), .settings-form select { min-height: 2.65rem; border-color: #d8e0ea; background: #ffffff; }
.settings-logo-preview { width: 2.5rem; height: 2.5rem; object-fit: contain; border: 1px solid #e2e8f0; border-radius: .5rem; background: #fff; padding: .2rem; }
.settings-save-area { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .25rem; padding: .9rem 1rem; border-top: 1px solid #e2e8f0; background: #ffffff; }
.settings-save-area strong, .settings-save-area small { display: block; }
.settings-save-area strong { color: #0f172a; font-size: .85rem; }
.settings-save-area small { margin-top: .15rem; color: #64748b; font-size: .72rem; }
.settings-section-title {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .5rem;
    padding: .85rem 1rem;
    border-left: 4px solid var(--color-primary, #087f5b);
    border-radius: .75rem;
    background: #f8fafc;
    color: #0f172a;
}
.settings-section-title > i { color: var(--color-primary, #087f5b); font-size: 1.1rem; }
.settings-section-title span { display: flex; flex-direction: column; gap: .15rem; }
.settings-section-title strong { font-size: .95rem; }
.settings-section-title small { color: #64748b; font-size: .75rem; font-weight: 500; }

@media (max-width: 768px) {
    .settings-workspace { display: block; }
    .settings-nav { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; margin-bottom: .85rem; padding: .55rem; }
    .settings-nav-heading { grid-column: 1 / -1; }
    .settings-nav a { padding: .55rem .5rem; font-size: .7rem; }
    .settings-card-heading { align-items: flex-start; }
    .settings-status { font-size: .62rem; }
    .settings-scope-banner { font-size: .72rem; }
    .settings-hero { display: block; padding: 1rem; border-radius: 1.15rem; }
    .settings-hero-meta { align-items: flex-start; margin-top: .8rem; }
    .settings-save-area { align-items: stretch; flex-direction: column; }
    .settings-save-area button { width: 100%; }
    .settings-panel { border-radius: .85rem; }
    .settings-panel .settings-section-title { padding: .75rem .8rem; }
    .settings-panel { grid-template-columns: minmax(0, 1fr); gap: .5rem; padding: .5rem .65rem .65rem; }
    .settings-panel .settings-section-title { margin-left: -.65rem; margin-right: -.65rem; }
    .settings-form-footer { bottom: .5rem; }
}

.app-toast {
    position: fixed;
    top: 4.75rem;
    right: 1rem;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: .65rem;
    max-width: min(28rem, calc(100vw - 2rem));
    padding: .8rem 1rem;
    border: 1px solid;
    border-radius: .9rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
    font-size: .875rem;
    font-weight: 700;
    transition: opacity .2s ease, transform .2s ease;
}
.app-toast-success { background: #ecfdf5; border-color: #86efac; color: #166534; }
.app-toast-error { background: #fff1f2; border-color: #fda4af; color: #9f1239; }
.app-toast.is-hidden { opacity: 0; transform: translateY(-.5rem); pointer-events: none; }
.app-toast-close { margin-left: auto; color: inherit; font-size: 1.25rem; line-height: 1; }
.global-search-input {
    background-color: rgba(15, 23, 42, .28) !important;
    color: #ffffff !important;
    caret-color: #ffffff;
}
.global-search-input::placeholder { color: rgba(255, 255, 255, .72) !important; }
.global-search-input:focus { background-color: rgba(15, 23, 42, .5) !important; border-color: rgba(255, 255, 255, .65) !important; }
.global-search-button { background-color: rgba(15, 23, 42, .55) !important; line-height: 1 !important; transform: translateY(-50%); }
.global-search-button:hover, .global-search-button:focus { background-color: rgba(15, 23, 42, .85) !important; color: #ffffff !important; }
.mobile-quick-nav { display: none; }
@media (max-width: 767px) {
    .app-toast { left: 1rem; right: 1rem; top: 4.5rem; max-width: none; }
    .mobile-quick-nav {
        position: fixed;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        padding: .45rem .35rem calc(.45rem + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .97);
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -8px 20px rgba(15, 23, 42, .08);
    }
    .mobile-quick-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: .2rem;
        padding: .35rem .2rem;
        color: #64748b;
        font-size: .68rem;
        font-weight: 800;
    }
    .mobile-quick-nav a i { font-size: 1rem; }
    .mobile-quick-nav a.active { color: var(--color-primary, #166534); }
    main { padding-bottom: 5rem !important; }
}
.sale-success-hero * { color: inherit; }
.sale-success-hero .sale-success-muted { color: #d1fae5 !important; }
.sale-success-hero .sale-success-pill { background: rgba(255,255,255,.16); color: #ffffff !important; }

@media (max-width: 640px) {
    .dashboard-mobile-tabs { display: flex !important; }
    .dashboard-mobile-panel { display: none; }
    .dashboard-mobile-panel.is-active { display: block; }
}

/* Global accessibility baseline for keyboard, touch, and motion-sensitive users. */
:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid #f59e0b !important;
    outline-offset: 2px;
}
:where(button, input[type="submit"], input[type="button"], select):disabled {
    cursor: not-allowed;
    opacity: .6;
}
@media (max-width: 767px) {
    :where(button, input[type="submit"], input[type="button"], select) {
        min-height: 2.7rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
