/* Smart Business Analytics POS - Main Stylesheet */

:root {
    --primary: #287a4e;
    --primary-dark: #143d2a;
    --primary-light: #dceedd;
    --success: #3a9b68;
    --success-light: #eaf7ee;
    --warning: #b77b28;
    --warning-light: #fff3d9;
    --danger: #a84c3c;
    --danger-light: #ffe4dd;
    --gray-50: #f7fff9;
    --gray-100: #eef7ee;
    --gray-200: #cce1d3;
    --gray-300: #adc9b4;
    --gray-400: #708b73;
    --gray-500: #60766c;
    --gray-600: #435b4a;
    --gray-700: #233b2c;
    --gray-800: #102d20;
    --gray-900: #0b2219;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(16,45,32,.08), 0 1px 2px rgba(16,45,32,.06);
    --shadow-lg: 0 10px 25px rgba(16,45,32,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #eefbf4 0%, #b8dfbf 100%);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--green-800, #244f3d) 0%, var(--green-900, #173d2f) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform .3s;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(220, 255, 230, 0.16);
}

.sidebar-brand {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(135deg, rgba(58,155,104,.14) 0%, rgba(16,45,32,.15) 100%);
    text-align: center;
}

.sidebar-logo {
    margin-bottom: 8px;
}

.sidebar-logo-svg {
    width: 90px;
    height: 90px;
    margin: 0 auto;
    display: block;
    object-fit: cover;
    border-radius: 50%;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-brand-main {
    font-size: 7px;
    font-weight: 700;
    color: #dceedd;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    line-height: 1.1;
}

.sidebar-brand-sub {
    font-size: 6px;
    font-weight: 800;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.1px;
    line-height: 1.1;
}

.brand-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.brand-icon.lg { width: 56px; height: 56px; font-size: 24px; }

.brand-text strong { 
    display: block; 
    font-size: 16px; 
    font-weight: 700;
    letter-spacing: -0.3px;
}
.brand-text small { 
    color: var(--gray-400); 
    font-size: 11px; 
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav { 
    flex: 1; 
    min-height: 0;
    padding: 16px 12px; 
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 238, 221, .35) transparent;
}

.nav-section + .nav-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.nav-section-title {
    margin: 0 12px 8px;
    color: #adc9b4;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    color: var(--gray-100);
    border-radius: 0;
    margin-bottom: 2px;
    transition: all .2s ease;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
    border: none;
    background: transparent;
}
.nav-item svg {
    flex-shrink: 0;
}
.nav-item:hover { 
    background: rgba(255,255,255,.06);
    color: #fff;
    border: none;
}
.nav-item.active { 
    background: rgba(143,213,152,.12);
    color: #dceedd;
    box-shadow: none;
    border: none;
    border-left: 3px solid #8fd598;
    padding-left: 9px;
}
.nav-item:focus-visible, .nav-subitem:focus-visible {
    outline: 2px solid #8fd598;
    outline-offset: -2px;
}
.nav-group {
    margin-bottom: 4px;
}
.nav-item.nav-parent {
    width: 100%;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.nav-item.nav-parent .nav-caret {
    margin-left: auto;
    display: inline-block;
    font-size: 11px;
    transform: rotate(-90deg);
    transition: transform .25s ease;
}
.nav-item.nav-parent .nav-caret.expanded {
    transform: rotate(0deg);
}
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .35s ease, opacity .2s ease, margin-top .2s ease;
    margin-left: 18px;
    margin-top: 0;
}
.nav-group.expanded .nav-submenu {
    max-height: 200px;
    opacity: 1;
    margin-top: 6px;
}
.nav-subitem {
    display: block;
    padding: 10px 12px 10px 18px;
    color: #dceedd;
    font-size: 13px;
    font-weight: 600;
    border-left: 2px solid transparent;
    transition: all .2s ease;
}
.nav-subitem:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
    border-left-color: rgba(143, 213, 152, 0.7);
}
.nav-subitem.active {
    color: #fff;
    background: rgba(143, 213, 152, 0.12);
    border-left-color: #8fd598;
}
.nav-item.logout { 
    color: #ffe4e4; 
}
.nav-item.logout:hover { 
    background: linear-gradient(135deg, rgba(220,38,38,.15) 0%, rgba(220,38,38,.08) 100%); 
    color: #fca5a5;
}

.sidebar-footer { 
    flex-shrink: 0;
    padding: 16px 12px; 
    border-top: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(135deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,.1) 100%);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #eefbf4 0%, #f7fff9 100%);
}

