/* ═══════════════════════════════════════════════════════════
   SalesIQ — Premium Dark Dashboard Theme
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables ───────────────────────────────────────── */
:root {
    /* Backgrounds — Enterprise Formal Dark Slate (Opsi 4) */
    --bg-root:          #0b0f19;
    --bg-primary:       #0f172a;
    --bg-secondary:     #1e293b;
    --bg-card:          #1e293b;
    --bg-card-solid:    #1e293b;
    --bg-card-hover:    #24334a;
    --bg-input:         #0f172a;
    --bg-sidebar:       #0a0f1d;

    /* Borders — Crisp Solid Slate Borders (No Neon Glow) */
    --border:           #2b374e;
    --border-hover:     #3e4f6e;
    --border-active:    #2563eb;

    /* Text */
    --text-primary:     #f8fafc;
    --text-secondary:   #94a3b8;
    --text-muted:       #64748b;
    --text-inverse:     #0f172a;

    /* Accent Colors — Corporate Royal Blue (Dark Mode Synced) */
    --accent:           #2563eb;
    --accent-hover:     #3b82f6;
    --accent-text:      #60a5fa;
    --accent-muted:     rgba(59, 130, 246, 0.16);
    --accent-gradient:  linear-gradient(135deg, #1e40af 0%, #2563eb 100%);

    /* Semantic (Dark Slate Contrast Safe) */
    --success:          #34d399;
    --success-bg:       rgba(16, 185, 129, 0.14);
    --warning:          #fbbf24;
    --warning-bg:       rgba(245, 158, 11, 0.14);
    --danger:           #f87171;
    --danger-bg:        rgba(239, 68, 68, 0.14);
    --info:             #38bdf8;
    --info-bg:          rgba(14, 165, 233, 0.14);

    /* KPI Card Icon Colors */
    --kpi-blue:         #60a5fa;
    --kpi-blue-bg:      rgba(59, 130, 246, 0.15);
    --kpi-emerald:      #34d399;
    --kpi-emerald-bg:   rgba(16, 185, 129, 0.15);
    --kpi-amber:        #fbbf24;
    --kpi-amber-bg:     rgba(245, 158, 11, 0.15);
    --kpi-rose:         #f87171;
    --kpi-rose-bg:      rgba(239, 68, 68, 0.15);

    /* Layout */
    --sidebar-w:        260px;
    --sidebar-collapsed: 72px;
    --header-h:         72px;

    /* Radii */
    --r-sm:  8px;
    --r-md:  10px;
    --r-lg:  14px;
    --r-xl:  16px;
    --r-full: 9999px;

    /* Shadows */
    --shadow-sm:   0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md:   0 4px 12px rgba(15, 23, 42, 0.12);
    --shadow-lg:   0 10px 24px rgba(15, 23, 42, 0.15);
    --shadow-glow: none;

    /* Transitions */
    --t-fast:  150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base:  250ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow:  400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Chart Colors — Corporate Financial & Sales Palette */
    --chart-1:  #3b82f6;
    --chart-2:  #0ea5e9;
    --chart-3:  #16a34a;
    --chart-4:  #d97706;
    --chart-5:  #64748b;
    --chart-6:  #0284c7;
    --chart-7:  #059669;
    --chart-8:  #334155;
}

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

html {
    font-size: 14px;
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-root);
    color: var(--text-primary);
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(37, 99, 235, 0.5); }

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--t-base);
}

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

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

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-muted);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.logo-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-tag {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    padding: 12px 12px 8px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--t-fast);
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.nav-item.active {
    color: var(--accent-text);
    background: var(--accent-muted);
}

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

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--r-full);
    text-transform: uppercase;
}

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

.sidebar-footer-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-badge {
    padding: 3px 10px;
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--accent-muted);
    color: var(--accent-text);
    border-radius: var(--r-full);
}

.powered-by {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base);
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ─── Main Content ────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
    overflow: hidden;
    min-width: 0;
    transition: margin-left var(--t-base);
}

/* ─── Header ──────────────────────────────────────────────── */
.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: var(--header-h);
    height: auto;
    background: rgba(11, 15, 26, 0.92);
    backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 8px 20px;
    gap: 10px 14px;
}

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

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast);
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(255,255,255,0.04);
}

.header-title-group {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}

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

.date-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 4px;
}

.date-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    color: var(--text-muted);
}

.date-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    padding: 6px 0;
    outline: none;
    width: 130px;
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
}

.date-separator {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-full);
    background: var(--success-bg);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--success);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 2s infinite;
}

.header-status.error {
    background: var(--danger-bg);
    color: var(--danger);
}

.header-status.error .status-dot {
    background: var(--danger);
    animation: none;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, filter 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(0.985);
}

.btn-primary {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
    border-color: #1e40af;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 55%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.btn-sm { padding: 6px 14px; font-size: 0.78rem; }

.btn-ai-generate {
    padding: 13px 28px;
    font-size: 0.96rem;
    font-weight: 700;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
    color: #ffffff;
    border: 1px solid #1e40af;
    border-radius: var(--r-lg);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-ai-generate:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 55%, #1e40af 100%);
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-ai-generate:active {
    transform: translateY(0) scale(0.985);
}

.btn-ai-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.chart-btn {
    padding: 6px 13px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast);
}

.chart-btn:hover {
    color: var(--text-primary);
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(59, 130, 246, 0.45);
}

.chart-btn.active {
    color: var(--accent-text);
    border-color: var(--accent);
    background: var(--accent-muted);
}

/* ─── Dashboard Scroll ────────────────────────────────────── */
.dashboard-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 28px 40px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.dashboard-section {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.dashboard-section.active {
    display: block;
}

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

/* ─── KPI Grid ────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--t-base);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--t-base);
}

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

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

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

.kpi-icon-blue    { background: var(--kpi-blue-bg);    color: var(--kpi-blue);    }
.kpi-icon-emerald { background: var(--kpi-emerald-bg); color: var(--kpi-emerald); }
.kpi-icon-amber   { background: var(--kpi-amber-bg);   color: var(--kpi-amber);   }
.kpi-icon-rose    { background: var(--kpi-rose-bg);     color: var(--kpi-rose);    }

.kpi-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.kpi-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--success);
}

.kpi-change.negative {
    color: var(--danger);
}

.change-period {
    color: var(--text-muted);
    font-weight: 400;
}

/* ─── Chart Cards ─────────────────────────────────────────── */
.chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all var(--t-base);
}

.chart-card:hover {
    border-color: var(--border-hover);
}

.chart-full-width {
    margin-bottom: 24px;
}

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

.chart-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chart-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.chart-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-body {
    padding: 20px 22px;
    height: 320px;
    position: relative;
}

.chart-body-lg {
    height: 380px;
}

.charts-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

/* ─── Profit Metrics ──────────────────────────────────────── */
.profit-metrics-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    height: 100%;
}

.profit-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    transition: all var(--t-fast);
}

.profit-card:hover {
    background: rgba(255,255,255,0.04);
    border-color: var(--border-hover);
}

.profit-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.profit-value {
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Data Tables ─────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background var(--t-fast);
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.data-table tbody td {
    padding: 12px 16px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.table-loading {
    text-align: center !important;
    color: var(--text-muted) !important;
    padding: 40px 16px !important;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--r-full);
    text-transform: capitalize;
}

.status-completed { background: var(--success-bg); color: var(--success); }
.status-pending   { background: var(--warning-bg); color: var(--warning); }
.status-cancelled { background: var(--danger-bg);  color: var(--danger);  }
.status-returned  { background: var(--info-bg);    color: var(--info);    }

/* Discount suggestion badge */
.discount-badge {
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--r-full);
    background: var(--warning-bg);
    color: var(--warning);
}

/* Pagination */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.page-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast);
}

.page-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.page-btn.active { border-color: var(--accent); color: var(--accent-text); background: var(--accent-muted); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ─── Filter / Search ─────────────────────────────────────── */
.filter-select {
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition: border-color var(--t-fast);
}

.filter-select:focus { border-color: var(--accent); }

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-input);
    color: var(--text-muted);
    transition: border-color var(--t-fast);
}

