﻿:root {
    --sidebar-w: 225px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f0f2f5;
}

/* ══ LOGIN SCREEN ══ */
#login-screen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0d6efd22 100%);
    align-items: center;
    justify-content: center;
}

    #login-screen.show {
        display: flex;
    }

.login-card {
    background: #fff;
    border-radius: 20px;
    width: 420px;
    max-width: 95vw;
    padding: 40px 36px;
    box-shadow: 0 32px 80px rgba(0,0,0,.35);
    animation: loginPop .4s cubic-bezier(.175,.885,.32,1.275);
}

@keyframes loginPop {
    from {
        transform: scale(.88) translateY(30px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

    .login-brand .logo {
        font-size: 2.8rem;
    }

    .login-brand h3 {
        font-weight: 800;
        margin: 4px 0 2px;
        color: #1a1d23;
    }

    .login-brand p {
        color: #6c757d;
        font-size: .85rem;
        margin: 0;
    }

.login-demo-hint {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 14px;
    font-size: .8rem;
}

    .login-demo-hint b {
        display: block;
        color: #495057;
        margin-bottom: 4px;
    }

.login-demo-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    cursor: pointer;
    margin: 2px;
    transition: all .15s;
}

    .login-demo-chip:hover {
        transform: scale(1.05);
    }

.pw-toggle {
    cursor: pointer;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: none;
    border-radius: 0 6px 6px 0;
}

/* ══ FIRST LOGIN FORCE CHANGE ══ */
#force-pw-screen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

    #force-pw-screen.show {
        display: flex;
    }

.force-pw-card {
    background: #fff;
    border-radius: 16px;
    width: 420px;
    max-width: 95vw;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ══ SESSION TIMEOUT BANNER ══ */
#session-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8888;
    background: #dc3545;
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: .88rem;
    font-weight: 500;
}

    #session-warning.show {
        display: block;
    }

/* ══ SIDEBAR ══ */
#app-shell {
    display: none;
}

    #app-shell.show {
        display: block;
    }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: #1a1d23;
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .25s;
}

.sidebar-brand {
    padding: 18px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

    .sidebar-brand h4 {
        margin: 0;
        font-weight: 700;
        font-size: 1.1rem;
    }

.sidebar-user {
    font-size: .76rem;
    color: #adb5bd;
    margin-top: 6px;
}

    .sidebar-user strong {
        color: #e9ecef;
    }

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: .87rem;
    transition: all .15s;
}

    .nav-item a:hover {
        background: rgba(255,255,255,.06);
        color: #fff;
    }

    .nav-item a.active {
        background: #0d6efd22;
        color: #6ea8fe;
        border-left: 3px solid #0d6efd;
    }

.nav-divider {
    border-top: 1px solid rgba(255,255,255,.07);
    margin: 6px 0;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.badge-role {
    font-size: .62rem;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 700;
}

/* ══ MAIN ══ */
.main-wrap {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 10px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ══ PAGES ══ */
.page {
    /*display: none;*/
    padding: 24px;
}

    .page.active {
        display: block;
    }

/* ══ METRIC CARDS ══ */
.metric-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
    border: 1px solid #f0f0f0;
}

    .metric-card .metric-val {
        font-size: 1.7rem;
        font-weight: 700;
    }

    .metric-card .metric-lbl {
        font-size: .78rem;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* ══ BAR CHART ══ */
.bar-wrap {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 140px;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar {
    width: 100%;
    border-radius: 5px 5px 0 0;
    background: #0d6efd;
    min-height: 4px;
    transition: height .4s ease;
}

.bar-lbl {
    font-size: 9px;
    color: #adb5bd;
    margin-top: 4px;
}

.bar-val {
    font-size: 9px;
    color: #495057;
    font-weight: 600;
    margin-bottom: 2px;
}

/* ══ POS ══ */
.pos-wrap {
    display: flex;
    gap: 0;
    height: calc(100vh - 90px);
    overflow: hidden;
}

.pos-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    overflow-y: auto;
    background: #f8f9fa;
}

.pos-right {
    width: 320px;
    border-left: 1px solid #dee2e6;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 2px 4px;
    font-size: .9rem;
}

/* ══ TABLE ══ */
.data-table {
    border-collapse: collapse;
    width: 100%;
}

    .data-table th {
        background: #f8f9fa;
        font-size: .76rem;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: #6c757d;
        padding: 10px 14px;
        border-bottom: 2px solid #e9ecef;
    }

    .data-table td {
        padding: 11px 14px;
        border-bottom: 1px solid #f0f0f0;
        font-size: .875rem;
        vertical-align: middle;
    }

    .data-table tr:hover td {
        background: #f8f9fa;
    }

/* ══ STATUS BADGES ══ */
.status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
}

.status-ok {
    background: #d1e7dd;
    color: #0a3622;
}

.status-low {
    background: #fff3cd;
    color: #664d03;
}

.status-out {
    background: #f8d7da;
    color: #58151c;
}

.status-paid {
    background: #d1e7dd;
    color: #0a3622;
}

.status-due {
    background: #f8d7da;
    color: #58151c;
}

.status-active {
    background: #d1e7dd;
    color: #0a3622;
}

.status-inactive {
    background: #f8d7da;
    color: #58151c;
}

/* ══ ROLE BADGES ══ */
.role-superadmin {
    background: #4c1d95;
    color: #fff;
}

.role-admin {
    background: #dc3545;
    color: #fff;
}

.role-manager {
    background: #e67e22;
    color: #fff;
}

.role-cashier {
    background: #6c757d;
    color: #fff;
}

/* ══ CUSTOM MODAL ══ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

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

.modal-box {
    background: #fff;
    border-radius: 14px;
    width: 60%;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

/* ══ USER MANAGEMENT ══ */
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
    flex-shrink: 0;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.activity-online {
    background: #198754;
}

.activity-offline {
    background: #adb5bd;
}

/* ══ PASSWORD STRENGTH ══ */
.pw-strength-bar {
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    margin-top: 6px;
    overflow: hidden;
}

.pw-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: all .3s;
}

/* ══ TOAST ══ */
.toast-bar {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-msg {
    color: #fff;
    padding: 11px 18px;
    border-radius: 9px;
    font-size: .875rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    animation: slideIn .3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes slideIn {
    from {
        transform: translateX(110%);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

/* ══ MISC ══ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

    .section-header h5 {
        margin: 0;
        font-weight: 700;
    }

.card-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.card-panel-header {
    padding: 13px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    font-size: .9rem;
    background: #fafafa;
}

.pos-item-name {
    font-weight: 600;
    font-size: .9rem;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-wrap {
        margin-left: 0;
    }
}
