/**
 * POS System - Main Stylesheet
 * Mobile-first responsive design
 * Color scheme: White base, Navy blue headers, Orange accents
 */

/* ============================================================
   CSS Custom Properties (Theme Variables)
   ============================================================ */
:root {
    /* Primary Colors */
    --color-primary: #1B2A4A;
    --color-primary-light: #2D4A7A;
    --color-primary-dark: #0F1A2E;

    /* Secondary Colors */
    --color-secondary: #FFFFFF;
    --color-secondary-dark: #F5F7FA;

    /* Accent Colors */
    --color-accent: #FF6B35;
    --color-accent-light: #FF8C5E;
    --color-accent-dark: #E55A25;

    /* Neutral Colors */
    --color-text-primary: #1A1A2E;
    --color-text-secondary: #6B7280;
    --color-text-light: #9CA3AF;
    --color-border: #E5E7EB;
    --color-background: #F9FAFB;
    --color-surface: #FFFFFF;

    /* Sidebar */
    --color-sidebar: #1B2A4A;

    /* Status Colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;
    --color-danger: #dc3545;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 64px;
    --header-height: 64px;
    --bottom-nav-height: 64px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 4px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    --transition-theme: 300ms ease;
}

/* ============================================================
   Reset & Base Styles
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-background);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-theme);
}

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

a:hover {
    color: var(--color-primary-light);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 10px 14px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
    min-height: 44px;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   Mobile Header
   ============================================================ */
.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 16px;
    background: var(--color-primary);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: background-color var(--transition-theme);
}

.menu-toggle {
    color: white;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: background var(--transition-fast);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.mobile-user {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

/* ============================================================
   Sidebar Navigation
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--transition-normal), background-color var(--transition-theme);
    transform: translateX(-100%);
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: white;
}

.sidebar-close {
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: background var(--transition-fast);
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 2px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    min-height: 48px;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: white;
    background: rgba(255, 107, 53, 0.2);
    border-left: 3px solid var(--color-accent);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-label {
    white-space: nowrap;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
    transition: background-color var(--transition-theme);
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: var(--font-size-xs);
    opacity: 0.7;
}

.logout-btn {
    color: rgba(255, 255, 255, 0.7);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

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

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

/* ============================================================
   Bottom Navigation (Mobile)
   ============================================================ */
.bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: white;
    border-top: 1px solid var(--color-border);
    z-index: 100;
    padding: 0 8px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 12px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    border-radius: var(--border-radius);
    transition: color var(--transition-fast);
    min-width: 56px;
    text-decoration: none;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--color-accent);
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
}

/* ============================================================
   Page Layout Components
   ============================================================ */
.page-container {
    padding: 16px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-primary);
    transition: color var(--transition-theme);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color var(--transition-theme);
}

.card-body {
    padding: 20px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: var(--font-size-sm);
    min-height: 44px;
    min-width: 44px;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-light);
    color: white;
}

.btn-accent {
    background: var(--color-accent);
    color: white;
}

.btn-accent:hover {
    background: var(--color-accent-dark);
    color: white;
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #0ea572;
    color: white;
}

.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.btn-outline:hover {
    background: var(--color-secondary-dark);
    border-color: var(--color-text-secondary);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: var(--color-secondary-dark);
    color: var(--color-text-primary);
}

.btn-sm {
    padding: 6px 12px;
    min-height: 36px;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: 14px 28px;
    min-height: 52px;
    font-size: var(--font-size-lg);
}

.btn-block {
    width: 100%;
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================================
   Forms
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    min-height: 44px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
    outline: none;
}

.form-row {
    display: grid;
    gap: 16px;
}

.form-error {
    color: var(--color-error);
    font-size: var(--font-size-sm);
    margin-top: 4px;
}

/* ============================================================
   Tables
   ============================================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--color-primary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    transition: background-color var(--transition-theme);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
}

.table tbody tr:hover {
    background: var(--color-secondary-dark);
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

/* ============================================================
   Dashboard Styles
   ============================================================ */
