/* ============================================
   BIMU INVESTMENTS POS - Royal Blue Theme
   ============================================ */

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

:root {
    --primary: #4169E1;
    --primary-dark: #2850C8;
    --primary-light: #6B8BF5;
    --primary-bg: #EEF2FF;
    --secondary: #1E293B;
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #06B6D4;
    --info-light: #CFFAFE;
    --dark: #0F172A;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --transition: all 0.2s ease;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #4169E1 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: rgba(65,105,225,0.15);
    top: -150px; right: -100px;
}
.login-page::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(65,105,225,0.1);
    bottom: -100px; left: -50px;
}
.login-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo .logo-icon {
    width: 70px; height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: white;
    box-shadow: 0 8px 20px rgba(65,105,225,0.3);
}
.login-logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}
.login-logo p {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: var(--font);
    transition: var(--transition);
    background: var(--gray-50);
    color: var(--gray-800);
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(65,105,225,0.1);
}
.input-icon-wrap {
    position: relative;
}
.input-icon-wrap .form-input { padding-left: 44px; }
.input-icon-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(65,105,225,0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(65,105,225,0.4);
}
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon {
    width: 38px; height: 38px;
    padding: 0;
    border-radius: var(--radius);
}

/* ============================================
   LAYOUT - SIDEBAR + CONTENT
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}
.sidebar-brand {
    padding: 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sidebar-brand h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.sidebar-brand small {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 400;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.nav-section {
    padding: 0 16px;
    margin-bottom: 8px;
}
.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 12px 6px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}
.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.07);
}
.nav-link.active {
    color: white;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(65,105,225,0.3);
}
.nav-link i { width: 20px; text-align: center; font-size: 15px; }
.nav-link .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user .user-avatar {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.sidebar-user .user-info { flex: 1; }
.sidebar-user .user-info .name { font-size: 13px; font-weight: 600; }
.sidebar-user .user-info .role {
    font-size: 11px;
    color: var(--gray-400);
    text-transform: capitalize;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}
.topbar {
    background: var(--white);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}
.topbar-left .breadcrumb {
    font-size: 13px;
    color: var(--gray-500);
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-700);
    cursor: pointer;
    padding: 4px;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-content {
    padding: 24px 28px;
}

/* ============================================
   CARDS & STATS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-card .stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.stat-card .stat-icon.blue { background: var(--primary-bg); color: var(--primary); }
.stat-card .stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-card .stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-card .stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-card .stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 2px;
}

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
}
.card-body { padding: 22px; }

/* ============================================
   TABLES
   ============================================ */
.table-responsive { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
}
table.data-table th {
    background: var(--gray-50);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
table.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
table.data-table tr:hover { background: var(--gray-50); }

.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    gap: 4px;
}
.badge-status.active { background: var(--success-light); color: #065F46; }
.badge-status.inactive { background: var(--danger-light); color: #991B1B; }
.badge-status.completed { background: var(--success-light); color: #065F46; }
.badge-status.pending { background: var(--warning-light); color: #92400E; }
.badge-status.cancelled { background: var(--danger-light); color: #991B1B; }
.badge-status.low-stock { background: var(--warning-light); color: #92400E; }
.badge-status.out-of-stock { background: var(--danger-light); color: #991B1B; }

/* ============================================
   POS TERMINAL
   ============================================ */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
    height: calc(100vh - 60px);
    overflow: hidden;
}
.pos-products {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--gray-100);
}
.pos-search-bar {
    padding: 16px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.pos-search-bar .search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px 10px 40px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    background: var(--gray-50);
    transition: var(--transition);
}
.pos-search-bar .search-input:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(65,105,225,0.1);
}
.pos-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.pos-search-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}
.module-tabs {
    display: flex;
    gap: 6px;
}
.module-tab {
    padding: 8px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-600);
    white-space: nowrap;
}
.module-tab.active {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}
.pos-categories {
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    -webkit-overflow-scrolling: touch;
}
.pos-categories::-webkit-scrollbar { display: none; }
.cat-chip {
    padding: 7px 16px;
    border-radius: 20px;
    border: 2px solid var(--gray-200);
    background: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: var(--font);
    color: var(--gray-600);
}
.cat-chip.active, .cat-chip:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}
.pos-grid-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.product-tile {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    border: 2px solid var(--gray-200);
    transition: var(--transition);
    text-align: center;
    user-select: none;
    position: relative;
}
.product-tile:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.product-tile:active {
    transform: scale(0.97);
}
.product-tile .tile-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
}
.product-tile .tile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-tile .tile-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}
.product-tile .tile-stock {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 2px;
}
.product-tile .tile-stock.low { color: var(--warning); }
.product-tile .tile-stock.out { color: var(--danger); font-weight: 600; }
.product-tile.out-of-stock {
    opacity: 0.5;
    pointer-events: none;
}
.product-tile .tile-module-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Cart Panel */
.pos-cart {
    background: var(--white);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--gray-200);
    height: calc(100vh - 60px);
}
.cart-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cart-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-header .cart-count {
    background: var(--primary);
    color: white;
    font-size: 12px;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-customer {
    padding: 12px 18px;
    border-bottom: 1px solid var(--gray-100);
}
.cart-customer input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font);
}
.cart-customer input:focus {
    outline: none;
    border-color: var(--primary);
}
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.cart-item {
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}
.cart-item:hover { background: var(--gray-50); }
.cart-item-info {
    flex: 1;
    min-width: 0;
}
.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-price {
    font-size: 12px;
    color: var(--gray-500);
}
.cart-qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cart-qty-control button {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--gray-600);
}
.cart-qty-control button:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}
.cart-qty-control .qty-value {
    width: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}
