/* style.css - Premium Aesthetics & Layout System for Frozpos */

/* -------------------------------------------------------------
   1. GLOBAL PROPERTIES & VARIABLES
   ------------------------------------------------------------- */

/* LIGHT THEME (Default) - Frozen Food Aesthetic */
:root,
body.light-theme {
    /* Background Colors - Cool Ice Blue Tones */
    --bg-base: #f0f7ff;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #e8f2fc;
    --bg-surface-hover: #dceaf7;
    
    /* Border Colors */
    --border-color: #d1e3f5;
    --border-glow: rgba(59, 130, 246, 0.2);
    
    /* Primary Colors - Ice Blue */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.15);
    --primary-soft: #dbeafe;
    
    /* Success Colors - Fresh Green */
    --success: #10b981;
    --success-hover: #059669;
    --success-glow: rgba(16, 185, 129, 0.15);
    --success-soft: #d1fae5;
    
    /* Warning Colors - Warm Amber */
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-glow: rgba(245, 158, 11, 0.15);
    --warning-soft: #fef3c7;
    
    /* Danger Colors - Alert Red */
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.15);
    --danger-soft: #fee2e2;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Shadow & Effects */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.1), 0 4px 6px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 20px 25px rgba(15, 23, 42, 0.15), 0 10px 10px rgba(15, 23, 42, 0.04);
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    
    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-frost: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
}

/* DARK THEME - Deep Ice / Night Mode */
body.dark-theme {
    /* Background Colors - Deep Navy/Black */
    --bg-base: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-elevated: #334155;
    --bg-surface-hover: #475569;
    
    /* Border Colors */
    --border-color: #334155;
    --border-glow: rgba(59, 130, 246, 0.3);
    
    /* Primary Colors - Bright Ice Blue */
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-glow: rgba(96, 165, 250, 0.2);
    --primary-soft: rgba(96, 165, 250, 0.1);
    
    /* Success Colors */
    --success: #34d399;
    --success-hover: #10b981;
    --success-glow: rgba(52, 211, 153, 0.2);
    --success-soft: rgba(52, 211, 153, 0.1);
    
    /* Warning Colors */
    --warning: #fbbf24;
    --warning-hover: #f59e0b;
    --warning-glow: rgba(251, 191, 36, 0.2);
    --warning-soft: rgba(251, 191, 36, 0.1);
    
    /* Danger Colors */
    --danger: #f87171;
    --danger-hover: #ef4444;
    --danger-glow: rgba(248, 113, 113, 0.2);
    --danger-soft: rgba(248, 113, 113, 0.1);
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    
    /* Shadow & Effects */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5), 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6), 0 10px 10px rgba(0, 0, 0, 0.5);
    
    /* Glass Effect */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(51, 65, 85, 0.5);
    
    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --gradient-success: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --gradient-frost: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Shared Variables (Theme Independent) */
:root {
    /* Geometry */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    /* Transitions */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
    border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Theme Toggle Button */
.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 20px;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle .icon {
    transition: var(--transition-smooth);
}

.theme-toggle:hover .icon {
    transform: rotate(20deg);
}

/* Theme Toggle in Header */
.top-bar-right .theme-toggle {
    margin-right: 12px;
}

/* Theme Toggle in Home */
.home-nav .theme-toggle {
    margin-left: 16px;
}

/* Utilities */
.hidden { display: none !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

/* -------------------------------------------------------------
   2. APP SHELL LAYOUT
   ------------------------------------------------------------- */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* SIDEBAR STYLING */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-smooth);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px var(--primary));
    animation: pulse-glow 3s infinite ease-in-out;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 20px;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.brand-name .highlight {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.brand-tag {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -2px;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    background: none;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-elevated);
    transform: translateX(4px);
}

