:root {
  --bg: #f3f4f1; --pn: #fff; --ink: #1c2326; --mu: #566166; --ln: #d9ddd8; --ac: #1f4e5f; --acs: #e3eef1;
  --wn: #7a4f00; --wns: #fcf1d8; --ok: #1d6b3a; --oks: #e2f1e6; --un: #4a5258; --uns: #e9ebea;
  --bad: #8a1c13; --bads: #fadbd8; --info: #0b3d6b; --infos: #d6e8f7; --hi: #4b3b73; --his: #ece8f3;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #2b7a93; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; color: var(--ac); padding: .5rem 1rem; z-index: 40; }
.skip-link:focus { left: 0; }

/* Layout: sidebar + content that fills all remaining width (no artificial max-width). */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: #17262c; color: #e8eef0; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.brand { font-weight: 700; font-size: 16px; padding: 4px 10px 14px; }
.brand small { display: block; font-weight: 400; color: #9fb3ba; font-size: 12px; }
.navlist { display: flex; flex-direction: column; gap: 6px; }
.nav {
  background: none; border: 0; text-align: left; padding: 10px 12px; min-height: 44px; border-radius: 8px; color: #cfdce0;
  display: flex; justify-content: space-between; align-items: center; gap: 8px; white-space: nowrap;
}
.nav:hover { background: #22363e; }
.nav[aria-current="page"] { background: #2d4a55; color: #fff; font-weight: 600; }
.nav .dot { width: 9px; height: 9px; border-radius: 50%; background: #e0a526; flex: none; }
.sidefoot { margin: auto 0 0; font-size: 12px; color: #9fb3ba; padding: 10px; }
.main { padding: 20px clamp(14px, 2.2vw, 40px) 48px; min-width: 0; width: 100%; }
.main:focus { outline: none; }

.top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 14px; }
.top .btn { margin-left: auto; }
.meta { font-size: 12.5px; color: var(--mu); }
.note { font-size: 13px; color: var(--mu); }
.foot { margin-top: 24px; }
h1 { font-size: 22px; margin: 6px 0 4px; line-height: 1.25; }
h2 { font-size: 16px; margin: 14px 0 6px; line-height: 1.3; }
h3 { font-size: 16px; margin: 0 0 6px; }
.panel h2:first-child { margin-top: 0; }
.sub { color: var(--mu); margin: 0 0 16px; }
p { margin: 0 0 .5rem; }

/* Buttons and chips: label stays on one line; descriptive copy beside them may wrap. */
.btn {
  min-height: 44px; padding: 8px 16px; border-radius: 8px; border: 1px solid #1f6f8b; background: #1f6f8b; color: #fff;
  font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { background: #185a72; }
.btn-line { background: #fff; color: var(--ac); border-color: #8a96a8; }
.btn-line:hover { background: var(--acs); }
.lk { background: none; border: 0; padding: 0; color: var(--ac); text-decoration: underline; min-height: 44px; white-space: nowrap; }
.chip {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; margin: 1px 4px 1px 0;
  white-space: nowrap; max-width: 100%;
}
.ok { background: var(--oks); color: var(--ok); }
.un { background: var(--uns); color: var(--un); }
.wn { background: var(--wns); color: var(--wn); }
.bad { background: var(--bads); color: var(--bad); }
.info { background: var(--infos); color: var(--info); }
.hi { background: var(--his); color: var(--hi); }

.warn, .alert {
  border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; border: 1px solid;
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between;
}
.warn { background: var(--wns); color: var(--wn); border-color: #e6cf97; }
.alert-bad { background: var(--bads); color: var(--bad); border-color: #e59b94; }
.alert-info { background: var(--acs); color: var(--ac); border-color: #b9d2da; }
.warn > span, .alert > span { flex: 1 1 320px; min-width: 0; }

.panel { background: var(--pn); border: 1px solid var(--ln); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.empty { border-left: 5px solid var(--ac); }
.stats { display: flex; flex-wrap: wrap; background: var(--pn); border: 1px solid var(--ln); border-radius: 10px; margin-bottom: 16px; }
.stat { flex: 1 1 150px; padding: 12px 16px; border-right: 1px solid var(--ln); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: 26px; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--mu); }
.two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }

/* Task rows: description (wraps) | facts | chips + one-line action */
/* Default (narrow containers, e.g. Beranda side panel): single readable column. */
.row {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 16px; align-items: start;
  border-top: 1px solid var(--ln); padding: 12px 4px;
}
.row .facts { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.row .acts { justify-content: flex-start; }
/* Full-width list (Pekerjaan) on wide viewports: description | facts | actions. */
@media (min-width: 1101px) {
  .panel.rows > .row { grid-template-columns: minmax(0, 2fr) minmax(220px, 1.4fr) fit-content(280px); align-items: center; }
  .panel.rows > .row .facts { display: block; }
  .panel.rows > .row .acts { justify-content: flex-end; }
}
.rows > .row:first-child { border-top: 0; }
.row.attention { border-left: 4px solid var(--bad); padding-left: 10px; }
.row .t, .kcard .t { font-weight: 600; display: block; }
.row .s, .kcard .s, .facts { font-size: 12.5px; color: var(--mu); }
.facts div { margin: 0; }
.acts { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; justify-content: flex-end; }

.tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; }
.tools[hidden] { display: none; }
input, select {
  font: inherit; padding: 8px 10px; border: 1px solid #8a96a8; border-radius: 8px; background-color: #fff; color: var(--ink);
  min-height: 44px; max-width: 100%;
}
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none; padding-right: 44px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, #33403f 50%), linear-gradient(135deg, #33403f 50%, transparent 50%);
  background-position: calc(100% - 22px) calc(50% + 1px), calc(100% - 16px) calc(50% + 1px);
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  flex: 1 1 240px; min-width: min(240px, 100%);
}
input[type="search"] { flex: 1 1 240px; min-width: 0; }
label.ck { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 44px; }
label.ck input { min-height: 0; width: 18px; height: 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.card { background: var(--pn); border: 1px solid var(--ln); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.kv { font-size: 13.5px; color: var(--mu); margin: 3px 0; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { border-left: 2px solid var(--ln); margin-left: 6px; padding: 0 0 16px 16px; position: relative; }
.tl li::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ac); }
.rel { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 8px; border-top: 1px solid var(--ln); vertical-align: top; }
th { font-size: 12.5px; color: var(--mu); border-top: 0; }

/* Kanban */
.kb { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; align-items: start; }
.kc { background: #eef0ed; border: 1px solid var(--ln); border-radius: 10px; padding: 10px; min-width: 0; }
.kc h2 { margin: 0 0 2px; font-size: 15px; }
.kcard { background: #fff; border: 1px solid var(--ln); border-radius: 8px; padding: 10px; margin-top: 8px; }
.kcard .kv { margin: 6px 0; }
.kempty { font-size: 13px; color: var(--mu); margin: 8px 0 0; border: 1px dashed #8a96a8; border-radius: 8px; padding: 8px; }

/* Report (right drawer) */
.report {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 100%); background: #fff; border-left: 1px solid var(--ln);
  box-shadow: -8px 0 24px rgba(0, 0, 0, .12); padding: 16px 20px 32px; overflow: auto; z-index: 30;
}
.report[hidden] { display: none; }
.report-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.report-head h2 { margin: 0; font-size: 18px; }
.rep dt { font-size: 12.5px; color: var(--mu); margin-top: 12px; font-weight: 600; }
.rep dd { margin: 2px 0 0; }
ul.plain { margin: 6px 0; padding-left: 18px; }

@media (max-width: 1100px) {
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 10px; }
  .navlist { flex-direction: row; flex-wrap: wrap; }
  .brand { padding: 2px 8px 6px; }
  .nav { padding: 8px 11px; }
  .sidefoot { display: none; }
  .main { padding: 14px 14px 48px; }
  .stat { border-right: 0; border-bottom: 1px solid var(--ln); }
}
@media (max-width: 600px) {
  .acts { justify-content: flex-start; }
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt tr.hd { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.rt tr { border-top: 1px solid var(--ln); padding: 8px 0; }
  table.rt td { border-top: 0; padding: 2px 6px; }
  table.rt td::before { content: attr(data-l); display: block; font-size: 12px; color: var(--mu); }
}
@media (max-width: 480px) {
  .navlist { flex-direction: column; }
  .nav { width: 100%; }
  .main { padding: 12px 10px 48px; }
  .panel { padding: 12px; }
  .report { padding: 14px; }
  .top .btn { margin-left: 0; }
}
