/* Betanova Karbon & SKDM — demo panel */
:root {
  --navy: #151A48;
  --navy-2: #1C3767;
  --blue: #0F548F;
  --accent: #097AA3;
  --accent-2: #4797B8;
  --bg: #F4F7FA;
  --bg-2: #E1E7EC;
  --white: #fff;
  --text: #151A48;
  --muted: #445a78;
  --border: rgba(21, 26, 72, 0.1);
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 2px 16px rgba(21, 26, 72, 0.06);
  --radius: 14px;
  --sidebar: 248px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Plus Jakarta Sans", var(--font);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button, input, select { font: inherit; }
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar); flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy) 0%, #0c1238 100%);
  color: #fff; display: flex; flex-direction: column;
  padding: 1.1rem 0.9rem; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.35rem 0.5rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1rem;
}
.sidebar__brand img { height: 28px; width: auto; filter: brightness(0) invert(1); opacity: 0.95; }
.sidebar__brand strong { display: block; font-size: 0.82rem; font-family: var(--display); }
.sidebar__brand span { display: block; font-size: 0.68rem; opacity: 0.7; }
.nav-btn {
  display: flex; align-items: center; gap: 0.65rem; width: 100%;
  border: 0; background: transparent; color: rgba(255,255,255,0.78);
  text-align: left; padding: 0.7rem 0.75rem; border-radius: 10px;
  cursor: pointer; font-size: 0.9rem; font-weight: 500; margin-bottom: 0.2rem;
}
.nav-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-btn.is-active {
  background: linear-gradient(135deg, var(--blue), var(--accent));
  color: #fff; font-weight: 700;
}
.nav-btn .ico { width: 1.25rem; text-align: center; opacity: 0.9; }
.sidebar__foot {
  margin-top: auto; padding: 0.85rem 0.5rem 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.75rem; opacity: 0.75;
}
.sidebar__foot a { color: #9ad4ea; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 1.35rem; background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--border); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; font-size: 1.05rem; font-family: var(--display); }
.topbar p { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--muted); }
.topbar__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.badge {
  font-size: 0.7rem; font-weight: 700; padding: 0.28rem 0.6rem; border-radius: 999px;
  background: rgba(9,122,163,0.12); color: var(--accent);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 0.95rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 650; font-size: 0.86rem; cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--accent));
  color: #fff; box-shadow: 0 6px 18px rgba(9,122,163,0.25);
}
.btn-ghost { background: var(--white); border-color: var(--border); color: var(--text); }
.btn:hover { transform: translateY(-1px); }