.dashboard-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.metric-card {
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon svg {
    width: 24px;
    height: 24px;
}

.metric-icon-sales {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.metric-icon-orders {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

.metric-icon-products {
    background: rgba(255, 107, 53, 0.1);
    color: var(--color-accent);
}

.metric-icon-lowstock {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.metric-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.metric-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.metric-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* Quick Actions */
.dashboard-quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.quick-action-btn:hover {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.quick-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.dashboard-chart-card {
    min-height: 280px;
}

.dashboard-chart-card canvas {
    max-height: 220px;
}

/* Dashboard Alerts */
.dashboard-alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.dashboard-alert-item:last-child {
    margin-bottom: 0;
}

.dashboard-alert-item:hover {
    transform: translateX(4px);
}

.dashboard-alert-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dashboard-alert-item .alert-arrow {
    margin-left: auto;
    opacity: 0.5;
}

.dashboard-alert-warning {
    background: rgba(245, 158, 11, 0.08);
    color: var(--color-warning);
}

.dashboard-alert-info {
    background: rgba(59, 130, 246, 0.08);
    color: var(--color-info);
}

.dashboard-alert-success {
    background: rgba(16, 185, 129, 0.08);
    color: var(--color-success);
}

.dashboard-alert-error {
    background: rgba(239, 68, 68, 0.08);
    color: var(--color-error);
}

/* ============================================================
   Settings Page Styles
   ============================================================ */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--color-border);
    -webkit-overflow-scrolling: touch;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
}

.settings-tab:hover {
    color: var(--color-primary);
    background: var(--color-secondary-dark);
}

.settings-tab.active {
    color: var(--color-accent);
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-accent);
    margin-bottom: -2px;
}

.settings-tab svg {
    width: 16px;
    height: 16px;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

/* Color Picker */
.color-picker-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-picker-input {
    width: 60px;
    height: 44px;
    padding: 4px;
    cursor: pointer;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    min-height: auto;
}

.color-hex-input {
    max-width: 100px;
    font-family: monospace;
    font-size: var(--font-size-sm);
    text-align: center;
}

/* Theme Preview */
.theme-preview {
    margin-top: 20px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.theme-preview-header {
    padding: 16px 20px;
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    transition: background-color var(--transition-theme);
}

.theme-preview-body {
    padding: 20px;
    background: var(--color-background);
    transition: background-color var(--transition-theme);
}

.theme-preview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.theme-preview-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

.theme-preview-btn {
    padding: 8px 16px;
    background: var(--color-accent);
    color: white;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border: none;
    cursor: default;
    transition: background-color var(--transition-theme);
}

/* Preset Themes */
.preset-themes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.preset-theme-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--color-surface);
}

.preset-theme-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.preset-colors {
    display: flex;
    gap: 6px;
}

.preset-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.preset-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-primary);
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

/* ============================================================
   POS Terminal Layout
   ============================================================ */
.pos-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    overflow: hidden;
}

.pos-products {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.pos-cart-panel {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

/* Search Bar */
.pos-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.pos-search-input {
    flex: 1;
    position: relative;
}

.pos-search-input input {
    padding-left: 40px;
}

.pos-search-input .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    width: 18px;
    height: 18px;
}

.btn-scan {
    background: var(--color-primary);
    color: white;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background-color var(--transition-fast);
}

.btn-scan:hover {
    background: var(--color-primary-light);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    background: var(--color-secondary-dark);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
    cursor: pointer;
    min-height: 36px;
}

.category-tab:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.category-tab.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.product-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 120px;
    justify-content: center;
}

.product-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

.product-card-name {
    font-weight: 500;
    font-size: var(--font-size-sm);
    margin-bottom: 4px;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.product-card-price {
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--color-accent);
}

.product-card-sku {
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
    margin-top: 4px;
}

/* Cart Panel */
.cart-header {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-title {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-count {
    background: var(--color-accent);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--color-text-light);
    text-align: center;
}

.cart-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

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

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 500;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-secondary-dark);
    border: 1px solid var(--color-border);
    font-weight: 600;
    font-size: var(--font-size-lg);
    transition: all var(--transition-fast);
    color: var(--color-text-primary);
}

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

