/* =========================================================
   ACCOUNTIFY STORE - DESIGN SYSTEM & STYLESHEET
   Sleek Fintech Dark / Light Aesthetic with Ambient Glows
========================================================= */

:root {
    /* Color Palette - Default Dark (Accountify Theme) */
    --bg-base: #08090f;
    --bg-header: rgba(13, 15, 25, 0.88);
    --bg-card: rgba(19, 23, 38, 0.75);
    --bg-card-hover: rgba(26, 32, 52, 0.9);
    --bg-input: rgba(15, 18, 30, 0.85);
    --bg-input-focus: #141829;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(168, 85, 247, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;
    
    /* Brand Accent Gradients */
    --brand-purple: #9333ea;
    --brand-magenta: #c026d3;
    --brand-pink: #ec4899;
    --brand-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --brand-gradient-hover: linear-gradient(135deg, #b86bfc 0%, #f45ca7 100%);
    --brand-glow: 0 0 24px rgba(168, 85, 247, 0.35);
    --card-glow: 0 8px 32px -4px rgba(0, 0, 0, 0.45);
    
    /* Functional Colors */
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-danger: #f43f5e;
    --color-danger-bg: rgba(244, 63, 94, 0.12);
    --color-info: #0ea5e9;
    --color-info-bg: rgba(14, 165, 233, 0.12);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.12);
    
    /* Table & Group Highlights */
    --sales-accent: #a855f7;
    --sales-bg: rgba(168, 85, 247, 0.07);
    --struk-accent: #0ea5e9;
    --struk-bg: rgba(14, 165, 233, 0.07);
    --apc-accent: #10b981;
    --apc-bg: rgba(16, 185, 129, 0.07);
    
    --table-header-bg: #111422;
    --table-stripe-bg: rgba(255, 255, 255, 0.015);
    --table-hover-bg: rgba(168, 85, 247, 0.08);
    --table-today-bg: rgba(16, 185, 129, 0.12);
    --table-border: rgba(255, 255, 255, 0.07);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-header: rgba(255, 255, 255, 0.92);
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: #ffffff;
    --bg-input: #f1f5f9;
    --bg-input-focus: #ffffff;
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-card: rgba(0, 0, 0, 0.1);
    --border-accent: rgba(147, 51, 234, 0.35);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    
    --table-header-bg: #f1f5f9;
    --table-stripe-bg: #fcfdfe;
    --table-hover-bg: rgba(147, 51, 234, 0.06);
    --table-today-bg: rgba(16, 185, 129, 0.14);
    --table-border: #e2e8f0;
    
    --card-glow: 0 6px 24px -2px rgba(15, 23, 42, 0.08);
}

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

html, body {
    width: 100%;
    min-height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================================
   AMBIENT GLOW ACCENTS
========================================================= */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.45;
}

.glow-top-left {
    top: -150px;
    left: -100px;
    width: 500px;
    height: 450px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, transparent 70%);
}

.glow-top-right {
    top: -120px;
    right: -80px;
    width: 550px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.28) 0%, transparent 70%);
}

.glow-center {
    top: 40%;
    left: 30%;
    width: 600px;
    height: 400px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
}

/* =========================================================
   NOTIFICATION STATUS TOAST
========================================================= */
.status {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translate(-50%, -20px) scale(0.95);
    background: rgba(15, 18, 30, 0.94);
    backdrop-filter: blur(16px);
    color: #fff;
    padding: 9px 20px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-accent);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s;
    pointer-events: none;
}

.status.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0) scale(1);
}

.status-icon {
    font-size: 14px;
}

/* =========================================================
   HEADER & NAVBAR
========================================================= */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    max-width: 1600px;
    margin: 0 auto;
}

/* Brand Section */
.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.brand-badge:hover {
    background: var(--border-subtle);
}

.logo-wrapper {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
    background: #000;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-pulse {
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--brand-pink);
    opacity: 0.6;
    animation: logoPulse 3s infinite ease-in-out;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.08); opacity: 0.8; }
}

.title-area {
    display: flex;
    flex-direction: column;
}

.brand-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.store-tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.app-subtitle {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Nav Pills & Dropdowns */
.bot-credit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    user-select: none;
}

.nav-pill-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.nav-icon {
    flex-shrink: 0;
}

.chevron {
    font-size: 8px;
    opacity: 0.7;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: inline-block;
}

/* Dropdown Menus */
.menuDropdown {
    position: relative;
    display: inline-flex;
}

