/* ============================================
   GestionPro - Modern Design System v2
   ============================================ */

/* === CSS Variables === */
:root {
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #3730A3;
    --primary-50: rgba(79,70,229,0.06);
    --primary-100: rgba(79,70,229,0.12);
    --secondary: #0EA5E9;
    --accent: #F59E0B;
    --accent-light: #FBBF24;
    --success: #10B981;
    --success-light: #34D399;
    --danger: #EF4444;
    --danger-light: #F87171;
    --warning: #F59E0B;
    --info: #0EA5E9;
    --bg: #F8FAFC;
    --bg-subtle: #F1F5F9;
    --surface: #FFFFFF;
    --surface-hover: #F8FAFC;
    --text: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 16px -4px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 40px -8px rgba(0,0,0,0.12);
    --shadow-xl: 0 24px 50px -12px rgba(0,0,0,0.18);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --sidebar-width: 264px;
    --header-height: 64px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="dark"] {
    --primary: #818CF8;
    --primary-light: #A5B4FC;
    --primary-dark: #6366F1;
    --primary-50: rgba(129,140,248,0.08);
    --primary-100: rgba(129,140,248,0.15);
    --secondary: #38BDF8;
    --accent: #FBBF24;
    --success: #34D399;
    --danger: #F87171;
    --warning: #FBBF24;
    --info: #38BDF8;
    --bg: #0F172A;
    --bg-subtle: #1E293B;
    --surface: #1E293B;
    --surface-hover: #334155;
    --text: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border: #334155;
    --border-light: #1E293B;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 16px -4px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 40px -8px rgba(0,0,0,0.5);
    --shadow-xl: 0 24px 50px -12px rgba(0,0,0,0.6);
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

::selection {
    background: var(--primary-100);
    color: var(--primary-dark);
}

/* === 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); }

/* === Layout === */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.sidebar-brand .logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.sidebar-brand h1 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--text);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 12px 14px 6px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 1px;
    position: relative;
}

.nav-item:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
    line-height: 1.4;
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    bottom: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.sidebar-user:hover {
    background: var(--bg-subtle);
}

.sidebar-user .avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
}

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

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

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

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

/* === Header === */
.header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.85);
}

[data-theme="dark"] .header {
    background: rgba(30,41,59,0.85);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-menu-toggle:hover {
    background: var(--bg-subtle);
}

/* === Page Content === */
.page-content {
    flex: 1;
    padding: 28px;
}

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

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

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    font-size: 16px;
}

.card-body {
    padding: 22px;
}

.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* === KPI Cards === */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: var(--transition);
}

.kpi-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    border-color: var(--primary-100);
}

.kpi-card:hover::after {
    background: var(--primary);
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.kpi-icon.blue { background: rgba(14,165,233,0.1); color: var(--secondary); }
.kpi-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.kpi-icon.orange { background: rgba(245,158,11,0.1); color: var(--accent); }
.kpi-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }
.kpi-icon.purple { background: rgba(139,92,246,0.1); color: #8B5CF6; }

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

.kpi-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kpi-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    font-family: var(--font-mono);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.kpi-change {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 600;
}

.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: var(--transition);
    font-family: var(--font);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(79,70,229,0.3);
}
.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79,70,229,0.35);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg-subtle);
    color: var(--text);
    border-color: var(--text-muted);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
    box-shadow: 0 1px 3px rgba(16,185,129,0.3);
}
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    box-shadow: 0 1px 3px rgba(239,68,68,0.3);
}
.btn-danger:hover { background: #DC2626; border-color: #DC2626; color: #fff; }

.btn-warning {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 1px 3px rgba(245,158,11,0.3);
}
.btn-warning:hover { background: #D97706; border-color: #D97706; color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); box-shadow: none; transform: none; }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; justify-content: center; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 4px; }

.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

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

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

.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: var(--transition);
    font-family: var(--font);
}

.form-control:hover {
    border-color: var(--text-muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

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

.form-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
}

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

.form-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

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

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

.table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.table tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    vertical-align: middle;
    color: var(--text);
}

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

.table tbody tr:hover {
    background: var(--primary-50);
}

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

.table .text-right { text-align: right; }
.table .text-center { text-align: center; }
.table .text-mono { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; }

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.badge-success { background: rgba(16,185,129,0.1); color: var(--success); }
.badge-danger { background: rgba(239,68,68,0.1); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,0.1); color: var(--accent); }
.badge-info { background: rgba(14,165,233,0.1); color: var(--info); }
.badge-secondary { background: var(--bg-subtle); color: var(--text-muted); }
.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-vip { background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff; }

/* === Modals === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-subtle);
    color: var(--text);
}

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

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { transform: scale(0.95) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 420px;
    backdrop-filter: blur(8px);
}

.toast-success { background: linear-gradient(135deg, #10B981, #059669); }
.toast-error { background: linear-gradient(135deg, #EF4444, #DC2626); }
.toast-warning { background: linear-gradient(135deg, #F59E0B, #D97706); }
.toast-info { background: linear-gradient(135deg, #0EA5E9, #0284C7); }

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

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    justify-content: center;
}

.pagination a, .pagination span {
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition);
    background: var(--surface);
}

.pagination a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(79,70,229,0.3);
}

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(79,70,229,0.3);
}

/* === Toolbar === */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-search {
    position: relative;
    flex: 1;
    max-width: 380px;
}

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

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