.qty-value {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.cart-item-total {
    font-weight: 600;
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.cart-item-remove {
    color: var(--color-error);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.cart-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

.cart-item-remove svg {
    width: 16px;
    height: 16px;
}

/* Cart Coupon */
.cart-coupon {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    gap: 8px;
}

.cart-coupon input {
    flex: 1;
    min-height: 40px;
    font-size: var(--font-size-sm);
}

.cart-coupon .btn {
    min-height: 40px;
    padding: 8px 14px;
}

/* Cart Summary */
.cart-summary {
    padding: 16px;
    border-top: 1px solid var(--color-border);
    background: var(--color-secondary-dark);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: var(--font-size-sm);
}

.cart-summary-row.total {
    font-size: var(--font-size-xl);
    font-weight: 700;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid var(--color-border);
    color: var(--color-primary);
}

.cart-summary-row .label {
    color: var(--color-text-secondary);
}

.cart-summary-row.total .label {
    color: var(--color-primary);
}

/* Cart Actions */
.cart-actions {
    padding: 16px;
    display: flex;
    gap: 8px;
}

.cart-actions .btn {
    flex: 1;
}

/* ============================================================
   Payment Modal
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

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

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-secondary-dark);
    color: var(--color-text-primary);
}

.modal-body {
    padding: 24px;
}

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

/* Payment Methods */
.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.payment-method-btn {
    padding: 20px;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    min-height: 80px;
}

.payment-method-btn:hover {
    border-color: var(--color-accent);
}

.payment-method-btn.active {
    border-color: var(--color-accent);
    background: rgba(255, 107, 53, 0.05);
    color: var(--color-accent);
}

.payment-method-btn svg {
    width: 28px;
    height: 28px;
}

/* Cash Payment */
.cash-payment {
    display: none;
}

.cash-payment.active {
    display: block;
}

.amount-display {
    text-align: center;
    padding: 20px;
    background: var(--color-secondary-dark);
    border-radius: var(--border-radius-lg);
    margin-bottom: 16px;
}

.amount-display .label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.amount-display .amount {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-primary);
}

.quick-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.quick-amount-btn {
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    transition: all var(--transition-fast);
    min-height: 44px;
}

.quick-amount-btn:hover {
    border-color: var(--color-accent);
    background: rgba(255, 107, 53, 0.05);
}

.change-display {
    text-align: center;
    padding: 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--border-radius-lg);
    margin-top: 16px;
    display: none;
}

.change-display.visible {
    display: block;
}

.change-display .label {
    font-size: var(--font-size-sm);
    color: var(--color-success);
}

.change-display .amount {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-success);
}

/* PayNow Payment */
.paynow-payment {
    display: none;
    text-align: center;
}

.paynow-payment.active {
    display: block;
}

.qr-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-code {
    margin: 16px 0;
    padding: 16px;
    background: white;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    display: inline-block;
}

.qr-info {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: 12px;
}

.waiting-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: var(--color-info);
    font-weight: 500;
}

.waiting-indicator .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================================
   Receipt
   ============================================================ */
.receipt-container {
    display: none;
}

.receipt-container.active {
    display: block;
}

.receipt {
    background: white;
    max-width: 320px;
    margin: 0 auto;
    padding: 24px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    border: 1px dashed var(--color-border);
    border-radius: var(--border-radius);
}

.receipt-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--color-text-light);
}

.receipt-store-name {
    font-size: 16px;
    font-weight: 700;
}

.receipt-address {
    font-size: 11px;
    color: var(--color-text-secondary);
}

.receipt-items {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--color-text-light);
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.receipt-item-detail {
    font-size: 11px;
    color: var(--color-text-secondary);
    padding-left: 8px;
}

.receipt-totals {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--color-text-light);
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.receipt-total-row.grand-total {
    font-weight: 700;
    font-size: 14px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-text-primary);
}

.receipt-payment {
    margin-bottom: 12px;
}

.receipt-footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--color-text-light);
    font-size: 11px;
    color: var(--color-text-secondary);
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-background);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: var(--font-size-2xl);
    color: var(--color-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   User Management
   ============================================================ */
.user-list-card {
    overflow: hidden;
}

.user-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.user-filters input,
.user-filters select {
    min-width: 150px;
    flex: 1;
}

/* ============================================================
   Barcode Scanner
   ============================================================ */
.scanner-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scanner-modal.active {
    display: flex;
}

.scanner-viewport {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 4/3;
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
}

.scanner-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 40%;
    border: 2px solid var(--color-accent);
    border-radius: var(--border-radius);
}

