/* ==========================================================================
   Modern POS Application Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Brand & Accent Colors */
    --pos-primary: #4f46e5;
    --pos-primary-rgb: 79, 70, 229;
    --pos-primary-hover: #4338ca;
    --pos-primary-light: #eef2ff;
    --pos-accent: #3b82f6;

    /* Theme colors */
    --pos-success: #10b981;
    --pos-warning: #f59e0b;
    --pos-danger: #ef4444;
    --pos-info: #06b6d4;

    /* Neutrals & Surfaces */
    --pos-body-bg: #f8fafc;
    --pos-surface: #ffffff;
    --pos-card-border: #e2e8f0;
    --pos-text-main: #0f172a;
    --pos-text-muted: #64748b;
    --pos-border-color: #e2e8f0;

    /* Sidebar theme */
    --pos-sidebar-width: 260px;
    --pos-sidebar-bg: #0b1329;
    --pos-sidebar-hover: rgba(255, 255, 255, 0.07);
    --pos-sidebar-active: #4f46e5;
    --pos-sidebar-text: #94a3b8;
    --pos-sidebar-text-active: #ffffff;

    /* Bootstrap Overrides */
    --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-font-size: 0.885rem;
    --bs-body-color: #1e293b;
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: #4f46e5;
    --bs-link-color-rgb: 79, 70, 229;
    --bs-border-radius: 0.5rem;
    --bs-border-radius-sm: 0.375rem;
    --bs-border-radius-lg: 0.75rem;
    --bs-border-radius-xl: 1rem;
}

/* Base resets & typography */
body {
    background-color: var(--pos-body-bg);
    color: var(--pos-body-color);
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-primary {
    --bs-btn-bg: var(--pos-primary);
    --bs-btn-border-color: var(--pos-primary);
    --bs-btn-hover-bg: var(--pos-primary-hover);
    --bs-btn-hover-border-color: var(--pos-primary-hover);
    --bs-btn-active-bg: #3730a3;
    --bs-btn-active-border-color: #3730a3;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}
.btn-primary:hover {
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-success {
    --bs-btn-bg: #10b981;
    --bs-btn-border-color: #10b981;
    --bs-btn-hover-bg: #059669;
    --bs-btn-hover-border-color: #059669;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.btn-pos-launch {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-pos-launch:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.form-control, .form-select {
    border-radius: 8px;
    border-color: #e2e8f0;
    padding: 0.5rem 0.8rem;
    font-size: 0.885rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ==========================================================================
   Shell Layout (Sidebar & Main Content)
   ========================================================================== */
.app-sidebar {
    width: var(--pos-sidebar-width);
    /* !important: Bootstrap's .offcanvas-lg forces a transparent background on desktop */
    background: var(--pos-sidebar-bg) !important;
    color: var(--pos-sidebar-text);
    box-shadow: 1px 0 10px rgba(0, 0, 0, 0.15);
}

@media (min-width: 992px) {
    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        overflow-y: auto;
        z-index: 1030;
    }
    .app-main {
        margin-left: var(--pos-sidebar-width);
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
}

.app-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 1.25rem;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}
.app-sidebar .brand img {
    max-height: 34px;
    max-width: 44px;
    border-radius: 6px;
    background: #ffffff;
    padding: 2px;
}
.app-sidebar .brand .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.app-sidebar .nav-heading {
    padding: 1.1rem 1.25rem 0.35rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    font-weight: 700;
    text-transform: uppercase;
    color: #475569;
}

.app-sidebar .nav-link {
    color: #94a3b8;
    padding: 0.55rem 1rem;
    margin: 2px 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}
.app-sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.3rem;
    text-align: center;
    opacity: 0.85;
}
.app-sidebar .nav-link:hover {
    background: var(--pos-sidebar-hover);
    color: #f1f5f9;
    transform: translateX(2px);
}
.app-sidebar .nav-link.active {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.app-sidebar .nav-link.active i {
    opacity: 1;
}

.app-sidebar .offcanvas-body {
    padding: 0;
    display: block;
}

/* ==========================================================================
   Topbar & Page Headers
   ========================================================================== */
.app-topbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0;
}

.breadcrumb {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
}
.breadcrumb-item a {
    color: #64748b;
    text-decoration: none;
}
.breadcrumb-item a:hover {
    color: var(--pos-primary);
}
.breadcrumb-item.active {
    color: #94a3b8;
}

.user-avatar-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 5px rgba(99, 102, 241, 0.25);
}

.btn-user-profile:hover .user-avatar-badge {
    transform: scale(1.05);
}

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

.app-footer {
    color: #94a3b8;
    font-size: 0.8rem;
    background: #ffffff;
}

/* ==========================================================================
   Cards & Modern Dashboard Widgets
   ========================================================================== */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
    background-color: #ffffff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    color: #1e293b;
    padding: 0.9rem 1.15rem;
}

