/* PetBook - Design System v2.0 - Indigo Theme */
:root {
    /* Primary Palette */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4338CA;
    --primary-subtle: #F5F3FF;

    /* Background & Surface */
    --background: #FFFFFF;
    --surface: #F8FAFC;
    --main-bg: #F8FAFC;
    --card-bg: #FFFFFF;

    /* Border */
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;

    /* Text */
    --text-heading: #0F172A;
    --text-body: #0F172A;
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    /* Status Colors */
    --success: #10B981;
    --success-subtle: #ECFDF5;
    --warning: #F59E0B;
    --warning-subtle: #FFFBEB;
    --danger: #EF4444;
    --danger-subtle: #FEF2F2;
    --info: #06B6D4;

    /* Legacy mappings for compatibility */
    --primary-pink: #6366F1;
    --primary-purple: #6366F1;
    --gradient-primary: linear-gradient(135deg, #6366F1, #818CF8);
    --sidebar-bg: #FFFFFF;
    --sidebar-active-bg: #F5F3FF;
    --sidebar-text: #0F172A;
    --accent-pink: #818CF8;
    --accent-purple: #6366F1;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;

    /* Shadows */
    --shadow-card: 0 4px 6px -1px rgba(99,102,241,0.08);
    --shadow-modal: 0 20px 25px -5px rgba(0,0,0,0.1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);

    /* Radius */
    --radius-card: 16px;
    --radius-button: 12px;
    --radius-input: 8px;
    --radius-badge: 6px;
}

/* Dark Theme Variables - PetBook Premium Dark */
html[data-theme="dark"] {
    /* Primary Palette - Brand Purple */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;
    --primary-subtle: rgba(99, 102, 241, 0.15);

    /* Background & Surface - Dark Navy Deep */
    --background: #0B0F19;
    --surface: #111827;
    --main-bg: #0B0F19;
    --card-bg: #1E293B;

    /* Border */
    --border-color: #334155;
    --border-light: #334155;

    /* Text */
    --text-heading: #F8FAFC;
    --text-body: #CBD5E1;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #94A3B8;

    /* Status Colors - Emerald Accent */
    --success: #10B981;
    --success-subtle: rgba(16, 185, 129, 0.15);
    --warning: #F59E0B;
    --warning-subtle: rgba(245, 158, 11, 0.15);
    --danger: #EF4444;
    --danger-subtle: rgba(239, 68, 68, 0.15);
    --info: #06B6D4;

    /* Legacy mappings */
    --primary-pink: #818CF8;
    --primary-purple: #6366F1;
    --gradient-primary: linear-gradient(135deg, #6366F1, #818CF8);
    --sidebar-bg: #111827;
    --sidebar-active-bg: rgba(99, 102, 241, 0.1);
    --sidebar-text: #F8FAFC;
    --accent-pink: #818CF8;
    --accent-purple: #6366F1;

    /* Shadows - Deep floating */
    --shadow-card: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-modal: 0 20px 25px -5px rgba(0,0,0,0.5);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366F1 0%, #818CF8 50%, #A78BFA 100%);
}

.login-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 420px;
}

.logo { text-align: center; margin-bottom: 24px; }
.logo i { font-size: 48px; color: var(--primary); }
.logo h1 { font-size: 28px; margin-top: 10px; color: var(--text-heading); }
.logo p { color: var(--text-secondary); margin-bottom: 6px; font-size: 14px; }
.logo-img { max-width: 180px; height: auto; display: block; margin: 0 auto 12px; }

.login-form { display: none; }
.login-form.active { display: block; }

/* Theme Toggle */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--primary-subtle);
    color: var(--primary);
    border-color: var(--primary-light);
}

/* Dark mode specific overrides - PetBook Premium Dark */
html[data-theme="dark"] body {
    background: var(--background);
    color: var(--text-body);
}

