/**
 * Kasir FL STORE - Main Stylesheet
 * Premium POS design system with modern aesthetics
 */

/* ============================================================
   CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
    /* Primary palette */
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --primary-bg: rgba(79, 70, 229, 0.08);
    
    /* Secondary */
    --secondary: #64748b;
    --secondary-light: #94a3b8;
    
    /* Accent */
    --accent: #06b6d4;
    --accent-light: #67e8f9;
    
    /* Status colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    
    /* Backgrounds */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-sidebar-active: rgba(79, 70, 229, 0.15);
    --bg-topbar: #ffffff;
    
    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: #cbd5e1;
    --text-sidebar-active: #ffffff;
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-radius: 0.75rem;
    --border-radius-sm: 0.5rem;
    --border-radius-lg: 1rem;
    
    /* Shadows */
    --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 -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;
    --bottom-nav-height: 64px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-info: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    --gradient-teal: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    --gradient-orange: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

/* ============================================================
   Base & Typography
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: var(--bg-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--text-primary); }

/* ============================================================
   Top Navbar
   ============================================================ */
.top-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1020;
    transition: left var(--transition);
    box-shadow: var(--shadow-sm);
}

.top-navbar-left { display: flex; align-items: center; gap: 1rem; }
.top-navbar-right { display: flex; align-items: center; gap: 0.5rem; }

.top-navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.btn-sidebar-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-sidebar-toggle:hover { background: var(--primary-bg); color: var(--primary); }

.btn-navbar-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}
.btn-navbar-icon:hover { background: var(--primary-bg); color: var(--primary); }

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    font-weight: 600;
    line-height: 1;
}

.btn-user-menu {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border: none;
    background: transparent;
    padding: 0.375rem 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.btn-user-menu:hover { background: var(--bg-body); }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
    flex-shrink: 0;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { text-align: left; }
.user-name { font-weight: 600; font-size: 0.8125rem; color: var(--text-primary); line-height: 1.3; }
.user-role { font-size: 0.6875rem; color: var(--text-muted); line-height: 1.3; }

.btn-user-menu i { font-size: 0.625rem; color: var(--text-muted); }

/* Notification Dropdown */
.notification-dropdown { width: 340px; max-height: 420px; padding: 0; }
.notification-dropdown .dropdown-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
.notification-list { max-height: 320px; overflow-y: auto; }
.notification-dropdown .dropdown-footer { padding: 0.75rem; border-top: 1px solid var(--border-color); }
.notification-dropdown .dropdown-footer a { font-size: 0.8125rem; font-weight: 500; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
    overflow: hidden;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.125rem;
}
.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary-light);
}
.sidebar-brand-text { white-space: nowrap; }