.nav-item.active {
    color: var(--primary);
    background-color: var(--primary-soft);
    border: 1px solid var(--primary-glow);
    box-shadow: 0 2px 8px var(--primary-glow);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background-color: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.logout-btn {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--danger);
    font-family: var(--font-heading);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.logout-btn:hover {
    background-color: var(--danger-glow);
    border-color: var(--danger);
}

/* MAIN CONTENT LAYOUT */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* TOP BAR */
.top-bar {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.view-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.branch-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-surface-elevated);
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.branch-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.quick-selectors {
    display: flex;
    align-items: center;
    gap: 16px;
}

.selector-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selector-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.control-select {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    outline: none;
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.control-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.notifications-bell {
    position: relative;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.notifications-bell:hover {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.bell-icon {
    font-size: 16px;
}

.notifications-bell .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger);
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-surface);
}

/* Dropdown Panel */
.dropdown-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: 320px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 150;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-header h3 {
    font-size: 13px;
    font-weight: 600;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.btn-text:hover {
    text-decoration: underline;
}

.dropdown-body {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: var(--transition-smooth);
}

.notification-item:hover {
    background-color: var(--bg-surface-elevated);
}

.notification-item.warning { border-left: 3px solid var(--warning); }
.notification-item.danger { border-left: 3px solid var(--danger); }
.notification-item.info { border-left: 3px solid var(--primary); }

.notif-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.notif-title {
    font-weight: 600;
    font-size: 12px;
}

.notif-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.notif-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* VIEWPORT ENGINE */
.view-viewport {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    position: relative;
}

.app-view {
    display: none;
    animation: fade-in 0.3s ease-out;
}

.app-view.active {
    display: block;
}

/* -------------------------------------------------------------
   3. VIEW 1: POS KASIR SCREEN
   ------------------------------------------------------------- */
.pos-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    height: calc(100vh - var(--header-height) - 64px);
    overflow: hidden;
}

.pos-catalog-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    min-height: 0;
}

.catalog-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-box-wrapper {
    position: relative;
    width: 100%;
}

.search-box-wrapper .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-muted);
}

.search-box-wrapper input {
    width: 100%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 14px 16px 14px 44px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: var(--transition-smooth);
}

.search-box-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.category-btn {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 500;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.category-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.category-btn.active {
    background-color: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
    font-weight: 600;
}

.catalog-products-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    grid-auto-rows: minmax(370px, auto);
    gap: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px;
    padding-right: 8px;
    align-content: start;
}

/* PRODUCT CARD STYLING - MATCHES HOMEPAGE */
.product-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 0 20px var(--primary-glow);
}

.product-card:active {
    transform: translateY(-2px);
}