.search-box:focus-within { border-color: var(--accent); }

.search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.78rem;
    padding: 7px 0;
    outline: none;
    width: 160px;
}

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

/* ─── AI Insights Section ─────────────────────────────────── */
.ai-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 40px;
    margin-bottom: 24px;
    background: radial-gradient(ellipse at center, rgba(37, 99, 235,0.06) 0%, transparent 70%);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    position: relative;
    overflow: hidden;
}

.ai-hero::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.ai-hero-icon {
    width: 80px;
    height: 80px;
    background: var(--accent-muted);
    border-radius: var(--r-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

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

.ai-hero-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-hero-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 480px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.ai-insights-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    animation: fadeInUp 0.4s ease;
}

.ai-insights-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(37, 99, 235,0.04);
}

.ai-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-text);
}

.ai-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

.ai-timestamp {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ai-insights-content {
    padding: 24px 28px;
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.ai-insights-content h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 24px 0 10px;
}

.ai-insights-content h2:first-child {
    margin-top: 0;
}

.ai-insights-content strong {
    color: var(--text-primary);
}

.ai-insights-content em {
    color: var(--accent-text);
    font-style: normal;
}

.ai-insights-content ul, .ai-insights-content ol {
    padding-left: 24px;
    margin: 8px 0;
}

.ai-insights-content li {
    margin-bottom: 6px;
}

.ai-insights-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.ai-insights-content code {
    background: var(--accent-muted);
    color: var(--accent-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* Loading state for AI */
.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px;
    color: var(--text-muted);
}

.ai-loading-dots {
    display: flex;
    gap: 8px;
}

.ai-loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    animation: bounce-dot 1.4s ease-in-out infinite;
}

.ai-loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes bounce-dot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* ─── Loading Overlay ─────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-root);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner-ring {
    width: 48px;
    height: 48px;
    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); }
}

.spinner-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    width: 440px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform var(--t-base);
}

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

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all var(--t-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.modal-body {
    padding: 24px;
}

.modal-info {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.modal-info code {
    background: var(--accent-muted);
    color: var(--accent-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .sidebar-toggle {
        display: flex;
    }

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

    .header-right {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .main-header {
        padding: 0 16px;
        flex-wrap: wrap;
        height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
        gap: 12px;
    }

    .dashboard-scroll {
        padding: 16px;
    }

    .date-filter-group {
        flex-wrap: wrap;
    }

    .date-input {
        width: 110px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .search-input {
        width: 120px;
    }

    .ai-hero {
        padding: 40px 20px;
    }

    .header-status {
        display: none;
    }
}

/* ─── Animations (entrance) ───────────────────────────────── */
.kpi-card {
    animation: slideUp 0.5s ease backwards;
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.1s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.2s; }

.chart-card {
    animation: slideUp 0.5s ease backwards;
    animation-delay: 0.25s;
}

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

/* ─── AI Chat UI Components ───────────────────────────────── */
.chat-chip {
    white-space: nowrap;
    padding: 6px 14px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-chip:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.5);
    color: #f1f5f9;
    transform: translateY(-1px);
}

.chat-bubble {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeInMsg 0.3s ease;
}

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

.chat-bubble.ai-bubble {
    align-self: flex-start;
}

.chat-bubble.user-bubble {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.ai-avatar {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.3) 0%, rgba(37, 99, 235, 0.3) 100%);
    border: 1px solid rgba(37, 99, 235, 0.4);
}

.user-avatar {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
}

.chat-text {
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 0.86rem;
    line-height: 1.6;
}

.ai-bubble .chat-text {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: #e2e8f0;
    border-top-left-radius: 4px;
}

.user-bubble .chat-text {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.chat-text strong {
    color: #ffffff;
}

.chat-text ul, .chat-text ol {
    margin: 6px 0 6px 18px;
    padding: 0;
}

.chat-text li {
    margin-bottom: 4px;
}

.chat-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
}

.chat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3b82f6;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-5px); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   Executive Report & Print Styles
   ═══════════════════════════════════════════════════════════ */
.report-paper-preview {
    background: #ffffff !important;
    color: #1e293b !important;
    border-radius: 12px;
    padding: 32px 36px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    max-height: 65vh;
    overflow-y: auto;
}

.report-paper-preview * {
    color: #1e293b;
}

.report-header-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.report-brand-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.report-meta-text {
    font-size: 0.82rem;
    color: #64748b;
}

.report-status-badge {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.report-kpi-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
}

.report-kpi-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.report-kpi-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.report-section-block {
    margin-bottom: 22px;
}

.report-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    border-left: 4px solid #2563eb;
    padding-left: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-table-clean {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.report-table-clean th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #cbd5e1;
}

.report-table-clean td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

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

.report-signature-block {
    display: flex;
    justify-content: space-between;
    margin-top: 36px;
    padding-top: 16px;
    border-top: 1px dashed #cbd5e1;
}

.report-sign-col {
    text-align: center;
    width: 200px;
}

.report-sign-line {
    border-bottom: 1px solid #0f172a;
    height: 48px;
    margin-bottom: 6px;
}

/* Print Only Rules */
@media print {
    body * {
        visibility: hidden !important;
    }
    
    #printableExecutiveReport, #printableExecutiveReport * {
        visibility: visible !important;
    }
    
    #printableExecutiveReport {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .no-print, .modal-close, .modal-header, .export-modal-actions {
        display: none !important;
    }

    @page {
        margin: 1.5cm;
        size: A4 portrait;
    }
}

/* ═══════════════════════════════════════════════════════════
   Sales Activity Heatmap (Research-Backed Ergonomic Matrix)
   ═══════════════════════════════════════════════════════════ */
.heatmap-wrapper {
    overflow-x: auto;
    padding-bottom: 8px;
}

.heatmap-table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 6px;
}

.heatmap-th-day {
    width: 80px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 6px 10px;
}

.heatmap-th-slot {
    text-align: center;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 4px;
}

.heatmap-th-slot span {
    display: block;
    font-size: 0.68rem;
    color: #3b82f6;
    margin-top: 2px;
}

.heatmap-cell {
    border-radius: 8px;
    padding: 12px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.heatmap-cell:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
    border-color: rgba(37, 99, 235, 0.6);
}

.heatmap-cell-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.2px;
}

.heatmap-cell-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.heatmap-cell.is-peak {
    border: 1px solid #f59e0b;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

.heatmap-peak-badge {
    position: absolute;
    top: -6px;
    right: 4px;
    background: #f59e0b;
    color: #0f172a;
    font-size: 0.58rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.heatmap-legend-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.heatmap-legend-gradient {
    width: 140px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.4) 50%, rgba(37, 99, 235, 0.95) 100%);
}

/* ═══════════════════════════════════════════════════════════
   Pareto 80/20 & ABC Stratification Styles
   ═══════════════════════════════════════════════════════════ */
.pareto-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

@media (max-width: 900px) {
    .pareto-grid-3 {
        grid-template-columns: 1fr;
    }
}