.topbar {
    height: var(--topbar-height);
    background: linear-gradient(135deg, #ffffff 0%, #eefbf4 100%);
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 2px 8px rgba(16,45,32,0.04);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title { 
    font-size: 20px; 
    font-weight: 700; 
    color: var(--gray-900);
    letter-spacing: -0.4px;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.notification-wrapper {
    position: relative;
}
.notification-trigger {
    position: relative;
    width: 42px;
    height: 42px;
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    background: var(--gray-50);
    color: var(--gray-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.notification-trigger:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}
.notification-badge {
    position: absolute;
    top: -4px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.notification-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(360px, 90vw);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 60;
}
.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 700;
    color: var(--gray-800);
}
.notification-mark-all {
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.notification-list {
    max-height: 360px;
    max-height: min(360px, calc(100vh - var(--topbar-height) - 100px));
    overflow-y: auto;
    overscroll-behavior: contain;
}
.notification-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    transition: background-color 0.2s ease;
}
.notification-item:hover {
    background: var(--gray-50);
}
.notification-item.unread {
    background: rgba(40, 122, 78, 0.04);
}
.notification-item.read {
    opacity: 0.8;
}
.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 7px;
    flex-shrink: 0;
}
.type-info { background: var(--primary); }
.type-success { background: var(--success); }
.type-warning { background: var(--warning); }
.type-error { background: var(--danger); }
.notification-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.notification-copy strong {
    font-size: 13px;
    line-height: 1.3;
}
.notification-copy small {
    color: var(--gray-600);
    line-height: 1.45;
    display: block;
    white-space: normal;
}
.notification-copy time {
    color: var(--gray-400);
    font-size: 11px;
}
.notification-empty {
    padding: 18px 16px;
    color: var(--gray-500);
    text-align: center;
}
.notification-detail {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}
.notification-detail.hidden {
    display: none;
}
.notification-detail-card {
    position: relative;
    width: min(500px, 100%);
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 28px 24px 20px;
    border: 1px solid var(--gray-200);
}
.notification-detail-card h3 {
    margin: 8px 0 12px;
    color: var(--gray-900);
    font-size: 22px;
}
.notification-detail-card p {
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
}
.notification-detail-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}
.notification-detail-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}
.user-name { 
    font-weight: 600; 
    color: var(--gray-700);
    font-size: 14px;
}
.user-badge {
    font-size: 11px; 
    font-weight: 700; 
    text-transform: uppercase;
    padding: 4px 10px; 
    border-radius: 6px;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.user-badge.role-admin { 
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%); 
    color: white;
}
.user-badge.role-cashier { 
    background: linear-gradient(135deg, var(--success-light) 0%, var(--success) 100%); 
    color: white;
}

.sidebar-toggle {
    display: none;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    color: var(--gray-600); 
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--gray-800);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.content-area { 
    padding: 32px; 
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}

.auth-container { width: 100%; max-width: 420px; padding: 20px; }

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow-lg);
}

.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand h1 { font-size: 22px; margin: 12px 0 4px; color: var(--gray-900); }
.auth-brand p { color: var(--gray-500); font-size: 13px; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--gray-500); font-size: 13px; }
.demo-credentials { text-align: center; margin-top: 16px; color: var(--gray-400); }

/* Cards & KPIs */
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}
.card-header h3 { 
    font-size: 16px; 
    font-weight: 700; 
    color: var(--gray-800); 
    letter-spacing: -0.3px;
}
.card-body { 
    padding: 24px; 
    background: #ffffff;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
    align-items: stretch;
}

.kpi-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    border: 1px solid rgba(255,255,255,0.12);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 150px;
    color: #ffffff;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.80);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.10);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-card.primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }
.kpi-card.success { background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%); }
.kpi-card.warning { background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%); }
.kpi-card.danger { background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%); }

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    background: rgba(255,255,255,0.18);
    color: #ffffff;
    box-shadow: none;
}

