/* ===== BayarFlow POS / Auth theme ===== */

:root {
    --bg: #EEF1F6;
    --surface: #FFFFFF;
    --surface2: #F6F8FB;
    --border: #E6EBF2;
    --text: #0B1A38;
    --text2: #64748B;
    --primary: #2E6BFF;
    --primary-soft: #EAF1FF;
    --sidebar: #0B1A38;
    --sidebar2: #16233F;
    --green: #16A34A;
    --green-soft: #DCFCE7;
    --red: #DC2626;
    --red-soft: #FEE2E2;
    --amber: #D97706;
    --amber-soft: #FEF3C7;
}

[data-theme="dark"] {
    --bg: #0A0F1C;
    --surface: #121A2C;
    --surface2: #0E1626;
    --border: #22304A;
    --text: #E8EEF8;
    --text2: #8A99B2;
    --primary: #4D82FF;
    --primary-soft: #16233F;
    --sidebar: #0A111F;
    --sidebar2: #18243C;
    --green: #22C55E;
    --green-soft: #10271B;
    --red: #F0556B;
    --red-soft: #2A151A;
    --amber: #F59E0B;
    --amber-soft: #2A2110;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); }
img { display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }
a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(120, 140, 170, 0.35); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

@keyframes popin { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* product tile hover */
.pos-tile { transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.pos-tile:hover { border-color: var(--primary) !important; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(46, 107, 255, 0.16); }

/* auth responsive */
@media (max-width: 880px) {
    .brandpanel { display: none !important; }
    .formpanel { width: 100% !important; flex: 1 1 auto !important; }
}
@media (min-width: 881px) {
    .mobilelogo { display: none !important; }
}
@media (max-width: 480px) {
    .formpanel > div:last-child { padding: 18px 22px 32px !important; }
}

/* ===================================================================
   POS APP — mobile (≤768px)
   Inline styles dominate, so overrides use !important.
   =================================================================== */
@media (max-width: 768px) {
    /* --- shell: sidebar becomes an off-canvas drawer --- */
    .app-sidebar {
        position: fixed !important;
        left: 0; top: 0;
        height: 100vh !important;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 60 !important;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    }
    .app-sidebar.open { transform: translateX(0); }
    .app-hamburger { display: inline-flex !important; }
    .app-topbar { padding: 0 14px !important; gap: 10px !important; }
    .topbar-outlet { display: none !important; }

    /* --- dashboard --- */
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .dash-2col { grid-template-columns: 1fr !important; }

    /* --- reports --- */
    .report-summary { grid-template-columns: repeat(2, 1fr) !important; }
    .report-2col { grid-template-columns: 1fr !important; }
    .report-head { flex-wrap: wrap !important; }
    .report-tabs { overflow-x: auto; }

    /* --- settings --- */
    .settings-grid { grid-template-columns: 1fr !important; }

    /* --- tables: stack the header, swipe the table horizontally --- */
    .table-head { flex-direction: column !important; align-items: stretch !important; }
    .table-search { max-width: none !important; }
    .table-card { min-width: 720px; }
    .table-card-wide { min-width: 860px; }

    /* --- POS checkout: full-width menu + slide-in order sheet + cart FAB --- */
    .pos-menu { padding: 16px 16px 92px !important; }
    .pos-order {
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        flex: 1 1 auto !important;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        z-index: 58 !important;
        border-left: none !important;
    }
    .pos-order.open { transform: translateX(0); }
    .pos-order-close { display: flex !important; }
    .pos-cart-fab { display: flex !important; }
}

/* finer phone tweaks (≤440px) */
@media (max-width: 440px) {
    .kpi-grid { grid-template-columns: 1fr !important; }
    .pay-methods { grid-template-columns: repeat(2, 1fr) !important; }
    .modal-2col { grid-template-columns: 1fr !important; }
    .recent-time { display: none !important; }
}