.product-image-container {
    background: var(--gradient-frost);
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.product-icon {
    font-size: 4rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    transition: var(--transition-smooth);
}

.product-card:hover .product-icon {
    transform: scale(1.1);
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge-exp {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.badge-exp-crit {
    background-color: var(--danger);
    color: var(--text-inverse);
}

.badge-exp-warn {
    background-color: var(--warning);
    color: var(--text-inverse);
}

.badge-exp-safe {
    background-color: var(--success);
    color: var(--text-inverse);
}

.product-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.product-category {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.8px;
    opacity: 0.8;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
    min-height: 38px;
    margin: 0;
}

/* stock dot indicators */
.stock-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.stock-dot.ok { background: var(--success); box-shadow: 0 0 4px var(--success); }
.stock-dot.low { background: var(--warning); box-shadow: 0 0 4px var(--warning); }
.stock-dot.out { background: var(--danger); box-shadow: 0 0 4px var(--danger); }

.product-stock {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-stock.low {
    color: var(--warning);
    font-weight: 600;
}

.product-stock.out {
    color: var(--danger);
    font-weight: 600;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-top: 2px;
}

/* Full-width add button (matching homepage catalog) */
.btn-add-to-cart-full {
    margin-top: auto;
    width: 100%;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.88rem;
    font-family: var(--font-heading);
    font-weight: 600;
    background: var(--gradient-primary);
    color: var(--text-inverse);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.3px;
}

.btn-add-to-cart-full:hover:not(:disabled) {
    box-shadow: var(--shadow-md), 0 4px 12px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-add-to-cart-full:disabled {
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Out of stock overlay on image */
.product-out-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    z-index: 5;
}

/* Dimmed out-of-stock card */
.product-card.out-of-stock {
    opacity: 0.7;
    cursor: default;
}

/* POS CART PANEL RIGHT */
.pos-cart-panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.pos-cart-panel .panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-clear-cart {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.btn-clear-cart:hover {
    text-decoration: underline;
}

.cart-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 12px;
    text-align: center;
}

.cart-empty-icon {
    font-size: 48px;
    opacity: 0.3;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
}

.cart-item-fefo-batch {
    font-size: 9px;
    color: var(--text-muted);
    background-color: var(--bg-surface-elevated);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    width: fit-content;
    border: 1px solid rgba(255,255,255,0.03);
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 12px;
}

.cart-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-qty {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-qty:hover {
    background-color: var(--border-color);
}

.cart-qty-value {
    font-weight: 700;
    font-size: 14px;
    min-width: 20px;
    text-align: center;
}

.cart-summary-section {
    padding: 20px;
    background-color: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.summary-row.discount {
    align-items: center;
}

.summary-input {
    width: 60px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    outline: none;
    text-align: right;
    font-family: var(--font-body);
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.summary-row.total #cart-total {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

.payment-method-section {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-method-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.payment-option {
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface-elevated);
    gap: 4px;
    transition: var(--transition-smooth);
}

.option-icon {
    font-size: 18px;
}

.option-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.payment-option input:checked + .option-card {
    border-color: var(--primary);
    background-color: var(--primary-glow);
}

.payment-option input:checked + .option-card .option-label {
    color: var(--text-primary);
}

.payment-cash-helper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
    background-color: var(--bg-surface-elevated);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.payment-cash-helper .input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.payment-cash-helper label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.quick-cash-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.btn-quick-cash {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-quick-cash:hover {
    border-color: var(--primary);
}

.change-display {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-top: 4px;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
}

.change-display strong {
    color: var(--success);
    font-size: 14px;
}

.btn-checkout-process {
    margin: 20px;
    background: var(--gradient-success);
    color: var(--text-inverse);
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-checkout-process:hover:not(:disabled) {
    background: var(--gradient-success);
    box-shadow: var(--shadow-lg), 0 4px 16px var(--success-glow);
    transform: translateY(-2px);
}

.btn-checkout-process:active:not(:disabled) {
    transform: translateY(0);
}

.btn-checkout-process:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* -------------------------------------------------------------
   4. VIEW 2: CFD PREVIEW & SIMULATOR
   ------------------------------------------------------------- */
.cfd-preview-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cfd-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-surface);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.info-alert {
    font-size: 13px;
    color: var(--text-muted);
}

.cfd-simulator-frame {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.cfd-simulator-title {
    background-color: var(--bg-surface-elevated);
    padding: 12px 20px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 14px;
}

/* CFD REAL LAYOUT */
.cfd-screen {
    background: var(--gradient-frost);
    min-height: 500px;
    display: grid;
    grid-template-columns: 1fr 420px;
    color: var(--text-primary);
    font-family: var(--font-body);
    position: relative;
}

.cfd-left-panel {
    padding: 32px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-surface);
}

.cfd-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.cfd-logo {
    font-size: 32px;
}

.cfd-title {
    font-size: 24px;
    font-weight: 800;
    font-family: var(--font-heading);
}

.cfd-title span {
    color: var(--primary);
}

.cfd-table-wrapper {
    flex: 1;
    overflow-y: auto;
}

.cfd-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.cfd-table th {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.cfd-table td {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.cfd-item-name {
    font-weight: 700;
    font-size: 16px;
    font-family: var(--font-heading);
}

.cfd-item-qty {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 14px;
}

.cfd-item-price {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 15px;
}

.cfd-item-total {
    font-weight: 800;
    color: var(--primary);
    font-size: 16px;
    text-align: right;
}

.cfd-right-panel {
    background-color: var(--bg-surface);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* CFD PROMO PANEL (Idle) */
.cfd-promo-panel {
    height: 100%;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.promo-image-placeholder {
    font-size: 80px;
    animation: bounce-float 4s infinite ease-in-out;
}

.promo-title {
    font-size: 26px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary);
}

.promo-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 300px;
}

/* CFD PAYMENT WINDOW (Active) */
.cfd-payment-panel {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.cfd-payment-header {
    text-align: center;
}

.cfd-payment-header span {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.cfd-payment-total {
    font-size: 36px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary);
    margin-top: 8px;
    text-shadow: 0 0 16px var(--primary-glow);
}

.cfd-payment-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.cfd-qr-frame {
    background-color: white;
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfd-qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cfd-payment-desc {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    max-width: 260px;
}

.cfd-payment-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.cfd-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

/* CFD TRANSACTION SUCCESS SCREEN */
.cfd-success-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10;
    animation: fade-in 0.4s ease-out;
}

.success-icon-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--success-glow);
    border: 2px solid var(--success);
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scale-up-bounce 0.5s ease-out;
}

.success-message-title {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--success);
}

/* -------------------------------------------------------------
   5. VIEW 3: ADMIN DASHBOARD
   ------------------------------------------------------------- */
.admin-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1px;
}

.admin-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 12px 20px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.admin-tab-btn:hover {
    color: var(--text-primary);
}

.admin-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-viewport {
    min-height: 400px;
}

.admin-subview {
    display: none;
    animation: fade-in 0.3s ease-out;
}

.admin-subview.active {
    display: block;
}

/* SUBVIEW A: ANALYTICS METRICS */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-smooth);
}

.metric-card:hover {
    border-color: var(--primary-glow);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.metric-icon {
    font-size: 20px;
    padding: 8px;
    background: var(--primary-soft);
    border-radius: var(--radius-sm);
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-footer {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    width: fit-content;
}

.metric-footer.success { background-color: var(--success-glow); color: var(--success); }
.metric-footer.warning { background-color: var(--warning-glow); color: var(--warning); }
.metric-footer.danger { background-color: var(--danger-glow); color: var(--danger); }
.metric-footer.info { background-color: var(--primary-glow); color: var(--primary); }

.charts-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

.chart-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: var(--font-heading);
}

.chart-container {
    height: 300px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SUBVIEW B: INVENTORY TABLE */
.panel-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.search-box-wrapper.mini input {
    padding: 10px 12px 10px 36px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    width: 260px;
}

.search-box-wrapper.mini .search-icon {
    left: 12px;
    font-size: 14px;
}

.branch-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.control-select.mini {
    padding: 6px 10px;
    font-size: 12px;
}

.table-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 13px;
}

.data-table th {
    background-color: var(--bg-surface-elevated);
    padding: 14px 16px;
    color: var(--text-secondary);
    font-weight: 700;
    font-family: var(--font-heading);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--bg-surface-hover);
    transform: scale(1.001);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badge for Expiry Alerts */
.badge-alert {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-alert.danger { background-color: var(--danger-glow); color: var(--danger); }
.badge-alert.warning { background-color: var(--warning-glow); color: var(--warning); }
.badge-alert.success { background-color: var(--success-glow); color: var(--success); }

/* SUBVIEW C: PRICING & FORMULA */
.pricing-card-wrapper {
    display: grid;
    grid-template-columns: 5fr 4fr;
    gap: 24px;
}

.pricing-calculator-card, .pricing-current-list {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.pricing-calculator-card h3, .pricing-current-list h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    outline: none;
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.form-control:read-only {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.calculated-preview-box {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.preview-item strong {
    color: var(--text-primary);
}

.preview-item.highlight {
    font-size: 14px;
    font-weight: 700;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
    color: var(--text-primary);
}

.preview-item.highlight strong {
    color: var(--primary);
    font-size: 16px;
}

.btn-primary-action {
    background-color: var(--primary);
    color: var(--text-inverse);
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary-action:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 12px var(--primary-glow);
}

.product-price-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.price-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-surface-elevated);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.02);
}

.price-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-item-title {
    font-weight: 600;
    font-size: 13px;
}

.price-item-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.price-item-val {
    font-weight: 800;
    color: var(--primary);
}

/* -------------------------------------------------------------
   6. LOGIN SCREEN
   ------------------------------------------------------------- */
.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, var(--primary-glow) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, var(--success-glow) 0%, transparent 50%);
    pointer-events: none;
}

.card-glass {
    background-color: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl);
}

.login-box {
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    padding: 48px;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
}

.login-logo-icon {
    font-size: 56px;
    filter: drop-shadow(0 0 16px var(--primary));
    animation: pulse-glow 3s infinite ease-in-out;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 800;
}

.login-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-login-submit {
    width: 100%;
    background-color: var(--primary);
    color: var(--text-inverse);
    border: none;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    transition: var(--transition-smooth);
}

.btn-login-submit:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 16px var(--primary-glow);
}

/* Badges for roles in User Management */
.badge-superadmin {
    background-color: var(--warning-soft) !important;
    color: var(--warning-hover) !important;
    border: 1px solid var(--warning) !important;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-admin {
    background-color: var(--primary-soft) !important;
    color: var(--primary-hover) !important;
    border: 1px solid var(--primary) !important;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-cashier {
    background-color: var(--success-soft) !important;
    color: var(--success-hover) !important;
    border: 1px solid var(--success) !important;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

/* -------------------------------------------------------------
   7. SYSTEM MODALS
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fade-in 0.25s ease-out;
}

.modal-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.modal-close-x {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-close-x:hover {
    color: var(--text-primary);
}

.modal-overlay form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    padding: 16px 24px;
    background-color: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background-color: var(--bg-surface-elevated);
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-md), 0 4px 12px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-soft);
    transform: translateY(-2px);
}

/* RECEIPT MODAL SPECIFICS */
.receipt-modal {
    max-width: 380px;
    background-color: #ffffff;
    color: #000000;
}

.receipt-modal .modal-footer {
    background-color: #f7f7f7;
    border-top: 1px solid #e0e0e0;
}

.receipt-modal .btn-secondary {
    border-color: #d0d0d0;
    color: #444444;
}

.receipt-modal .btn-secondary:hover {
    background-color: #eaeaea;
}

.receipt-print-area {
    padding: 32px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #000000;
    background-color: #ffffff;
}

.receipt-header {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.receipt-logo { font-size: 24px; }
.receipt-store-name { font-size: 16px; font-weight: bold; }
.receipt-divider { border-top: 1px dashed #000000; margin: 10px 0; }

.receipt-item-row {
    display: grid;
    grid-template-columns: 1fr 40px 80px;
    gap: 8px;
    margin-bottom: 4px;
}

.receipt-item-sub {
    font-size: 10px;
    color: #444444;
    margin-top: -3px;
    margin-bottom: 4px;
}

.receipt-totals {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
}

.receipt-total-row.grand {
    font-weight: bold;
    font-size: 14px;
    border-top: 1px dashed #000000;
    padding-top: 6px;
    margin-top: 4px;
}

.receipt-footer-text {
    text-align: center;
    margin-top: 24px;
    font-size: 10px;
}

/* -------------------------------------------------------------
   8. TOAST NOTIFICATIONS & ANIMATIONS
   ------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slide-in-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger { border-left-color: var(--danger); }

.toast-icon { font-size: 18px; }
.toast-content { flex: 1; }
.toast-title { font-weight: 700; font-size: 13px; }
.toast-message { font-size: 12px; color: var(--text-muted); }

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
}

.toast-close:hover { color: var(--text-primary); }

/* SVG Visual Chart Styles */
.chart-bar {
    fill: var(--primary);
    rx: 4px;
    transition: var(--transition-smooth);
}
.chart-bar:hover {
    fill: var(--primary-hover);
}
.chart-line {
    stroke: var(--primary);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
}
.chart-point {
    fill: var(--primary);
    stroke: var(--bg-surface);
    stroke-width: 2;
    transition: var(--transition-smooth);
    cursor: pointer;
}
.chart-point:hover {
    r: 7;
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 6px var(--primary-glow)); }
    50% { filter: drop-shadow(0 0 16px var(--primary)); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounce-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes scale-up-bounce {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* -------------------------------------------------------------
   9. PRINT STYLESHEET
   ------------------------------------------------------------- */
@media print {
    /* Hide everything except the receipt modal */
    body > *:not(#modal-receipt) {
        display: none !important;
    }

    /* Make receipt modal transparent and full-width */
    #modal-receipt {
        position: static !important;
        display: block !important;
        background: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Hide modal card styling */
    #modal-receipt .modal-card {
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: none !important;
    }

    /* Hide modal header and footer */
    #modal-receipt .modal-header,
    #modal-receipt .modal-footer,
    #modal-receipt .modal-close-x {
        display: none !important;
    }

    /* Show receipt print area */
    #receipt-print-content {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        width: 80mm;
        margin: 0 auto;
        padding: 0;
        background: #fff;
        color: #000;
    }

    /* Hide other modals */
    .modal-overlay:not(#modal-receipt) {
        display: none !important;
    }
}

/* ==========================================================================
   HOME SCREEN (LANDING PAGE)
   ========================================================================== */
.home-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-base);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
}

.home-wrapper.hidden {
    display: none !important;
}

.home-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.home-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
}

.home-hero {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 60vh;
    padding: 4rem 2rem;
    background: radial-gradient(circle at 30% 50%, var(--primary-glow) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, var(--success-glow) 0%, transparent 50%);
    position: relative;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highlight-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 3rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.hero-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
}

.home-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card-home {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    transition: var(--transition-smooth);
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.feature-card-home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: var(--transition-smooth);
}

.feature-card-home:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.feature-card-home:hover::before {
    transform: scaleX(1);
}

.feature-card-home .feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    transition: var(--transition-smooth);
}

.feature-card-home:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card-home h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card-home p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.home-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

@media (max-width: 768px) {
    .home-nav {
        padding: 1rem 2rem;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .home-features {
        padding: 2rem;
    }
    .hero-actions {
        flex-direction: column;
    }
}

/* PUBLIC STORE CSS - MARKETPLACE STYLE */
.public-store-section {
    padding: 60px 5%;
    background: var(--bg-base);
    text-align: left;
}
.public-store-header {
    max-width: 1200px;
    margin: 0 auto 30px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.public-store-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 700;
}
.public-store-header p {
    color: var(--text-secondary);
    margin-top: 5px;
}
.public-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.public-catalog-grid .product-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: var(--transition-smooth);
    text-align: left;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.public-catalog-grid .product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.public-catalog-grid .product-image-container {
    background: var(--gradient-frost);
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.public-catalog-grid .product-icon {
    font-size: 4rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    transition: var(--transition-smooth);
}
.public-catalog-grid .product-card:hover .product-icon {
    transform: scale(1.1);
}
.product-discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: var(--text-inverse);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-sm);
}
.public-catalog-grid .product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.public-catalog-grid .product-info h3 {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.public-catalog-grid .product-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 2px;
}
.product-rating {
    font-size: 0.75rem;
    color: var(--warning);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.product-rating span {
    color: var(--text-muted);
}
.public-catalog-grid .product-info button {
    margin-top: auto;
    width: 100%;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 0.9rem;
    background: var(--gradient-primary);
    color: var(--text-inverse);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}
.public-catalog-grid .product-info button:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.floating-cart-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    left: auto;
    background: var(--gradient-primary);
    color: var(--text-inverse);
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg), 0 6px 16px var(--primary-glow);
    z-index: 100;
    transition: var(--transition-smooth);
}
.floating-cart-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl), 0 8px 20px var(--primary-glow);
}
.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--bg-surface);
    color: var(--primary);
    border: 2px solid var(--primary);
    font-size: 0.85rem;
    font-weight: 800;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}
