/* NextRise PDV - Point of Sale System
   Modern Light Theme with Teal Accents
   ============================================== */

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

:root {
    /* Color Palette - Fresh Light Theme */
    --primary: #FFFFFF;
    --primary-light: #F8FAFB;
    --secondary: #E8EEF2;
    
    /* Accent Colors - Teal */
    --accent: #0D9488;
    --accent-light: #14B8A6;
    --accent-hover: #0F766E;
    --accent-glow: rgba(13, 148, 136, 0.12);
    --accent-subtle: rgba(13, 148, 136, 0.06);
    
    --accent-warm: #F97316;
    --accent-warm-light: #FB923C;
    --accent-warm-glow: rgba(249, 115, 22, 0.12);
    
    /* Status Colors */
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #EAB308;
    --warning-bg: rgba(234, 179, 8, 0.1);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.1);
    --neutral: #64748B;
    --neutral-bg: rgba(100, 116, 139, 0.1);
    
    /* Text */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-light: #CBD5E1;
    
    /* Backgrounds */
    --bg-body: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;
    --bg-input: #FFFFFF;
    --bg-sidebar: #FAFBFC;
    
    /* Borders */
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --border-focus: var(--accent);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(13, 148, 136, 0.15);
    
    /* Spacing & Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    color: var(--text-secondary);
}

/* ==================== Layout ==================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==================== Sidebar ==================== */

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 24px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.logo-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.02em;
}

.logo-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--bg-body);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(13, 148, 136, 0.2);
    font-weight: 600;
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

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

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 16px 16px 8px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    transition: background var(--transition);
}

.user-info:hover {
    background: var(--bg-body);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent-glow), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--accent);
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* ==================== Main Content ==================== */

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px 32px 24px 24px;
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
    overflow-x: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header-left {
    flex: 1;
    min-width: 200px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* ==================== Stats Cards ==================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all 0.25s ease;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--stat-color, var(--accent));
    border-radius: 4px 0 0 4px;
}

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

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--stat-bg, var(--accent-glow));
    color: var(--stat-color, var(--accent));
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-card.primary { --stat-color: var(--accent); --stat-bg: var(--accent-glow); }
.stat-card.success { --stat-color: var(--success); --stat-bg: var(--success-bg); }
.stat-card.warning { --stat-color: var(--warning); --stat-bg: var(--warning-bg); }
.stat-card.danger { --stat-color: var(--danger); --stat-bg: var(--danger-bg); }
.stat-card.info { --stat-color: var(--info); --stat-bg: var(--info-bg); }
.stat-card.warm { --stat-color: var(--accent-warm); --stat-bg: var(--accent-warm-glow); }

/* ==================== Cards ==================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.card-title i {
    color: var(--accent);
}

/* ==================== Buttons ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    color: var(--text-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}

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

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

.btn-success:hover {
    background: #16A34A;
}

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

.btn-danger:hover {
    background: #DC2626;
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #D97706, #F59E0B);
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, #3B82F6, #60A5FA);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    transform: translateY(-1px);
}

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

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

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius);
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

/* Disabled button state - only use when action is not available */
.btn:disabled,
.btn.disabled {
    background: #9CA3AF !important;
    color: #F3F4F6 !important;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover,
.btn.disabled:hover {
    transform: none !important;
}

/* Toggle buttons (e.g., discount type) */
.discount-type-btn {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

.discount-type-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    border-color: var(--accent);
}

/* ==================== Form Elements ==================== */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: 3px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-lg {
    padding: 16px 18px;
    font-size: 1.125rem;
}

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

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

/* Input with icon */
.input-group {
    position: relative;
}

.input-group .form-input {
    padding-left: 44px;
}

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

/* ==================== Tables ==================== */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-body);
    white-space: nowrap;
}

.data-table tr:hover {
    background: var(--bg-card-hover);
}

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

/* ==================== Badges ==================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge-primary { background: var(--accent-glow); color: var(--accent); }

/* ==================== Modal ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
    padding: 16px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: all var(--transition-slow);
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }
.modal-sm { max-width: 400px; }

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.modal-title i {
    color: var(--accent);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

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

/* ==================== Loading & Empty States ==================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.4;
    display: block;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ==================== Toast Notifications ==================== */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    min-width: 260px;
    max-width: 360px;
    color: var(--text-primary);
}

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

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

/* ==================== PDV Specific Styles ==================== */

.pdv-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - 56px);
    padding: 0;
}

.pdv-main {
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

.pdv-sidebar {
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 380px;
}

/* Product Search */
.product-search {
    position: relative;
    margin-bottom: 16px;
}

.product-search input {
    width: 100%;
    padding: 14px 18px 14px 48px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition);
}

.product-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    outline: none;
}

.product-search input::placeholder {
    color: var(--text-muted);
}

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

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    overflow-y: auto;
    padding: 8px;
    flex: 1;
    align-content: start;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    aspect-ratio: 1 / 1.15;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent) 0%, #10b981 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 25px -5px rgba(13, 148, 136, 0.25);
    transform: translateY(-3px) scale(1.02);
}

.product-card:hover::before {
    opacity: 0.05;
}

.product-card:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow-sm);
}

.product-card.selected {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.product-card.out-of-stock {
    opacity: 0.6;
}

.product-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--accent);
    flex-shrink: 0;
}