.kpi-card.primary .kpi-icon { background: rgba(255,255,255,0.18); color: #ffffff; }
.kpi-card.success .kpi-icon { background: rgba(255,255,255,0.14); color: #ffffff; }
.kpi-card.warning .kpi-icon { background: rgba(255,255,255,0.14); color: #ffffff; }
.kpi-card.danger .kpi-icon { background: rgba(255,255,255,0.14); color: #ffffff; }

.kpi-label {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.90);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.kpi-value {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    margin-top: 2px;
    letter-spacing: -0.5px;
}
.kpi-change {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.88);
    margin-top: 6px;
    font-weight: 500;
}

.grid-2 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 24px; 
}

.dmpc-forecast-chart {
    height: 360px;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
}

.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.quick-actions .btn {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.quick-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.quick-actions .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.quick-actions .btn-secondary {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-200);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.quick-actions .btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 5px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.input-sm { padding: 6px 10px; font-size: 13px; max-width: 120px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    font-size: 14px; font-weight: 600;
    border: none; border-radius: 8px;
    cursor: pointer; font-family: inherit;
    transition: all .2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.btn-primary { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
    color: #fff;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover { 
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}
.btn-secondary { 
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); 
    color: var(--gray-700); 
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.btn-secondary:hover { 
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: var(--gray-300);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}
.btn-danger { 
    background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%); 
    color: #fff;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.2);
}
.btn-danger:hover { 
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(220, 38, 38, 0.3);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { 
    padding: 2px 6px; 
    font-size: 10px; 
    font-weight: 600; 
    border-radius: 4px;
    min-width: 50px;
}
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }

/* Tables */
.table-responsive { 
    overflow-x: auto; 
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}
.table { 
    width: 100%; 
    border-collapse: collapse; 
    background: white;
}
.table th {
    text-align: left; 
    padding: 14px 16px;
    font-size: 12px; 
    font-weight: 700; 
    text-transform: uppercase;
    color: var(--gray-600); 
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}
.table td { 
    padding: 14px 16px; 
    border-bottom: 1px solid var(--gray-100); 
    vertical-align: middle;
    font-size: 13px;
    color: var(--gray-700);
}
.table tbody tr:hover { 
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}
.table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
    display: inline-block; 
    padding: 4px 10px;
    font-size: 11px; 
    font-weight: 700; 
    border-radius: 6px;
    letter-spacing: 0.03em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.badge-success { 
    background: linear-gradient(135deg, var(--success-light) 0%, var(--success) 100%); 
    color: white;
}
.badge-warning { 
    background: linear-gradient(135deg, var(--warning-light) 0%, var(--warning) 100%); 
    color: white;
}
.badge-danger { 
    background: linear-gradient(135deg, var(--danger-light) 0%, var(--danger) 100%); 
    color: white;
}
.badge-info { 
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%); 
    color: white;
}

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }

/* Page Header */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); }

/* Filters */
.filters-bar {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.filters-bar .form-control { max-width: 200px; }
.report-filter-card { margin-bottom: 18px; }
.report-filter-card .card-header,
.report-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.card-header .text-muted { margin-top: 3px; font-size: 12px; }
.report-filter-grid {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, .8fr) auto;
    align-items: end;
    gap: 14px;
}
.report-filter-grid .form-group,
.inventory-report-modal .filters-bar .form-group { margin: 0; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.report-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.report-status { min-height: 20px; margin-top: 12px; font-size: 12px; }
.report-empty { text-align: center; padding: 22px !important; color: var(--gray-500); }
.inventory-report-section .filters-bar { align-items: end; }
.inventory-report-section .filters-bar .form-group { min-width: 160px; }
.inventory-report-section .filters-bar .form-control { max-width: none; }
.report-intro { margin-bottom: 16px; }
.report-filter-card .btn:disabled,
.inventory-report-modal .btn:disabled { opacity: .55; cursor: not-allowed; }
.transaction-products summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.transaction-products ul { margin: 8px 0 0; padding-left: 18px; min-width: 220px; }
.transaction-products li { margin-bottom: 8px; }
.transaction-products li span, .transaction-credit span { display: block; color: var(--gray-500); font-size: 12px; }
.transaction-credit { margin-top: 6px; }
.transaction-notes span { display: block; color: var(--gray-500); font-size: 12px; overflow-wrap: anywhere; }

/* POS Layout */
.purchase-items-table-wrap { overflow-x: auto; margin: 12px 0; }
.purchase-items-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.purchase-items-table th, .purchase-items-table td { padding: 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--gray-200); }
.purchase-items-table th { background: var(--gray-50); }
.purchase-items-table small { display: block; color: var(--gray-500); font-size: 11px; }
.purchase-items-table td:first-child { overflow-wrap: anywhere; min-width: 100px; }
.audit-product-summary { margin-top: 6px; color: var(--gray-600); font-size: 12px; overflow-wrap: anywhere; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; height: calc(100vh - var(--topbar-height) - 48px); }