html[data-theme="dark"] .login-container {
    background: linear-gradient(135deg, #312E81 0%, #4338CA 50%, #0B0F19 100%);
}

/* Sidebar */
html[data-theme="dark"] .sidebar {
    background: var(--sidebar-bg);
    border-right-color: var(--border-color);
}

html[data-theme="dark"] .sidebar-header {
    border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .sidebar-nav a {
    color: var(--text-secondary);
}

html[data-theme="dark"] .sidebar-nav a i {
    color: #94A3B8;
}

html[data-theme="dark"] .sidebar-nav a:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #818CF8;
}

html[data-theme="dark"] .sidebar-nav a:hover i {
    color: #818CF8;
}

html[data-theme="dark"] .sidebar-nav a.active {
    background: rgba(99, 102, 241, 0.1);
    color: #818CF8;
    border-left: 3px solid #6366F1;
}

html[data-theme="dark"] .sidebar-nav a.active i {
    color: #818CF8;
}

html[data-theme="dark"] .sidebar-help {
    background: var(--success-subtle);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

html[data-theme="dark"] .sidebar-help:hover {
    background: rgba(16, 185, 129, 0.25);
    color: #34D399;
}

html[data-theme="dark"] .sidebar-promo {
    background: var(--primary-subtle);
    border-color: rgba(129, 140, 248, 0.2);
}

/* Cards - glassmorphism + floating */
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .rev-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .report-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

html[data-theme="dark"] .stat-card:hover,
html[data-theme="dark"] .rev-card:hover,
html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .chart-card:hover,
html[data-theme="dark"] .report-item:hover {
    transform: translateY(-3px);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 12px 24px -4px rgba(0,0,0,0.5), 0 0 20px rgba(16, 185, 129, 0.08);
}

html[data-theme="dark"] .stat-card:hover .stat-info h3,
html[data-theme="dark"] .report-item:hover strong {
    color: #F8FAFC;
}

html[data-theme="dark"] .stat-info h3 {
    color: #F8FAFC;
}

html[data-theme="dark"] .stat-info p {
    color: #94A3B8;
}

/* Report cards - accent emerald bottom glow for profit */
html[data-theme="dark"] .report-item.profit-positive,
html[data-theme="dark"] .report-item:nth-child(3),
html[data-theme="dark"] .report-item:nth-child(4) {
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #6366F1, #10B981) 1;
    border-image-slice: 0 0 2 0;
}

html[data-theme="dark"] .report-item strong {
    color: #F8FAFC;
}

html[data-theme="dark"] .report-item span {
    color: #94A3B8;
}

/* Tables */
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table td {
    border-color: var(--border-color);
}

html[data-theme="dark"] .table th {
    background: var(--surface);
    color: var(--text-heading);
}

html[data-theme="dark"] .table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* Modal */
html[data-theme="dark"] .modal {
    background: rgba(11, 15, 25, 0.85);
}

html[data-theme="dark"] .modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
}

html[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
    color: var(--text-heading);
}

html[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}

/* Form controls - rounded-xl + purple focus */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: var(--surface);
    border-color: var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    border-color: #6366F1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

html[data-theme="dark"] .form-control::placeholder {
    color: #64748B;
}

/* Buttons */
html[data-theme="dark"] .btn-primary {
    background: #6366F1;
    color: #fff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    border: none;
}

html[data-theme="dark"] .btn-primary:hover {
    background: #4F46E5;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

html[data-theme="dark"] .btn-outline-primary {
    background: transparent;
    border-color: #6366F1;
    color: #818CF8;
}

html[data-theme="dark"] .btn-outline-primary:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
    border-color: #6366F1;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

html[data-theme="dark"] .btn-outline-secondary {
    background: transparent;
    border-color: #475569;
    color: #94A3B8;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
    background: rgba(71, 85, 105, 0.3);
    color: #F8FAFC;
    border-color: #64748B;
}

html[data-theme="dark"] .btn-outline-danger {
    border-color: var(--danger);
    color: var(--danger);
}

html[data-theme="dark"] .btn-outline-danger:hover {
    background: var(--danger);
    color: #fff;
}

/* Badges */
html[data-theme="dark"] .badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

html[data-theme="dark"] .badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

html[data-theme="dark"] .badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

html[data-theme="dark"] .badge-info {
    background: rgba(6, 182, 212, 0.15);
    color: #22D3EE;
    border: 1px solid rgba(6, 182, 212, 0.25);
}

html[data-theme="dark"] .badge-primary {
    background: rgba(99, 102, 241, 0.15);
    color: #818CF8;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

html[data-theme="dark"] .badge-secondary {
    background: rgba(30, 41, 59, 0.5);
    color: #94A3B8;
    border: 1px solid #475569;
}

/* Chart card header */
html[data-theme="dark"] .chart-card .card-header {
    background: transparent;
    border-bottom-color: var(--border-color);
    color: var(--text-heading);
}

html[data-theme="dark"] .chart-card .card-header i {
    color: #818CF8;
}

/* Status dots */
html[data-theme="dark"] .status-dot.success { background: #10B981; box-shadow: 0 0 6px rgba(16,185,129,0.4); }
html[data-theme="dark"] .status-dot.primary { background: #6366F1; box-shadow: 0 0 6px rgba(99,102,241,0.4); }

/* Sidebar logo */
.sidebar-header .logo-img { max-height: 64px; width: auto; object-fit: contain; display: block; margin: 0 auto; }
.sidebar.collapsed .sidebar-header .logo-img { max-height: 56px; padding: 4px 0; }

.receipt-logo { max-width: 140px; height: auto; display: block; margin: 0 auto 6px auto; }

/* ============================================
   LAYOUT - SIDEBAR & MAIN
   ============================================ */
#main-app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
    position: fixed;
    height: 100vh;
    z-index: 100;
    border-right: 1px solid var(--border-color);
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-nav a span { display: none; }
.sidebar.collapsed .sidebar-header span { display: none; }
.sidebar.collapsed .sidebar-help,
.sidebar.collapsed .sidebar-promo { display: none; }

.sidebar-header {
    padding: 28px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-header i { font-size: 24px; color: var(--primary); }

.sidebar-nav {
    flex: 1;
    padding: 15px 10px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 3px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.sidebar-nav a:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}

.sidebar-nav a:hover i {
    color: var(--primary);
}

.sidebar-nav a.active {
    background: var(--primary-subtle);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    margin-left: -3px;
    border-radius: 0 10px 10px 0;
}

.sidebar-nav a.active i {
    color: var(--primary);
}

.sidebar-footer { 
    padding: 15px; 
    border-top: 1px solid var(--border-light); 
}

.sidebar-footer .btn {
    width: 100%;
    justify-content: center;
}

.sidebar-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    margin-top: 12px;
    border-radius: var(--radius-button);
    background: var(--success-subtle);
    color: #065F46;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-help:hover {
    background: #D1FAE5;
    color: #047857;
}

.sidebar-promo {
    margin-top: 12px;
    padding: 12px;
    background: var(--primary-subtle);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: var(--radius-button);
    text-align: center;
}

.sidebar-promo .promo-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.sidebar-promo p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s;
    background: var(--background);
}

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

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    background: var(--card-bg);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border-light);
}

.topbar-title { 
    flex: 1; 
    font-size: 24px; 
    font-weight: 700; 
    color: var(--text-heading);
    letter-spacing: -0.3px;
}

.topbar-user { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    color: var(--text-secondary); 
    font-size: 13px;
    font-weight: 500;
}

.topbar-user i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 9999px;
    font-size: 12px;
}

.header-clock {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-subtle);
    padding: 6px 14px;
    border-radius: 20px;
    margin-left: auto;
}