.content { padding: 1.25rem 1.35rem 2.5rem; }
.view { display: none; animation: fade .25s ease; }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; margin-bottom: 1rem;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.05rem; box-shadow: var(--shadow);
}
.kpi__label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.kpi__value { font-size: 1.55rem; font-weight: 800; font-family: var(--display); margin: 0.25rem 0; letter-spacing: -0.02em; }
.kpi__meta { font-size: 0.78rem; color: var(--muted); }
.kpi__meta.up { color: var(--danger); }
.kpi__meta.down { color: var(--ok); }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0.85rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
@media (max-width: 980px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: flex !important; }
}
.mobile-nav {
  display: none; gap: 0.35rem; overflow-x: auto; padding: 0.65rem 1rem;
  background: var(--white); border-bottom: 1px solid var(--border);
}
.mobile-nav button {
  flex: 0 0 auto; border: 1px solid var(--border); background: var(--bg);
  border-radius: 999px; padding: 0.4rem 0.8rem; font-size: 0.78rem; font-weight: 650; cursor: pointer;
}
.mobile-nav button.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.05rem 1.15rem; box-shadow: var(--shadow); margin-bottom: 0.85rem;
}
.card h2 { margin: 0 0 0.85rem; font-size: 0.98rem; font-family: var(--display); }
.card__head {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem;
}
.card__head h2 { margin: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.7rem 0.55rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:hover td { background: rgba(9,122,163,0.04); }
.status {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
}
.status-ok { background: #ecfdf5; color: var(--ok); }
.status-warn { background: #fffbeb; color: var(--warn); }
.status-danger { background: #fef2f2; color: var(--danger); }
.status-info { background: #eff8fc; color: var(--accent); }

.bars { display: grid; gap: 0.7rem; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 64px; gap: 0.6rem; align-items: center; font-size: 0.84rem; }
.bar-track { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--accent)); }
.chart {
  height: 220px; border-radius: 12px; background:
    linear-gradient(180deg, rgba(9,122,163,0.08), transparent),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(21,26,72,0.04) 40px);
  position: relative; display: flex; align-items: flex-end; gap: 0.55rem; padding: 1rem 0.75rem 1.6rem;
}
.chart-col {
  flex: 1; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  position: relative; min-width: 0; transition: height .35s ease;
}
.chart-col span {
  position: absolute; bottom: -1.25rem; left: 50%; transform: translateX(-50%);
  font-size: 0.68rem; color: var(--muted); white-space: nowrap;
}
.alert {
  display: flex; gap: 0.75rem; padding: 0.85rem 1rem; border-radius: 12px;
  background: #fff7ed; border: 1px solid #fed7aa; margin-bottom: 0.85rem; font-size: 0.88rem;
}
.alert strong { display: block; margin-bottom: 0.15rem; }
.list-clean { list-style: none; margin: 0; padding: 0; }
.list-clean li {
  display: flex; justify-content: space-between; gap: 0.75rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem;
}
.list-clean li:last-child { border-bottom: 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0; }
.pill {
  font-size: 0.72rem; font-weight: 650; padding: 0.28rem 0.55rem; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }
label { display: block; font-size: 0.78rem; font-weight: 650; color: var(--muted); margin-bottom: 0.3rem; }
input, select {
  width: 100%; padding: 0.65rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--white);
}
input:focus, select:focus { outline: 2px solid rgba(9,122,163,0.25); border-color: var(--accent); }
.progress {
  height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin-top: 0.45rem;
}
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--accent)); }
.toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50;
  background: var(--navy); color: #fff; padding: 0.85rem 1.1rem; border-radius: 12px;
  box-shadow: var(--shadow); font-size: 0.88rem; transform: translateY(120%);
  transition: transform .25s ease; max-width: min(360px, calc(100vw - 2rem));
}
.toast.is-show { transform: translateY(0); }
.demo-banner {
  background: linear-gradient(90deg, rgba(15,84,143,0.1), rgba(9,122,163,0.08));
  border: 1px solid rgba(9,122,163,0.2); border-radius: 12px;
  padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.86rem; color: var(--muted);
}
.scenario {
  border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.scenario:hover, .scenario.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(9,122,163,0.12); }
.scenario h3 { margin: 0 0 0.35rem; font-size: 0.92rem; }
.scenario p { margin: 0; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.empty { color: var(--muted); font-size: 0.9rem; padding: 1rem 0; }

.map-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
  aspect-ratio: 16/10; border-radius: 12px; padding: 0.75rem;
  background:
    linear-gradient(160deg, rgba(15,84,143,0.12), rgba(9,122,163,0.05)),
    repeating-linear-gradient(0deg, transparent, transparent 24px, rgba(21,26,72,0.04) 25px),
    repeating-linear-gradient(90deg, transparent, transparent 24px, rgba(21,26,72,0.04) 25px);
}
.map-cell {
  border-radius: 6px; min-height: 0; cursor: default;
  transition: transform .15s ease;
}
.map-cell:hover { transform: scale(1.06); }
.map-cell.ok { background: rgba(5,150,105,0.45); }
.map-cell.warn { background: rgba(217,119,6,0.55); }
.map-cell.danger { background: rgba(220,38,38,0.55); }
.map-legend {
  display: flex; gap: 0.85rem; flex-wrap: wrap; margin-top: 0.75rem;
  font-size: 0.78rem; color: var(--muted);
}
.map-legend i {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  margin-right: 0.35rem; vertical-align: -1px;
}
.timeline {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.35rem; margin-top: 0.5rem;
}
.timeline__h {
  text-align: center; padding: 0.55rem 0.2rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); font-size: 0.72rem;
}
.timeline__h strong { display: block; font-size: 0.85rem; margin-bottom: 0.15rem; }
.timeline__h.ok { background: #ecfdf5; border-color: #a7f3d0; }
.timeline__h.warn { background: #fffbeb; border-color: #fde68a; }
.timeline__h.danger { background: #fef2f2; border-color: #fecaca; }