.checkout-modal {
    max-width: 500px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    padding: 24px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    box-sizing: border-box !important;
}

/* Beautiful custom scrollbar for checkout modal scroll */
.checkout-modal::-webkit-scrollbar {
    width: 6px;
}
.checkout-modal::-webkit-scrollbar-track {
    background: transparent;
}
.checkout-modal::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
}

.checkout-modal h2 {
    font-family: 'Outfit', sans-serif !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding-bottom: 12px !important;
}

.public-cart-items {
    max-height: 250px !important;
    overflow-y: auto !important;
    margin-bottom: 24px !important;
    padding-right: 8px !important;
}

/* Beautiful custom scrollbar for cart items */
.public-cart-items::-webkit-scrollbar {
    width: 6px;
}
.public-cart-items::-webkit-scrollbar-track {
    background: transparent;
}
.public-cart-items::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
}

/* Styled Cart Item Rows */
.public-cart-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 14px 16px !important;
    background: var(--bg-surface-elevated) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 10px !important;
    transition: all 0.2s ease !important;
}
.public-cart-item:hover {
    transform: translateY(-1px) !important;
    border-color: var(--primary) !important;
    box-shadow: var(--shadow-sm) !important;
}
.public-cart-item-left {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    text-align: left !important;
}
.public-cart-item-name {
    font-weight: 700 !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
}
.public-cart-item-meta {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
}
.public-cart-item-price {
    font-weight: 800 !important;
    font-size: 15px !important;
    color: var(--primary) !important;
}