.header-clock i {
    font-size: 12px;
}

/* ============================================
   CONTENT
   ============================================ */
.content-wrapper { padding: 24px; }

.content-page { animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--text-heading);
}

.card-header i {
    color: var(--primary);
}

.card-body { padding: 20px; }

/* ============================================
   STATS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 80px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(99,102,241,0.12);
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover .stat-icon {
    transform: scale(1.05);
}

.stat-card.clickable .stat-icon {
    transition: transform 0.2s;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.bg-blue { background: linear-gradient(135deg, #6366F1, #818CF8); }
.bg-red { background: linear-gradient(135deg, #EF4444, #F87171); }
.bg-green { background: linear-gradient(135deg, #10B981, #34D399); }
.bg-orange { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.bg-purple { background: linear-gradient(135deg, #8B5CF6, #A78BFA); }
.bg-teal { background: linear-gradient(135deg, #06B6D4, #22D3EE); }

.stat-info h3 { 
    font-size: 22px; 
    font-weight: 700;
    margin-bottom: 2px; 
    color: var(--text-heading);
    letter-spacing: -0.5px;
}

.stat-info p { 
    color: var(--text-secondary); 
    font-size: 13px; 
    font-weight: 500;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.stat-change.up {
    color: var(--success);
}

.stat-change.down {
    color: var(--danger);
}

/* Revenue Breakdown */
.revenue-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.rev-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.rev-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.rev-klinik .rev-icon { background: linear-gradient(135deg, #6366F1, #818CF8); }
.rev-petshop .rev-icon { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.rev-petcare .rev-icon { background: linear-gradient(135deg, #10B981, #34D399); }

.rev-info h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-heading);
}

.rev-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.rev-info p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Dashboard Chart */
.chart-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.chart-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
}

.chart-card .card-header i {
    color: var(--primary);
    margin-right: 8px;
}

.chart-card .card-body {
    flex: 1;
    min-height: 280px;
    max-height: 320px;
    padding: 12px 8px 8px 4px;
}

#projection-chart {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================
   TABLES
   ============================================ */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { 
    padding: 12px 16px; 
    text-align: left; 
    border-bottom: 1px solid var(--border-light); 
}
.table th { 
    font-weight: 600; 
    background: var(--surface); 
    font-size: 11px; 
    text-transform: uppercase; 
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.table tbody tr:hover { background: var(--surface); }
.table tbody tr { transition: background 0.15s; }
.table-sm th, .table-sm td { padding: 8px 12px; font-size: 13px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-button);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary { 
    background: var(--primary); 
    color: white; 
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}
.btn-primary:hover { 
    background: var(--primary-dark); 
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99,102,241,0.35);
}

.btn-success { 
    background: var(--success); 
    color: white; 
    box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}
.btn-success:hover { 
    background: #059669; 
    transform: translateY(-1px);
}

.btn-danger { 
    background: var(--danger); 
    color: white; 
    box-shadow: 0 4px 12px rgba(239,68,68,0.25);
}
.btn-danger:hover { 
    background: #DC2626; 
    transform: translateY(-1px);
}

.btn-warning { 
    background: var(--warning); 
    color: white; 
    box-shadow: 0 4px 12px rgba(245,158,11,0.25);
}
.btn-warning:hover { 
    background: #D97706; 
    transform: translateY(-1px);
}

.btn-secondary { 
    background: var(--surface); 
    color: var(--text-secondary); 
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { 
    background: var(--border-light); 
    color: var(--text-primary);
}

.btn-outline-primary { 
    background: transparent; 
    border: 1.5px solid var(--primary); 
    color: var(--primary); 
}
.btn-outline-primary:hover { 
    background: var(--primary-subtle); 
    color: var(--primary-dark);
}

.btn-outline-danger { 
    background: transparent; 
    border: 1.5px solid var(--danger); 
    color: var(--danger); 
}
.btn-outline-danger:hover { 
    background: var(--danger-subtle); 
}

.btn-outline-secondary {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline-secondary:hover {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 8px; background: transparent; color: var(--text-secondary); border-radius: 8px; }
.btn-icon:hover { background: var(--surface); color: var(--text-primary); }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-group label { 
    display: block; 
    margin-bottom: 6px; 
    font-weight: 500; 
    font-size: 14px; 
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-input);
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--card-bg);
}

.form-control:focus { 
    outline: none; 
    border-color: var(--primary-light); 
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}

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

select.form-control {
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-badge);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: var(--success-subtle); color: #065F46; }
.badge-danger { background: var(--danger-subtle); color: #991B1B; }
.badge-warning { background: var(--warning-subtle); color: #92400E; }
.badge-info { background: #E0F2FE; color: #075985; }
.badge-primary { background: var(--primary-subtle); color: var(--primary-dark); }
.badge-secondary { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border-color); }

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    display: inline-block;
}
.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.danger { background: var(--danger); }
.status-dot.primary { background: var(--primary); }
.status-dot.secondary { background: var(--text-muted); }

/* ============================================
   AVATAR
   ============================================ */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

.avatar-gradient-1 { background: linear-gradient(135deg, #6366F1, #818CF8); }
.avatar-gradient-2 { background: linear-gradient(135deg, #8B5CF6, #A78BFA); }
.avatar-gradient-3 { background: linear-gradient(135deg, #EC4899, #F472B6); }
.avatar-gradient-4 { background: linear-gradient(135deg, #10B981, #34D399); }
.avatar-gradient-5 { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.avatar-gradient-6 { background: linear-gradient(135deg, #06B6D4, #22D3EE); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border-light);
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-body { padding: 20px 24px; }

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

.btn-close { 
    background: none; 
    border: none; 
    font-size: 24px; 
    cursor: pointer; 
    color: var(--text-muted); 
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-close:hover {
    background: var(--surface);
    color: var(--text-primary);
}

/* ============================================
   TOAST
   ============================================ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--card-bg);
    padding: 14px 18px;
    border-radius: var(--radius-input);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s;
    min-width: 280px;
    border: 1px solid var(--border-light);
    font-size: 13px;
}

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

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

/* ============================================
   POS
   ============================================ */
.pos-type-selector { display: flex; gap: 10px; }
.pos-type-btn { 
    flex: 1; 
    padding: 14px; 
    font-size: 14px; 
    font-weight: 600;
    border-radius: var(--radius-button);
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pos-type-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}
.pos-type-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}

.pos-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 60vh;
    overflow-y: auto;
}

.pos-item {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.pos-item:hover { 
    border-color: var(--primary-light); 
    box-shadow: 0 4px 12px rgba(99,102,241,0.12);
    transform: translateY(-2px);
}

.pos-item-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pos-item-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 28px;
}

.pos-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding: 0 2px;
}

.pos-item-name { 
    font-size: 13px; 
    color: var(--text-heading);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.pos-item-price { 
    color: var(--primary); 
    font-weight: 700; 
    font-size: 14px;
    white-space: nowrap;
}

.cart-panel {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 20px;
    border: 1px solid var(--border-light);
}

.cart-items { max-height: 300px; overflow-y: auto; }

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item div:first-child {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-heading);
}

.cart-item small {
    color: var(--text-muted);
    font-size: 12px;
}

.cart-total { 
    font-size: 20px; 
    text-align: right; 
    font-weight: 700;
    color: var(--text-heading);
    padding-top: 12px;
    border-top: 2px solid var(--border-color);
    margin-top: 8px;
}

.payment-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.payment-pill {
    padding: 8px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.payment-pill:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.payment-pill.active {
    border-color: var(--primary);
    background: var(--primary-subtle);
    color: var(--primary-dark);
}

/* ============================================
   UTILITIES
   ============================================ */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.w-50 { width: 50%; }
.row { display: flex; gap: 20px; }
.col-4 { flex: 0 0 33.333%; }
.col-6 { flex: 0 0 50%; }
.col-8 { flex: 0 0 66.666%; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.bg-surface { background: var(--surface); }

/* ============================================
   REPORTS
   ============================================ */
.report-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.report-item {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-card);
    text-align: center;
    border: 1px solid var(--border-light);
}

.report-item span { 
    display: block; 
    color: var(--text-secondary); 
    margin-bottom: 8px; 
    font-size: 13px;
    font-weight: 500;
}

.report-item strong { 
    font-size: 22px; 
    font-weight: 700;
    color: var(--text-heading);
}

.error-message { color: var(--danger); margin-top: 10px; font-size: 13px; }
.branches-info { text-align: center; margin-top: 15px; color: var(--text-secondary); }

/* ============================================
   BRANCH SELECTION
   ============================================ */
.branch-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.branch-card {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.branch-card:hover {
    border-color: var(--primary-light);
    background: var(--card-bg);
    box-shadow: var(--shadow-card);
    transform: translateY(-1px);
}

.branch-card i {
    font-size: 22px;
    color: var(--primary);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-subtle);
    border-radius: 12px;
}

.branch-card-info h4 {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
}

.branch-card-info p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

.branch-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   MEDICAL TIMELINE
   ============================================ */
.contact-medical-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.contact-medical-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.contact-medical-header i {
    font-size: 20px;
    color: var(--primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-subtle);
    border-radius: 10px;
}

.contact-medical-header h4 {
    font-size: 15px;
    margin: 0;
    font-weight: 600;
    color: var(--text-heading);
}

.contact-medical-header small {
    color: var(--text-secondary);
    font-size: 12px;
}

.pet-medical-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pet-medical-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.pet-medical-item:hover {
    background: var(--surface);
    border-color: var(--primary-light);
}

.pet-medical-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pet-medical-info i {
    font-size: 18px;
    color: var(--primary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-subtle);
    border-radius: 8px;
}

.pet-medical-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.pet-medical-meta span {
    margin-right: 12px;
}

.pet-info-banner {
    background: var(--gradient-primary);
    color: white;
    padding: 20px 24px;
    border-radius: var(--radius-card);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.pet-info-banner i {
    font-size: 32px;
    opacity: 0.9;
}

.pet-info-banner h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
}

.pet-info-banner p {
    margin: 0;
    opacity: 0.9;
    font-size: 13px;
}

.medical-timeline {
    position: relative;
    padding-left: 28px;
}

.medical-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.medical-timeline-entry {
    position: relative;
    margin-bottom: 20px;
}

.medical-timeline-entry::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 18px;
    width: 12px;
    height: 12px;
    background: var(--gradient-primary);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

.medical-log-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.medical-log-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.medical-log-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
}

.medical-log-branch {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 3px 10px;
    border-radius: var(--radius-badge);
    font-weight: 500;
}

.medical-log-vitals {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.medical-log-vital {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.medical-log-vital i {
    color: var(--primary);
}

.medical-log-vital strong {
    color: var(--text-heading);
}

.medical-log-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.medical-log-section {
    background: var(--surface);
    border-radius: 8px;
    padding: 12px 14px;
}

.medical-log-section label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.medical-log-section p {
    margin: 0;
    font-size: 13px;
    color: var(--text-body);
    line-height: 1.5;
}

.medical-log-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    justify-content: flex-end;
}

.no-medical-logs {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-medical-logs i {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--border-color);
}

/* ============================================
   RECEIPT PRINT
   ============================================ */
.receipt-paper {
    background: var(--card-bg);
    padding: 20px;
    max-width: 360px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-heading);
}

.receipt-header {
    text-align: center;
    margin-bottom: 12px;
}

.receipt-header h2 {
    font-size: 20px;
    margin: 0 0 4px 0;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--primary);
    font-weight: 700;
}

.receipt-header p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.receipt-divider {
    border-top: 1px dashed var(--border-color);
    margin: 10px 0;
}

.receipt-info p {
    margin: 3px 0;
    display: flex;
    justify-content: space-between;
}

.receipt-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.receipt-items th {
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    padding: 4px 0;
    font-weight: 600;
}

.receipt-items td {
    padding: 4px 0;
    vertical-align: top;
}

.receipt-items td:nth-child(2),
.receipt-items td:nth-child(3),
.receipt-items td:nth-child(4) {
    text-align: right;
    white-space: nowrap;
    padding-left: 8px;
}

.receipt-total {
    text-align: right;
    font-size: 16px;
    padding: 8px 0;
    font-weight: 700;
}

.receipt-footer {
    text-align: center;
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.receipt-footer p {
    margin: 2px 0;
}

@media print {
    body * {
        visibility: hidden;
    }
    #receipt-modal, #receipt-modal * {
        visibility: visible;
    }
    #receipt-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    #receipt-modal .modal-header,
    #receipt-modal .modal-footer {
        display: none !important;
    }
    #receipt-modal .modal-body {
        padding: 0;
    }
    .receipt-paper {
        box-shadow: none;
        max-width: none;
        width: 80mm;
        margin: 0 auto;
    }
}

/* ============================================
   CONTACTS WITH PETS
   ============================================ */
.contact-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.contact-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.contact-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-card-info i {
    font-size: 20px;
    color: var(--primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-subtle);
    border-radius: 10px;
}

.contact-card-info h4 {
    margin: 0 0 2px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
}

.contact-card-info small {
    color: var(--text-secondary);
    font-size: 13px;
}

.contact-card-actions {
    display: flex;
    gap: 6px;
}

.pet-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pet-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.pet-item:hover {
    border-color: var(--primary-light);
}

.pet-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pet-item-info i {
    font-size: 16px;
    color: var(--primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-subtle);
    border-radius: 8px;
}

.pet-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.pet-item-meta span {
    margin-right: 8px;
}

.add-pet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--surface);
    border: 1.5px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.add-pet-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-subtle);
}

/* ============================================
   CALENDAR
   ============================================ */
.calendar-wrap {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

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

.calendar-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar .sidebar-nav a span { display: none; }
    .sidebar .sidebar-header span { display: none; }
    .sidebar-header .logo-img { max-height: 28px; }
    .main-content { margin-left: var(--sidebar-collapsed); }
    .row { flex-direction: column; }
    .col-4, .col-6, .col-8 { flex: 1; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .revenue-breakdown { grid-template-columns: 1fr; }
    .report-grid { grid-template-columns: 1fr; }
    .content-wrapper { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .topbar-title { font-size: 16px; }
    .pos-items-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-card .card-body { min-height: 260px; max-height: 300px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .chart-card .card-body { min-height: 220px; max-height: 260px; }
}

/* ============================================
   WHATSAPP SUPPORT
   ============================================ */
.whatsapp-support {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--success-subtle);
    border-radius: 10px;
    color: #065F46;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    margin-top: 8px;
    transition: all 0.2s;
}

.whatsapp-support:hover {
    background: #D1FAE5;
    transform: translateY(-1px);
}

.whatsapp-support i {
    font-size: 16px;
}

/* ============================================
   BILLING / UPGRADE
   ============================================ */
.billing-card {
    background: linear-gradient(135deg, var(--primary-subtle), #EDE9FE);
    border: 1.5px solid var(--primary-light);
    border-radius: var(--radius-card);
    padding: 20px;
    text-align: center;
}

.billing-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.billing-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.billing-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

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

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

/* Payment Chart - Reports */
.payment-chart { display: flex; flex-direction: column; gap: 10px; }
.payment-chart-item { display: flex; align-items: center; gap: 10px; }
.payment-chart-label { width: 70px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-secondary); }
.payment-chart-bar-wrap { flex: 1; background: var(--border-light); border-radius: 6px; height: 24px; position: relative; overflow: hidden; border: 1px solid var(--border-color); }
.payment-chart-bar { height: 100%; border-radius: 6px; transition: width 0.4s ease; }
.payment-chart-bar.qris { background: linear-gradient(90deg, #6366F1, #818CF8); }
.payment-chart-bar.transfer { background: linear-gradient(90deg, #10B981, #34D399); }
.payment-chart-bar.cash { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.payment-chart-pct { width: 45px; font-size: 12px; text-align: right; font-weight: 600; color: var(--text-secondary); }
.payment-chart-amount { width: 100px; font-size: 12px; text-align: right; font-weight: 700; color: var(--text-heading); }

/* Dark mode payment chart */
html[data-theme="dark"] .payment-chart-bar-wrap { background: rgba(51, 65, 85, 0.4); border-color: #475569; }
html[data-theme="dark"] .payment-chart-label { color: #94A3B8; }
html[data-theme="dark"] .payment-chart-pct { color: #94A3B8; }
html[data-theme="dark"] .payment-chart-amount { color: #F8FAFC; }

/* Dark mode report profit accent */
html[data-theme="dark"] .report-item:nth-child(3) strong,
html[data-theme="dark"] .report-item:nth-child(4) strong {
    color: #F8FAFC;
    position: relative;
    display: inline-block;
}

html[data-theme="dark"] .report-item:nth-child(3) strong::after,
html[data-theme="dark"] .report-item:nth-child(4) strong::after {
    content: ' ↑';
    color: #10B981;
    font-size: 0.75em;
    margin-left: 4px;
}

html[data-theme="dark"] .report-item:nth-child(3),
html[data-theme="dark"] .report-item:nth-child(4) {
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #6366F1, #10B981) 1;
    border-image-slice: 0 0 2 0;
    box-shadow: inset 0 -8px 20px rgba(16, 185, 129, 0.06);
}

/* Dark mode breakdown rows */
html[data-theme="dark"] #report-pos-breakdown .d-flex,
html[data-theme="dark"] #report-expenses-breakdown .d-flex,
html[data-theme="dark"] #report-payment-breakdown .d-flex {
    padding: 6px 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

html[data-theme="dark"] #report-pos-breakdown .d-flex:last-child,
html[data-theme="dark"] #report-expenses-breakdown .d-flex:last-child,
html[data-theme="dark"] #report-payment-breakdown .d-flex:last-child {
    border-bottom: none;
}

html[data-theme="dark"] #report-pos-breakdown span,
html[data-theme="dark"] #report-expenses-breakdown span,
html[data-theme="dark"] #report-payment-breakdown span {
    color: #94A3B8;
    text-transform: capitalize;
    font-size: 13px;
}

html[data-theme="dark"] #report-pos-breakdown strong,
html[data-theme="dark"] #report-expenses-breakdown strong,
html[data-theme="dark"] #report-payment-breakdown strong {
    color: #F8FAFC;
    font-weight: 600;
    font-size: 13px;
}

/* ============================================
   INVENTORY - PRODUCT THUMBNAIL (50% smaller)
   ============================================ */
.product-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.product-thumb-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
}