.pos-products { display: flex; flex-direction: column; overflow: hidden; }
.search-bar input {
    width: 100%; padding: 12px 16px;
    border: 1px solid var(--gray-200); border-radius: var(--radius);
    font-size: 15px; margin-bottom: 16px;
}
.search-bar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: all .15s;
}
.product-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.product-card.out-of-stock { opacity: .5; pointer-events: none; }
.product-card .name { font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--gray-800); }
.product-card .sku { font-size: 11px; color: var(--gray-400); }
.product-card .price { font-size: 15px; font-weight: 700; color: var(--primary); margin-top: 8px; }
.product-card .stock { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* Product tiles shared by Process Sale and Record Disposition. */
.pos-product-catalog .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pos-product-catalog .product-card { padding: 10px; min-height: 120px; }
.pos-product-catalog .product-card .name { font-size: 12px; margin-bottom: 2px; }
.pos-product-catalog .product-card .sku { font-size: 10px; }
.pos-product-catalog .product-card .price { font-size: 14px; margin-top: 4px; }
.pos-product-catalog .product-card .stock { font-size: 10px; margin-top: 2px; }

.pos-cart {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.cart-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}
.cart-header h3 { font-size: 16px; font-weight: 600; }

.cart-header, .cart-summary, .cart-payment { flex-shrink: 0; }
.cart-items { flex: 1 0 160px; min-height: 160px; overflow-y: auto; padding: 12px 20px; }
.cart-item-count { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 12px; background: var(--primary-light); color: var(--primary-dark); font-size: 11px; white-space: nowrap; }
.cart-selection-status { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.cart-empty { text-align: center; padding: 40px 0; }

.cart-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}
.cart-item-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cart-item-info .name { font-weight: 500; font-size: 13px; }
.cart-item-info .price { font-size: 12px; color: var(--gray-500); }
.cart-item-qty { display: flex; align-items: center; gap: 6px; }
.cart-item-qty button {
    width: 28px; height: 28px;
    border: 1px solid var(--gray-200); border-radius: 6px;
    background: #fff; cursor: pointer; font-size: 14px;
}
.cart-item-qty button:hover { background: var(--gray-100); }
.cart-item-qty span { min-width: 24px; text-align: center; font-weight: 600; }
.cart-item-total { font-weight: 600; min-width: 70px; text-align: right; }
.cart-item-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 16px; padding: 4px; }

.cart-summary { padding: 16px 20px; border-top: 1px solid var(--gray-100); }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; }
.summary-row.total { font-size: 18px; font-weight: 700; border-top: 2px solid var(--gray-200); padding-top: 12px; margin-top: 6px; }

.cart-payment { padding: 16px 20px; border-top: 1px solid var(--gray-100); background: var(--gray-50); }
.pos-cart fieldset.cart-payment { margin: 0; border: 0; border-top: 1px solid var(--gray-100); min-width: 0; }
.pos-cart fieldset.cart-payment:disabled { opacity: .55; }
.cart-verification { padding: 12px 16px; border-top: 1px solid var(--gray-200); background: var(--primary-light); flex-shrink: 0; }
.cart-verification p { margin-bottom: 8px; font-size: 12px; color: var(--primary-dark); }
.cart-review-confirmation { display: flex; align-items: flex-start; gap: 10px; padding: 14px 0; margin-top: 12px; font-weight: 600; }
.cart-review-confirmation input { flex-shrink: 0; margin-top: 3px; }
.pos-cart button:disabled, #cartReviewModal button:disabled { opacity: .6; cursor: not-allowed; }
.credit-fields { margin-top: 10px; }