.cart-qty-btn {
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    vertical-align: middle !important;
}
.cart-qty-btn:hover {
    background: var(--bg-base) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.public-cart-summary {
    background: linear-gradient(135deg, rgba(0, 136, 255, 0.06) 0%, rgba(0, 200, 255, 0.03) 100%) !important;
    padding: 18px 24px !important;
    border-radius: var(--radius-lg) !important;
    margin-bottom: 24px !important;
    border: 1px solid rgba(0, 136, 255, 0.15) !important;
}

.public-cart-summary .summary-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.public-cart-summary .summary-row span {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
}

.public-cart-summary .summary-row strong {
    color: var(--primary) !important;
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    font-family: 'Outfit', sans-serif !important;
}

/* Form Polish */
.checkout-modal .form-group {
    margin-bottom: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    text-align: left !important;
}

.checkout-modal label {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
}

.checkout-modal .form-control,
.checkout-modal input[type="text"],
.checkout-modal select {
    width: 100% !important;
    box-sizing: border-box !important;
    background-color: var(--bg-base) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 12px 16px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
    transition: all 0.2s ease !important;
}

.checkout-modal .form-control:focus,
.checkout-modal input[type="text"]:focus,
.checkout-modal select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.15) !important;
    background-color: var(--bg-surface) !important;
    outline: none !important;
}