.btn-sidebar-close {
    width: 32px; height: 32px;
    border: none; background: transparent;
    color: var(--text-sidebar);
    border-radius: var(--border-radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.btn-sidebar-close:hover { background: rgba(255,255,255,0.1); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-menu { list-style: none; padding: 0; margin: 0; }

.sidebar-menu-header {
    padding: 1.25rem 1.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-menu-item { margin: 1px 0.625rem; }

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    color: var(--text-sidebar);
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    font-weight: 400;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.sidebar-menu-item a:hover {
    background: var(--bg-sidebar-hover);
    color: #fff;
}

.sidebar-menu-item.active a {
    background: var(--bg-sidebar-active);
    color: var(--primary-light);
    font-weight: 500;
}
.sidebar-menu-item.active a i { color: var(--primary-light); }

.sidebar-menu-item a i {
    width: 20px;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-badge {
    margin-left: auto;
    font-size: 0.625rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.sidebar-footer-info { text-align: center; }
.sidebar-footer small { font-size: 0.6875rem; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

/* Sidebar collapsed state (desktop) */
body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .sidebar .sidebar-brand-text,
body.sidebar-collapsed .sidebar .sidebar-menu-header,
body.sidebar-collapsed .sidebar .sidebar-badge,
body.sidebar-collapsed .sidebar .sidebar-menu-item a span,
body.sidebar-collapsed .sidebar .sidebar-footer { display: none; }
body.sidebar-collapsed .sidebar .sidebar-menu-item a { justify-content: center; padding: 0.75rem; }
body.sidebar-collapsed .sidebar .sidebar-menu-item a i { width: auto; font-size: 1.125rem; margin: 0; }
body.sidebar-collapsed .top-navbar { left: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed-width); }

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left var(--transition);
}

/* ============================================================
   Bottom Navigation (Mobile)
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    color: var(--text-muted);
    font-size: 0.625rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    min-width: 56px;
}
.bottom-nav-item i { font-size: 1.125rem; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active i { color: var(--primary); }

.bottom-nav-primary-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    transition: transform var(--transition-fast);
}
.bottom-nav-primary:hover .bottom-nav-primary-icon { transform: scale(1.1); }
.bottom-nav-primary span { color: var(--primary); font-weight: 600; }

/* ============================================================
   Cards
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}
.card:hover { box-shadow: var(--shadow); }

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-body { padding: 1.25rem; }

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: var(--border-radius-lg);
    color: #fff;
    overflow: hidden;
    position: relative;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
}
.stat-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -10px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.stat-card .card-body { position: relative; z-index: 1; }
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}
.stat-card .stat-label {
    font-size: 0.8125rem;
    opacity: 0.85;
    font-weight: 400;
}
.stat-card .stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.stat-card .stat-change i { font-size: 0.625rem; }

.stat-card.gradient-primary { background: var(--gradient-primary); }
.stat-card.gradient-success { background: var(--gradient-success); }
.stat-card.gradient-warning { background: var(--gradient-warning); }
.stat-card.gradient-danger { background: var(--gradient-danger); }
.stat-card.gradient-info { background: var(--gradient-info); }
.stat-card.gradient-purple { background: var(--gradient-purple); }
.stat-card.gradient-teal { background: var(--gradient-teal); }
.stat-card.gradient-orange { background: var(--gradient-orange); }

/* ============================================================
   Tables
   ============================================================ */
.table-responsive { border-radius: var(--border-radius-sm); }

.table {
    margin-bottom: 0;
    font-size: 0.8125rem;
}

.table thead th {
    background: var(--bg-body);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 0.75rem 0.875rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table tbody td {
    padding: 0.75rem 0.875rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tbody tr {
    transition: background var(--transition-fast);
}
.table tbody tr:hover { background: var(--primary-bg); }
.table tbody tr:last-child td { border-bottom: none; }

.table .sortable {
    cursor: pointer;
    user-select: none;
}
.table .sortable:hover { color: var(--primary); }
.table .sortable i { font-size: 0.625rem; margin-left: 0.25rem; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(79,70,229,0.3); }

.btn-success { background: var(--success); border-color: var(--success); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-info { background: var(--info); border-color: var(--info); }

.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.btn-light { background: var(--bg-body); border-color: var(--border-color); color: var(--text-primary); }
.btn-light:hover { background: var(--border-color); }

.btn-sm { padding: 0.3rem 0.625rem; font-size: 0.75rem; }
.btn-lg { padding: 0.625rem 1.5rem; font-size: 0.9375rem; }

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
}

/* ============================================================
   Forms
   ============================================================ */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.form-text { font-size: 0.75rem; color: var(--text-muted); }

.input-group-text {
    background: var(--bg-body);
    border-color: var(--border-color);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
    font-weight: 500;
    font-size: 0.6875rem;
    padding: 0.3em 0.6em;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.8125rem;
    margin-bottom: 0;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    font-weight: 600;
    color: var(--text-muted);
}
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 500; }

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.page-header h1, .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}
.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================================
   Filter Toolbar
   ============================================================ */
.filter-toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}
.filter-toolbar .form-group { flex: 1; min-width: 150px; }
.filter-toolbar .form-group label { font-size: 0.75rem; font-weight: 500; margin-bottom: 0.25rem; display: block; }

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}
.empty-state h5 {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.empty-state p {
    font-size: 0.875rem;
    max-width: 360px;
    margin: 0 auto 1rem;
}

/* ============================================================
   Skeleton Loading
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-body) 25%, #e2e8f0 50%, var(--bg-body) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.toast-header {
    border-bottom: none;
    padding: 0.625rem 1rem;
}
.toast-body { padding: 0.625rem 1rem; }

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info { border-left: 4px solid var(--info); }

/* ============================================================
   Status Indicators
   ============================================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.375rem;
}
.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--text-muted); }
.status-dot.warning { background: var(--warning); }
.status-dot.danger { background: var(--danger); }

/* ============================================================
   Modal Enhancements
   ============================================================ */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header { padding: 1.25rem 1.5rem; }
.modal-body { padding: 1rem 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; }

/* ============================================================
   Responsive: Tablet & Mobile
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay.show { display: block; }
    
    .top-navbar { left: 0; }
    
    .main-content {
        margin-left: 0;
        padding-bottom: calc(var(--bottom-nav-height) + 1.5rem);
    }
}

@media (max-width: 767.98px) {
    .main-content { padding: 1rem; }
    
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-actions { width: 100%; }
    
    .stat-card .stat-value { font-size: 1.375rem; }
    
    .filter-toolbar { flex-direction: column; }
    .filter-toolbar .form-group { min-width: auto; width: 100%; }
    
    .notification-dropdown { width: 300px; }
}

@media (max-width: 575.98px) {
    .main-content { padding: 0.75rem; }
    .page-title { font-size: 1.25rem; }
    .btn { font-size: 0.75rem; }
    .table { font-size: 0.75rem; }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    .sidebar, .top-navbar, .bottom-nav, .no-print,
    .btn, .page-actions, .filter-toolbar,
    .pagination, .alert, .toast-container { display: none !important; }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body { background: #fff; font-size: 11pt; }
    .card { border: 1px solid #ddd; box-shadow: none; }
    .table thead th { background: #f5f5f5 !important; }
    
    @page { margin: 1.5cm; }
}

/* ============================================================
   Utility Classes
   ============================================================ */
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-light { background: var(--primary-bg) !important; }
.bg-success-light { background: var(--success-bg) !important; }
.bg-warning-light { background: var(--warning-bg) !important; }
.bg-danger-light { background: var(--danger-bg) !important; }
.bg-info-light { background: var(--info-bg) !important; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.fs-xs { font-size: 0.6875rem; }
.fs-sm { font-size: 0.8125rem; }
.fs-md { font-size: 0.9375rem; }
.fs-lg { font-size: 1.125rem; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.cursor-pointer { cursor: pointer; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.slide-up { animation: slideUp 0.5s ease-out; }

/* ============================================================
   POS-Specific Styles
   ============================================================ */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1rem;
    height: calc(100vh - var(--topbar-height) - 3rem);
}

.pos-products {
    overflow-y: auto;
    padding-right: 0.5rem;
}

.pos-cart {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.pos-product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}
.pos-product-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-bg);
    transform: translateY(-2px);
}
.pos-product-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
}
.pos-product-card .product-name {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pos-product-card .product-price {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
}
.pos-product-card .product-stock {
    font-size: 0.625rem;
    color: var(--text-muted);
}

.pos-cart-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.pos-cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
.pos-cart-item:last-child { border-bottom: none; }

.pos-cart-item .item-info { flex: 1; }
.pos-cart-item .item-name { font-size: 0.8125rem; font-weight: 500; }
.pos-cart-item .item-price { font-size: 0.75rem; color: var(--text-secondary); }

.pos-cart-item .item-qty {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.pos-cart-item .item-qty button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pos-cart-item .item-qty input {
    width: 40px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.pos-cart-item .item-subtotal {
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.pos-cart-item .item-remove {
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.75rem;
}

.pos-cart-summary {
    padding: 1rem 1.25rem;
    border-top: 2px solid var(--border-color);
    background: var(--bg-body);
}
.pos-cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
}
.pos-cart-summary .summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.125rem;
    font-weight: 700;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    color: var(--primary);
}

.pos-cart-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}
.pos-cart-actions .btn { flex: 1; }

@media (max-width: 991.98px) {
    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* ============================================================
   Login Page
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.login-wrapper::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--border-radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: block;
}
.login-logo h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.login-logo p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================================
   Receipt Print Styles
   ============================================================ */
.receipt-container {
    max-width: 300px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}
.receipt-container .receipt-header { text-align: center; margin-bottom: 8px; }
.receipt-container .receipt-divider { border-top: 1px dashed #000; margin: 4px 0; }
.receipt-container .receipt-row { display: flex; justify-content: space-between; }
.receipt-container .receipt-footer { text-align: center; margin-top: 8px; font-size: 11px; }

/* ============================================================
   Installer Styles
   ============================================================ */
.installer-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    padding: 2rem;
}

.installer-card {
    width: 100%;
    max-width: 640px;
    background: #fff;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.installer-header {
    background: var(--gradient-primary);
    color: #fff;
    padding: 2rem;
    text-align: center;
}
.installer-header h2 { color: #fff; margin-bottom: 0.5rem; }
.installer-header p { opacity: 0.85; font-size: 0.875rem; margin: 0; }

.installer-body { padding: 2rem; }

.installer-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 0.5rem;
}
.installer-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-body);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-muted);
    position: relative;
}
.installer-step.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.installer-step.completed {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.installer-step + .installer-step::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    width: 0.5rem;
    height: 2px;
    background: var(--border-color);
    margin-right: 0;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color);
}
.check-item:last-child { border-bottom: none; }
.check-item i { width: 20px; text-align: center; }
.check-item .check-pass { color: var(--success); }
.check-item .check-fail { color: var(--danger); }

