:root {
    --primary: #0f172a;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text-main); height: 100vh; display: flex; overflow: hidden; }

/* Sidebar */
.sidebar { width: 340px; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; z-index: 10; }
.brand { padding: 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.logo { width: 42px; height: 42px; background: var(--primary); color: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.brand-name { font-size: 18px; font-weight: 700; color: var(--primary); }
.brand-ver { font-size: 11px; font-weight: 500; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.5px; }

.form-content { padding: 20px; flex: 1; }
.section-title { font-size: 11px; font-weight: 800; color: #94a3b8; text-transform: uppercase; margin: 24px 0 12px; letter-spacing: 0.5px; }
.section-title:first-child { margin-top: 0; }

/* Inputs */
.input-group { margin-bottom: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-sub); margin-bottom: 6px; }
input, select { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; color: var(--text-main); transition: 0.2s; background: #fff; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
input:disabled { background: #f1f5f9; cursor: not-allowed; }

.checkbox-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.checkbox-group label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; cursor: pointer; }

.btn-calc { width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
.btn-calc:hover { background: #1e293b; transform: translateY(-1px); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }

/* Main Area */
.main { flex: 1; padding: 30px; overflow-y: auto; position: relative; }

/* Header */
.header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.tag { background: #dbeafe; color: var(--accent); font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 4px; display: inline-block; margin-bottom: 6px; }
.header h1 { font-family: 'JetBrains Mono', monospace; font-size: 24px; color: var(--primary); }
.validity { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.big-price { text-align: right; }
.big-price small { display: block; font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.big-price div { font-family: 'JetBrains Mono', monospace; font-size: 32px; font-weight: 700; color: var(--accent); }
.btn-export { margin-top: 8px; padding: 8px 16px; border: 1px solid var(--border); background: #fff; border-radius: 6px; color: var(--text-main); font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: 0.2s; }
.btn-export:hover { background: #f8fafc; border-color: #cbd5e1; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { display: flex; align-items: center; gap: 16px; padding: 16px !important; }
.icon-box { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.icon-box.blue { background: #eff6ff; color: #3b82f6; }
.icon-box.purple { background: #f3e8ff; color: #a855f7; }
.icon-box.orange { background: #ffedd5; color: #f97316; }
.icon-box.green { background: #dcfce7; color: #22c55e; }
.kpi-card .label { font-size: 11px; color: var(--text-sub); margin-bottom: 2px; }
.kpi-card .value { font-size: 16px; font-weight: 700; color: var(--text-main); font-family: 'JetBrains Mono'; }

/* Layout & Cards */
.grid-layout { display: grid; grid-template-columns: 350px 1fr; gap: 20px; margin-bottom: 20px; }
.card { background: var(--card-bg); border-radius: 10px; padding: 20px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--primary); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #f1f5f9; padding-bottom: 10px; }
.chart-container { position: relative; height: 220px; }

/* Detail Table */
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table td { padding: 10px 0; border-bottom: 1px solid #f1f5f9; color: var(--text-main); }
.detail-table tr:last-child td { border-bottom: none; }
.detail-table .text-right { text-align: right; font-family: 'JetBrains Mono'; font-weight: 500; }
.row-total td { font-weight: 700; color: var(--primary); border-top: 1px solid var(--border); padding-top: 15px; }

/* Roadmap */
.roadmap-container { display: flex; gap: 0; overflow-x: auto; padding-bottom: 10px; }
.roadmap-step { flex: 1; min-width: 120px; position: relative; padding-right: 20px; }
.step-icon { width: 32px; height: 32px; background: #f8fafc; border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-sub); font-size: 12px; margin-bottom: 10px; z-index: 2; position: relative; }
.step-line { position: absolute; top: 16px; left: 16px; width: 100%; height: 2px; background: #e2e8f0; z-index: 1; }
.roadmap-step:last-child .step-line { display: none; }
.roadmap-step.active .step-icon { background: var(--accent); color: white; border-color: var(--accent); }
.roadmap-step.active .step-line { background: var(--accent); }
.step-title { font-size: 12px; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.step-desc { font-size: 10px; color: var(--text-sub); line-height: 1.4; }

/* Utilities */
.hidden { display: none !important; }
.empty-state { text-align: center; margin-top: 10vh; color: #cbd5e1; }
.empty-icon { font-size: 64px; margin-bottom: 20px; }
#loadingOverlay { position: fixed; inset: 0; background: rgba(255,255,255,0.9); z-index: 999; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.loader { width: 40px; height: 40px; border: 4px solid #e2e8f0; border-top: 4px solid var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.loader-text { margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.pdf-template { font-family: 'Inter', sans-serif !important; background: #fff; }