.stat-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e1;
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.stat-card .stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.2;
}
.stat-card .stat-label {
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

/* Pastel color variants for stat icons */
.bg-primary-subtle { background-color: #eef2ff !important; color: #4f46e5 !important; }
.bg-success-subtle { background-color: #ecfdf5 !important; color: #10b981 !important; }
.bg-warning-subtle { background-color: #fffbeb !important; color: #d97706 !important; }
.bg-danger-subtle  { background-color: #fef2f2 !important; color: #ef4444 !important; }
.bg-info-subtle    { background-color: #ecfeff !important; color: #0891b2 !important; }
.bg-secondary-subtle { background-color: #f1f5f9 !important; color: #475569 !important; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash-hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 1.5rem 1.6rem;
    color: #ffffff;
    background:
        radial-gradient(circle at 85% -20%, rgba(255, 255, 255, 0.22) 0, transparent 45%),
        radial-gradient(circle at 10% 120%, rgba(59, 130, 246, 0.55) 0, transparent 50%),
        linear-gradient(135deg, #4338ca 0%, #4f46e5 45%, #6366f1 100%);
    box-shadow: 0 18px 40px -18px rgba(79, 70, 229, 0.65);
}
.dash-hero h2 { font-weight: 800; letter-spacing: -0.03em; font-size: 1.5rem; margin: 0; }
.dash-hero .hero-sub { color: rgba(255, 255, 255, 0.75); font-size: 0.85rem; }
.dash-hero .hero-period {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
}
.dash-hero .hero-filters {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    border-radius: 14px;
    padding: 0.65rem;
}
.dash-hero .hero-filters .form-label {
    color: rgba(255, 255, 255, 0.75); font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.2rem;
}
.dash-hero .hero-filters .form-control,
.dash-hero .hero-filters .form-select { border: 0; background-color: rgba(255, 255, 255, 0.95); }
.dash-hero .btn-hero { background: #ffffff; color: #4338ca; font-weight: 700; border: 0; }
.dash-hero .btn-hero:hover { background: #eef2ff; color: #3730a3; transform: translateY(-1px); }
.dash-hero .btn-hero-ghost { color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.45); background: transparent; }
.dash-hero .btn-hero-ghost:hover { background: rgba(255, 255, 255, 0.15); color: #ffffff; }

.kpi-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 1.15rem 1.25rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -12px rgba(15, 23, 42, 0.14); }
.kpi-card::after {
    content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
    border-radius: 50%; background: var(--kpi-color); opacity: 0.08;
}
.kpi-card .kpi-icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    font-size: 1.25rem; color: #ffffff;
    background: var(--kpi-color);
    box-shadow: 0 8px 16px -6px var(--kpi-color);
}
.kpi-card .kpi-label { color: #64748b; font-size: 0.78rem; font-weight: 600; margin-top: 0.9rem; }
.kpi-card .kpi-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; color: #0f172a; line-height: 1.25; }

.mini-stat {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.8rem 0.95rem; border-radius: 14px;
    background: #ffffff; border: 1px solid #eef2f7;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mini-stat:hover { border-color: #c7d2fe; box-shadow: 0 6px 16px -10px rgba(79, 70, 229, 0.4); }
.mini-stat .mini-icon {
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    font-size: 1rem; flex-shrink: 0;
}
.mini-stat .mini-label { font-size: 0.72rem; color: #64748b; font-weight: 600; }
.mini-stat .mini-value { font-size: 1.05rem; font-weight: 800; color: #0f172a; letter-spacing: -0.02em; }

.dash-card { border: 1px solid #eef2f7; border-radius: 16px; }
.dash-card .card-header {
    border: 0; padding: 1.1rem 1.25rem 0.25rem; display: flex; align-items: center;
    justify-content: space-between; gap: 0.5rem;
}
.dash-card .dash-card-title { font-weight: 700; font-size: 0.95rem; color: #0f172a; }
.dash-card .dash-card-sub { font-size: 0.75rem; color: #94a3b8; font-weight: 500; }
.dash-card .chart-box { position: relative; height: 300px; }
.dash-empty {
    position: absolute; inset: 0; display: none; place-items: center; text-align: center;
    color: #94a3b8; font-size: 0.85rem; pointer-events: none;
}
.dash-empty i { font-size: 1.8rem; display: block; margin-bottom: 0.35rem; color: #cbd5e1; }

.stock-row {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 1.25rem;
    border-top: 1px solid #f1f5f9;
}
.stock-row .stock-avatar {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}

/* Filter bar */
.filter-bar {
    background: #ffffff;
    border-radius: 10px;
}
.filter-bar .form-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Tables & DataTables */
.table > :not(caption) > * > * {
    vertical-align: middle;
    padding: 0.75rem 0.85rem;
}
table.dataTable thead th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--pos-primary) !important;
    color: #ffffff !important;
    border-radius: 6px;
    border: none;
}
/* DataTables toolbar: page length, search, Columns / Export */
div.dt-container .dt-layout-row { margin: 0.6rem 0; }
div.dt-container .dt-search input,
div.dt-container .dt-length select {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    padding: 0.42rem 0.8rem;
    font-size: 0.85rem;
}
div.dt-container .dt-search input {
    min-width: 230px;
    margin-left: 0;
    padding-left: 2.1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
}
div.dt-container .dt-search input:focus { background-color: #ffffff; }
div.dt-container .dt-length label { color: #64748b; font-size: 0.8rem; margin-left: 0.4rem; }

.dt-buttons.btn-group { gap: 0.5rem; margin-left: 0.5rem; }
.dt-buttons .btn-group > .btn { border-radius: 10px !important; }
.btn-dt {
    --bs-btn-color: #334155;
    --bs-btn-bg: #ffffff;
    --bs-btn-border-color: #e2e8f0;
    --bs-btn-hover-color: var(--pos-primary);
    --bs-btn-hover-bg: var(--pos-primary-light);
    --bs-btn-hover-border-color: #c7d2fe;
    --bs-btn-active-color: var(--pos-primary);
    --bs-btn-active-bg: var(--pos-primary-light);
    --bs-btn-active-border-color: #c7d2fe;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.42rem 0.85rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
/* Export / Columns dropdown */
div.dt-button-collection {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.25) !important;
    padding: 0.35rem !important;
    min-width: 170px;
}
div.dt-button-collection .dropdown-item,
div.dt-button-collection .dt-button {
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.45rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
div.dt-button-collection .dropdown-item:hover { background: var(--pos-primary-light); color: var(--pos-primary); }
div.dt-button-collection .dropdown-item.active { background: var(--pos-primary-light); color: var(--pos-primary); font-weight: 600; }

/* Empty / loading states */
table.dataTable td.dt-empty {
    background: #ffffff !important;
    box-shadow: none !important;
    color: #94a3b8;
    padding: 2.5rem 1rem !important;
    font-weight: 500;
}
table.dataTable td.dt-empty::before {
    content: "\F3E1"; /* bi-inbox */
    font-family: "bootstrap-icons";
    display: block;
    font-size: 2rem;
    color: #cbd5e1;
    margin-bottom: 0.35rem;
}
div.dt-container div.dt-processing {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 24px -10px rgba(15, 23, 42, 0.2);
}

/* Info + pagination */
div.dt-container .dt-info { color: #94a3b8; font-size: 0.8rem; }
div.dt-container .dt-paging .pagination { gap: 0.3rem; margin: 0; }
div.dt-container .dt-paging .page-link {
    border-radius: 9px !important;
    border: 1px solid #e2e8f0;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0 0.6rem;
    color: #475569;
    font-weight: 600;
    font-size: 0.82rem;
}
div.dt-container .dt-paging .page-link:hover { background: var(--pos-primary-light); color: var(--pos-primary); border-color: #c7d2fe; }
div.dt-container .dt-paging .page-item.active .page-link {
    background: var(--pos-primary);
    border-color: var(--pos-primary);
    color: #ffffff;
    box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.45);
}
div.dt-container .dt-paging .page-item.disabled .page-link { background: #f8fafc; color: #cbd5e1; }

/* Thumbnails */
.thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #e2e8f0;
}
.thumb-empty {
    background: #f1f5f9;
    color: #94a3b8;
}

/* ==========================================================================
   Modern POS Billing Screen
   ========================================================================== */
.pos-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f1f5f9;
}

.pos-topbar {
    background: #0b1329;
    color: #ffffff;
    padding: 0.55rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 0 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pos-topbar .btn {
    --bs-btn-color: #cbd5e1;
    --bs-btn-border-color: rgba(255, 255, 255, 0.15);
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.1);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
}

.shift-pill {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.pulsing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pos-body {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(430px, 42%);
    gap: 0.85rem;
    padding: 0.85rem;
    min-height: 0;
}

.pos-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Product Catalog Grid */
.pos-products {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.85rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    align-content: start;
}

.pos-product {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    padding: 0.65rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.pos-product:hover, .pos-product:focus {
    transform: translateY(-2px);
    border-color: #818cf8;
    box-shadow: 0 8px 16px -2px rgba(79, 70, 229, 0.12), 0 2px 4px rgba(0, 0, 0, 0.04);
    outline: 0;
}
.pos-product:active {
    transform: scale(0.98);
}
.pos-product.out {
    opacity: 0.55;
    background: #f8fafc;
}
.pos-product .img {
    height: 80px;
    border-radius: 8px;
    background: #f1f5f9;
    display: grid;
    place-items: center;
    color: #94a3b8;
    font-size: 1.8rem;
    overflow: hidden;
}
.pos-product .img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pos-product .name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    height: 2.5em;
    overflow: hidden;
    color: #0f172a;
}
.pos-product .price {
    font-weight: 800;
    color: #4f46e5;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
}
.pos-product .stock {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
}

/* Cart Table & Styling */
.pos-cart-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}
.pos-cart th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.04em;
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid #e2e8f0;
    z-index: 2;
}
.pos-cart td {
    font-size: 0.85rem;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #f1f5f9;
}
.pos-cart input {
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
    text-align: right;
}
.pos-cart .qty-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px;
}
.pos-cart .qty-group .btn {
    padding: 0 0.45rem;
    line-height: 1.4;
    border-radius: 4px;
    font-size: 0.85rem;
    border: none;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.pos-cart .qty-group .btn:hover {
    background: #e2e8f0;
}
.pos-cart .qty-group input {
    border: none;
    background: transparent;
    width: 48px;
    padding: 0;
    text-align: center;
    font-weight: 600;
}

/* Totals Summary */
.pos-totals {
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 0.75rem 1rem;
    font-size: 0.885rem;
    flex: 0 0 auto;
}
.pos-totals .row-line {
    display: flex;
    justify-content: space-between;
    padding: 0.15rem 0;
    color: #475569;
}
.pos-totals .grand {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    border-top: 1px dashed #cbd5e1;
    margin-top: 0.4rem;
    padding-top: 0.45rem;
}

/* Bottom Action Buttons */
.pos-actions {
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr) 1.6fr;
    gap: 0.6rem;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    flex: 0 0 auto;
}
.pos-actions .btn {
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.65rem 0.5rem;
}
.btn-pay-action,
.pos-actions #btn-pay {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #ffffff !important;
    font-size: 1.02rem;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.btn-pay-action:hover,
.pos-actions #btn-pay:hover {
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* Payment Modal Upgrades */
#pay-modal .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
#pay-modal .modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.1rem 1.5rem;
}
#pay-modal .modal-body {
    padding: 1.5rem;
}
#quick-cash .btn {
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
}

/* ==========================================================================
   Login Screen
   ========================================================================== */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.35) 0, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(59, 130, 246, 0.25) 0, transparent 40%),
        #0b1120;
}
.login-shell {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 1fr;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.55);
}
@media (min-width: 768px) {
    .login-shell { grid-template-columns: 1fr 1.05fr; min-height: 540px; }
}

.login-aside {
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.5rem;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.18) 0, transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(59, 130, 246, 0.6) 0, transparent 55%),
        linear-gradient(150deg, #4338ca 0%, #4f46e5 50%, #6366f1 100%);
}
.login-aside::after {
    content: "";
    position: absolute;
    width: 260px; height: 260px;
    right: -90px; bottom: -90px;
    border-radius: 50%;
    border: 40px solid rgba(255, 255, 255, 0.07);
}
.login-aside-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.login-aside-logo { max-height: 40px; max-width: 56px; border-radius: 10px; background: #ffffff; padding: 3px; }
.login-aside-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 1.5rem; }
.login-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.login-features li { display: flex; align-items: center; gap: 0.75rem; color: rgba(255, 255, 255, 0.9); font-weight: 500; }
.login-features i {
    width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.15);
}

.login-main { padding: 2.5rem 2rem; display: flex; flex-direction: column; justify-content: center; }
@media (min-width: 576px) { .login-main { padding: 3rem; } }
.login-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; color: #0f172a; margin-bottom: 0.25rem; }
.login-label { font-size: 0.8rem; font-weight: 600; color: #334155; }

.login-brand-icon {
    width: 56px; height: 56px; border-radius: 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    display: grid; place-items: center;
    box-shadow: 0 8px 16px -2px rgba(79, 70, 229, 0.4);
}

/* One rounded box per field: icon + input (+ eye button), with a single focus ring */
.login-field {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.4rem 0 0.95rem;
    height: 48px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.login-field > i { color: #94a3b8; font-size: 1.05rem; }
.login-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 0.92rem;
    color: #0f172a;
}
.login-field input::placeholder { color: #94a3b8; }
.login-field:focus-within { background: #ffffff; border-color: #818cf8; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
.login-field:focus-within > i { color: var(--pos-primary); }
.login-field.is-invalid { border-color: #f87171; background: #fef2f2; }
.login-eye {
    border: 0; background: transparent; color: #94a3b8;
    width: 38px; height: 38px; border-radius: 9px;
}
.login-eye:hover { background: #eef2ff; color: var(--pos-primary); }

.btn-login {
    height: 48px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -6px rgba(79, 70, 229, 0.55); }

/* ==========================================================================
   Responsive & Print
   ========================================================================== */
@media (max-width: 991.98px) {
    .pos-screen { height: auto; overflow: visible; }
    .pos-body { grid-template-columns: 1fr; }
    .pos-products { max-height: 55vh; }
}

@media print {
    .app-sidebar, .app-topbar, .app-footer, .no-print, .dt-buttons, .dt-search, .dt-length, .dt-paging, .dt-info, .filter-bar, .btn { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .app-content { padding: 0 !important; }
    body { background: #fff !important; font-size: 12px; }
    .card { border: 0 !important; box-shadow: none !important; }
    a { text-decoration: none; color: inherit; }
}