/* Modal */
.modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 200; padding: 20px;
}
.modal.hidden { display: none; }
.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 640px; }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--gray-400); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; gap: 10px; justify-content: flex-end; }

/* Quick Actions */
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px 0; }
.pagination button {
    padding: 6px 12px; border: 1px solid var(--gray-200);
    background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .5; cursor: not-allowed; }

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid var(--gray-200);
    margin-top: 16px;
}

.pagination-info {
    font-size: 13px;
    color: var(--gray-600);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-controls span {
    color: var(--gray-600);
    font-size: 13px;
}

/* QR Code Display */
.qr-display {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 12px;
}

.qr-display #gcashQrCode {
    background: #fff;
    border: 2px solid var(--gray-200);
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0),
                linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    margin: 0 auto;
    position: relative;
}

.qr-placeholder::before {
    content: 'QR Code';
    position: absolute;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
}

.qr-placeholder.gcash-qr {
    background: #00b8d4;
    border-color: #008c9e;
}

.qr-placeholder.gcash-qr::before {
    color: #fff;
    content: 'GCash';
}

.payment-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.payment-status-indicator.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.payment-status-indicator.verified {
    background: var(--success-light);
    color: var(--success);
}

.payment-status-indicator.failed {
    background: var(--danger-light);
    color: var(--danger);
}

/* Receipt Styles */
.receipt {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.receipt-header {
    text-align: center;
    margin-bottom: 16px;
}

.receipt-header h4 {
    margin: 0 0 8px 0;
    color: var(--gray-800);
}

.receipt-date {
    margin: 0;
    color: var(--gray-500);
    font-size: 13px;
}

.receipt .line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--gray-200);
}

.receipt .line.total {
    border-bottom: none;
    border-top: 2px solid var(--gray-800);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 16px;
}

.receipt .divider {
    border-top: 1px solid var(--gray-200);
    margin: 16px 0;
}

.receipt-footer {
    text-align: center;
    margin-top: 20px;
}

.receipt-message {
    margin: 0 0 8px 0;
    color: var(--gray-600);
    font-weight: 500;
}

.receipt-note {
    margin: 0;
    color: var(--gray-500);
    font-size: 12px;
}

/* Risk Grid */
.risk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.risk-item {
    background: var(--gray-50); padding: 16px; border-radius: 8px;
    display: flex; flex-direction: column; gap: 4px;
}
.risk-item span { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .03em; }
.risk-item strong { font-size: 20px; color: var(--gray-900); }

.hidden { display: none !important; }

/* Tabs */
.tab-nav { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; border-bottom: 1px solid var(--gray-200); }
.tab-nav li { margin: 0; }
.tab-btn {
    background: none; border: none; padding: 10px 16px; cursor: pointer;
    font-size: 14px; font-weight: 500; color: var(--gray-500);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: block; }
.tab-panel.hidden { display: none !important; }

/* Receipt */
.receipt { font-family: monospace; font-size: 13px; }
.receipt h4 { text-align: center; margin-bottom: 12px; }
.receipt .line { display: flex; justify-content: space-between; padding: 3px 0; }
.receipt .divider { border-top: 1px dashed var(--gray-300); margin: 8px 0; }

/* Product page fit styling */
.products-page-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.products-page-wrap .card {
    width: 100%;
    min-height: auto;
}

.products-page-wrap .card-body {
    min-height: auto;
}

.products-page-wrap .table-responsive {
    width: 100%;
    max-height: calc(100vh - var(--topbar-height) - 280px);
    overflow: auto;
}

/* Inventory page */
.inventory-page {
    display: grid;
    gap: 20px;
}

.inventory-page > .card {
    margin-top: 0;
}

.inventory-page .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.inventory-page .card-header h3 {
    margin: 0;
}

.inventory-page .card-header p {
    margin: 4px 0 0;
}

.inventory-actions,
.inventory-action-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.inventory-actions {
    justify-content: flex-end;
}

.inventory-page .table-responsive {
    width: 100%;
}

.inventory-stock-card .table {
    min-width: 620px;
}

.inventory-restock-card .table {
    min-width: 760px;
}

.inventory-restock-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(110px, .7fr) minmax(180px, 1.5fr) auto;
    align-items: end;
    gap: 14px;
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-50);
}

