:root {
    --bg-dark: #030712;
    --card-bg: #0f172a;
    --input-bg: #1e293b;
    --border-color: #334155;
    --accent-gold: #f59e0b;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background-color: var(--bg-dark); color: var(--text-main); display: flex; justify-content: center; padding: 10px; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.app-container { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 10px; }

/* Top Header */
.top-header { background: var(--card-bg); padding: 10px; border-radius: 10px; border: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 8px; }
.brand-logo { font-size: 16px; color: var(--accent-gold); font-weight: bold; }
.brand-slogan { font-size: 9px; color: var(--text-sub); }
.header-actions { display: flex; justify-content: space-between; gap: 8px; }
.role-dropdown { background: var(--input-bg); color: var(--accent-gold); border: 1px solid var(--accent-gold); padding: 6px; border-radius: 6px; font-size: 11px; font-weight: bold; width: 65%; }
.b2c-switch-btn { background: var(--accent-gold); color: #000; border: none; padding: 6px 10px; border-radius: 6px; font-weight: bold; font-size: 10px; cursor: pointer; width: 33%; }

/* Main Navigation */
.main-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.nav-tab { background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-sub); padding: 6px 12px; border-radius: 20px; font-size: 11px; white-space: nowrap; cursor: pointer; }
.nav-tab.active { background: var(--accent-blue); color: #fff; font-weight: bold; border-color: var(--accent-blue); }
.badge-count { background: var(--accent-red); color: #fff; border-radius: 50%; padding: 1px 5px; font-size: 9px; margin-left: 3px; }

/* Search Bar */
.search-bar-container { background: var(--card-bg); border: 1px solid var(--border-color); padding: 6px; border-radius: 8px; }
.search-input-group { display: flex; gap: 6px; }
.search-input-group input { width: 100%; background: transparent; border: none; outline: none; color: #fff; font-size: 12px; }
.search-tool-btn { background: var(--input-bg); border: 1px solid var(--border-color); color: #fff; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; }

/* Publicity Carousel */
.ad-carousel-card { background: #000; border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; position: relative; }
.ad-banner { padding: 12px; text-align: center; }
.ad-badge { position: absolute; top: 6px; right: 6px; background: var(--accent-gold); color: #000; font-size: 9px; font-weight: bold; padding: 2px 6px; border-radius: 10px; }
.ad-title { font-size: 11px; font-weight: bold; color: var(--accent-gold); }
.ad-sub { font-size: 9px; color: var(--text-sub); margin: 4px 0 8px 0; }
.ad-action-btn { background: var(--input-bg); border: 1px solid var(--accent-gold); color: var(--accent-gold); padding: 4px 10px; font-size: 10px; border-radius: 6px; cursor: pointer; }

/* Card Components */
.card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 13px; font-weight: bold; color: var(--text-main); }
.card-header-flex { display: flex; justify-content: space-between; align-items: flex-start; }
.sub-id { font-size: 10px; color: var(--text-sub); }
.status-badge { font-size: 9px; font-weight: bold; padding: 2px 6px; border-radius: 4px; }
.status-badge.gold { background: rgba(245,158,11,0.2); color: var(--accent-gold); }
.status-badge.green { background: rgba(16,185,129,0.2); color: var(--accent-green); }
.status-badge.blue { background: rgba(59,130,246,0.2); color: var(--accent-blue); }

.info-row { display: flex; justify-content: space-between; font-size: 11px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.gold-text { color: var(--accent-gold); }
.green-text { color: var(--accent-green); }

/* Buttons */
.btn-primary { background: var(--accent-blue); color: #fff; border: none; padding: 8px 12px; border-radius: 6px; font-size: 11px; font-weight: bold; cursor: pointer; width: 100%; margin-top: 4px; }
.btn-secondary { background: var(--input-bg); color: var(--text-main); border: 1px solid var(--border-color); padding: 8px 12px; border-radius: 6px; font-size: 11px; font-weight: bold; cursor: pointer; width: 100%; }
.red-btn { background: var(--accent-red); }

/* Products Grid & Filter Chips */
.filter-chips { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 8px; }
.chip { background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-sub); font-size: 10px; padding: 4px 8px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--accent-gold); color: #000; font-weight: bold; }
.product-grid { display: flex; flex-direction: column; gap: 8px; }
.product-item-card { background: var(--input-bg); border: 1px solid var(--border-color); padding: 8px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }

/* 1/9 to 9/9 Stepper */
.stepper-wrapper { display: flex; justify-content: space-between; position: relative; margin: 15px 0 10px 0; }
.stepper-line-bg { position: absolute; top: 10px; left: 0; width: 100%; height: 2px; background: var(--border-color); z-index: 1; }
.stepper-line-fill { height: 100%; background: var(--accent-gold); width: 25%; transition: width 0.3s; }
.step-node { width: 22px; height: 22px; border-radius: 50%; background: var(--input-bg); border: 1px solid var(--border-color); font-size: 9px; font-weight: bold; display: flex; align-items: center; justify-content: center; z-index: 2; color: var(--text-sub); }
.step-node.completed { background: var(--accent-green); color: #000; border-color: var(--accent-green); }
.step-node.active { background: var(--accent-gold); color: #000; border-color: var(--accent-gold); }

.diagnostic-box { background: var(--input-bg); padding: 8px; border-radius: 6px; font-size: 10px; border-left: 3px solid var(--accent-gold); }

/* Incidents KPI Grid */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.kpi-box { background: var(--input-bg); border: 1px solid var(--border-color); padding: 8px; border-radius: 6px; display: flex; flex-direction: column; }
.kpi-num { font-size: 14px; font-weight: bold; }
.kpi-lbl { font-size: 8px; color: var(--text-sub); }
.rule-text-warning { font-size: 10px; color: var(--accent-gold); line-height: 1.3; }

/* Chat Window */
.chat-window { background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 8px; height: 120px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.chat-bubble { font-size: 10px; padding: 6px; border-radius: 6px; max-width: 85%; }
.chat-bubble.left { background: #334155; align-self: flex-start; }
.chat-bubble.right { background: #1e3a8a; align-self: flex-end; }
.chat-author { font-size: 8px; color: var(--accent-gold); font-weight: bold; display: block; }
.chat-input-bar { display: flex; gap: 6px; margin-top: 6px; }
.chat-input-bar input { width: 100%; background: var(--input-bg); border: 1px solid var(--border-color); color: #fff; padding: 6px; border-radius: 6px; font-size: 11px; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 34px; height: 18px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #334155; transition: .3s; border-radius: 20px; }
.switch-slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .switch-slider { background-color: var(--accent-gold); }
input:checked + .switch-slider:before { transform: translateX(16px); }

/* Modals */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 1000; justify-content: center; align-items: center; padding: 10px; }
.modal-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; width: 100%; max-width: 420px; padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 6px; }
.close-btn { background: transparent; border: none; color: #fff; font-size: 14px; cursor: pointer; }
.cam-preview-box { background: #000; height: 140px; border-radius: 8px; border: 1px dashed var(--accent-gold); display: flex; align-items: center; justify-content: center; font-size: 11px; }

canvas { background: #fff; border-radius: 6px; cursor: crosshair; }
.form-lbl { font-size: 10px; color: var(--text-sub); display: block; margin-top: 4px; }
.form-input { background: var(--input-bg); border: 1px solid var(--border-color); color: #fff; padding: 6px; border-radius: 4px; font-size: 11px; width: 100%; }
.form-row { display: flex; gap: 6px; }
.error-block-economic { background: rgba(239,68,68,0.2); border: 1px solid var(--accent-red); color: #fca5a5; font-size: 10px; padding: 6px; border-radius: 6px; line-height: 1.3; }
.small-sub-text { font-size: 9px; color: var(--text-sub); }