.checkout-modal .form-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    margin-top: 28px !important;
    border-top: 1px solid var(--border-color) !important;
    padding-top: 20px !important;
}

.checkout-modal .btn-primary {
    background-color: var(--primary) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    padding: 12px 28px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 14px rgba(0, 136, 255, 0.3) !important;
}

.checkout-modal .btn-primary:hover {
    background-color: #0077ee !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(0, 136, 255, 0.4) !important;
}

.checkout-modal .btn-secondary {
    background-color: var(--bg-base) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.checkout-modal .btn-secondary:hover {
    background-color: var(--bg-surface-elevated) !important;
}

/* ==========================================================================
   MISSING UTILITY CLASSES
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-info {
    background-color: var(--primary-glow);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-sm {
    padding: 4px 10px !important;
    font-size: 12px !important;
    margin-right: 6px;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted) !important;
}

.border-danger {
    border-color: var(--danger) !important;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 14px;
    gap: 8px;
}

.loading-spinner::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
    .pos-grid {
        grid-template-columns: 1fr 340px;
        gap: 20px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .pricing-card-wrapper {
        grid-template-columns: 1fr;
    }
    
    .catalog-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .option-label {
        font-size: 10px;
    }

    .btn-quick-cash {
        font-size: 10px;
        padding: 6px 2px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .pos-grid {
        grid-template-columns: 1fr 320px;
        gap: 16px;
    }
    
    .catalog-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
    
    .product-image-container {
        height: 140px;
    }

    .option-label {
        font-size: 9.5px;
    }

    .payment-options {
        gap: 6px;
    }

    .option-card {
        padding: 6px 4px;
    }

    .btn-quick-cash {
        font-size: 9.5px;
        padding: 6px 1px;
    }
}

/* Mobile landscape and small tablets */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s ease;
        z-index: 200;
    }

    .sidebar.mobile-open {
        left: 0;
    }

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

    .mobile-menu-toggle {
        display: flex !important;
    }

    .pos-grid {
        grid-template-columns: 1fr;
        height: auto;
        min-height: calc(100vh - var(--header-height) - 64px);
    }
    
    .pos-catalog-panel {
        max-height: none;
        overflow: visible;
    }
    
    .catalog-products-grid {
        max-height: 60vh;
        overflow-y: auto;
    }

    .pos-cart-panel {
        max-height: none;
        min-height: 400px;
    }

    .top-bar {
        padding: 0 16px;
    }

    .quick-selectors {
        display: none;
    }

    .view-viewport {
        padding: 16px;
        overflow-y: auto;
    }

    .admin-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .admin-tab-btn {
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 13px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .home-features {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .public-catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .home-nav {
        padding: 1rem 2rem;
    }
}

/* Mobile portrait */
@media (max-width: 600px) {
    .pos-grid {
        gap: 12px;
    }
    
    .catalog-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .product-image-container {
        height: 120px;
    }
    
    .product-icon {
        font-size: 3rem;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 13px;
        min-height: 34px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .btn-add-to-cart {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .payment-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .option-label {
        font-size: 10px;
    }

    .btn-quick-cash {
        font-size: 10px;
        padding: 6px 2px;
    }

    .option-card {
        padding: 6px 4px;
    }

    .cfd-screen {
        grid-template-columns: 1fr;
    }

    .cfd-right-panel {
        min-height: 300px;
    }

    .product-info {
        gap: 6px;
    }
    
    .view-viewport {
        padding: 12px;
    }
    
    .top-bar {
        padding: 0 12px;
    }
    
    .view-title {
        font-size: 16px;
    }
    
    .branch-indicator {
        display: none;
    }
    
    .home-nav {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-desc {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-btn {
        width: 100%;
    }
}

/* Extra small mobile */
@media (max-width: 380px) {
    .catalog-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .product-image-container {
        height: 100px;
    }
    
    .product-icon {
        font-size: 2.5rem;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-name {
        font-size: 12px;
        min-height: 32px;
    }
    
    .product-price {
        font-size: 14px;
    }
    
    .btn-add-to-cart {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .option-label {
        font-size: 9px;
    }

    .btn-quick-cash {
        font-size: 9px;
        padding: 6px 1px;
    }

    .payment-options {
        gap: 4px;
    }

    .option-card {
        padding: 6px 2px;
    }
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none !important;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px 8px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
}

.sidebar-overlay.active {
    display: block;
}

/* ==========================================================================
   NOTIFICATION DROPDOWN IMPROVEMENTS
   ========================================================================== */
.dropdown-body:empty::after {
    content: 'Tidak ada notifikasi aktif';
    display: block;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================================================
   DATA TABLE ACTION BUTTONS
   ========================================================================== */
.data-table td .btn-outline {
    margin-right: 4px;
}

/* ==========================================================================
   PROCESSING STATE BUTTON
   ========================================================================== */
.btn-checkout-process:disabled {
    position: relative;
}

/* Animation for processing */
@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Short viewport heights - prevent clipping in POS cart */
@media (max-height: 850px) {
    .pos-cart-panel {
        overflow-y: auto;
    }
    
    .pos-cart-panel .panel-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background-color: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        padding: 12px 16px;
    }
    
    .cart-items-list {
        flex: none;
        overflow-y: visible;
        padding: 12px 16px;
        gap: 10px;
    }
    
    .cart-summary-section {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .payment-method-section {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .payment-cash-helper {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .payment-cash-helper .form-control {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn-checkout-process {
        margin: 12px 16px 20px 16px;
        padding: 12px;
        font-size: 14px;
    }
}

/* Premium E-Commerce Footer Shared Styles */
.premium-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 48px 24px 24px 24px;
    margin-top: 48px;
}
.footer-cols {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
@media(max-width: 768px) {
    .footer-cols {
        grid-template-columns: 1fr;
    }
}
.footer-col h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-col p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 12px 0;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-col ul li a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-col ul li a:hover {
    color: var(--primary);
}
.footer-badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.footer-badge {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}
.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}
