body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body {
    max-width: 100%;
}

.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2e3a6e;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5e72e4;
}

.shadow-premium,
.premium-shadow,
.shadow-soft-premium,
.shadow-soft-xl {
    box-shadow: 0 20px 27px 0 rgb(0 0 0 / 0.05);
}

.input-glow:focus,
.input-focus:focus {
    box-shadow: 0 0 0 3px rgb(94 114 228 / 0.18);
    border-color: #5e72e4;
    outline: none;
}

/* Argon gradient utilities */
.bg-gradient-primary {
    background-image: linear-gradient(310deg, #5e72e4 0%, #825ee4 100%);
}

.bg-gradient-info {
    background-image: linear-gradient(310deg, #2152ff 0%, #21d4fd 100%);
}

.bg-gradient-success {
    background-image: linear-gradient(310deg, #17ad37 0%, #98ec2d 100%);
}

.bg-gradient-warning {
    background-image: linear-gradient(310deg, #f53939 0%, #fbcf33 100%);
}

.bg-gradient-orange {
    background-image: linear-gradient(310deg, #fb6340 0%, #fbb140 100%);
}

.bg-gradient-danger {
    background-image: linear-gradient(310deg, #ea0606 0%, #ff667c 100%);
}

.bg-gradient-dark {
    background-image: linear-gradient(310deg, #141727 0%, #3a416f 100%);
}

.app-main {
    margin-left: 17rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - 17rem);
}

.app-topbar {
    left: auto;
    width: 100%;
}

.app-content {
    padding: 1rem;
}

@media (min-width: 1024px) {
    .app-content {
        padding: 1.5rem;
    }
}

.app-sidebar {
    position: fixed;
    top: 1rem;
    left: 1rem;
    bottom: 1rem;
    width: 15.5rem;
    height: auto;
    background: #111c44;
    border: 1px solid rgb(255 255 255 / 0.06);
    border-radius: 1rem;
    box-shadow: 0 20px 27px 0 rgb(0 0 0 / 0.4);
    overflow-y: auto;
    z-index: 50;
}

.app-sidebar .sidebar-link:not(.is-active) {
    color: #a3aed0 !important;
}

.app-sidebar .sidebar-link:not(.is-active):hover {
    background: rgb(255 255 255 / 0.06) !important;
}

.app-sidebar .sidebar-link.is-active {
    background-image: linear-gradient(310deg, #5e72e4 0%, #825ee4 100%);
    box-shadow: 0 6px 16px -4px rgb(94 114 228 / 0.55);
    color: #ffffff !important;
}

.app-sidebar .sidebar-link.is-active .material-symbols-outlined {
    color: #ffffff !important;
}

.sidebar-tile {
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px 0 rgb(0 0 0 / 0.12);
    flex-shrink: 0;
}

.sidebar-tile .material-symbols-outlined {
    color: #ffffff !important;
    font-size: 18px;
}

.card {
    background: #1b254b;
    border: 1px solid rgb(255 255 255 / 0.06);
    border-radius: 1rem;
    box-shadow: 0 8px 26px 0 rgb(0 0 0 / 0.35);
}

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

.app-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

.app-table th {
    background: #ffffff;
    color: #8898aa;
    font-size: 11px;
    line-height: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 18px;
    border-bottom: 1px solid #e9ecef;
}

.app-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 14px;
    line-height: 20px;
    color: #525f7f;
}

.app-table tr:hover td {
    background: #f6f9fc;
}

/* Dark tables inside the admin shell (print/public invoices stay light) */
.app-main .app-table th,
.pos-screen .app-table th {
    background: transparent;
    color: #8b97c2;
    border-bottom: 1px solid rgb(255 255 255 / 0.1);
}

.app-main .app-table td,
.pos-screen .app-table td {
    color: #c7cddf;
    border-bottom: 1px solid rgb(255 255 255 / 0.06);
}

.app-main .app-table tr:hover td,
.pos-screen .app-table tr:hover td {
    background: rgb(255 255 255 / 0.03);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgb(0 0 0 / 0.65);
}

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

.modal-panel {
    max-height: 92vh;
    overflow-y: auto;
    width: min(980px, 100%);
    background: #1b254b;
    border: 1px solid rgb(255 255 255 / 0.08);
    border-radius: 1rem;
    box-shadow: 0 24px 50px rgb(0 0 0 / 0.5);
}

/* Dark form controls inside the app shell (overrides default white inputs and bg-white) */
.bg-background input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.bg-background select,
.bg-background textarea {
    background-color: #101a3a;
    color: #e2e6f3;
    border-color: rgb(255 255 255 / 0.12);
}

.bg-background input::placeholder,
.bg-background textarea::placeholder {
    color: #6b78a3;
}

.bg-background select option {
    background-color: #1b254b;
    color: #e2e6f3;
}

/* POS dark surfaces (cards, cart, pills marked bg-white) */
.pos-screen .bg-white {
    background-color: #1b254b !important;
}

.chart-grid-bg {
    background-image: linear-gradient(to right, rgb(255 255 255 / 0.05) 1px, transparent 1px), linear-gradient(to bottom, rgb(255 255 255 / 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center bottom;
}

.wa-icon {
    color: #25d366;
}

.bg-gradient-golden {
    background: linear-gradient(135deg, #131c45 0%, #0b1437 55%, #16243f 100%);
}

.auth-shell {
    min-height: 100dvh;
}

.auth-visual {
    padding: clamp(2rem, 5vw, 5rem);
}

.auth-preview {
    transform: translateY(1.25rem);
}

.auth-form-panel {
    min-height: 100dvh;
    padding: clamp(1.25rem, 4vw, 4.5rem);
}

.auth-form-panel > .w-full {
    margin-top: auto;
    margin-bottom: auto;
}

.login-card {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.auth-footer {
    margin-top: clamp(1.25rem, 4vh, 3rem);
    flex-shrink: 0;
}

.print-body {
    background: #f7f9fb;
    color: #191c1e;
    font-family: Inter, Arial, sans-serif;
    margin: 0;
}

.print-page {
    width: min(920px, calc(100% - 24px));
    margin: 24px auto;
    background: #fff;
    border: 1px solid #e0e3e5;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgb(15 23 42 / 0.05), 0 2px 4px -2px rgb(15 23 42 / 0.05);
    padding: 28px;
}

.thermal-page {
    width: 80mm;
    margin: 0 auto;
    background: #fff;
    padding: 10px;
    font-size: 11px;
}

.print-footer {
    border-top: 1px solid #e0e3e5;
    margin-top: 24px;
    padding-top: 12px;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 1023px) {
    .app-sidebar {
        transform: translateX(-115%);
        transition: transform 180ms ease;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
        width: 100%;
    }

    .app-topbar {
        left: 0;
        width: 100%;
    }

    .app-content {
        padding: 0.875rem;
    }

    .pos-screen {
        height: auto;
        min-height: 100dvh;
        overflow: auto;
    }

    .pos-screen > main {
        overflow: visible;
    }

    .pos-screen section {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .app-main {
        padding-top: 0;
    }

    .app-topbar {
        min-height: 3.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .app-content {
        padding: 0.75rem;
    }

    .card {
        border-radius: 0.75rem;
    }

    .app-table th,
    .app-table td {
        padding: 10px 11px;
        font-size: 12px;
        line-height: 18px;
    }

    .modal {
        padding: 0;
        align-items: stretch;
    }

    .modal-panel {
        width: 100%;
        max-height: 100dvh;
        border-radius: 0;
    }

    .auth-form-panel {
        min-height: 100dvh;
        padding: 1rem;
    }

    .login-card {
        padding: 1.25rem;
        border-radius: 0.875rem;
    }

    .auth-footer {
        margin-top: 1rem;
        padding: 0.875rem 0.5rem;
    }

    .pos-screen header {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .pos-screen .product-card {
        min-width: 0;
    }

    .print-page {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        border-radius: 0;
        border: 0;
        box-shadow: none;
        padding: 18px;
    }
}

@media print {
    body,
    .print-body {
        background: #fff;
    }

    .print-hide {
        display: none !important;
    }

    .print-page {
        width: 100%;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .thermal-page {
        width: 58mm;
    }
}