/* ============================================================
   POS (Point of Sale) Layout
   ============================================================ */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0.75rem;
    height: calc(100vh - var(--topbar-height) - 1.5rem);
    overflow: hidden;
}

/* --- Products Panel --- */
.pos-products {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.625rem;
    overflow-y: auto;
    padding: 0.25rem;
    flex: 1;
    align-content: start;
}
.pos-product-grid::-webkit-scrollbar { width: 4px; }
.pos-product-grid::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.pos-product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}
.pos-product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(79, 70, 229, 0.12);
    transform: translateY(-2px);
}
.pos-product-card:active {
    transform: translateY(0);
}
.pos-product-card img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}
.pos-product-card .product-name {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 1.8em;
    color: var(--text-primary);
}
.pos-product-card .product-price {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
}
.pos-product-card .product-stock {
    font-size: 0.625rem;
    color: var(--text-muted);
}

/* --- Cart Panel --- */
.pos-cart {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-cart-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9375rem;
    flex-shrink: 0;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.pos-cart-items::-webkit-scrollbar { width: 4px; }
.pos-cart-items::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.pos-cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8125rem;
    transition: background 0.15s;
}
.pos-cart-item:hover {
    background: var(--bg-body);
}

.pos-cart-item .item-info {
    overflow: hidden;
}
.pos-cart-item .item-name {
    font-weight: 600;
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.pos-cart-item .item-price {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.pos-cart-item .item-qty {
    display: flex;
    align-items: center;
    gap: 0;
}
.pos-cart-item .item-qty button {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    border-radius: 4px;
    font-size: 0.625rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--text-primary);
}
.pos-cart-item .item-qty button:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pos-cart-item .item-qty input {
    width: 40px;
    height: 26px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-left: none;
    border-right: none;
    font-size: 0.75rem;
    font-weight: 600;
    outline: none;
    -moz-appearance: textfield;
    background: var(--bg-card);
    color: var(--text-primary);
}
.pos-cart-item .item-qty input::-webkit-outer-spin-button,
.pos-cart-item .item-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

.pos-cart-item .item-subtotal {
    font-weight: 700;
    font-size: 0.8125rem;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
    color: var(--text-primary);
}

.pos-cart-item .item-remove {
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    transition: color 0.15s;
}
.pos-cart-item .item-remove:hover { color: var(--danger); }

/* Cart Summary */
.pos-cart-summary {
    padding: 0.75rem 1rem;
    border-top: 2px solid var(--border-color);
    background: var(--bg-body);
    flex-shrink: 0;
}
.pos-cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.pos-cart-summary .summary-total {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0 0;
    margin-top: 0.5rem;
    border-top: 2px solid var(--primary);
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--primary);
}

/* Cart Actions */
.pos-cart-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}
.pos-cart-actions .btn { flex: 1; }

/* Cart Empty State */
.pos-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}
.pos-cart-empty i { font-size: 2.5rem; opacity: 0.2; margin-bottom: 0.75rem; }
.pos-cart-empty p { margin-bottom: 0.25rem; font-weight: 500; }
.pos-cart-empty small { opacity: 0.7; }

/* --- POS Responsive --- */
@media (max-width: 991.98px) {
    .pos-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        height: auto;
        min-height: calc(100vh - var(--topbar-height));
    }
    .pos-products {
        min-height: 50vh;
    }
    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
    .pos-cart {
        max-height: 50vh;
    }
}