.toolbar-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 44px;
    margin-bottom: 16px;
    opacity: 0.3;
    color: var(--text-muted);
}

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

.empty-state p { font-size: 13px; margin-bottom: 20px; }

/* === POS === */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - var(--header-height) - 56px);
}

.pos-products {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding: 4px;
    flex: 1;
}

.pos-product-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

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

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

.pos-product-card .name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    color: var(--text);
}

.pos-product-card .price {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary);
    font-size: 13px;
}

.pos-product-card .stock {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.pos-cart {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.pos-cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    color: var(--text);
}

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

.pos-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.pos-cart-item:hover { background: var(--bg-subtle); }

.pos-cart-item .item-info { flex: 1; min-width: 0; }
.pos-cart-item .item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.pos-cart-item .item-price { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

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

.pos-cart-item .qty-btn {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    transition: var(--transition);
}

.pos-cart-item .qty-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

.pos-cart-item .qty-value {
    font-family: var(--font-mono);
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    font-size: 13px;
}

.pos-cart-item .item-total {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    min-width: 80px;
    text-align: right;
    color: var(--text);
}

.pos-cart-item .remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    opacity: 0.5;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.pos-cart-item .remove-btn:hover { opacity: 1; background: rgba(239,68,68,0.08); }

.pos-cart-totals {
    padding: 16px 20px;
    border-top: 2px solid var(--border);
    background: var(--bg);
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.pos-total-row.grand-total {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    padding-top: 10px;
    margin-top: 8px;
    border-top: 2px solid var(--border);
}

.pos-total-row .amount { font-family: var(--font-mono); font-weight: 700; }

.pos-actions {
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pos-actions .btn { justify-content: center; padding: 12px; font-size: 13px; }
.pos-actions .btn-pay { grid-column: 1 / -1; font-size: 15px; padding: 14px; }

/* === Utilities === */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--accent) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-mono { font-family: var(--font-mono); }
.fw-bold { font-weight: 700 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.hidden, .d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-grid { display: grid !important; }
.flex-column { flex-direction: column; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-0 { gap: 0; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }
.mb-4 { margin-bottom: 32px !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-4 { margin-top: 32px !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }
.pl-0 { padding-left: 0 !important; }
.pr-0 { padding-right: 0 !important; }
.w-auto { width: auto !important; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.position-relative { position: relative; }
.cursor-pointer { cursor: pointer; }
.overflow-auto { overflow: auto; }
.nowrap { white-space: nowrap; }

/* === Language toggle === */
.lang-toggle {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
}
.lang-toggle a {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-muted);
}
.lang-toggle a.active {
    background: var(--primary);
    color: #fff;
}

/* === Trial banner === */
.trial-banner {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border: 1px solid #F59E0B;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.trial-banner .icon { font-size: 22px; color: #D97706; }
.trial-banner .title { font-weight: 700; color: #92400E; font-size: 14px; }
.trial-banner .subtitle { font-size: 12px; color: #78350F; margin-top: 2px; }
.trial-banner .cta {
    background: #D97706;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

/* === Page header (generic view head: title + toolbar actions) === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-header h1, .page-header h2, .page-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}
.page-header .page-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* === Stats Grid === */
.stats-list { list-style: none; }
.stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}
.stats-list li:last-child { border-bottom: none; }
.stats-list .label { color: var(--text-muted); font-weight: 500; }
.stats-list .value { font-weight: 600; font-family: var(--font-mono); color: var(--text); font-size: 13px; }

/* === Tabs === */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    gap: 0;
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

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

/* === Responsive === */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .btn-menu-toggle { display: block; }
    .pos-layout { grid-template-columns: 1fr; height: auto; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .page-content { padding: 16px; }
    .header { padding: 0 16px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-search { max-width: 100%; }
    .card-header { padding: 14px 16px; }
    .card-body { padding: 16px; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .kpi-card { padding: 16px; }
}

/* === Entrance Animations === */
.kpi-card,
.card {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.kpi-card.visible,
.card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger cards */
.kpi-grid .kpi-card:nth-child(2) { transition-delay: 0.05s; }
.kpi-grid .kpi-card:nth-child(3) { transition-delay: 0.1s; }
.kpi-grid .kpi-card:nth-child(4) { transition-delay: 0.15s; }

/* === Print === */
@media print {
    .sidebar, .header, .toolbar, .btn, .pagination, .toast-container { display: none !important; }
    .main-content { margin-left: 0; }
    .page-content { padding: 0; }
    .card { border: none; box-shadow: none; opacity: 1; transform: none; }
    .kpi-card { opacity: 1; transform: none; }
    .table tbody tr:hover { background: transparent; }
}