.scanner-close {
    margin-top: 20px;
    color: white;
    padding: 12px 24px;
    border: 1px solid white;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
}

.scanner-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   Floating Cart Button (Mobile)
   ============================================================ */
.cart-fab {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-accent);
    color: white;
    box-shadow: var(--shadow-lg);
    align-items: center;
    justify-content: center;
    z-index: 90;
    transition: transform var(--transition-fast);
}

.cart-fab:hover {
    transform: scale(1.1);
}

.cart-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   Alerts / Notifications
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ============================================================
   Responsive: Tablet Portrait (768px+)
   ============================================================ */
@media (min-width: 768px) {
    .mobile-header {
        display: none;
    }

    .sidebar {
        transform: translateX(0);
        width: var(--sidebar-collapsed-width);
    }

    .sidebar .nav-label,
    .sidebar .sidebar-logo,
    .sidebar .user-details,
    .sidebar .sidebar-close {
        display: none;
    }

    .sidebar-header {
        justify-content: center;
        padding: 16px;
    }

    .sidebar-footer {
        justify-content: center;
        padding: 12px;
    }

    .sidebar-footer .logout-btn {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 12px;
    }

    .main-content {
        padding-top: 0;
        margin-left: var(--sidebar-collapsed-width);
    }

    .bottom-nav {
        display: none;
    }

    .page-container {
        padding: 24px;
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pos-layout {
        height: 100vh;
    }

    .cart-fab {
        display: flex;
    }

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

    /* Dashboard responsive */
    .dashboard-metrics {
        grid-template-columns: repeat(4, 1fr);
    }

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

    .preset-themes {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================================
   Responsive: Tablet Landscape / Desktop (992px+)
   ============================================================ */
@media (min-width: 992px) {
    .sidebar {
        width: var(--sidebar-width);
    }

    .sidebar .nav-label,
    .sidebar .sidebar-logo,
    .sidebar .user-details {
        display: block;
    }

    .sidebar .sidebar-close {
        display: none;
    }

    .sidebar-header {
        justify-content: flex-start;
        padding: 20px;
    }

    .sidebar-footer {
        justify-content: space-between;
        padding: 16px 20px;
    }

    .sidebar-footer .logout-btn {
        display: flex;
    }

    .nav-link {
        justify-content: flex-start;
        padding: 12px 16px;
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    .pos-layout {
        flex-direction: row;
        height: 100vh;
    }

    .pos-products {
        flex: 1;
        border-right: 1px solid var(--color-border);
    }

    .pos-cart-panel {
        width: 380px;
        border-top: none;
        height: 100vh;
    }

    .cart-fab {
        display: none;
    }

    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }

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

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

/* ============================================================
   Responsive: Large Desktop (1200px+)
   ============================================================ */
@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .page-container {
        max-width: 1400px;
    }
}

/* ============================================================
   Responsive: Small phones (<576px)
   ============================================================ */
@media (max-width: 575px) {
    .dashboard-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .metric-card {
        padding: 12px;
    }

    .metric-icon {
        width: 40px;
        height: 40px;
    }

    .metric-icon svg {
        width: 20px;
        height: 20px;
    }

    .metric-value {
        font-size: var(--font-size-lg);
    }

    .dashboard-quick-actions {
        gap: 8px;
    }

    .quick-action-btn {
        padding: 8px 12px;
        font-size: var(--font-size-xs);
    }

    .settings-tabs {
        gap: 2px;
    }

    .settings-tab {
        padding: 10px 12px;
        font-size: var(--font-size-xs);
    }

    .settings-tab span {
        display: none;
    }

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

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions .btn {
        width: 100%;
    }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    body {
        background: white;
        font-size: 12px;
    }

    .sidebar,
    .mobile-header,
    .bottom-nav,
    .cart-fab,
    .modal-overlay,
    .no-print,
    .btn-print {
        display: none !important;
    }

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

    .receipt-container {
        display: block !important;
    }

    .receipt {
        border: none;
        box-shadow: none;
        max-width: 80mm;
        padding: 0;
        margin: 0;
    }

    .print-only {
        display: block !important;
    }
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.animate-fade-in {
    animation: fadeIn var(--transition-normal);
}

.animate-slide-up {
    animation: slideUp var(--transition-normal);
}