.pareto-card {
    border-radius: var(--r-md);
    padding: 16px 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.pareto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.pareto-card-a::before { background: #2563eb; }
.pareto-card-b::before { background: #38bdf8; }
.pareto-card-c::before { background: #64748b; }

.pareto-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.pareto-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.badge-class-a { background: rgba(37, 99, 235, 0.18); color: #3b82f6; border: 1px solid rgba(37, 99, 235, 0.35); }
.badge-class-b { background: rgba(56, 189, 248, 0.18); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.badge-class-c { background: rgba(100, 116, 139, 0.18); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.35); }

.pareto-card-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -0.3px;
    margin-bottom: 2px;
}

.pareto-card-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.pareto-card-action {
    font-size: 0.74rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 6px 10px;
    line-height: 1.4;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}
.pareto-chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   Market Basket Analysis & Bundling Recommendations
   ═══════════════════════════════════════════════════════════ */
.basket-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .basket-metric-grid {
        grid-template-columns: 1fr;
    }
}

.basket-metric-card {
    border-radius: var(--r-md);
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.basket-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border-color: rgba(37, 99, 235, 0.3);
}

.basket-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #2563eb, #2563eb);
}

.basket-metric-card.card-accent-emerald::before {
    background: linear-gradient(180deg, #10b981, #06b6d4);
}

.basket-metric-card.card-accent-amber::before {
    background: linear-gradient(180deg, #f59e0b, #ef4444);
}

.basket-metric-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.basket-metric-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 2px;
}

.basket-metric-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* User Understanding Guide Box (Bahasa Indonesia Ramah Pengguna) */
.basket-guide-box {
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--r-md);
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.basket-guide-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.basket-guide-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.basket-guide-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
}

.basket-guide-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.basket-guide-tag {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.basket-guide-tag strong {
    color: #93c5fd;
}

/* Bundles Grid */
.basket-bundles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

@media (max-width: 768px) {
    .basket-bundles-grid {
        grid-template-columns: 1fr;
    }
}

.bundle-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.bundle-card:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.bundle-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.bundle-rank-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.18);
    color: #93c5fd;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.bundle-strength-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.bundle-strength-high {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.bundle-strength-medium {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.bundle-strength-moderate {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Products Pair Flow in Card */
.bundle-items-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--r-md);
    padding: 12px;
    margin-bottom: 14px;
    gap: 8px;
}

.bundle-item-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.bundle-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.bundle-item-info {
    min-width: 0;
}

.bundle-item-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bundle-item-meta {
    font-size: 0.72rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.bundle-item-price {
    color: #38bdf8;
    font-weight: 600;
}

.bundle-plus-sign {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: #93c5fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Metric Stats Row */
.bundle-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--r-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.bundle-stat-col {
    text-align: center;
    flex: 1;
}

.bundle-stat-lbl {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.bundle-stat-num {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f8fafc;
    margin-top: 2px;
}

/* Pricing Offer Banner */
.bundle-price-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: var(--r-md);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.bundle-price-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.bundle-price-promo {
    font-size: 1.15rem;
    font-weight: 800;
    color: #34d399;
}

.bundle-price-normal {
    font-size: 0.78rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.bundle-price-save-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Strategy Text */
.bundle-strategy-text {
    font-size: 0.75rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #2563eb;
    border-radius: 4px;
    padding: 8px 10px;
    line-height: 1.45;
    margin-bottom: 16px;
}

/* Action Buttons */
.bundle-card-actions {
    display: flex;
    gap: 8px;
}

.btn-bundle-copy {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.35);
    color: #bfdbfe;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-bundle-copy:hover {
    background: rgba(37, 99, 235, 0.28);
    color: #ffffff;
    border-color: #3b82f6;
}

.btn-bundle-sim {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-bundle-sim:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Cross-Selling Matrix Table Section */
.basket-matrix-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--r-md);
    padding: 18px;
    margin-top: 10px;
}

.basket-matrix-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.basket-search-input {
    flex: 1;
    min-width: 240px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-sm);
    padding: 8px 14px;
    color: #f8fafc;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.basket-search-input:focus {
    border-color: #2563eb;
}

.basket-table-wrapper {
    overflow-x: auto;
}

.basket-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.basket-matrix-table th {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.basket-matrix-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}

.basket-matrix-table tbody tr:hover td {
    background: rgba(37, 99, 235, 0.04);
}

/* Toast Notification */
.basket-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    border: 1px solid #10b981;
    color: #34d399;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: 101050;
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: min(440px, calc(100vw - 32px));
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.basket-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.basket-toast.toast-error {
    border-color: #ef4444;
    color: #fca5a5;
    background: #1c1014;
}

.basket-toast.toast-warning {
    border-color: #f59e0b;
    color: #fcd34d;
    background: #1c170d;
}

.basket-toast.toast-info {
    border-color: #3b82f6;
    color: #93c5fd;
    background: #0f172a;
}

/* ═══════════════════════════════════════════════════════════
   RFM Customer Segmentation & Retention Engine
   ═══════════════════════════════════════════════════════════ */
.rfm-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .rfm-metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .rfm-metric-grid {
        grid-template-columns: 1fr;
    }
}

.rfm-metric-card {
    border-radius: var(--r-md);
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.rfm-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border-color: rgba(56, 189, 248, 0.3);
}

.rfm-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #38bdf8, #3b82f6);
}

.rfm-metric-card.card-accent-emerald::before {
    background: linear-gradient(180deg, #10b981, #06b6d4);
}

.rfm-metric-card.card-accent-amber::before {
    background: linear-gradient(180deg, #f59e0b, #ef4444);
}

.rfm-metric-card.card-accent-indigo::before {
    background: linear-gradient(180deg, #2563eb, #60a5fa);
}

.rfm-metric-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.rfm-metric-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 2px;
}

.rfm-metric-sub {
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* RFM Guide Box */
.rfm-guide-box {
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--r-md);
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.rfm-guide-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.rfm-guide-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.rfm-guide-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
}

.rfm-guide-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.rfm-guide-tag {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.rfm-guide-tag strong {
    color: #38bdf8;
}

/* RFM 6 Segments Grid */
.rfm-segments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

@media (max-width: 640px) {
    .rfm-segments-grid {
        grid-template-columns: 1fr;
    }
}

.rfm-segment-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--r-md);
    padding: 16px 18px;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.rfm-segment-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.rfm-segment-card.active-filter {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    box-shadow: 0 0 0 1px #38bdf8;
}

.rfm-seg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.rfm-seg-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.segment-champion {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.segment-loyal {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.segment-potential {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.segment-at-risk {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.segment-hibernating {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.segment-lost {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.rfm-seg-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rfm-seg-stat-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
}

.rfm-seg-stat-lbl {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.rfm-seg-desc {
    font-size: 0.74rem;
    color: #94a3b8;
    line-height: 1.45;
    margin-bottom: 10px;
}

.rfm-seg-advice {
    font-size: 0.72rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid #38bdf8;
    padding: 6px 8px;
    border-radius: 4px;
    line-height: 1.4;
}

/* Customer Directory Table */
.rfm-directory-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--r-md);
    padding: 18px;
    margin-top: 10px;
}

.rfm-directory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.rfm-segment-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    color: #f8fafc;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
}

.rfm-search-input {
    min-width: 240px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-sm);
    padding: 8px 14px;
    color: #f8fafc;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.rfm-search-input:focus {
    border-color: #38bdf8;
}

.rfm-table-wrapper {
    overflow-x: auto;
}

.rfm-customer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.rfm-customer-table th {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.rfm-customer-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}

.rfm-customer-table tbody tr:hover td {
    background: rgba(56, 189, 248, 0.04);
}

.btn-rfm-wa {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-rfm-wa:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════
   Inventory Velocity, Forecasting & Reorder Alerts
   ═══════════════════════════════════════════════════════════ */
.stock-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .stock-metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stock-metric-grid {
        grid-template-columns: 1fr;
    }
}

.stock-metric-card {
    border-radius: var(--r-md);
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.stock-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border-color: rgba(245, 158, 11, 0.3);
}

.stock-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #f59e0b, #ef4444);
}

.stock-metric-card.card-accent-rose::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.stock-metric-card.card-accent-emerald::before {
    background: linear-gradient(180deg, #10b981, #06b6d4);
}

.stock-metric-card.card-accent-indigo::before {
    background: linear-gradient(180deg, #2563eb, #2563eb);
}

.stock-metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stock-metric-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 2px;
}

.stock-metric-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* Stock Guide Box */
.stock-guide-box {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--r-md);
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.stock-guide-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.stock-guide-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.stock-guide-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
}

.stock-guide-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.stock-guide-tag {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.stock-guide-tag strong {
    color: #fbbf24;
}

/* Forecast Chart Box */
.stock-forecast-chart-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--r-md);
    padding: 20px;
    margin-bottom: 24px;
}

.stock-forecast-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.stock-forecast-chart-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f1f5f9;
}

.stock-forecast-legend {
    display: flex;
    gap: 14px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.stock-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.stock-forecast-canvas-wrapper {
    position: relative;
    height: 240px;
    width: 100%;
}

/* Stock Velocity Table & Toolbar */
.stock-velocity-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--r-md);
    padding: 18px;
}

