/* Kantor Decagon — tokens from docs/desain.md. Mobile-first; desktop at >= 768px. */
:root {
  --ink: #1C2733;
  --paper: #F1F5F2;
  --plate: #FFFFFF;
  --green-dark: #006837;
  --green: #009245;
  --green-light: #39B54A;
  --orange: #F7931E;
  --bata: #B3261E;
  --muted: #5B6670;
  --line: #D5DDD9;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font: 16px/1.5 system-ui, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
body.has-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px); }
main { max-width: 1120px; margin: 0 auto; padding: 16px; }
h1 { font-size: 26px; font-weight: 700; margin: 8px 0 16px; }
h2 { font-size: 20px; margin: 24px 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
a { color: var(--green-dark); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
code, .wrap { overflow-wrap: anywhere; }
.num { white-space: nowrap; }

/* Header: white plate with brand-green rule; logo top-left -> home. */
header.top {
  display: flex; align-items: center; gap: 16px; padding: 8px 16px;
  background: var(--plate); border-bottom: 3px solid var(--green);
}
header.top .logo {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none;
}
header.top .logo img { height: 32px; width: auto; display: block; }
header.top .logout { margin: 0 0 0 auto; }

/* Bottom nav on phones (Gmail/Tokopedia pattern). */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--plate); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: var(--nav-h); font-size: 12px; color: var(--ink); text-decoration: none;
}
.nav .ico { font-size: 20px; line-height: 1.2; }
.nav a[aria-current="page"] { color: var(--green-dark); font-weight: 700; box-shadow: inset 0 3px 0 var(--green-dark); }