.cart-item-total {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
    min-width: 70px;
    text-align: right;
}
.cart-item .remove-item {
    color: var(--gray-400);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: var(--transition);
}
.cart-item .remove-item:hover { color: var(--danger); }

.cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    padding: 40px;
}
.cart-empty i { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.cart-empty p { font-size: 14px; }

.cart-summary {
    border-top: 2px solid var(--gray-200);
    padding: 16px 18px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
}
.summary-row.total {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
    padding: 10px 0 4px;
    border-top: 2px solid var(--gray-200);
    margin-top: 6px;
}
.cart-actions {
    padding: 12px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cart-actions .btn {
    padding: 14px;
    font-size: 15px;
}
.pay-btn {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.pay-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16,185,129,0.4);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.2s ease;
}
.modal-box.lg { max-width: 700px; }
@keyframes modalIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--gray-100);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--gray-500);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================
   PAYMENT MODAL
   ============================================ */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.pay-method-btn {
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    font-family: var(--font);
}
.pay-method-btn:hover { border-color: var(--primary); }
.pay-method-btn.active {
    border-color: var(--primary);
    background: var(--primary-bg);
}
.pay-method-btn i { font-size: 24px; display: block; margin-bottom: 6px; color: var(--primary); }
.pay-method-btn span { font-size: 13px; font-weight: 600; color: var(--gray-700); }

/* ============================================
   RECEIPT
   ============================================ */
.receipt-preview {
    background: white;
    border: 1px dashed var(--gray-300);
    padding: 24px;
    max-width: 320px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}
.receipt-preview .receipt-header { text-align: center; margin-bottom: 12px; }
.receipt-preview .receipt-header h4 { font-size: 16px; }
.receipt-preview .receipt-divider {
    border: none;
    border-top: 1px dashed var(--gray-400);
    margin: 8px 0;
}
.receipt-preview table { width: 100%; }
.receipt-preview table td { padding: 2px 0; font-size: 12px; }
.receipt-preview .receipt-total { font-size: 16px; font-weight: bold; }
.receipt-preview .receipt-footer { text-align: center; margin-top: 12px; font-size: 11px; }

/* ============================================
   FORM STYLES
   ============================================ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
    cursor: pointer;
}
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    resize: vertical;
    min-height: 80px;
}
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   ALERTS & TOASTS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--primary); }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.filter-bar .form-input, .filter-bar select {
    padding: 9px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--font);
    background: white;
}
.filter-bar .form-input:focus, .filter-bar select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   CHART CONTAINERS
   ============================================ */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}
.pagination button, .pagination a {
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--gray-700);
    font-family: var(--font);
}
.pagination button:hover, .pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.pagination button.active, .pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart {
        position: fixed;
        right: -400px;
        top: 0;
        width: 380px;
        height: 100vh;
        z-index: 200;
        transition: right 0.3s ease;
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    }
    .pos-cart.open { right: 0; }
    .cart-toggle-mobile {
        display: flex !important;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 60px; height: 60px;
        border-radius: 50%;
        background: var(--primary);
        color: white;
        border: none;
        font-size: 22px;
        align-items: center;
        justify-content: center;
        z-index: 150;
        box-shadow: 0 4px 20px rgba(65,105,225,0.4);
        cursor: pointer;
    }
    .cart-toggle-mobile .cart-badge-mobile {
        position: absolute;
        top: -2px; right: -2px;
        background: var(--danger);
        color: white;
        width: 22px; height: 22px;
        border-radius: 50%;
        font-size: 11px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
    .sidebar-overlay.active { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .page-content { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .topbar-left h1 { font-size: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-card .stat-value { font-size: 20px; }
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
    .product-tile { padding: 10px; }
    .product-tile .tile-icon { width: 40px; height: 40px; }
    .pos-search-bar { padding: 12px 14px; }
    .modal-box { margin: 10px; }
    .form-row { grid-template-columns: 1fr; }
    .payment-methods { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .pos-grid { grid-template-columns: repeat(2, 1fr); }
    .module-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body { background: white; }
    .sidebar, .topbar, .no-print, .cart-actions { display: none !important; }
    .main-content { margin-left: 0; }
    .receipt-preview {
        border: none;
        box-shadow: none;
        max-width: 80mm;
        padding: 5mm;
        font-size: 11px;
    }
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-500); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none; }