.stock-velocity-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stock-status-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    color: #f8fafc;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
}

.stock-search-input {
    min-width: 240px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-sm);
    padding: 8px 14px;
    color: #f8fafc;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.stock-search-input:focus {
    border-color: #f59e0b;
}

.stock-velocity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.stock-velocity-table th {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.stock-velocity-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}

.stock-velocity-table tbody tr:hover td {
    background: rgba(245, 158, 11, 0.04);
}

/* Stock Badges */
.badge-stock-critical {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    display: inline-block;
}

.badge-stock-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    display: inline-block;
}

.badge-stock-optimal {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    display: inline-block;
}

.badge-stock-overstock {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    display: inline-block;
}

.btn-supplier-po {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-supplier-po:hover {
    background: rgba(245, 158, 11, 0.28);
    border-color: #f59e0b;
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════
   SMART NOTIFICATIONS & ANOMALY DRAWER
   ═══════════════════════════════════════════════════════════ */
.notification-bell-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-bell-btn:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
    color: #3b82f6;
    transform: translateY(-1px);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0f172a;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
    50% { transform: scale(1.12); box-shadow: 0 0 16px rgba(239, 68, 68, 0.9); }
}

.notification-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.notification-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 440px;
    max-width: 92vw;
    background: #0d1322;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.notification-drawer.active {
    transform: translateX(0);
}

.notification-drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.6);
}

.drawer-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0;
}

.drawer-count-pill {
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(37, 99, 235, 0.4);
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.drawer-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    line-height: 1;
    transition: all 0.2s;
}

.drawer-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.notification-filter-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(11, 15, 26, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
}

.notification-tab-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.notification-tab-btn:hover {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.2);
}

.notification-tab-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

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