.product-card-emoji {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.product-card-icon {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 6px;
}

.product-card-stock {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* Mini Product Cards (Top Selling) */
.product-card-mini {
    background: linear-gradient(135deg, #fff8f0 0%, #fff 100%);
    border: 1px solid #fed7aa;
    border-radius: var(--radius-sm);
    padding: 8px 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
}

.product-card-mini:hover {
    border-color: #f97316;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
    transform: translateY(-2px);
}

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

.product-card-mini.out-of-stock {
    opacity: 0.5;
    pointer-events: none;
}

.product-card-mini .mini-emoji {
    font-size: 20px;
    line-height: 1;
}

.product-card-mini .mini-name {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-mini .mini-price {
    font-size: 0.65rem;
    font-weight: 700;
    color: #f97316;
}

.product-card-name {
    font-weight: 600;
    font-size: 0.6875rem;
    margin-bottom: 2px;
    line-height: 1.2;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.4em;
}

.product-card-price {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--accent);
    font-size: 0.75rem;
}

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

.cart-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.cart-count {
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 24px;
    text-align: center;
}

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

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--bg-body);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

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

.cart-item-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.cart-item-price {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

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

.cart-item-qty button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.cart-item-qty button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.cart-item-qty span {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    color: var(--text-primary);
}

.cart-item-total {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--accent);
    min-width: 70px;
    text-align: right;
}

.cart-item-remove {
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition);
}

.cart-item-remove:hover {
    color: var(--danger);
}

/* Cart Footer */
.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-body);
    flex-shrink: 0;
}

.cart-totals {
    margin-bottom: 16px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.cart-total-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    color: var(--text-primary);
}

.cart-total-row.total .amount {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}

/* Payment Methods - FIXED */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.payment-btn {
    padding: 12px 8px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary); /* FIXED: Text color */
    min-height: 70px;
}

.payment-btn i {
    font-size: 20px;
    color: var(--text-muted);
    transition: color var(--transition);
}

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

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

.payment-btn.active {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.payment-btn.active i {
    color: var(--accent);
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.0625rem;
    border-radius: var(--radius-lg);
}

/* Category Pills */
.category-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.category-pill {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    font-family: inherit;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-pill i {
    font-size: 14px;
}

.category-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.category-pill.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ==================== Login Page ==================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--secondary) 100%);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 400px;
    padding: 36px;
    border: 1px solid var(--border);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.login-title {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.375rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

/* ==================== Mobile Menu ==================== */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ==================== Responsive - Tablet ==================== */

@media (max-width: 1024px) {
    .main-content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pdv-sidebar {
        width: 340px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
    
    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== Responsive - Mobile ==================== */

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-overlay {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: var(--shadow-xl);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 70px 16px 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-actions {
        justify-content: stretch;
    }
    
    .page-actions .btn {
        flex: 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Modal Mobile */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .modal {
        max-width: 100%;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 85vh;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* PDV Mobile */
    .pdv-sidebar {
        position: fixed;
        right: -100%;
        top: 0;
        bottom: 0;
        width: 100%;
        max-width: 400px;
        z-index: 200;
        transition: right var(--transition-slow);
    }
    
    .pdv-sidebar.open {
        right: 0;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .product-card {
        padding: 8px 6px;
    }
    
    .product-card-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .product-card-name {
        font-size: 0.625rem;
    }
    
    .product-card-price {
        font-size: 0.6875rem;
    }
    
    .cart-item {
        padding: 10px;
    }
    
    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .payment-btn {
        min-height: 60px;
        padding: 10px 6px;
    }
    
    /* Toast Mobile */
    .toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
    }
    
    .toast {
        width: 100%;
        max-width: none;
    }
    
    /* ===== Responsive Tables - Card Layout ===== */
    .table-container {
        overflow-x: visible;
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    .data-table {
        min-width: unset;
        display: block;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .data-table tr {
        display: flex;
        flex-direction: column;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 16px;
        gap: 8px;
    }
    
    .data-table tr:hover {
        background: var(--bg-card);
    }
    
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid var(--border-light);
        font-size: 0.9rem;
    }
    
    .data-table td:last-child {
        border-bottom: none;
        padding-top: 12px;
        justify-content: flex-end;
    }
    
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 16px;
    }
    
    .data-table td:last-child::before {
        display: none;
    }
    
    .data-table .actions {
        justify-content: flex-end;
        width: 100%;
    }
    
    /* Card header area for mobile */
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .card-header .card-title {
        font-size: 1rem;
    }
    
    /* Filter/Search responsivo */
    .filter-row,
    .search-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-row .form-select,
    .filter-row .form-input,
    .search-row .form-input {
        width: 100% !important;
    }
    
    .input-group {
        width: 100%;
    }
}

/* ==================== Responsive - Small Mobile ==================== */

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 14px 16px;
    }
    
    .stat-header {
        margin-bottom: 0;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-card {
        padding: 10px 8px;
    }
    
    .product-card-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .payment-methods {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .payment-btn {
        min-height: 50px;
        padding: 8px 4px;
        font-size: 0.625rem;
        gap: 4px;
    }
    
    .payment-btn i {
        font-size: 16px;
    }
    
    .checkout-btn {
        padding: 14px;
        font-size: 1rem;
    }
}

/* ==================== Touch Improvements ==================== */

@media (hover: none) and (pointer: coarse) {
    .data-table tr:hover {
        background: transparent;
    }
    
    .data-table tr:active {
        background: var(--bg-body);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
}

/* ==================== Safe Area ==================== */

@supports (padding: max(0px)) {
    .main-content {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    .sidebar {
        padding-left: max(20px, env(safe-area-inset-left));
    }
    
    .modal-footer {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .cart-footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* ==================== Scrollbar ==================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
