/* Kokpit — light · elegan · modern · futuristik · simple */
:root {
  --bg: #f3f5fa;
  --panel: #ffffff;
  --panel-2: #f7f9fd;
  --border: #e4e9f2;
  --text: #17233b;
  --muted: #6b7a94;
  --accent: #0ea5e9;          /* dioverride per bisnis */
  --good: #0d9d6e;
  --warn: #b7791f;
  --bad: #dc4b4b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 35, 59, .04), 0 8px 24px -12px rgba(23, 35, 59, .10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--bad); font-size: 13px; margin-top: 10px; text-align: center; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: #d4dbe8; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- login ---------- */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(700px 420px at 50% -8%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 65%),
    var(--bg);
}
.login-card {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 22px;
  padding: 44px 38px;
  width: 350px; text-align: center;
  box-shadow: 0 24px 70px -24px rgba(23, 35, 59, .25);
}
.login-logo { font-size: 42px; }
.login-card h1 { margin: 8px 0 2px; letter-spacing: 2.5px; font-weight: 800; text-transform: uppercase; font-size: 22px; }
.login-card p { margin-bottom: 24px; font-size: 13px; }
.login-card input {
  width: 100%; margin-bottom: 12px; padding: 12px 15px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

/* ---------- layout ---------- */
#app { display: flex; min-height: 100vh; }
#sidebar {
  width: 236px; flex-shrink: 0; display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
}
#main { flex: 1; min-width: 0; padding: 0 28px 44px; }
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 22px;
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
#topbar h2 { font-size: 19px; letter-spacing: .2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* ---------- business switcher ---------- */
#biz-switcher { position: relative; padding: 16px 14px 10px; }
#biz-current {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, #fff), #fff);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 11px 13px; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow);
}
#biz-current .chev { margin-left: auto; color: var(--muted); font-size: 11px; }
#biz-logo { font-size: 18px; }
#biz-menu {
  position: absolute; left: 14px; right: 14px; top: 64px; z-index: 20;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 16px 44px -16px rgba(23, 35, 59, .3);
}
#biz-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; color: var(--text); padding: 12px 14px;
  font-size: 13.5px; cursor: pointer; text-align: left;
}
#biz-menu button:hover { background: var(--panel-2); }
#biz-menu .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- nav ---------- */
#module-nav { flex: 1; overflow-y: auto; padding: 8px 10px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: none; border: none; border-radius: 11px;
  color: var(--muted); padding: 10px 12px; font-size: 13.5px; font-weight: 550;
  cursor: pointer; text-align: left; transition: background .12s, color .12s;
}
.nav-item:hover { color: var(--text); background: rgba(23, 35, 59, .045); }
.nav-item.active {
  color: var(--accent); font-weight: 700;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
}
.nav-item .icon { width: 20px; text-align: center; }

#sidebar-footer { border-top: 1px solid var(--border); padding: 10px 14px; }
#user-box { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 4px; }
.user-name { font-size: 13px; font-weight: 700; }
#logout-btn {
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  color: var(--muted); padding: 5px 9px; cursor: pointer;
}
#logout-btn:hover { color: var(--bad); border-color: var(--bad); }

/* ---------- tombol ---------- */
.btn {
  border: 1px solid var(--border); border-radius: 11px; background: #fff;
  color: var(--text); padding: 8px 15px; font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .1s, box-shadow .15s;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #1e3a8a));
  border: none; color: #fff; letter-spacing: .3px;
}
.btn.ghost { background: transparent; box-shadow: none; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: wait; transform: none; }

/* ---------- kartu KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 17px 19px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: .55;
}
.kpi .label { font-size: 11.5px; color: var(--muted); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: .7px; font-weight: 650; }
.kpi .value { font-size: 25px; font-weight: 800; letter-spacing: -.4px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
.kpi.trend-up .value { color: var(--good); }
.kpi.trend-down .value { color: var(--bad); }

/* ---------- section ---------- */
.section {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 19px 21px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.section h3 { font-size: 13px; margin-bottom: 14px; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted); font-weight: 700; }
.section table { width: 100%; border-collapse: collapse; font-size: 13px; }
.section th { text-align: left; color: var(--muted); font-weight: 650; padding: 6px 10px 9px;
  border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px;
  text-transform: uppercase; letter-spacing: .4px; }
.section td { padding: 9px 10px; border-bottom: 1px solid #eef1f7; }
.section tr:last-child td { border-bottom: none; }
.section tbody tr:hover td { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }

.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid #eef1f7; }
.list-item:last-child { border-bottom: none; }
.list-item .li-title { font-size: 13.5px; font-weight: 550; }
.list-item .li-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.badge {
  margin-left: auto; font-size: 11px; font-weight: 650; padding: 3px 10px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.badge.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, #fff); background: color-mix(in srgb, var(--good) 8%, #fff); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, #fff); background: color-mix(in srgb, var(--warn) 8%, #fff); }
.badge.bad  { color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 40%, #fff);  background: color-mix(in srgb, var(--bad) 8%, #fff); }

.bar-row { display: grid; grid-template-columns: 130px 1fr 70px; align-items: center; gap: 12px; padding: 7px 0; font-size: 13px; }
.bar-track { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff)); height: 100%; border-radius: 6px; }
.bar-val { text-align: right; color: var(--muted); font-size: 12px; }

.links-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.links-row a {
  color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 11px; padding: 8px 14px;
  background: var(--panel); box-shadow: var(--shadow);
}
.links-row a:hover { border-color: var(--accent); }

/* ---------- board kanban ---------- */
.board-wrap { overflow-x: auto; padding-bottom: 6px; }
.board { display: flex; gap: 12px; align-items: flex-start; min-width: max-content; }
.board-col {
  width: 232px; flex-shrink: 0; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px;
}
.board-col h4 { font-size: 11.5px; color: var(--muted); margin: 2px 2px 10px;
  white-space: nowrap; text-transform: uppercase; letter-spacing: .5px; }
.board-card {
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.bc-title { font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.bc-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bc-note { font-size: 11px; color: var(--text); opacity: .8; margin-top: 5px; line-height: 1.45; }
.bc-warn { font-size: 11px; color: var(--warn); margin-top: 4px; line-height: 1.45; font-weight: 550; }
.board-card .badge { margin: 8px 0 0; display: inline-block; }
.bc-empty { text-align: center; color: #c9d2e2; padding: 14px 0; }

/* ---------- status / kosong ---------- */
.notice {
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px;
  text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; background: var(--panel);
}
.notice.stale { border-color: var(--warn); color: var(--warn); text-align: left;
  padding: 10px 16px; margin-bottom: 14px; font-size: 12.5px;
  background: color-mix(in srgb, var(--warn) 6%, #fff); }
.spinner { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- form ---------- */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.form-row input, .form-row select {
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  color: var(--text); padding: 9px 13px; font-size: 13px;
}
.form-row input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }

/* ---------- tugas ---------- */
.task-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.task-col h4 { font-size: 12px; color: var(--muted); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: .5px; }
.task-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 11px;
  padding: 12px 14px; margin-bottom: 10px; font-size: 13.5px; box-shadow: var(--shadow);
}
.task-card .muted { display: block; margin-top: 4px; }
.task-actions { margin-top: 9px; display: flex; gap: 6px; }
.task-actions button {
  font-size: 11.5px; padding: 4px 10px; border-radius: 8px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); font-weight: 600;
}
.task-actions button:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- pengaturan ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }
.toggle { cursor: pointer; }

@media (max-width: 760px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; height: auto; position: static; flex-direction: column; }
  #module-nav { display: flex; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  #main { padding: 0 14px 30px; }
}
