:root {
    --sidebar-width: 278px;
    --sidebar-bg: #0f172a;
    --sidebar-bg-soft: #172033;
    --app-bg: #f5f7fb;
    --brand-primary: #2563eb;
    --brand-primary-dark: #1d4ed8;
    --text-strong: #172033;
}

html, body {
    min-height: 100%;
}

body {
    color: var(--text-strong);
}

.app-body {
    background: var(--app-bg);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    color: #fff;
    background: var(--sidebar-bg);
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    min-height: 76px;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark,
.login-logo {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
    font-size: 1.25rem;
}

.brand-copy {
    min-width: 0;
    color: #fff;
}

.brand-copy strong,
.brand-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy small {
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.75rem;
}

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.8rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-nav .nav-section {
    margin: 1.1rem 0.75rem 0.35rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 42px;
    padding: 0.62rem 0.75rem;
    border-radius: 0.65rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.91rem;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus,
.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.17);
}

.sidebar-nav .nav-link.active {
    box-shadow: inset 3px 0 0 #60a5fa;
}

.sidebar-nav .nav-link i {
    width: 1.2rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.08);
}

.app-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.app-topbar {
    min-height: 76px;
    z-index: 1020;
}

.app-content {
    flex: 1 1 auto;
}

.app-footer {
    margin-top: auto;
}

.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #1d4ed8;
    background: #dbeafe;
    font-weight: 700;
}

.min-w-0 {
    min-width: 0;
}

.sidebar-backdrop {
    display: none;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.card {
    border-radius: 0.9rem;
}

.btn,
.form-control,
.form-select,
.input-group-text,
.modal-content {
    border-radius: 0.65rem;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text,
.input-group > .btn {
    border-radius: 0;
}

.input-group > :first-child {
    border-top-left-radius: 0.65rem;
    border-bottom-left-radius: 0.65rem;
}

.input-group > :last-child {
    border-top-right-radius: 0.65rem;
    border-bottom-right-radius: 0.65rem;
}

.login-body {
    background: #fff;
}

.login-visual {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.28), transparent 38%),
        radial-gradient(circle at 90% 10%, rgba(99, 102, 241, 0.26), transparent 36%),
        linear-gradient(145deg, #0f172a 0%, #172554 52%, #1e3a8a 100%);
}

.login-visual::before,
.login-visual::after {
    position: absolute;
    content: '';
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
}

.login-visual::before {
    width: 420px;
    height: 420px;
    top: -120px;
    right: -100px;
}

.login-visual::after {
    width: 620px;
    height: 620px;
    bottom: -360px;
    left: -180px;
}

.login-panel {
    max-width: 510px;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    font-size: 0.9rem;
}

.mw-650 {
    max-width: 650px;
}

.module-placeholder {
    min-height: 360px;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

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

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

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(15, 23, 42, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .sidebar-backdrop.show {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

@media print {
    .app-sidebar,
    .app-topbar,
    .app-footer,
    .sidebar-backdrop,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin: 0 !important;
    }

    .app-content {
        padding: 0 !important;
    }
}

/* Dashboard and POS modules */
.metric-icon{width:3.25rem;height:3.25rem;border-radius:1rem;display:inline-flex;align-items:center;justify-content:center;font-size:1.35rem;flex:0 0 auto}.dashboard-card{transition:transform .15s ease,box-shadow .15s ease}.dashboard-card:hover{transform:translateY(-2px)}
.pos-shell{margin-top:-.5rem}.pos-products-panel,.pos-cart-panel{min-height:calc(100vh - 8.5rem)}.pos-cart-panel{top:5.8rem;max-height:calc(100vh - 7rem)}.pos-cart-panel .card-body{min-height:0}.category-pills{scrollbar-width:thin}.category-pill{white-space:nowrap}.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:.75rem;max-height:calc(100vh - 15rem);overflow:auto;padding:.15rem}.product-card{border:1px solid var(--bs-border-color);background:var(--bs-body-bg);border-radius:.85rem;padding:.65rem;text-align:left;display:flex;flex-direction:column;min-height:185px;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}.product-card:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 .4rem 1rem rgba(0,0,0,.08);border-color:var(--bs-primary)}.product-card:disabled{opacity:.55}.product-image{height:88px;border-radius:.65rem;background:var(--bs-tertiary-bg);display:flex;align-items:center;justify-content:center;overflow:hidden;margin-bottom:.55rem}.product-image img{width:100%;height:100%;object-fit:cover}.product-placeholder{font-size:2rem;color:var(--bs-secondary-color)}.product-name{font-weight:600;line-height:1.25;min-height:2.5em}.product-meta{display:flex;justify-content:space-between;align-items:end;gap:.4rem;margin-top:auto}.product-meta small{color:var(--bs-secondary-color);text-align:right}.cart-lines{overflow:auto;min-height:240px;max-height:calc(100vh - 32rem)}.cart-line{padding:.85rem 1rem;border-top:1px solid var(--bs-border-color)}.cart-line:first-child{border-top:0}.cart-line .line-discount-type{max-width:58px}.payment-row{padding:.75rem;border:1px solid var(--bs-border-color);border-radius:.75rem;background:var(--bs-tertiary-bg)}
@media(max-width:1199.98px){.pos-products-panel,.pos-cart-panel{min-height:auto}.pos-cart-panel{max-height:none}.product-grid{max-height:560px}.cart-lines{max-height:480px}}