@media (min-width: 768px) {
  body.has-nav { padding-bottom: 0; }
  main { padding: 24px; }
  .nav {
    position: static; display: flex; gap: 4px; border: 0; padding: 0; background: none;
  }
  .nav a { flex-direction: row; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 8px; font-size: 16px; }
  .nav .ico { display: none; }
  .nav a[aria-current="page"] { background: var(--green-dark); color: #fff; box-shadow: none; }
}

/* Plates (cards) */
.plate, .card {
  background: var(--plate); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 1px 0 rgba(28, 39, 51, .08); padding: 16px;
}
.card { max-width: 26rem; margin: 32px auto; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); padding: 0; margin: 0; list-style: none; }
.list { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.team li { display: flex; flex-direction: column; }
.project dl { margin: 8px 0; }
.project dt { font-size: 14px; color: var(--muted); }
.project dd { margin: 0 0 6px; overflow-wrap: anywhere; }
section + section { margin-top: 16px; }

/* Status lamp: the one bold element. */
.lamp {
  display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%;
  background: #A9B4AE; vertical-align: middle;
}
.lamp.on { background: var(--green-light); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(57, 181, 74, .25); } }
@media (prefers-reduced-motion: reduce) { .lamp.on { animation: none; } }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 14px; font-weight: 700; }
/* green-dark (not --green) so white text meets AA at 14px */
.badge-on { background: var(--green-dark); color: #fff; }
.badge-off { background: #E3E8E5; color: var(--ink); }
.badge-err { background: var(--bata); color: #fff; }
.count { display: inline-block; min-width: 24px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: var(--ink); font-size: 14px; text-align: center; }

/* Logs and code scroll inside their own box, never the page. */
pre { max-width: 100%; overflow: auto; }
pre.log {
  max-height: 24rem; margin: 8px 0 0; padding: 12px; border-radius: 8px;
  background: var(--ink); color: #E9EFEB; font: 13px/1.45 ui-monospace, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--green-dark); }
.scroll { overflow-x: auto; background: var(--plate); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
td.wrap { min-width: 14rem; white-space: pre-wrap; }
/* Phone: history rows become stacked cards (label: value), like a chat list, instead of a sideways-scrolling table. */
@media (max-width: 767px) {
  table.history thead { display: none; }
  table.history tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.history td { display: grid; grid-template-columns: 6.5rem 1fr; gap: 8px; border: 0; padding: 4px 12px; min-width: 0; }
  table.history td > .badge { justify-self: start; }
  table.history td::before { content: attr(data-label); color: var(--muted); font-size: 14px; }
}

/* Forms: label above field, primary button bottom-right (Google Forms pattern). */
.form-box { max-width: 640px; }
.form-box h2 { margin-top: 0; }
label { display: block; margin: 12px 0 4px; font-weight: 600; }
input, textarea, select {
  width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: var(--ink);
  background: var(--plate); border: 1px solid #8A969E; border-radius: 8px;
}
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 12px 0 0; }
legend { font-weight: 600; padding: 0; }
label.radio { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 16px 0 0; font-weight: 400; }
label.radio input { width: 20px; min-height: 0; height: 20px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
form.inline { display: inline; margin: 0; }

button, .btn-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px;
  font: inherit; font-weight: 600; border-radius: 8px; border: 1px solid var(--green-dark);
  background: var(--green-dark); color: #fff; cursor: pointer; text-decoration: none;
}
.btn-secondary, .btn-link { background: var(--plate); color: var(--ink); border-color: #8A969E; }
.btn-danger { background: var(--bata); border-color: var(--bata); color: #fff; }

/* Flash banner at the top of main. */
.flash { margin: 0 0 16px; padding: 12px 16px; border-radius: 8px; border-left: 6px solid; background: var(--plate); }
.flash-ok { border-color: var(--green-dark); }
.flash-err { border-color: var(--bata); color: var(--bata); font-weight: 600; }
.error { color: var(--bata); }
code.secret { word-break: break-all; font-size: 1.1rem; }

/* Board: chips, stacked columns on phones, three columns on desktop. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--plate); color: var(--ink); text-decoration: none;
}
.chip[aria-current="page"] { background: var(--green-dark); border-color: var(--green-dark); color: #fff; font-weight: 700; }
.board { display: grid; gap: 16px; margin-top: 16px; }
.board > .column { margin-top: 0; } /* grid gap spaces them; `section + section` would offset columns 2-3 */
.column h2 { margin-top: 0; }
.task p { margin: 4px 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.card-actions form { margin: 0; }
@media (min-width: 768px) { .board { grid-template-columns: repeat(3, 1fr); } }

/* Documents */
.doc-list { padding-left: 20px; margin: 0; }
.doc-list li { min-height: 44px; display: list-item; padding: 10px 0 0; overflow-wrap: anywhere; }
a.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.doc { max-width: 72ch; overflow-wrap: anywhere; }
.doc pre { background: #E3E8E5; padding: 12px; border-radius: 8px; }
.doc table { display: block; overflow-x: auto; }
.doc blockquote { margin: 0; padding-left: 12px; border-left: 4px solid var(--line); color: var(--muted); }

/* ---- v0.2 Ruang Kantor ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Beranda tabs (Gmail/Drive pattern) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; white-space: nowrap;
  color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent;
}
.tabs a[aria-current="page"] { color: var(--green-dark); font-weight: 700; border-bottom-color: var(--green-dark); }
.tabs > span[aria-current="page"] { align-self: center; padding: 0 12px; font-weight: 700; }
.product-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.product-grid > .plate { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.product-grid .btn-link { margin-top: auto; }
.product-breadcrumb { flex-wrap: wrap; }
.product-heading { border-left: 4px solid var(--green-dark); }
.product-heading h1, .product-section h2 { margin-top: 0; }
.product-status, .product-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.product-status { gap: 6px; }
.product-facts dt { color: var(--muted); font-size: 14px; }
.product-facts dd { margin: 0; font-weight: 600; }
.product-details, .template-preview { border-top: 1px solid var(--line); }
.product-details summary, .template-preview summary { justify-content: space-between; }
.product-details summary::after, .template-preview summary::after { content: "+" / ""; font-weight: 600; }
.product-details[open] summary::after, .template-preview[open] summary::after { content: "−" / ""; }
.product-details dt { font-weight: 600; }
.product-details dd { margin: 0 0 8px; overflow-wrap: anywhere; }
.preset-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.preset-card { display: grid; gap: 6px; align-content: start; color: var(--ink); text-decoration: none; }
.preset-card strong { color: var(--green-dark); }
.preset-card:hover strong, .preset-card[aria-current="page"] strong { text-decoration: underline; }
.preset-card[aria-current="page"] { border-color: var(--green-dark); }
.preset-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
#kirim, #perintah, #riwayat { scroll-margin-top: 16px; }
:is(.product-grid, .product-heading, .preset-grid, .tabs) a:focus-visible { outline-color: var(--ink); outline-offset: -3px; }
@media (min-width: 768px) {
  .preset-grid { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
}
@media (max-width: 767px) {
  table.product-history thead { display: table-header-group; position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  table.product-history td { grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr); overflow-wrap: anywhere; }
}

.note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }

/* The illustration pans inside this box. Browser pinch zoom remains available. */
.office-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.office-toolbar p { margin: 0; font-size: .8125rem; }
.office-pan-hint { display: none; }
.office-tools { gap: 8px; }
.office-tools:not([hidden]) { display: flex; }
.office-tools button { min-width: 44px; }
.office-scroll { overflow: auto; isolation: isolate; border: 1px solid var(--line); border-radius: 10px; background: var(--plate); }
.office { position: relative; width: max(100%, 960px); }
.office.zoom-1 { width: max(125%, 1200px); }
.office.zoom-2 { width: max(150%, 1440px); }
.office-map { display: block; width: 100%; height: auto; }

@media (max-width: 767px) {
  .office-note { display: grid; grid-template-columns: 1fr auto; margin-bottom: 6px; font-size: .875rem; }
  .office-pan-hint { display: block; }
}

.room { position: absolute; z-index: 101; }
.room > summary {
  display: grid; place-content: center; min-height: 44px; padding: 0 8px;
  border: 1px solid var(--green-dark); border-radius: 8px; background: #fffefa;
  color: var(--green-dark); font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.room[open], .person[open] { z-index: 102 !important; }
:is(.room, .person) > summary { list-style: none; }
:is(.room, .person) > summary::-webkit-details-marker { display: none; }
:is(.room, .person) > summary:is(:hover, :focus-visible),
:is(.room, .person)[open] > summary { outline: 3px solid var(--orange); outline-offset: 1px; }
.room-produk { left: 7%; top: 6%; }
.room-desain { left: 28%; top: 6%; }
.room-pengembangan { left: 44%; top: 6%; }
.room-qa { left: 66%; top: 6%; }
.room-keamanan { left: 82%; top: 6%; }
.room-devops, .room-dokumentasi, .room-dewan, .room-direktur, .room-codex { bottom: 39%; }
.room-devops { left: 9%; }
.room-dokumentasi { left: 26%; }
.room-dewan { left: 44%; }
.room-direktur { left: 62%; }
.room-codex { left: 82%; }

/* Actor coordinates are sampled at the feet. The fixed info card stays in the viewport. */
.person { position: absolute; width: 5.2%; aspect-ratio: 1; margin: -5.2% 0 0 -2.6%; }
.office-portrait-wrap { display: block; height: 100%; }
.person > summary { position: relative; display: block; aspect-ratio: 1; min-height: 44px; border-radius: 12px; }
.office-portrait { display: block; width: 100%; height: auto; }
.office-initials { display: grid; place-content: center; height: 100%; background: var(--plate); border: 2px solid var(--green-dark); border-radius: 50%; color: var(--green-dark); font-weight: 700; }
.office-sprite { display: none; position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.office-sprite, .office-portrait-wrap { scale: 1.35; transform-origin: center bottom; }
.office-name {
  position: absolute; z-index: 1; bottom: 135%; left: 50%; transform: translateX(-50%);
  width: max-content; padding: 2px 4px; border-radius: 5px;
  background: #fff; color: #000; text-align: center; white-space: nowrap;
  font-size: .65rem; font-weight: 700; line-height: 1.1; pointer-events: none;
}
.has-atlas .office-sprite, .has-work-atlas[data-status="work"][data-pose="work"] .office-sprite { display: block; }
.has-atlas .office-portrait-wrap, .has-work-atlas[data-status="work"][data-pose="work"] .office-portrait-wrap { opacity: 0; }
.office-sprite img { position: absolute; left: 0; top: calc(-100% * var(--pose, 0)); width: 400%; height: 1100%; max-width: none; }
[data-pose]:not([data-pose="idle"], [data-pose="work"]) .office-sprite img:not(.office-work-atlas) { animation: office-frames .8s steps(4) infinite; }
.office-sprite .office-work-atlas {
  display: none;
  top: 0;
  height: 600%;
  transform: translate(calc(-25% * var(--work-frame, 0)), calc(-100% * var(--work-row, 0) / 6));
}
.has-work-atlas[data-status="work"][data-pose="work"] .office-work-atlas { display: block; }
.has-work-atlas[data-status="work"][data-pose="work"] .office-sprite img:not(.office-work-atlas) { display: none; }
[data-work-frame="1"] { --work-frame: 1; }
[data-work-frame="2"] { --work-frame: 2; }
[data-work-frame="3"] { --work-frame: 3; }
[data-work-row="1"] { --work-row: 1; }
[data-work-row="2"] { --work-row: 2; }
[data-work-row="3"] { --work-row: 3; }
[data-work-row="4"] { --work-row: 4; }
[data-work-row="5"] { --work-row: 5; }
.office-work-glow {
  position: absolute;
  top: 62%;
  left: 51%;
  width: 35%;
  height: 22%;
  background: radial-gradient(ellipse, #b4f4ff65, transparent 68%);
  opacity: 0;
}
.work-animating[data-status="work"][data-pose="work"] .office-work-glow { animation: office-screen-glow 4.6s ease-in-out infinite; }
@keyframes office-screen-glow {
  0%, 100% { opacity: .2; transform: scale(.9); }
  50% { opacity: .6; transform: scale(1.05); }
}
[data-pose="walk-up"] { --pose: 2; }
[data-pose="idle"], [data-pose="walk-down"] { --pose: 1; }
[data-pose="coffee"] { --pose: 3; }
[data-pose="game"] { --pose: 4; }
[data-pose="chat"] { --pose: 5; }
[data-pose="read"] { --pose: 6; }
[data-pose="stretch"] { --pose: 7; }
[data-pose="water"] { --pose: 8; }
[data-pose="nap"] { --pose: 9; }
[data-pose="meeting"] { --pose: 10; }
.face-left .office-sprite { transform: scaleX(-1); }
@keyframes office-frames { to { transform: translateX(-100%); } }
.office-hidden .office-sprite :is(img, .office-work-glow) { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .office-sprite :is(img, .office-work-glow) { animation: none !important; }
}

.seat-cak-nanang { left: 12.5%; top: 35%; z-index: 35; }
.seat-siti { left: 32%; top: 34%; z-index: 34; }
.seat-mas-joko { left: 50%; top: 34%; z-index: 34; }
.seat-cak-kholil { left: 68%; top: 34%; z-index: 34; }
.seat-pak-slamet { left: 87.5%; top: 35%; z-index: 35; }
.seat-cak-supri { left: 15%; top: 89%; z-index: 89; }
.seat-mbak-lilik { left: 34.5%; top: 94.5%; z-index: 95; }
.seat-mas-bayu { left: 44%; top: 78%; z-index: 78; }
.seat-bu-endang { left: 56%; top: 78%; z-index: 78; }
.seat-pak-hadi { left: 44%; top: 89%; z-index: 89; }
.seat-bu-sri { left: 56%; top: 89%; z-index: 89; }
.seat-cak-rudi { left: 50%; top: 96%; z-index: 96; }
.seat-pak-karno { left: 68.5%; top: 87%; z-index: 87; }
.seat-mas-dodik { left: 82%; top: 90%; z-index: 90; }
.seat-mbak-ratna { left: 88.5%; top: 90%; z-index: 90; }
.seat-mas-yudi { left: 94.5%; top: 90%; z-index: 90; }

.balloon {
  position: absolute; bottom: calc(135% + 2rem); left: 50%; z-index: 2; transform: translateX(-50%);
  max-width: 11rem; padding: 2px 8px; border-radius: 10px; background: #fff; border: 1px solid var(--green-dark);
  font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(28, 39, 51, .2); pointer-events: none;
}

/* Info card: bottom sheet on phones (above the nav), floating card bottom-right on desktop (Google Maps). */
.sheet {
  position: fixed; left: 0; right: 0; z-index: 20; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  max-height: 60vh; overflow: auto; padding: 16px; background: var(--plate);
  border-top: 3px solid var(--green); border-radius: 14px 14px 0 0; box-shadow: 0 -4px 16px rgba(28, 39, 51, .2);
}
.sheet h3 { font-size: 18px; }
.sheet p, .sheet dl { margin: 4px 0; }
.sheet dt { font-size: 14px; color: var(--muted); }
.sheet dd { margin: 0 0 6px; overflow-wrap: anywhere; }
.sheet .list { gap: 4px; }
@media (min-width: 768px) {
  .sheet { left: auto; right: 24px; bottom: 24px; width: 24rem; border-radius: 12px; border: 1px solid var(--line); border-top: 3px solid var(--green); }
}