.dropdownContent {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 210px;
    max-height: 380px;
    overflow-y: auto;
    padding: 6px;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    z-index: 1000;
}

.menuDropdown.open .dropdownContent {
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: fadeInDown 0.15s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdownContent a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    color: var(--text-secondary) !important;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.dropdownContent a:hover {
    background: var(--brand-gradient);
    color: #ffffff !important;
}

/* =========================================================
   TOP ACTIONS (STORE, PERIOD, BUTTONS)
========================================================= */
.top-actions {
    display: grid;
    grid-template-columns: 140px 240px 1fr;
    gap: 8px;
    align-items: center;
    width: 100%;
    margin-top: 6px;
    max-width: 1600px;
}

.control-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: var(--transition);
}

.control-box:hover {
    border-color: var(--border-accent);
}

.control-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 8.5px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.store-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.store-input-wrapper input {
    background: transparent;
    border: 0;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
    width: 70px;
    cursor: pointer;
    outline: none;
    letter-spacing: 0.5px;
}

.store-edit-badge {
    font-size: 9px;
    font-weight: 700;
    color: var(--brand-pink);
    background: rgba(236, 72, 153, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Period Selectors */
.period-select-row {
    display: flex;
    gap: 6px;
}

.select-wrapper {
    position: relative;
    flex: 1;
}

.select-wrapper select {
    width: 100%;
    height: 24px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.select-wrapper select:focus {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

/* Action Buttons Toolbar */
.action-btn-group {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-accent {
    background: var(--brand-gradient);
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(168, 85, 247, 0.35);
}

.btn-accent:hover {
    background: var(--brand-gradient-hover);
}

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

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

.btn-danger {
    background: var(--color-danger-bg);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: #fda4af;
}

.btn-danger:hover {
    background: var(--color-danger);
    color: #ffffff;
}

/* =========================================================
   SUMMARY / KPI METRICS CARDS
========================================================= */
.summary {
    display: grid;
    grid-template-columns: 140px 170px 1.2fr 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.summary-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 7px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--card-glow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: var(--transition);
}

.card-sales::before { background: var(--brand-gradient); }
.card-struk::before { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.card-apc::before { background: linear-gradient(90deg, #10b981, #34d399); }
.card-target::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.summary-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.card-icon {
    font-size: 11px;
}

.card-label {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.card-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.currency-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.card-sales .metric-value {
    color: #f1f5f9;
    text-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.unit-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.metric-indicator {
    font-size: 8.5px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* History Undo/Redo Card */
.history-actions {
    display: flex;
    gap: 5px;
}

.history-btn {
    flex: 1;
    height: 26px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 9.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: var(--transition);
}

.history-btn:hover:not(:disabled) {
    background: var(--border-accent);
    color: #ffffff;
    border-color: var(--brand-purple);
}

.history-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Target SPD Input Card */
.card-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    height: 26px;
    transition: var(--transition);
}

.card-input-wrapper:focus-within {
    border-color: var(--color-warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.card-input-wrapper .prefix {
    font-size: 10px;
    font-weight: 800;
    color: var(--color-warning);
    margin-right: 4px;
}

.card-input-wrapper input {
    width: 100%;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
}

.target-subtext {
    font-size: 8.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* =========================================================
   TABLE CONTAINER & WRAPPER
========================================================= */
.table-container {
    width: 100%;
    max-width: 1600px;
    margin: 8px auto 20px;
    padding: 0 16px;
}

.table-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.table-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 10px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.today-dot { background: var(--color-success); box-shadow: 0 0 8px var(--color-success); }
.input-dot { background: #eab308; }
.auto-dot { background: var(--brand-purple); }

.btn-micro {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-micro:hover {
    color: var(--brand-pink);
    border-color: var(--brand-pink);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 190px);
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-glow);
    scrollbar-width: thin;
    scrollbar-color: var(--brand-purple) var(--bg-input);
}

/* Custom Scrollbars */
.table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-input);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-accent);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--brand-purple);
}

/* Table Architecture */
table {
    width: 100%;
    min-width: 1100px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 10.5px;
    color: var(--text-primary);
}

/* Sticky Headers */
thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

th {
    padding: 4px 6px;
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.3px;
    border-right: 1px solid var(--table-border);
    border-bottom: 1px solid var(--table-border);
    background: var(--table-header-bg);
}

.header-super th {
    padding: 5px 6px;
    font-size: 9.5px;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-weight: 800;
    letter-spacing: 0.5px;
}

.cat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.category-sales .cat-pill {
    background: var(--sales-bg);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.25);
}
.category-sales .cat-dot { background: var(--sales-accent); }

.category-struk .cat-pill {
    background: var(--struk-bg);
    color: #7dd3fc;
    border: 1px solid rgba(14, 165, 233, 0.25);
}
.category-struk .cat-dot { background: var(--struk-accent); }

.category-apc .cat-pill {
    background: var(--apc-bg);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.category-apc .cat-dot { background: var(--apc-accent); }

.header-sub th {
    font-size: 8.5px;
    color: var(--text-muted);
    background: var(--table-header-bg);
}

.col-input-head {
    color: #facc15 !important;
}

.col-compare {
    color: #94a3b8 !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Sticky First Column: TGL */
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 25;
    background: var(--table-header-bg);
    width: 44px;
    min-width: 44px;
}

.col-tgl-head {
    z-index: 30 !important;
}

.th-content {
    font-weight: 900;
    color: var(--brand-pink);
}

td.tgl {
    position: sticky;
    left: 0;
    z-index: 10;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 11px;
    color: var(--brand-purple);
    background: var(--bg-card);
    text-align: center;
    border-right: 1px solid var(--table-border);
    border-bottom: 1px solid var(--table-border);
}

/* Table Cells */
td {
    padding: 2px 4px;
    border-right: 1px solid var(--table-border);
    border-bottom: 1px solid var(--table-border);
    text-align: right;
    font-family: var(--font-mono);
    font-size: 10px;
    white-space: nowrap;
    transition: background 0.15s ease;
}

tbody tr:nth-child(even) {
    background-color: var(--table-stripe-bg);
}

tbody tr:hover {
    background-color: var(--table-hover-bg) !important;
}

tbody tr:hover td.tgl {
    background-color: rgba(168, 85, 247, 0.15);
}

/* TODAY Highlighting */
tr.today {
    background-color: var(--table-today-bg) !important;
}

tr.today td.tgl {
    background-color: rgba(16, 185, 129, 0.25) !important;
    color: var(--color-success) !important;
    font-weight: 900;
    position: relative;
}

tr.today td.tgl::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3.5px;
    background: var(--color-success);
}

/* Cell Inputs (Sales & Struk) */
.cell-input {
    width: var(--input-width, 6ch);
    min-width: 42px;
    height: 22px;
    padding: 0 4px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    text-align: right;
    outline: none;
    transition: var(--transition);
}

.cell-input:focus {
    background: var(--bg-input-focus);
    border-color: var(--brand-pink);
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.25);
    color: #ffffff;
}

.cell-input:not(:placeholder-shown) {
    border-color: rgba(250, 204, 21, 0.35);
}

/* Calculated Auto Cells */
.auto {
    cursor: pointer !important;
    user-select: text;
    -webkit-user-select: text;
    padding: 2px 5px;
    font-weight: 600;
}

.auto:hover {
    text-decoration: underline dotted var(--brand-purple);
}

.previous {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.015);
}

/* Growth Indicators (Badges) */
.positive {
    color: var(--color-success) !important;
    font-weight: 800;
}

.negative {
    color: var(--color-danger) !important;
    font-weight: 800;
}

/* =========================================================
   FORMULA TOOLTIP NOTIFICATION
========================================================= */
#rumusNotif {
    position: fixed;
    z-index: 1000001;
    padding: 8px 14px;
    background: rgba(15, 18, 30, 0.95);
    backdrop-filter: blur(12px);
    color: #ffffff;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-accent);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    pointer-events: none;
}

#rumusNotif.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Formula Modal */
#rumusModal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    padding: 16px;
}

#rumusModal.show {
    opacity: 1;
    visibility: visible;
}

.rumus-box {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-accent);
    padding: 20px;
    width: min(440px, 95%);
    position: relative;
    animation: zoomIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.rumus-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: 0;
    background: var(--border-subtle);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.rumus-close:hover {
    background: var(--color-danger);
    color: #fff;
}

.rumus-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--brand-pink);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.rumus-text {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    max-height: 320px;
    overflow-y: auto;
}

.rumus-hint {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
}

/* =========================================================
   MODALS: STORE & COMPLETE STORE
========================================================= */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 99999;
}

.modal.hidden {
    display: none !important;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 5, 10, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-box {
    position: relative;
    width: min(390px, 94%);
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-accent);
    padding: 24px;
    z-index: 2;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 0;
    background: var(--border-subtle);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: var(--border-accent);
    color: #fff;
}

/* Welcome Store Modal */
.welcome-header {
    text-align: center;
    margin-bottom: 16px;
}

.welcome-logo-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background: #000;
    border: 2px solid var(--brand-purple);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.5);
    overflow: hidden;
}

