/* DKK — Diluar Kotak Kreasindo: ungu tua (kotak), ungu terang (panah keluar kotak), koral & kuning (aksen kreatif) */
:root {
  --brand: #4b2bd6;
  --brand-2: #6c4cf0;
  --brand-3: #a18bff;
  --brand-dark: #2a1e5c;
  --accent: #ff5d73;
  --accent-2: #ffc23d;
  --bg: #f6f4fd;
  --card: #ffffff;
  --text: #1e1b2e;
  --muted: #6b6880;
  --line: #e4e1ef;
  --ok: #1e8a4c;
  --ok-bg: #e5f5ec;
  --warn: #a35f00;
  --warn-bg: #fff2d9;
  --bad: #c62f45;
  --bad-bg: #fde8eb;
  --info-bg: #efebff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(30, 20, 70, .06), 0 4px 14px rgba(30, 20, 70, .06);
  --st-brief: #8a85a6;
  --st-production: #3f7ff2;
  --st-qc: #a35bef;
  --st-approval: #e89300;
  --st-posting: #0fa37f;
  --st-done: #1e8a4c;
  --st-cancelled: #9aa0a6;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); min-height: 100vh;
  background:
    radial-gradient(900px 480px at 108% -10%, rgba(161, 139, 255, .25), transparent 62%),
    radial-gradient(700px 420px at -10% 110%, rgba(255, 93, 115, .12), transparent 60%),
    linear-gradient(180deg, #f8f6ff 0%, #f3f1fb 100%);
  background-attachment: fixed;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: 0 0 .75rem; color: var(--brand-dark); letter-spacing: -.2px; }
h2 { font-size: 1.08rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
h4 { font-size: .9rem; margin: .8rem 0 .3rem; color: var(--brand-dark); }
small, .muted { color: var(--muted); }
.small { font-size: .86rem; }
code { background: var(--info-bg); padding: 0 .3rem; border-radius: 4px; }
.pre { white-space: pre-wrap; word-break: break-word; }
ul.plain, ol.plain-ol { padding-left: 1.1rem; margin: .3rem 0; }
ul.plain li, ol.plain-ol li { margin-bottom: .35rem; }

/* ---------- layout */
.topbar {
  position: sticky; top: 0; z-index: 20; color: #fff;
  background: linear-gradient(100deg, var(--brand-dark) 0%, #3a24a0 55%, var(--brand) 100%);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 55%, var(--brand-3) 100%) 1;
  box-shadow: 0 2px 12px rgba(42, 30, 92, .3);
  display: flex; align-items: center; gap: .75rem; padding: .5rem 1rem; flex-wrap: wrap;
}
.topbar .brand { font-weight: 800; color: #fff; white-space: nowrap; display: flex; align-items: center; gap: .5rem; letter-spacing: .2px; }
.topbar .brand:hover { text-decoration: none; }
.topbar .brand img { width: 30px; height: 30px; background: #fff; border-radius: 8px; padding: 2px; }
.topbar .brand span { color: var(--accent-2); }
/* Menu atas: tautan langsung + grup dropdown (Order, Performa, Operasional, Pengaturan). */
.topbar nav { display: flex; gap: .1rem; flex-wrap: wrap; flex: 1; min-width: 0; align-items: center; }
.topbar nav a, .topbar .nav-drop {
  color: #e9e4ff; padding: .35rem .6rem; border-radius: 7px; font-size: .9rem; white-space: nowrap;
  background: transparent; border: 0; font-family: inherit; cursor: pointer; line-height: 1.45;
}
.topbar nav > a.active, .topbar nav > a:hover, .topbar .nav-drop:hover, .topbar .nav-group.open .nav-drop {
  background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none;
}
.topbar nav > a.active, .topbar .nav-group.active .nav-drop { box-shadow: inset 0 -2px 0 var(--accent-2); color: #fff; }
.topbar .nav-drop .caret { font-size: .7rem; opacity: .8; margin-left: .1rem; }
.topbar .nav-group { position: relative; }
.topbar .nav-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 190px;
  background: #fff; border-radius: 10px; padding: .35rem; box-shadow: 0 10px 30px rgba(42, 30, 92, .25);
  border: 1px solid rgba(75, 43, 214, .12);
}
.topbar .nav-group.open .nav-menu { display: block; }
.topbar .nav-menu a { display: block; color: var(--text); padding: .45rem .7rem; border-radius: 7px; font-size: .9rem; }
.topbar .nav-menu a:hover { background: var(--info-bg); color: var(--brand); text-decoration: none; }
.topbar .nav-menu a.active { background: var(--info-bg); color: var(--brand); font-weight: 650; }
.topbar .nav-burger {
  display: none; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); color: #fff;
  border-radius: 7px; padding: .3rem .65rem; font: inherit; font-size: .9rem; cursor: pointer;
}
.topbar .who { font-size: .85rem; color: #e9e4ff; display: flex; align-items: center; gap: .5rem; }
.topbar .who a.name { color: #fff; font-weight: 600; }
.topbar .who .role-chip { background: rgba(255, 255, 255, .14); border-radius: 999px; padding: .05rem .5rem; font-size: .75rem; }
.topbar .who button { background: transparent; border: 1px solid rgba(255, 255, 255, .4); color: #fff; padding: .2rem .55rem; border-radius: 6px; cursor: pointer; }
main { max-width: 1240px; margin: 0 auto; padding: 1rem; }
main.narrow { max-width: 700px; }
main.narrow.wide-form { max-width: 860px; }
main.wide { max-width: 1600px; }
@media (max-width: 1100px) {
  .topbar .who .role-chip { display: none; }
}
/* HP: menu dilipat ke tombol "☰ Menu"; grup tampil bertumpuk, isinya terbuka di tempat. */
@media (max-width: 760px) {
  .topbar { padding: .5rem .75rem; }
  .topbar .nav-burger { display: inline-block; margin-left: auto; }
  .topbar nav { order: 3; flex-basis: 100%; display: none; flex-direction: column; align-items: stretch; padding: .3rem 0 .4rem; }
  .topbar nav.open { display: flex; }
  .topbar nav > a, .topbar .nav-drop { text-align: left; width: 100%; padding: .55rem .6rem; font-size: .95rem; }
  .topbar .nav-menu { position: static; box-shadow: none; border: 0; background: rgba(255, 255, 255, .08); margin: .1rem 0 .3rem .6rem; }
  .topbar .nav-menu a { color: #f1edff; }
  .topbar .nav-menu a.active, .topbar .nav-menu a:hover { background: rgba(255, 255, 255, .16); color: #fff; }
  .topbar .who .name, .topbar .who .role-chip { display: none; }
  main { padding: .75rem; }
}

/* ---------- cards & grid */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; border: 1px solid rgba(75, 43, 214, .07); }
.card.tight { padding: .75rem; }
details.card > summary { cursor: pointer; }
.grid { display: grid; gap: .75rem; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.grid.two > .card { margin-bottom: 0; }
.grid.two + .grid.two, .grid.two + .card { margin-top: 1rem; }
.kpi .tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem .9rem; border-top: 4px solid var(--brand-2); color: var(--text); display: block; }
.kpi .tile:nth-child(4n+2) { border-top-color: var(--accent); }
.kpi .tile:nth-child(4n+3) { border-top-color: var(--accent-2); }
.kpi .tile:nth-child(4n+4) { border-top-color: var(--st-posting); }
.kpi .tile .label { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.kpi .tile .value { font-size: 1.65rem; font-weight: 800; margin-top: .15rem; word-break: break-word; }
.kpi .tile .value.money { font-size: 1.1rem; font-variant-numeric: tabular-nums; line-height: 1.3; }
.kpi .tile .sub { font-size: .8rem; color: var(--muted); }
.kpi .tile.bad .value { color: var(--bad); }
.kpi .tile.ok .value { color: var(--ok); }
.kpi a.tile.link { transition: transform .12s ease, box-shadow .12s ease; }
.kpi a.tile.link:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(75, 43, 214, .14); }
.score-tile { display: flex !important; gap: .8rem; align-items: center; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .5rem; }
.hide { display: none !important; }
h2.section { font-size: .9rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: .4rem 0 .6rem; }

/* ---------- forms */
label { display: block; font-size: .84rem; color: var(--muted); margin-bottom: .2rem; }
input, select, textarea {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
input[type=file] { padding: .4rem; }
select[multiple] { padding: .3rem; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; align-items: end; }
.filters .actions { display: flex; gap: .4rem; }
.field { margin-bottom: .7rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-bottom: .9rem; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid.six { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
fieldset.form-grid { border: 1px dashed var(--line); border-radius: 10px; padding: .8rem; }
fieldset legend { font-size: .85rem; color: var(--brand-dark); font-weight: 600; padding: 0 .3rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.checks.col { flex-direction: column; gap: .4rem; margin-bottom: .8rem; }
label.check { display: inline-flex; gap: .4rem; align-items: flex-start; color: var(--text); font-size: .9rem; margin: 0; cursor: pointer; }
label.check input { margin-top: .2rem; }
label.check.safe { background: var(--warn-bg); padding: .5rem .6rem; border-radius: 8px; }
.inline-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.inline-form input:not([type=checkbox]):not([type=hidden]), .inline-form select { width: auto; flex: 1 1 9rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .55rem .95rem; border-radius: 9px; border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.secondary:hover { background: var(--info-bg); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.small { padding: .28rem .6rem; font-size: .84rem; }
.btn.block { width: 100%; padding: .85rem; font-size: 1.05rem; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .5rem .55rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); background: #faf9fe; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.p0 { padding: 0; }
tr:hover td { background: #fbfaff; }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--bad); font-weight: 600; }

/* ---------- badges & alerts */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 650; background: var(--info-bg); color: var(--brand); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.grey { background: #eeedf3; color: #5c5a6e; }
.badge.trend { background: linear-gradient(90deg, #ffe3e8, #fff1cc); color: #b8324a; }
.badge.phase-naik { background: #e6f7ef; color: #13795b; }
.badge.phase-puncak { background: #fff1cc; color: #8a5a00; }
.badge.phase-turun { background: #eeedf3; color: #6b6880; }
.badge[class*="st-"] { color: #fff; }
.badge.st-brief { background: var(--st-brief); } .badge.st-production { background: var(--st-production); }
.badge.st-qc { background: var(--st-qc); } .badge.st-approval { background: var(--st-approval); }
.badge.st-posting { background: var(--st-posting); } .badge.st-done { background: var(--st-done); }
.badge.st-cancelled { background: var(--st-cancelled); }
.alert { padding: .7rem .9rem; border-radius: 10px; margin-bottom: 1rem; background: var(--info-bg); }
.alert.warn { background: var(--warn-bg); color: #5f3a00; }
.alert.bad { background: var(--bad-bg); color: #7b1d2b; }
.alert.ok { background: var(--ok-bg); color: #145c33; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .9rem; }
.chips a { padding: .3rem .75rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: .87rem; }
.chips a.active { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; border-color: var(--brand); }
.grade { font-weight: 700; padding: .05rem .45rem; border-radius: 6px; }
.grade.g-A { background: var(--ok-bg); color: var(--ok); } .grade.g-B { background: #e7f0ff; color: #2459c4; }
.grade.g-C { background: var(--warn-bg); color: var(--warn); } .grade.g-D { background: var(--bad-bg); color: var(--bad); }

/* ---------- list item */
.list-item { display: block; background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: .7rem .9rem; margin-bottom: .55rem; color: var(--text); border-left: 4px solid var(--brand-2); }
.list-item:hover { text-decoration: none; background: #fcfbff; }
.list-item .title { font-weight: 650; }
.list-item .meta { font-size: .84rem; color: var(--muted); margin-top: .2rem; }
.list-item .next-step { color: var(--brand-dark); }
.list-item.st-border-brief { border-left-color: var(--st-brief); } .list-item.st-border-production { border-left-color: var(--st-production); }
.list-item.st-border-qc { border-left-color: var(--st-qc); } .list-item.st-border-approval { border-left-color: var(--st-approval); }
.list-item.st-border-posting { border-left-color: var(--st-posting); } .list-item.st-border-done { border-left-color: var(--st-done); }
.list-row { padding: .45rem 0; border-bottom: 1px dashed var(--line); }

/* ---------- perhatian */
.warn-list .warn-item { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem .5rem; border-top: 1px solid var(--line); color: var(--text); }
.warn-list .warn-item:first-of-type { border-top: 0; }
.warn-list .warn-item:hover { background: rgba(75, 43, 214, .04); text-decoration: none; }
.warn-list .warn-item.critical { box-shadow: inset 3px 0 0 var(--bad); }
.warn-list .warn-item.high { box-shadow: inset 3px 0 0 var(--warn); }
.warn-list .warn-item.normal { box-shadow: inset 3px 0 0 #b9b5cc; }
.warn-list .warn-item .badge { flex: none; margin-top: .1rem; }

/* ---------- pipeline & board */
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.pipe { border-radius: 10px; padding: .6rem .5rem; color: #fff; text-align: center; display: grid; gap: .1rem; }
.pipe:hover { text-decoration: none; filter: brightness(1.06); }
.pipe b { font-size: 1.5rem; } .pipe span { font-size: .78rem; } .pipe em { font-style: normal; font-size: .72rem; background: rgba(0,0,0,.18); border-radius: 99px; padding: 0 .4rem; justify-self: center; }
.pipe.st-brief { background: var(--st-brief); } .pipe.st-production { background: var(--st-production); } .pipe.st-qc { background: var(--st-qc); }
.pipe.st-approval { background: var(--st-approval); } .pipe.st-posting { background: var(--st-posting); }
@media (max-width: 560px) { .pipeline { grid-template-columns: repeat(3, 1fr); } }
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.board .col { background: rgba(255,255,255,.6); border-radius: 12px; padding: .5rem; min-height: 50vh; border-top: 4px solid var(--st-brief); }
.board .col.st-production { border-top-color: var(--st-production); } .board .col.st-qc { border-top-color: var(--st-qc); }
.board .col.st-approval { border-top-color: var(--st-approval); } .board .col.st-posting { border-top-color: var(--st-posting); }
.board .col header { display: flex; justify-content: space-between; font-weight: 700; padding: .2rem .3rem .5rem; color: var(--brand-dark); }
.board .col header b { background: #fff; border-radius: 99px; padding: 0 .5rem; font-size: .85rem; }
.kcard { display: block; background: #fff; border-radius: 10px; padding: .6rem .65rem; margin-bottom: .5rem; box-shadow: var(--shadow); color: var(--text); border: 1px solid transparent; }
.kcard:hover { text-decoration: none; border-color: var(--brand-3); }
.kcard.late { border-color: var(--bad); }
.kcard.pr-urgent { box-shadow: inset 3px 0 0 var(--bad), var(--shadow); } .kcard.pr-high { box-shadow: inset 3px 0 0 var(--warn), var(--shadow); }
.kcode { font-size: .74rem; color: var(--muted); }
.ktitle { font-weight: 650; margin: .15rem 0; }
.kmeta { font-size: .8rem; color: var(--muted); }
.kfoot { display: flex; gap: .5rem; align-items: center; font-size: .78rem; margin-top: .35rem; }
.kflags .badge { margin-top: .3rem; }
.kflags .badge.ok { display: none; }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-3); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .72rem; }
.board .empty { text-align: center; font-size: .85rem; }

/* ---------- stepper & detail */
.stepper { display: flex; list-style: none; margin: 0; padding: 0; gap: .25rem; overflow-x: auto; }
.stepper li { flex: 1; min-width: 92px; text-align: center; font-size: .78rem; color: var(--muted); position: relative; padding-top: 2rem; }
.stepper li span { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: #eeedf3; color: var(--muted); font-weight: 700; z-index: 1; }
.stepper li::before { content: ""; position: absolute; top: .85rem; left: -50%; width: 100%; height: 3px; background: #eeedf3; }
.stepper li:first-child::before { display: none; }
.stepper li.done span { background: var(--ok); color: #fff; } .stepper li.done::before, .stepper li.current::before { background: var(--ok); }
.stepper li.current span { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(75, 43, 214, .18); }
.stepper li.current { color: var(--brand-dark); font-weight: 700; }
.dod { margin: .7rem 0 0; font-size: .88rem; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }
.card.action { border: 2px solid var(--brand-3); }
.dl { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .35rem .8rem; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; font-size: .88rem; }
.dl dd { margin: 0; min-width: 0; }
.dl.compact { grid-template-columns: 7rem minmax(0, 1fr); font-size: .9rem; }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; } .dl dt { margin-top: .3rem; } }
.timeline { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .55rem; }
.timeline li { border-left: 3px solid var(--line); padding: .1rem 0 .1rem .8rem; }
.timeline .k { font-weight: 650; }
.timeline li.ev-revision, .timeline li.ev-cancelled { border-left-color: var(--bad); }
.timeline li.ev-approved, .timeline li.ev-posted { border-left-color: var(--ok); }
.timeline li.ev-ai_check { border-left-color: var(--st-qc); }
.timeline li.ev-comment { border-left-color: var(--brand-3); }

/* ---------- KPI */
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; align-content: center;
  background: radial-gradient(closest-side, #fff 76%, transparent 78% 100%), conic-gradient(var(--c, var(--brand)) calc(var(--p) * 1%), #ecebf3 0); }
.ring b { font-size: 1.15rem; line-height: 1; } .ring small { font-size: .7rem; font-weight: 700; }
.ring.g-A { --c: var(--ok); } .ring.g-B { --c: #2f6fe0; } .ring.g-C { --c: var(--st-approval); } .ring.g-D { --c: var(--bad); }
.kpi-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi-cards .card { margin: 0; color: var(--text); display: grid; gap: .6rem; }
.kpi-cards .card:hover { text-decoration: none; box-shadow: 0 8px 22px rgba(75, 43, 214, .14); }
.comp-bars { display: grid; gap: .3rem; }
.comp { display: grid; grid-template-columns: 9.5rem 1fr 3.4rem; gap: .5rem; align-items: center; font-size: .82rem; }
.comp b { text-align: right; font-variant-numeric: tabular-nums; } .comp b small { font-weight: 400; color: var(--muted); }
.meter { height: .55rem; border-radius: 99px; background: #ecebf3; overflow: hidden; min-width: 80px; }
.meter span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-2), var(--brand-3)); }
.meter.over span { background: linear-gradient(90deg, var(--accent), var(--bad)); }
.meter.na { background: repeating-linear-gradient(45deg, #f1f0f6, #f1f0f6 4px, #e6e4ef 4px, #e6e4ef 8px); }
.top-list { padding-left: 1.2rem; display: grid; gap: .5rem; margin: 0; }

/* ---------- kalender */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar .dow { text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); padding: .2rem; }
.calendar .day { background: #fff; border-radius: 8px; min-height: 108px; padding: .3rem; display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); }
.calendar .day.other { opacity: .45; }
.calendar .day.today { border: 2px solid var(--brand); }
.calendar .dnum { font-size: .78rem; font-weight: 700; color: var(--muted); }
.cal-item { display: block; font-size: .74rem; line-height: 1.2; padding: .2rem .3rem; border-radius: 5px; color: #fff; overflow: hidden; text-overflow: ellipsis; background: var(--st-brief); }
.cal-item small { display: block; opacity: .85; color: #fff; font-size: .68rem; }
.cal-item:hover { text-decoration: none; filter: brightness(1.08); }
.cal-item.st-production { background: var(--st-production); } .cal-item.st-qc { background: var(--st-qc); }
.cal-item.st-approval { background: var(--st-approval); } .cal-item.st-posting { background: var(--st-posting); }
.cal-item.st-done { background: var(--st-done); } .cal-item.late { outline: 2px solid var(--bad); }
@media (max-width: 700px) { .calendar .day { min-height: 70px; } .cal-item small { display: none; } }

/* ---------- tren */
.trend-card { border-left: 4px solid var(--warn); }
.trend-card.tr-approved { border-left-color: var(--ok); } .trend-card.tr-taken { border-left-color: var(--accent); }
.trend-card.tr-skipped, .trend-card.tr-expired { border-left-color: #c9c6d6; opacity: .85; }
.trend-card .idea { background: #fff8e6; border-radius: 8px; padding: .4rem .6rem; margin: .4rem 0; }
.trend-card .meta { font-size: .84rem; margin: .3rem 0 .5rem; }
.vote { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: .3rem .6rem; cursor: pointer; color: var(--muted); font: inherit; }
.vote.on { background: var(--info-bg); color: var(--brand); border-color: var(--brand-3); }
.signal { display: grid; gap: .3rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.signal:first-of-type { border-top: 0; }

/* ---------- tim */
table.raci td, table.raci th { text-align: center; } table.raci td:first-child, table.raci th:first-child { text-align: left; }
table.raci td { font-weight: 700; }
.r-a, .r-ar { background: #efe9ff; color: var(--brand-dark); } .r-r { background: #e6f2ff; color: #2459c4; }
.r-c { background: #fff6e0; color: #8a5a00; } .r-i { color: var(--muted); font-weight: 500; }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.job-grid .card { margin: 0; }
.job ul, .job-mini ul { padding-left: 1.1rem; margin: .2rem 0; } .job li, .job-mini li { margin-bottom: .25rem; font-size: .9rem; }
.kpi-list li::marker { content: "◎ "; color: var(--brand); }
.job-mini { background: #faf9fe; border-radius: 10px; padding: .6rem .8rem; }
.job-mini summary { cursor: pointer; }

/* ---------- master & misc */
.row-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.row-form input:not([type=checkbox]) { width: auto; flex: 1 1 7rem; }
.row-form input[type=number] { flex: 0 0 5.5rem; }
.row-form.new { background: #faf9fe; }
details.pop { position: relative; }
details.pop > form { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .7rem; width: 260px; box-shadow: var(--shadow); }
.pager { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; margin-top: .8rem; }
.chart-box { position: relative; height: 230px; }
pre.result { background: #faf9fe; border-radius: 8px; padding: .8rem; white-space: pre-wrap; font-size: .82rem; }
.flow li { margin-bottom: .45rem; }
.logo-row { display: flex; align-items: center; gap: .5rem; margin: .4rem 0 1rem; }

#toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 50; max-width: 92vw;
  background: #2a2640; color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); display: none; }
#toast.bad { background: var(--bad); } #toast.ok { background: var(--ok); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--brand-dark) 0%, #3a24a0 45%, var(--brand) 75%, var(--brand-2) 100%); }
/* Kotak & sesuatu yang keluar dari kotak — "diluar kotak" */
.login-wrap::before, .login-wrap::after { content: ""; position: absolute; pointer-events: none; }
.login-wrap::before { width: 360px; height: 360px; right: -90px; top: -90px; border-radius: 56px; border: 28px solid rgba(255, 255, 255, .12); transform: rotate(12deg); }
.login-wrap::after { width: 150px; height: 150px; right: 150px; top: 180px; border-radius: 50%; background: var(--accent); box-shadow: -260px 380px 0 -30px var(--accent-2); opacity: .9; }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 390px; background: #fff; border-radius: 18px; padding: 1.6rem; box-shadow: 0 18px 50px rgba(20, 10, 60, .4); border-top: 5px solid var(--accent); }
.login-card .logo { font-size: 1.4rem; font-weight: 800; color: var(--brand-dark); display: flex; align-items: center; gap: .6rem; }
.login-card .logo img { width: 52px; height: 52px; }
.login-card .logo span { color: var(--accent); }

@media print {
  .topbar, .no-print, #toast { display: none !important; }
  body { background: #fff; }
  .card, .kpi .tile { box-shadow: none; border: 1px solid #ddd; }
  form { display: none; }
}

/* ---------- Gantt (dashboard & project) */
.gantt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.25rem; }
.gantt { min-width: 860px; font-size: .85rem; }
.g-row { display: grid; grid-template-columns: 250px 1fr; align-items: stretch; border-bottom: 1px solid #efedf8; min-height: 40px; }
summary.g-row { list-style: none; cursor: pointer; }
summary.g-row::-webkit-details-marker { display: none; }
.g-group[open] > summary .g-caret { transform: rotate(90deg); }
.g-caret { display: inline-block; transition: transform .15s; color: var(--muted); margin-right: .25rem; font-size: .75rem; }
.g-label { padding: .4rem .6rem .4rem .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.g-label small { display: block; color: var(--muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; }
.g-child .g-label { padding-left: 1.4rem; }
.g-child { background: #fbfaff; min-height: 34px; }
.g-head { position: sticky; top: 0; background: #faf9fe; min-height: 44px; border-bottom: 1px solid #e3e0f2; }
.g-head .g-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 650; }
.g-track { position: relative; display: flex; }
.g-cols .g-col { flex: 1; text-align: center; padding: .3rem 0; border-left: 1px solid #ece9f7; line-height: 1.15; }
.g-col b { display: block; font-size: .74rem; font-weight: 650; color: var(--text); }
.g-col small { font-size: .7rem; color: var(--muted); }
.g-col.cur b { color: var(--brand); }
.g-col.sel, .g-cell.sel { background: rgba(75, 43, 214, .06); }
.g-col.off, .g-cell.off { background: repeating-linear-gradient(135deg, #f6f5fb, #f6f5fb 4px, #fff 4px, #fff 8px); }
.g-cell { flex: 1; border-left: 1px solid #f2f0fa; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); z-index: 2; opacity: .8; }
.g-bar {
  position: absolute; top: 50%; transform: translateY(-50%); height: 22px; border-radius: 6px; z-index: 3;
  overflow: hidden; color: #fff; font-size: .72rem; font-weight: 650; display: flex; align-items: center; min-width: 6px;
  box-shadow: 0 1px 3px rgba(42, 30, 92, .25);
}
.g-child .g-bar { height: 16px; font-size: .68rem; }
.g-bar:hover { text-decoration: none; filter: brightness(1.08); }
.g-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.g-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g-txt { position: relative; padding: 0 .4rem; white-space: nowrap; }
.g-prog { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .28); }
.g-active { background: var(--brand); } .g-done { background: var(--ok); } .g-late, .g-late-done { background: var(--bad); }
.g-hold { background: #9a97ad; }
.g-st-brief { background: #8c87a8; } .g-st-production { background: #3d7be0; } .g-st-qc { background: #9b51e0; }
.g-st-approval { background: #e08a1e; } .g-st-posting { background: #14966b; }
.g-empty { padding: 1rem .5rem; }
.g-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; margin-top: .6rem; }
.g-key { display: inline-block; width: 14px; height: 9px; border-radius: 3px; margin-right: .3rem; vertical-align: middle; }
.g-today-key { display: inline-block; width: 2px; height: 12px; background: var(--accent); margin-right: .3rem; vertical-align: middle; }
.scale-switch { display: inline-flex; border: 1px solid var(--brand); border-radius: 9px; overflow: hidden; }
.scale-switch a { padding: .4rem .8rem; font-size: .88rem; color: var(--brand); }
.scale-switch a.on { background: var(--brand); color: #fff; }
.scale-switch a:hover { text-decoration: none; }
.period-nav { display: inline-flex; gap: .3rem; align-items: center; }
.progress { height: 8px; background: #ece9f7; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); }
@media (max-width: 760px) { .g-row { grid-template-columns: 170px 1fr; } .gantt { min-width: 720px; } }

/* ---------- sub-task */
.subtask { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.subtask .tick-form { margin: 0; }
.subtask .tick { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--brand-2); background: #fff; color: #fff;
  font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.subtask .tick.ro { cursor: default; opacity: .6; }
.subtask.done .tick { background: var(--ok); border-color: var(--ok); }
.subtask.done .sub-title { text-decoration: line-through; color: var(--muted); }
.subtask.late .tick { border-color: var(--bad); }
.subtask .sub-body { flex: 1; min-width: 0; }
.section-title { margin: 1.2rem 0 .6rem; font-size: 1.15rem; color: var(--brand-dark); }

/* ---------- tim inti */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.team-grid .card { margin-bottom: 0; }
.team-form select[multiple] { width: 100%; }
/* sub-task: form tambah sebaris */
#subtask .row-form.new { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; background: transparent; padding: 0; }
#subtask .row-form.new input[name=title] { flex: 1 1 220px; }
#subtask .row-form.new select, #subtask .row-form.new input[type=date] { flex: 0 1 190px; width: auto; }
.g-bar.has-late { outline: 2px solid var(--bad); outline-offset: 1px; }
.g-late-n { color: var(--bad); font-weight: 650; }

/* riset audiens (/tren/riset) */
.persona { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 .7rem; }
.note-warn { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: .5rem .7rem; margin: 0; }
.ctl-label { font-size: .74rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: .6rem 0 .3rem; }
.query-table td { vertical-align: middle; }
.go { display: flex; gap: .25rem; flex-wrap: nowrap; }
.go a { border: 1px solid var(--line); border-radius: 7px; padding: .22rem .45rem; font-size: .8rem; white-space: nowrap; background: #fff; }
.go a:hover { border-color: var(--brand-3); background: var(--info-bg); text-decoration: none; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.tool { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.tool p { margin: 0; }
.tool .tool-demo { border-top: 1px dashed var(--line); padding-top: .35rem; margin-top: auto; }
.steps-list { padding-left: 1.2rem; display: grid; gap: .55rem; }
.score-pill { font-variant-numeric: tabular-nums; }

/* ---------- halaman User: email & kirim link aktivasi */
input.mini-input { padding: .2rem .4rem; font-size: .8rem; margin-top: .25rem; max-width: 16rem; }