.notification-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.notification-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.notification-card.type-critical {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.notification-card.type-warning {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.notification-card.type-info {
    border-color: rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.06) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.notification-card.type-success {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.notif-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notif-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.notif-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f1f5f9;
}

.notif-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.pill-critical {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.pill-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.pill-info {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.pill-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.notif-message {
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin: 0;
}

.notif-action-box {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.76rem;
    color: #94a3b8;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.notif-action-box strong {
    color: #e2e8f0;
}

.notif-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 4px;
}

.drawer-footer-actions {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 10px;
    background: rgba(15, 23, 42, 0.8);
}

/* ═══════════════════════════════════════════════════════════
   GOAL TRACKING & TARGETS WIDGET
   ═══════════════════════════════════════════════════════════ */
.goal-tracking-widget {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

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

.goal-widget-title-group h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f1f5f9;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.goal-widget-title-group p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

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

.goal-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
}

.goal-card:hover {
    border-color: rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.goal-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.goal-icon-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.goal-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.goal-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #e2e8f0;
}

.goal-status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.goal-numbers-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

.goal-actual-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #f8fafc;
}

.goal-target-val {
    font-size: 0.8rem;
    color: #94a3b8;
}

.goal-progress-wrap {
    position: relative;
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.goal-progress-bar {
    height: 100%;
    border-radius: 6px;
    position: relative;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
    background: linear-gradient(90deg, #2563eb, #2563eb);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

.goal-progress-bar.achieved {
    background: linear-gradient(90deg, #10b981, #06b6d4);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.goal-progress-bar.behind {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.goal-footer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    color: #94a3b8;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ═══════════════════════════════════════════════════════════
   PERIOD COMPARISON WIDGET
   ═══════════════════════════════════════════════════════════ */
.period-comparison-widget {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

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

.comparison-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comparison-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.comparison-dates-badge {
    font-size: 0.76rem;
    color: #94a3b8;
}

.comparison-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.comparison-metric-item {
    background: rgba(11, 15, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cmp-label {
    font-size: 0.74rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cmp-values {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.cmp-current {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
}

.cmp-delta {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.cmp-delta.positive {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.cmp-delta.negative {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
}

.cmp-prev {
    font-size: 0.7rem;
    color: #64748b;
}

.comparison-products-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
    .comparison-products-row {
        grid-template-columns: 1fr;
    }
}

.comparison-prod-col {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cmp-prod-col-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cmp-prod-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.78rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.cmp-prod-name {
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.cmp-prod-rev {
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   COHORT ANALYSIS MATRIX TABLE
   ═══════════════════════════════════════════════════════════ */
.cohort-card {
    margin-top: 24px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px 24px;
}

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

.cohort-title-wrap h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f1f5f9;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cohort-title-wrap p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

.cohort-summary-badges {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cohort-summary-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cohort-summary-pill strong {
    color: #f8fafc;
    font-weight: 800;
}

.cohort-table-wrapper {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(11, 15, 26, 0.7);
}

.cohort-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
    padding: 10px;
    font-size: 0.76rem;
}

.cohort-matrix-table th {
    color: #94a3b8;
    font-weight: 600;
    padding: 8px 10px;
    text-align: center;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cohort-matrix-table th.cohort-th-left {
    text-align: left;
}

.cohort-matrix-table td {
    padding: 8px 6px;
    text-align: center;
    font-weight: 700;
    border-radius: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.cohort-matrix-table td.cohort-name-cell {
    text-align: left;
    color: #e2e8f0;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    padding-left: 12px;
}

.cohort-matrix-table td.cohort-size-cell {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.02);
}

.cohort-cell {
    cursor: default;
    position: relative;
}

.cohort-cell:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* Heatmap color scales */
.cohort-cell.rate-100 {
    background: rgba(37, 99, 235, 0.45);
    color: #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.6);
}

.cohort-cell.rate-high {
    background: rgba(16, 185, 129, 0.4);
    color: #ecfdf5;
    border: 1px solid rgba(16, 185, 129, 0.55);
}

.cohort-cell.rate-med-high {
    background: rgba(20, 184, 166, 0.35);
    color: #f0fdfa;
    border: 1px solid rgba(20, 184, 166, 0.45);
}

.cohort-cell.rate-med {
    background: rgba(56, 189, 248, 0.28);
    color: #f0f9ff;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.cohort-cell.rate-low {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.cohort-cell.rate-empty {
    background: rgba(255, 255, 255, 0.02);
    color: #475569;
}







/* ═══════════════════════════════════════════════════════════
   CUSTOMER LIFETIME VALUE (CLV)
   ═══════════════════════════════════════════════════════════ */
.clv-card {
    margin-top: 24px;
    background: linear-gradient(160deg, rgba(30, 58, 138, 0.28) 0%, rgba(15, 23, 42, 0.78) 60%);
    border: 1px solid rgba(59, 130, 246, 0.24);
    border-radius: 16px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
}
.clv-card::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.16), transparent 70%);
    pointer-events: none;
}
.clv-cac-box { display: flex; flex-direction: column; gap: 6px; font-size: 0.74rem; color: #94a3b8; }
.clv-cac-input-wrap {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px; padding: 6px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.clv-cac-input-wrap:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22); }
.clv-cac-input-wrap input {
    background: transparent; border: none; outline: none;
    color: #f1f5f9; font-weight: 700; width: 130px; font-size: 0.85rem;
}
.clv-kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px; margin-bottom: 18px; position: relative;
}
.clv-kpi {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 4px;
    transition: transform 0.2s, border-color 0.2s;
}
.clv-kpi:hover { transform: translateY(-2px); border-color: rgba(59, 130, 246, 0.42); }
.clv-kpi span { font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.clv-kpi strong { font-size: 1.05rem; color: #f8fafc; font-weight: 800; }
.clv-segments {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px; margin-bottom: 18px; position: relative;
}
.clv-seg-card {
    background: rgba(11, 15, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid var(--seg-color);
    border-radius: 12px; padding: 14px 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.clv-seg-top { display: flex; justify-content: space-between; align-items: center; }
.clv-seg-name { font-weight: 800; color: var(--seg-color); font-size: 0.9rem; }
.clv-seg-count { font-size: 0.72rem; color: #94a3b8; }
.clv-seg-share { font-size: 1.5rem; font-weight: 800; color: #f8fafc; }
.clv-seg-share small { font-size: 0.68rem; color: #94a3b8; font-weight: 500; margin-left: 4px; }
.clv-seg-bar { height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; }
.clv-seg-bar div { height: 100%; background: var(--seg-color); border-radius: 99px; transition: width 0.8s ease; }
.clv-seg-avg { font-size: 0.76rem; color: #cbd5e1; }
.clv-seg-action { font-size: 0.72rem; color: #94a3b8; font-style: italic; }
.clv-two-col { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; position: relative; }
@media (max-width: 1100px) { .clv-two-col { grid-template-columns: 1fr; } }
.clv-panel {
    background: rgba(11, 15, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px; padding: 16px;
}
.clv-panel h4 { margin: 0 0 4px; font-size: 0.92rem; color: #f1f5f9; font-weight: 700; }
.clv-panel-sub { font-size: 0.74rem; color: #94a3b8; margin: 0 0 12px; }
.clv-table-wrap { overflow-x: auto; margin-top: 10px; }
.clv-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.clv-table th {
    text-align: left; color: #94a3b8; font-weight: 600; padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap;
}
.clv-table td { padding: 9px 10px; color: #e2e8f0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); white-space: nowrap; }
.clv-table tbody tr:hover { background: rgba(37, 99, 235, 0.08); }
.clv-sub { font-size: 0.68rem; color: #64748b; margin-top: 2px; }
.clv-main-val { font-weight: 800; color: #60a5fa; }
.clv-alive { font-weight: 700; }
.clv-seg-pill {
    display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 0.68rem; font-weight: 700;
    color: var(--seg-color); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--seg-color);
}
.clv-loyalty-list { display: flex; flex-direction: column; gap: 10px; }
.clv-loyalty-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: rgba(245, 158, 11, 0.07); border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px; padding: 10px 12px;
}
.clv-loyalty-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.clv-loyalty-main strong { color: #f8fafc; font-size: 0.82rem; }
.clv-loyalty-main span { color: #94a3b8; font-size: 0.7rem; }
.clv-loyalty-main em { color: #fbbf24; font-size: 0.7rem; font-style: normal; font-weight: 600; }
.clv-loyalty-disc {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 56px; padding: 6px 8px; border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff; font-weight: 800; font-size: 1rem;
}
.clv-loyalty-disc small { font-size: 0.58rem; font-weight: 600; opacity: 0.9; }
.clv-empty { color: #10b981; font-size: 0.8rem; padding: 12px; text-align: center; }
.clv-footnote { margin: 14px 0 0; font-size: 0.7rem; color: #64748b; }

/* ═══════════════════════════════════════════════════════════
   PROFIT & LOSS (P&L) & MARGIN ANALYSIS
   ═══════════════════════════════════════════════════════════ */
.pnl-card {
    margin-bottom: 24px;
    background: linear-gradient(160deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.85) 50%, rgba(30, 58, 138, 0.24) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 18px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}
.pnl-card::before {
    content: '';
    position: absolute;
    top: -90px; right: -90px;
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.16), transparent 70%);
    pointer-events: none;
}
.pnl-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.pnl-title-wrap {
    flex: 1;
    min-width: 260px;
}
.pnl-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.pnl-title-wrap h3 {
    font-size: 1.28rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
}
.pnl-title-wrap p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}
.pnl-opex-control {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 260px;
}
.pnl-opex-label-group label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #e2e8f0;
    display: block;
}
.pnl-opex-hint {
    font-size: 0.66rem;
    color: #64748b;
    display: block;
    margin-top: 1px;
}
.pnl-opex-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.pnl-opex-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 4px 8px;
    gap: 4px;
}
.pnl-opex-input-wrap input {
    width: 48px;
    background: transparent;
    border: none;
    outline: none;
    color: #34d399;
    font-weight: 800;
    font-size: 0.9rem;
    text-align: right;
}
.pnl-opex-input-wrap span {
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.8rem;
}
.pnl-opex-presets {
    display: flex;
    gap: 4px;
}
.pnl-preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.pnl-preset-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}
.pnl-preset-btn.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
    font-weight: 700;
}

/* 4 Financial Scorecards */
.pnl-scorecard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.pnl-scorecard {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}
.pnl-scorecard:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
}
.pnl-score-net { border-left: 3px solid #2563eb; }
.pnl-score-cogs { border-left: 3px solid #f59e0b; }
.pnl-score-gross { border-left: 3px solid #10b981; }
.pnl-score-netprofit { border-left: 3px solid #06b6d4; }

.pnl-score-icon {
    font-size: 1.4rem;
}
.pnl-score-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pnl-score-label {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.pnl-score-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
}
.pnl-score-sub {
    font-size: 0.72rem;
    color: #64748b;
}
.pnl-score-sub strong {
    color: #34d399;
}
.pnl-score-badge {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}
.pnl-score-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.pnl-score-pill.warning {
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Tabs Navigation */
.pnl-tabs-header {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 18px;
    overflow-x: auto;
}
.pnl-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #94a3b8;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.pnl-tab-btn:hover {
    color: #e2e8f0;
}
.pnl-tab-btn.active {
    color: #34d399;
    border-bottom-color: #10b981;
}
.pnl-tab-content {
    display: none;
    animation: fadeInTab 0.25s ease-out;
}
.pnl-tab-content.active {
    display: block;
}
@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tab 1: P&L Statement Table */
.pnl-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(11, 15, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.pnl-statement-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.pnl-statement-table th {
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}
.pnl-statement-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
}
.pnl-statement-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}
.pnl-row-depth-1 td:first-child {
    padding-left: 32px;
}
.pnl-row-subtotal {
    background: rgba(16, 185, 129, 0.05);
    font-weight: 700;
}
.pnl-row-subtotal td {
    color: #f1f5f9;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}
.pnl-row-final {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.12));
    font-weight: 800;
}
.pnl-row-final td {
    color: #34d399;
    font-size: 0.94rem;
    border-top: 2px solid rgba(16, 185, 129, 0.4);
    border-bottom: 2px solid rgba(16, 185, 129, 0.4);
}
.pnl-amt-deduct { color: #f87171; font-weight: 600; }
.pnl-amt-plus { color: #34d399; font-weight: 700; }
.pnl-amt-neutral { color: #e2e8f0; font-weight: 700; }

/* Tab 2: Chart */
.pnl-chart-container {
    background: rgba(11, 15, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
}
.pnl-chart-legend-custom {
    display: flex;
    gap: 16px;
    font-size: 0.74rem;
    color: #94a3b8;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.pnl-chart-legend-custom span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pnl-chart-legend-custom i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}
.pnl-canvas-wrap {
    height: 320px;
    position: relative;
}

/* Tab 3: Category Margin Breakdown */
.pnl-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.pnl-cat-card {
    background: rgba(11, 15, 26, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pnl-cat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pnl-cat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #f1f5f9;
    font-size: 0.88rem;
}
.pnl-cat-metric-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    color: #94a3b8;
}
.pnl-cat-metric-row strong {
    color: #e2e8f0;
}
.pnl-cat-bar-wrap {
    background: rgba(255, 255, 255, 0.08);
    height: 6px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.pnl-cat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #10b981);
    border-radius: 4px;
}

/* Two Column: Top Products vs Margin Alerts */
.pnl-two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
    margin-top: 22px;
}
.pnl-panel {
    background: rgba(11, 15, 26, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pnl-panel-header h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    color: #f8fafc;
    font-weight: 800;
}
.pnl-panel-sub {
    font-size: 0.72rem;
    color: #94a3b8;
}
.pnl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.pnl-table th {
    text-align: left;
    color: #94a3b8;
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}
.pnl-table td {
    padding: 9px 10px;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.pnl-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.05);
}
.pnl-tip-cell {
    font-size: 0.7rem;
    color: #fbbf24;
    line-height: 1.35;
}

/* AI Executive Insights */
.pnl-insights-card {
    margin-top: 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 16px 18px;
}
.pnl-insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.pnl-insights-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #38bdf8;
}
.pnl-insights-badge {
    font-size: 0.66rem;
    font-weight: 800;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
}
.pnl-insights-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.pnl-insight-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pnl-insight-item-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    color: #f1f5f9;
}
.pnl-insight-item p {
    margin: 0;
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.4;
}


/* ─── Header overflow fix: keep title readable on laptop screens ─── */
.header-left { flex-shrink: 0; min-width: 0; }
.header-title { white-space: nowrap; line-height: 1.2; }
.header-subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.header-right { min-width: 0; flex-shrink: 1; gap: 10px; }
.header-right .date-input { width: 118px; }
#btnSwitchAccount span, #headerUserName, #headerStoreName { white-space: nowrap; }

@media (max-width: 1700px) {
    .header-subtitle { display: none; }
    #connectionStatus .status-text { display: none; }
    #connectionStatus { padding: 6px; }
}
@media (max-width: 1400px) {
    .main-header { padding: 0 16px; gap: 10px; }
    .header-left, .header-right { gap: 8px; }
    .quick-date-select { max-width: 155px; }
}
@media (max-width: 1350px) {
    .user-info-badge { display: none !important; }
    .theme-label { display: none; }
}

/* ─── Mode Sederhana (UMKM) vs Mode Pro ─────────────────── */
body.mode-simple .pro-feature {
    display: none !important;
}

body.mode-simple #proUnlockBanner {
    display: block !important;
}

body.mode-simple .charts-grid-2:has(#regionSalesCard.pro-feature) {
    grid-template-columns: 1fr !important;
}

body.mode-pro .pro-feature {
    /* visible normally */
}

body.mode-pro #proUnlockBanner {
    display: none !important;
}

/* Trend View Filter Buttons */
.trend-pill-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.trend-pill-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.trend-pill-btn.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.35);
}

/* Mode Switcher Pill Component */
.mode-switcher-container {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 3px;
    gap: 3px;
    margin-left: 10px;
    flex-shrink: 0;
}

.mode-pill-btn {
    padding: 5px 12px;
    border-radius: 16px;
    border: none;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    color: #94a3b8;
    white-space: nowrap;
}

.mode-pill-btn:hover {
    color: #ffffff;
}

.mode-pill-btn.active.btn-simple {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.mode-pill-btn.active.btn-pro {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.45);
}

@media (max-width: 1200px) {
    .mode-pill-btn span { font-size: 0.68rem; }
    .mode-pill-btn { padding: 4px 8px; }
}

/* ─── Quick Sale (Kasir Cepat) Form Styles ─────────────────── */
.qs-items-header {
    display: grid;
    grid-template-columns: 2fr 1.1fr 1.1fr 0.9fr 0.8fr 32px;
    gap: 10px;
    padding: 0 14px 6px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qs-item-row {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--r-md);
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 2fr 1.1fr 1.1fr 0.9fr 0.8fr auto;
    gap: 10px;
    align-items: center;
    transition: border-color var(--t-fast), transform 0.2s;
}

@keyframes rowPulseSuccess {
    0% {
        background-color: rgba(16, 185, 129, 0.4);
        border-color: #10b981;
        transform: scale(1.015);
        box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
    }
    100% {
        background-color: rgba(15, 23, 42, 0.65);
        border-color: rgba(255, 255, 255, 0.08);
        transform: scale(1);
        box-shadow: none;
    }
}

.qs-item-row.row-pulse-success {
    animation: rowPulseSuccess 0.75s ease-out;
}

.qs-item-row:hover {
    border-color: rgba(16, 185, 129, 0.35);
}

.qs-item-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 10px;
    color: #f8fafc;
    font-size: 0.82rem;
    outline: none;
    transition: border-color var(--t-fast);
}

.qs-item-input:focus {
    border-color: #10b981;
}

.qs-stepper {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    overflow: hidden;
}

.qs-stepper-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 32px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.qs-stepper-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.qs-stepper-input {
    width: 36px;
    text-align: center;
    background: transparent;
    border: none;
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 700;
    outline: none;
    -moz-appearance: textfield;
}

.qs-stepper-input::-webkit-outer-spin-button,
.qs-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qs-btn-remove {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s;
}

.qs-btn-remove:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
    border-color: #ef4444;
}

.qs-btn-remove:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.qs-pay-btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.qs-pay-btn.active {
    background: rgba(16, 185, 129, 0.18) !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

@media (max-width: 680px) {
    .qs-items-header {
        display: none;
    }
    .qs-item-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .qs-item-row .col-prod {
        grid-column: 1 / -1;
    }
}

/* ─── Barcode & Price Tag Sticker Print Styles ────────────── */
.barcode-tag-card {
    background: #ffffff;
    color: #000000;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
    page-break-inside: avoid;
    break-inside: avoid;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: Arial, sans-serif;
    min-height: 110px;
}

.barcode-tag-store {
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.barcode-tag-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin: 3px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.barcode-tag-bars {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 900;
    letter-spacing: 2px;
    font-size: 0.95rem;
    margin: 4px 0 2px 0;
    color: #000000;
    line-height: 1;
}

.barcode-tag-sku {
    font-size: 0.68rem;
    color: #64748b;
    font-family: monospace;
    font-weight: 600;
}

.barcode-tag-price {
    font-size: 0.95rem;
    font-weight: 900;
    color: #000000;
    margin-top: 4px;
    border-top: 1px solid #e2e8f0;
    padding-top: 3px;
}

@media print {
    body.printing-barcodes * {
        visibility: hidden !important;
    }
    body.printing-barcodes #barcodePrintModal,
    body.printing-barcodes #barcodePrintModal * {
        visibility: visible !important;
    }
    body.printing-barcodes #barcodePrintModal {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }
    body.printing-barcodes #barcodePrintModal .modal-card {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        background: #ffffff !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    body.printing-barcodes .no-print,
    body.printing-barcodes .modal-header {
        display: none !important;
    }
    body.printing-barcodes #barcodePrintSheet {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6mm !important;
        padding: 5mm !important;
        background: #ffffff !important;
    }
}

/* ─── Digital Thermal Receipt & WhatsApp Invoice Styles ───── */
.receipt-paper {
    background: #ffffff;
    color: #0f172a;
    font-family: 'Courier New', Courier, monospace, monospace;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    padding: 24px 20px;
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    position: relative;
    font-size: 0.8rem;
    line-height: 1.4;
    user-select: text;
}

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

.receipt-store-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #020617;
    margin-bottom: 2px;
}

.receipt-store-sub {
    font-size: 0.72rem;
    color: #64748b;
}

.receipt-divider {
    border-top: 1px dashed #94a3b8;
    margin: 10px 0;
}

.receipt-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.76rem;
    color: #334155;
}

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

.receipt-items-table {
    width: 100%;
    margin: 8px 0;
    border-collapse: collapse;
}

.receipt-item-name {
    font-weight: 700;
    color: #0f172a;
    padding-top: 6px;
}

.receipt-item-sub {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: #475569;
    padding-bottom: 6px;
    border-bottom: 1px dotted #e2e8f0;
}

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

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

.receipt-total-main {
    display: flex;
    justify-content: space-between;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    padding: 6px 0;
    border-top: 1px dashed #64748b;
    border-bottom: 1px dashed #64748b;
}

.receipt-footer {
    text-align: center;
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.receipt-barcode {
    font-family: monospace;
    font-size: 1.2rem;
    letter-spacing: 4px;
    color: #475569;
    margin: 6px 0 2px 0;
    font-weight: 800;
}

/* Print Only Styles */
@media print {
    body * {
        visibility: hidden !important;
    }
    #receiptPrintArea, #receiptPrintArea * {
        visibility: visible !important;
    }
    #receiptPrintArea {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 80mm !important;
        margin: 0 !important;
        padding: 10px !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
    }
    .no-print {
        display: none !important;
    }

    body.printing-zreport * {
        visibility: hidden !important;
    }
    body.printing-zreport #zReportThermalArea,
    body.printing-zreport #zReportThermalArea * {
        visibility: visible !important;
    }
    body.printing-zreport #zReportThermalArea {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 80mm !important;
        margin: 0 !important;
        padding: 12px 10px !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        border: none !important;
        display: block !important;
    }
}



/* ═══════════════════════════════════════════════════════════ */
/* RECEIPT CUSTOMIZATION STYLES                                */
/* ═══════════════════════════════════════════════════════════ */
.receipt-logo-container {
    text-align: center;
    margin-bottom: 8px;
}

.receipt-logo-img {
    max-height: 52px;
    max-width: 140px;
    object-fit: contain;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.receipt-store-address {
    font-size: 0.68rem;
    color: #475569;
    margin-top: 2px;
    line-height: 1.3;
}

.receipt-footer-custom {
    font-size: 0.68rem;
    color: #334155;
    margin-top: 4px;
    line-height: 1.35;
    white-space: pre-line;
}

.receipt-custom-drawer {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    display: none;
    animation: fadeIn 0.2s ease;
}

.receipt-custom-drawer.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════ */
/* PRODUCT CATALOG (CRUD) STYLES                               */
/* ═══════════════════════════════════════════════════════════ */
.product-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.product-stat-card {
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.35);
}

.product-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.25);
    flex-shrink: 0;
}

.product-stat-info {
    display: flex;
    flex-direction: column;
}

.product-stat-label {
    font-size: 0.76rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 2px;
}

.product-sku-pill {
    font-family: monospace;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    color: #93c5fd;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.product-stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
}

.stock-safe {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.stock-low {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.stock-out {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.product-status-pill {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.status-inactive {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.btn-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.btn-action-icon:hover {
    background: rgba(37, 99, 235, 0.25);
    color: #ffffff;
    border-color: rgba(37, 99, 235, 0.5);
    transform: scale(1.05);
}

.btn-action-delete:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.5);
}

/* ─── Simplified Header Controls: Quick Date Preset & "Lainnya" Menu ─── */
.quick-date-select {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.quick-date-select:hover,
.quick-date-select:focus {
    border-color: rgba(37, 99, 235, 0.6);
}

.header-more-wrapper {
    position: relative;
    display: inline-block;
}

.header-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-more-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(37, 99, 235, 0.45);
    color: #ffffff;
}

.header-more-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(14px);
    z-index: 1200;
    display: none;
    flex-direction: column;
    gap: 2px;
}

.header-more-menu.open {
    display: flex;
}

.header-more-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #f1f5f9;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.header-more-item:hover {
    background: rgba(37, 99, 235, 0.16);
}

.header-more-item > span {
    font-size: 1.05rem;
    line-height: 1.2;
    margin-top: 1px;
}

.header-more-item strong {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #f8fafc;
}

.header-more-item small {
    display: block;
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 2px;
}

.header-more-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STEP #4: MODE KASIR FOKUS & FITUR RETUR / BATAL TRANSAKSI
   ═══════════════════════════════════════════════════════════════════════════ */

.mode-pill-btn.btn-cashier.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
}

.cashier-workspace-panel {
    display: none;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.14) 0%, rgba(30, 41, 59, 0.92) 100%);
    border: 1px solid rgba(14, 165, 233, 0.35);
    border-radius: 16px;
    padding: 20px 22px;
    margin-bottom: 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

body.mode-cashier .cashier-workspace-panel {
    display: block !important;
}

.cashier-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cashier-workspace-badge {
    background: rgba(14, 165, 233, 0.22);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #7dd3fc;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 8px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.cashier-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.cashier-action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #f8fafc;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cashier-action-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.cashier-action-card.primary {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(5, 150, 105, 0.15) 100%);
    border-color: rgba(16, 185, 129, 0.45);
}

.cashier-action-card.primary:hover {
    border-color: #34d399;
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.25);
}

.cashier-card-icon {
    font-size: 1.55rem;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cashier-card-info strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 2px;
}

.cashier-card-info span {
    display: block;
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.35;
}

/* Sembunyikan informasi sensitif pemilik (HPP, Laba, Margin, Analisis Pro, Reset Data) saat Mode Kasir aktif */
body.mode-cashier .pro-feature,
body.mode-cashier #proUnlockBanner,
body.mode-cashier #nav-ai-insights,
body.mode-cashier #nav-import-csv,
body.mode-cashier #nav-export-report,
body.mode-cashier #btnResetData,
body.mode-cashier .welcome-banner,
body.mode-cashier #btnOpenUpload,
body.mode-cashier #btnExportReport,
body.mode-cashier .trend-mode-pills,
body.mode-cashier .trend-mini-kpi-bar > div:nth-child(2),
body.mode-cashier .trend-mini-kpi-bar > div:nth-child(3),
body.mode-cashier .trend-mini-kpi-bar > div:nth-child(4),
body.mode-cashier .product-stats-grid > .product-stat-card:nth-child(2),
body.mode-cashier .product-stats-grid > .product-stat-card:nth-child(4),
body.mode-cashier #productsTable th:nth-child(5),
body.mode-cashier #productsTable td:nth-child(5),
body.mode-cashier #productsTable th:nth-child(7),
body.mode-cashier #productsTable td:nth-child(7),
body.mode-cashier #zReportModal div:has(> #zKpiNetProfit) {
    display: none !important;
}

/* Order Action Buttons in History Table */
.order-actions-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-order-action {
    font-size: 0.72rem;
    padding: 4px 9px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}
.btn-order-action:hover {
    transform: translateY(-1px);
}
.btn-order-action:active {
    transform: scale(0.97);
}

.btn-order-action.btn-receipt {
    background: rgba(37, 99, 235, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.42);
    color: #93c5fd;
}
.btn-order-action.btn-receipt:hover {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}

.btn-order-action.btn-return {
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.42);
    color: #fcd34d;
}
.btn-order-action.btn-return:hover {
    background: #d97706;
    border-color: #b45309;
    color: #ffffff;
}

.btn-order-action.btn-cancel {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: #fca5a5;
}
.btn-order-action.btn-cancel:hover {
    background: #dc2626;
    border-color: #b91c1c;
    color: #ffffff;
}

.btn-order-action.btn-complete {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.44);
    color: #6ee7b7;
}
.btn-order-action.btn-complete:hover {
    background: #059669;
    border-color: #047857;
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FULL-PAGE POS MACHINE (#section-pos) & KARTU RIWAYAT STOK
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 365px;
    gap: 16px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

.pos-catalog-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
}

.pos-catalog-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.pos-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 7px 10px;
    min-width: 0;
}

.pos-search-bar input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: #f8fafc;
    font-size: 0.86rem;
    outline: none;
}

.pos-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 2px;
    min-width: 0;
}

.pos-cat-pill {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.pos-cat-pill:hover {
    border-color: rgba(59, 130, 246, 0.55);
    color: #ffffff;
}

.pos-cat-pill.active {
    background: #1d4ed8;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: 10px;
    max-height: 66vh;
    overflow-y: auto;
    padding-right: 4px;
    min-width: 0;
}

.pos-product-card {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.16s ease;
    position: relative;
}

.pos-product-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(30, 41, 59, 0.96);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
}

.pos-product-card.out-of-stock {
    opacity: 0.55;
    border-color: rgba(239, 68, 68, 0.35);
    cursor: not-allowed;
}

.pos-product-card.out-of-stock:hover {
    transform: none;
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow: none;
}

.pos-product-card.low-stock {
    border-color: rgba(245, 158, 11, 0.38);
}

button:disabled,
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed !important;
}

.search-clear-btn {
    background: rgba(148, 163, 184, 0.16);
    border: none;
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.search-clear-btn:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}

.table-container {
    -webkit-overflow-scrolling: touch;
}

.pos-prod-cat {
    font-size: 0.66rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.pos-prod-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pos-prod-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pos-prod-price {
    font-size: 0.9rem;
    font-weight: 800;
    color: #34d399;
}

.pos-prod-stock {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
}

.pos-prod-stock.low {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
}

.pos-prod-stock.empty {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.pos-cart-panel {
    background: var(--bg-card);
    border: 1px solid rgba(16, 185, 129, 0.32);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 14px;
}

.pos-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pos-small-input {
    width: 100%;
    padding: 7px 10px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 0.78rem;
    outline: none;
}

.pos-small-input:focus {
    border-color: #2563eb;
}

.pos-cart-items {
    max-height: 250px;
    min-height: 130px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
}

.pos-cart-empty {
    text-align: center;
    padding: 24px 14px;
    color: #94a3b8;
    font-size: 0.82rem;
}

.pos-cart-item-row {
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 9px 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pos-cart-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pos-cart-item-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #f8fafc;
}

.pos-cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pos-qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 2px;
}

.pos-qty-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border-radius: 4px;
    font-weight: 800;
    cursor: pointer;
}

.pos-qty-btn:hover {
    background: #2563eb;
}

.pos-cart-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #6ee7b7;
}

.pos-total-row strong {
    font-size: 1.15rem;
    color: #34d399;
}

.pos-pay-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.pos-pay-pill {
    padding: 7px 4px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.pos-pay-pill.active {
    background: rgba(37, 99, 235, 0.25);
    border-color: #3b82f6;
    color: #ffffff;
}

.pos-cash-calculator {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
}

.pos-quick-cash-btn {
    flex: 1;
    padding: 4px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #cbd5e1;
    cursor: pointer;
}

.pos-quick-cash-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #34d399;
    color: #ffffff;
}

.pos-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.94rem;
    font-weight: 800;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.pos-submit-btn:hover {
    filter: brightness(1.08);
}

/* Stock Movement Type Badges */
.mut-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
}
.mut-sale { background: rgba(37, 99, 235, 0.16); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.35); }
.mut-restock { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.35); }
.mut-return { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.35); }
.mut-void { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }
.mut-adjustment, .mut-initial { background: rgba(14, 165, 233, 0.16); color: #7dd3fc; border: 1px solid rgba(14, 165, 233, 0.35); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE & TABLET OPTIMIZATION (LAYAR HP & TABLET KASIR)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1240px) {
    .pos-page-layout {
        grid-template-columns: minmax(0, 1fr) 330px;
        gap: 14px;
    }
}

@media (max-width: 1024px) {
    .pos-page-layout {
        grid-template-columns: 1fr;
    }
    .pos-cart-panel {
        position: static;
    }
    .pos-product-grid {
        max-height: 52vh;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 10px 14px !important;
        gap: 10px !important;
    }
    .header-left, .header-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px !important;
    }
    .mode-switcher-container {
        width: 100%;
        justify-content: center;
        overflow-x: auto;
    }
    .mode-pill-btn {
        flex: 1;
        justify-content: center;
        font-size: 0.72rem !important;
        padding: 6px 8px !important;
    }
    .date-filter-group {
        width: 100%;
        overflow-x: auto;
        justify-content: space-between;
    }
    .cashier-action-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .cashier-action-grid {
        grid-template-columns: 1fr;
    }
    .pos-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .pos-pay-methods {
        grid-template-columns: repeat(2, 1fr);
    }
    .date-input-wrapper {
        display: none; /* Pada layar HP sempit, cukup gunakan dropdown Preset Cepat (Hari Ini / 7 Hari / Bulan Ini) */
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALFAMART-STYLE MINIMARKET LED DISPLAY, INLINE PRODUCT INPUT & CLOUD SAAS
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-minimarket-led-bar {
    background: linear-gradient(135deg, #050b14 0%, #0f172a 100%);
    border: 2px solid rgba(16, 185, 129, 0.45);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: inset 0 0 24px rgba(16, 185, 129, 0.08), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.pos-cloud-terminal-badge {
    background: rgba(14, 165, 233, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.pos-saas-plan-badge {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pos-saas-plan-badge:hover {
    background: rgba(16, 185, 129, 0.32);
    color: #ffffff;
}

.pos-led-item-ticker {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.92rem;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.02em;
}

.pos-led-right {
    text-align: right;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 10px;
    padding: 8px 16px;
    min-width: 220px;
}

.pos-led-total-label {
    font-size: 0.66rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.06em;
}

.pos-led-total-digits {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 1.65rem;
    font-weight: 900;
    color: #34d399;
    text-shadow: 0 0 12px rgba(52, 211, 153, 0.45);
    line-height: 1.15;
}

.pos-fn-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.pos-fn-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pos-fn-btn:hover {
    border-color: #3b82f6;
    background: rgba(51, 65, 85, 0.95);
    color: #ffffff;
}

.pos-fn-btn.fn-add-prod {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.16));
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.pos-fn-btn.fn-cloud {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(37, 99, 235, 0.45);
    color: #bfdbfe;
}

.fn-key {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fcd34d;
    font-family: monospace;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
}

.pos-inline-new-prod-box {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.35) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(16, 185, 129, 0.45);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.pos-new-prod-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 14px;
}

.pos-new-prod-grid .pos-np-span-2 { grid-column: span 2; }

@media (max-width: 900px) {
    .pos-new-prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .pos-new-prod-grid { grid-template-columns: 1fr; }
    .pos-new-prod-grid .pos-np-span-2 { grid-column: auto; }
}

.pos-new-prod-grid label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 5px;
}

.pos-new-prod-grid input,
.pos-new-prod-grid select {
    width: 100%;
    padding: 9px 11px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 0.86rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pos-new-prod-grid input:focus,
.pos-new-prod-grid select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.pos-new-prod-grid input.is-invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}
.pos-new-prod-grid input.is-valid { border-color: #34d399; }

/* Form header / helpers */
.pos-np-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.pos-np-title { color: #6ee7b7; font-size: 0.95rem; display: block; }
.pos-np-subtitle { font-size: 0.74rem; color: #94a3b8; }
.pos-np-req { color: #f87171; }
.pos-np-inline { display: flex; gap: 6px; }
.pos-np-inline .btn { padding: 4px 10px; flex-shrink: 0; }
.pos-np-help {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
    color: #64748b;
    min-height: 1em;
}
.pos-np-help.ok { color: #34d399; }
.pos-np-help.err { color: #f87171; font-weight: 600; }
.pos-np-help.warn { color: #fbbf24; }

.pos-np-auto-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.18);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

/* Tooltip "?" */
.pos-np-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
    font-size: 0.62rem;
    font-weight: 800;
    cursor: help;
    outline: none;
}
.pos-np-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    width: 240px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 50;
}
.pos-np-tip:hover::after,
.pos-np-tip:focus::after {
    opacity: 1;
    visibility: visible;
}

.pos-np-error {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    font-size: 0.78rem;
    font-weight: 600;
}

.pos-np-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.pos-np-keyhint {
    margin-right: auto;
    font-size: 0.7rem;
    color: #64748b;
}
.pos-np-keyhint kbd {
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: inherit;
    font-size: 0.68rem;
    color: #cbd5e1;
}
.pos-np-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    font-weight: 700;
}
.pos-np-actions .btn:disabled { opacity: 0.55; cursor: not-allowed; }

.saas-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.saas-plan-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.saas-plan-card.active {
    border: 2px solid #10b981;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.saas-plan-popular {
    position: absolute;
    top: -10px;
    right: 12px;
    background: #10b981;
    color: #052e16;
    font-size: 0.62rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 10px;
}

.saas-plan-name {
    font-size: 0.92rem;
    font-weight: 800;
    color: #f8fafc;
}

.saas-plan-price {
    font-size: 1.3rem;
    font-weight: 900;
    color: #34d399;
    margin: 6px 0 10px 0;
}

.saas-plan-price span {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
}

.saas-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 14px 0;
    font-size: 0.76rem;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}





/* ─── POS: Held Bills icon button with count badge ─── */
.pos-held-icon-btn {
    position: relative;
    border-color: rgba(245, 158, 11, 0.45) !important;
    color: #fcd34d !important;
}
.pos-held-icon-btn .pos-held-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.35);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 800;
}
.pos-held-icon-btn.has-held .pos-held-badge {
    background: #f59e0b;
    color: #1c1917;
    animation: posHeldPulse 1.6s ease-in-out infinite;
}
@keyframes posHeldPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
#posHeldBillsListContainer {
    max-height: 260px;
    overflow-y: auto;
}
body.mode-cashier .owner-only-cost-field {
    display: none !important;
}