.welcome-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-glow-ring {
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-xl);
    border: 2px solid var(--brand-pink);
    opacity: 0.5;
    animation: logoPulse 2.5s infinite ease-in-out;
}

.welcome-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.accent-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-text {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

.welcome-divider {
    width: 50px;
    height: 3px;
    margin: 12px auto 0;
    background: var(--brand-gradient);
    border-radius: var(--radius-full);
}

.welcome-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-label {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.label-hint {
    color: var(--text-muted);
    font-weight: 500;
}

.store-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.store-input-group .input-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    pointer-events: none;
}

.store-input-group input {
    width: 100%;
    height: 46px;
    padding: 0 12px 0 40px;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    outline: none;
    transition: var(--transition);
}

.store-input-group input:focus {
    border-color: var(--brand-pink);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.25);
}

.quick-presets {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.preset-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.preset-pill {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--brand-pink);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    cursor: pointer;
    transition: var(--transition);
}

.preset-pill:hover {
    background: var(--border-accent);
    color: #fff;
}

.main-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--brand-gradient);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
    transition: var(--transition);
}

.main-start-btn:hover {
    background: var(--brand-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

.welcome-footer {
    text-align: center;
    margin-top: 14px;
    font-size: 9.5px;
    color: var(--text-muted);
}

/* Lengkapi Toko Modal */
.modal-header {
    text-align: center;
    margin-bottom: 16px;
}

.modal-icon-badge {
    font-size: 26px;
    margin-bottom: 6px;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-header p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.form-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    display: block;
    font-size: 9.5px;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.form-group input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.input-readonly {
    opacity: 0.65;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2) !important;
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.modal-actions .btn {
    flex: 1;
    height: 38px;
}

/* =========================================================
   FOOTER
========================================================= */
.app-footer {
    padding: 14px 20px 24px;
    background: transparent;
    border-top: 1px solid var(--border-subtle);
    font-size: 10.5px;
    color: var(--text-muted);
    max-width: 1600px;
    margin: 0 auto;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.file-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.file-info-badge b {
    color: var(--brand-pink);
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 6px var(--color-success);
}

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

.sep {
    opacity: 0.4;
}

/* =========================================================
   RESPONSIVE LAYOUT (MEDIA QUERIES)
========================================================= */

/* Tablets & Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
    .summary {
        grid-template-columns: 120px 140px 1.2fr 1fr 1fr;
        gap: 6px;
    }
    .top-actions {
        grid-template-columns: 120px 200px 1fr;
        gap: 6px;
    }
}

/* Large Phones & Tablets (<= 768px) */
@media (max-width: 768px) {
    .header {
        padding: 6px 10px;
    }
    
    .top-actions {
        grid-template-columns: 1fr 1.3fr;
        gap: 5px;
    }

    .action-btn-group {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        width: 100%;
    }

    .action-btn-group .btn {
        height: 30px;
        padding: 0 4px;
        font-size: 9.5px;
        width: 100%;
        gap: 3px;
    }

    .action-btn-group .btn svg {
        width: 11px;
        height: 11px;
    }

    /* Summary in 2 rows on mobile */
    .summary {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        margin-top: 6px;
    }

    .card-history {
        grid-column: 1 / 2;
    }

    .card-target {
        grid-column: 2 / 3;
    }

    .card-sales {
        grid-column: 1 / 2;
    }

    .card-struk {
        grid-column: 2 / 3;
    }

    .card-apc {
        grid-column: 1 / -1;
    }

    .summary-card {
        padding: 5px 8px;
    }

    .metric-value {
        font-size: 13.5px;
    }

    .table-container {
        padding: 0 6px;
    }

    .table-wrapper {
        max-height: calc(100dvh - 210px);
        border-radius: var(--radius-md);
    }
}

/* Mobile Phones (<= 600px) */
@media (max-width: 600px) {
    .header {
        padding: 5px 8px;
    }

    .brand-badge {
        padding: 2px 4px;
        gap: 8px;
    }

    .logo-wrapper {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .app-title {
        font-size: 16px;
    }

    .store-tag {
        font-size: 8.5px;
        padding: 1px 4px;
    }

    .app-subtitle {
        display: none;
    }

    .bot-credit {
        gap: 4px;
    }

    .nav-pill-btn {
        height: 25px;
        padding: 0 7px;
        font-size: 10px;
        gap: 4px;
    }

    .nav-icon {
        width: 11px;
        height: 11px;
    }

    .control-box {
        padding: 3px 6px;
    }

    .control-label {
        font-size: 7.5px;
        margin-bottom: 1px;
    }

    .store-input-wrapper input {
        font-size: 11.5px;
        width: 55px;
    }

    .store-edit-badge {
        font-size: 8px;
        padding: 1px 4px;
    }

    .select-wrapper select {
        height: 22px;
        font-size: 10px;
        padding: 0 4px;
    }

    .action-btn-group .btn {
        height: 27px;
        font-size: 8.5px;
        border-radius: 6px;
    }

    .action-btn-group .btn svg {
        display: none;
    }

    /* Compact 2-row Summary Cards for mobile phones */
    .summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .summary-card {
        padding: 4px 6px;
        border-radius: 8px;
    }

    .card-header {
        margin-bottom: 2px;
    }

    .card-label {
        font-size: 7.5px;
    }

    .card-icon {
        font-size: 9.5px;
    }

    .metric-value {
        font-size: 12px;
    }

    .currency-label, .unit-label {
        font-size: 8.5px;
    }

    .metric-indicator, .target-subtext {
        font-size: 7.5px;
        margin-top: 1px;
    }

    .history-btn {
        height: 21px;
        font-size: 8.5px;
        padding: 0 4px;
    }

    .card-input-wrapper {
        height: 21px;
        padding: 1px 4px;
    }

    .card-input-wrapper input {
        font-size: 10.5px;
    }

    .card-apc {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .card-apc .metric-indicator {
        display: none;
    }

    /* Table Optimizations on Mobile */
    .table-container {
        padding: 0 4px;
        margin-top: 4px;
    }

    .table-top-bar {
        margin-bottom: 4px;
        gap: 4px;
    }

    .table-legend {
        font-size: 8.5px;
        gap: 6px;
    }

    .btn-micro {
        font-size: 8.5px;
        padding: 2px 7px;
    }

    .table-wrapper {
        max-height: calc(100dvh - 185px);
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    table {
        min-width: 860px;
        font-size: 9px;
    }

    th {
        padding: 2.5px 3px;
        font-size: 8px;
    }

    .header-super th {
        padding: 3px 2px;
        font-size: 7.5px;
    }

    .cat-pill {
        padding: 1px 5px;
        gap: 3px;
        font-size: 7.5px;
    }

    .header-sub th {
        font-size: 7.5px;
        padding: 2px 3px;
    }

    /* Sticky Date column on mobile */
    .sticky-col {
        width: 32px;
        min-width: 32px;
    }

    td.tgl {
        font-size: 9.5px;
        padding: 2px 1px;
    }

    td {
        padding: 1.5px 3px;
        font-size: 9px;
    }

    .cell-input {
        height: 19px;
        font-size: 8.5px;
        min-width: 32px;
        padding: 0 2px;
        touch-action: manipulation;
    }

    .auto {
        padding: 1.5px 3px;
        font-size: 8.5px;
    }

    /* Mobile Modals */
    .modal-box {
        width: min(340px, 94vw);
        padding: 16px;
        border-radius: 16px;
    }

    .welcome-logo-container {
        width: 58px;
        height: 58px;
        border-radius: 14px;
        margin-bottom: 8px;
    }

    .welcome-title {
        font-size: 19px;
    }

    .welcome-text {
        font-size: 10px;
        margin-top: 2px;
    }

    .store-input-group input {
        height: 40px;
        font-size: 15px;
    }

    .main-start-btn {
        height: 38px;
        font-size: 11.5px;
    }

    .app-footer {
        padding: 10px 12px 20px;
        font-size: 9px;
    }
}

/* Very Small Phones (<= 360px) */
@media (max-width: 360px) {
    .app-title {
        font-size: 14px;
    }

    .nav-label {
        display: none;
    }

    .nav-pill-btn {
        padding: 0 5px;
    }

    .top-actions .btn {
        font-size: 7.5px;
        padding: 0 2px;
    }

    .metric-value {
        font-size: 11px;
    }
}