.inventory-restock-form .form-group {
    min-width: 0;
    margin: 0;
}

.inventory-restock-form .btn {
    min-height: 39px;
    white-space: nowrap;
}

.inventory-report-section .kpi-card {
    min-height: 120px;
}

.inventory-report-section .grid-2 {
    gap: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
    body { overflow-x: hidden; }
    .grid-2 { grid-template-columns: 1fr; }
    .pos-layout { grid-template-columns: 1fr; height: auto; min-height: auto; }
    .pos-products { min-height: 440px; }
    .pos-cart { max-height: none; }
    .content-area { max-width: 100%; padding: 24px; }
    .inventory-page .card-header { align-items: flex-start; flex-direction: column; }
    .inventory-actions { width: 100%; justify-content: flex-start; }
    .inventory-restock-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inventory-restock-form > .btn { justify-self: start; }
}

@media (max-width: 768px) {
    body { overflow-x: hidden; }
    .app-layout { min-height: auto; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .sidebar-toggle { display: block; }
    .notification-panel {
        position: fixed;
        top: calc(var(--topbar-height) + 8px);
        right: 12px;
        width: min(360px, calc(100vw - 24px));
    }
    .content-area { padding: 16px; width: 100%; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .filters-bar .form-control { max-width: 100%; flex: 1; }
    .page-header { flex-wrap: wrap; gap: 12px; }
    .report-filter-grid { grid-template-columns: 1fr 1fr; }
    .report-actions { grid-column: 1 / -1; }
    .report-filter-card .card-header { align-items: flex-start; flex-direction: column; }
    .inventory-report-section .filters-bar { align-items: stretch; }
    .inventory-report-section .filters-bar .form-group { flex: 1 1 180px; }
    
    /* POS Responsive */
    .pos-layout { grid-template-columns: 1fr; gap: 16px; }
    .pos-products { min-height: 420px; }
    .pos-cart { max-height: none; }
    .cart-summary { padding: 16px; }
    .cart-payment { padding: 16px; }
    .cart-header { padding: 12px 16px; }
    .cart-items { padding: 12px 16px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .online-fields { padding: 12px; }
    .credit-fields { padding: 12px; }
    #gcashQrCode { width: 150px; height: 150px; }
}

@media (max-width: 480px) {
    body { overflow-x: hidden; }
    .kpi-grid { grid-template-columns: 1fr; }
    .content-area { padding: 12px; }
    .page-header { flex-direction: column; }
    .report-filter-grid { grid-template-columns: 1fr; }
    .report-actions { grid-column: auto; display: grid; grid-template-columns: 1fr; }
    .report-actions .btn { width: 100%; }
    .inventory-action-group { width: 100%; }
    .inventory-action-group .btn { flex: 1 1 auto; }
    .inventory-restock-form { grid-template-columns: 1fr; padding: 14px; }
    .inventory-restock-form > .btn { width: 100%; }
    
    /* POS Mobile Responsive */
    .pos-layout { gap: 12px; }
    .pos-products { min-height: 380px; }
    .pos-cart { max-height: 400px; }
    .cart-summary { padding: 10px; }
    .cart-payment { padding: 10px; }
    .cart-header { padding: 8px 10px; }
    .cart-items { padding: 8px 10px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
    .online-fields { padding: 8px; }
    .credit-fields { padding: 8px; }
    #gcashQrCode { width: 100px; height: 100px; }
    .form-group { margin-bottom: 8px; }
    .form-control { font-size: 13px; padding: 8px 10px; }
    .btn-lg { padding: 10px 16px; font-size: 13px; }
    
    /* Payment Section Responsive */
    .cart-payment { overflow-y: auto; max-height: 300px; }
    .online-fields { max-height: 250px; overflow-y: auto; }
    .credit-fields { max-height: 250px; overflow-y: auto; }
    .summary-row { font-size: 12px; }
    .cart-header h3 { font-size: 13px; }
    .form-group label { font-size: 11px; margin-bottom: 4px; }
    .bypass-section { font-size: 11px; }
    .qr-display p { font-size: 11px; margin-top: 4px; }
    #gcashQrHint { font-size: 10px; padding: 6px; margin-bottom: 6px; }
}
