:root {
  --bg: #0f1729;
  --bg-soft: #16203a;
  --panel: #1c2945;
  --panel-2: #243156;
  --line: #2c3a5e;
  --text: #e6ecf7;
  --muted: #94a3c4;
  --primary: #4f7cff;
  --primary-dark: #3a63d8;
  --green: #2bb673;
  --amber: #e8a93b;
  --red: #e5564f;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }

/* ===== Login ===== */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 600px at 70% -10%, #1d2c4d 0%, #0f1729 60%);
  padding: 20px;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 36px 32px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.brand { text-align: center; margin-bottom: 26px; }
.brand h1 { font-size: 22px; margin: 14px 0 6px; }
.brand p { color: var(--muted); font-size: 13px; }
.brand-logo {
  width: 64px; height: 64px; margin: 0 auto;
  background: linear-gradient(135deg, var(--primary), #7c5cff);
  border-radius: 16px;
  display: grid; place-items: center;
  font-weight: 800; letter-spacing: 1px; font-size: 20px; color: #fff;
}
.brand-logo.small { width: 34px; height: 34px; font-size: 13px; border-radius: 9px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
select, input, textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 70px; }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; }

/* ===== Buttons ===== */
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
}
.btn:hover { border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; margin-top: 22px; padding: 12px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: var(--red); }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }

/* ===== App Shell ===== */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 14px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 6px 8px 18px; }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13px;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .ico { width: 18px; text-align: center; }
.nav-item .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
.sidebar-user-info { flex: 1; line-height: 1.3; overflow: hidden; }
.sidebar-user-info strong { font-size: 13px; }
.sidebar-user-info small { color: var(--muted); font-size: 11px; display: block; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #4f7cff, #7c5cff);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

/* ===== Main ===== */
.main { display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line);
}
.topbar h2 { font-size: 19px; }
.view { padding: 24px 28px; }

/* ===== Cards / Grid ===== */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; }
.stat .stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat .stat-value { font-size: 30px; font-weight: 800; margin: 6px 0 2px; }
.stat .stat-sub { font-size: 12px; color: var(--muted); }
.stat.danger .stat-value { color: var(--red); }
.stat.green .stat-value { color: var(--green); }
.stat.amber .stat-value { color: var(--amber); }

/* ===== Tables / Lists ===== */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: none; }
.empty { color: var(--muted); text-align: center; padding: 32px; font-size: 13px; }

/* ===== Pills / Tags ===== */
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.pill-green { background: rgba(43,182,115,.16); color: #4fd39a; }
.pill-amber { background: rgba(232,169,59,.16); color: #f0bd62; }
.pill-red { background: rgba(229,86,79,.16); color: #f08a85; }
.pill-blue { background: rgba(79,124,255,.16); color: #8aa8ff; }
.pill-gray { background: rgba(148,163,196,.16); color: var(--muted); }
.dept-tag { font-size: 11px; padding: 2px 9px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); }

.badge { background: var(--bg-soft); border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; font-size: 12px; color: var(--muted); }

.row { display: flex; gap: 10px; align-items: center; }
.row-between { justify-content: space-between; }
.mt { margin-top: 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar select, .toolbar input { width: auto; min-width: 160px; }
.spacer { flex: 1; }

/* ===== Report / metric items ===== */
.metric-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--bg-soft); }
.metric-item .mi-main { flex: 1; }
.metric-item .mi-main strong { display: block; font-size: 14px; }
.metric-item .mi-main small { color: var(--muted); }

.field { margin-bottom: 14px; }
.field label { margin-top: 0; }

/* Field laporan: nama metrik di atas, kolom input di bawahnya (full width) */
.report-field { border: 1px solid var(--line); background: var(--bg-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.report-field label { display: block; margin: 0 0 8px; color: var(--text); font-size: 13px; }
.report-field input { width: 100%; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== 5 Why ===== */
.why-chain { border-left: 2px solid var(--primary); padding-left: 14px; margin: 8px 0; }
.why-chain .why-row { margin-bottom: 6px; font-size: 13px; }
.why-chain .why-row b { color: var(--primary); }

/* ===== Sprint board ===== */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.board-col { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.board-col h4 { font-size: 13px; margin-bottom: 12px; display: flex; justify-content: space-between; color: var(--muted); }
.task-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 9px; font-size: 13px; cursor: pointer; }
.task-card:hover { border-color: var(--primary); }
.task-card small { color: var(--muted); display: block; margin-top: 5px; }

/* ===== Chat ===== */
.chat-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 16px; height: calc(100vh - 150px); }
.chat-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-y: auto; padding: 8px; }
.chat-list .ch { padding: 10px 12px; border-radius: 9px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.chat-list .ch:hover { background: var(--bg-soft); }
.chat-list .ch.active { background: var(--primary); color: #fff; }
.chat-main { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 70%; }
.msg.me { align-self: flex-end; text-align: right; }
.msg .bubble { background: var(--bg-soft); border: 1px solid var(--line); padding: 9px 13px; border-radius: 12px; display: inline-block; text-align: left; }
.msg.me .bubble { background: var(--primary); border-color: var(--primary); color: #fff; }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.msg .mention { color: var(--primary); font-weight: 700; }
.msg.me .mention { color: #cfe0ff; }
.chat-input { padding: 14px; border-top: 1px solid var(--line); display: flex; gap: 10px; position: relative; }
.chat-input input { flex: 1; }
.mention-pop { position: absolute; bottom: 60px; left: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; width: 220px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.mention-pop .mp { padding: 9px 12px; cursor: pointer; display: flex; gap: 9px; align-items: center; }
.mention-pop .mp:hover, .mention-pop .mp.sel { background: var(--primary); color: #fff; }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 100; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,9,18,.7); }
.modal-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; box-shadow: 0 30px 70px rgba(0,0,0,.5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 22px; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 12px 22px; border-radius: 10px; font-weight: 600; z-index: 200; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.toast.err { background: var(--red); }

.section-title { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; margin: 22px 0 12px; }
.muted { color: var(--muted); }
.progress { height: 7px; background: var(--bg-soft); border-radius: 5px; overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; background: var(--green); }
