@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-normal-200_800.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-normal-400_700.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #14160f;
  --ink-2: #34372c;
  --muted: #5f6356;
  --paper: #efecdf;
  --card: #fffef9;
  --line: rgba(20, 22, 15, .13);
  --green: #00733a;
  --green-2: #009848;
  --amber: #8A5A22;
  --red: #8c2f2a;
  --ff: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fd: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--green); }
h1, h2, h3, h4 { font-family: var(--fd); letter-spacing: -.02em; margin: 0; }

/* ------------------------------------------------------------ header */
.os-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1.2rem;
  padding: .7rem clamp(1rem, 3vw, 2rem);
  background: #101208; color: #f4f1e7;
}
.os-brand {
  font-family: var(--fd); font-weight: 700; letter-spacing: .12em;
  color: #f4f1e7; text-decoration: none; font-size: 1rem; white-space: nowrap;
}
.os-brand span { color: var(--green-2); margin-left: .35rem; font-weight: 600; font-size: .72rem; letter-spacing: .2em; }
.os-tabs { display: flex; gap: .15rem; flex: 1; flex-wrap: wrap; }
.os-tabs a {
  color: rgba(244, 241, 231, .72); text-decoration: none; font-size: .88rem;
  padding: .35rem .7rem; border-radius: 3px;
}
.os-tabs a:hover { background: rgba(244, 241, 231, .08); color: #fff; }
.os-tabs a.on { background: rgba(0, 152, 72, .18); color: #c8f0d6; }
.os-tabs b {
  display: inline-block; min-width: 18px; padding: 0 .28rem;
  background: #c8451f; color: #fff; border-radius: 99px; font-size: .7rem; text-align: center; margin-left: .3rem;
}
.os-out button {
  background: none; border: 1px solid rgba(244, 241, 231, .25); color: #f4f1e7;
  padding: .3rem .7rem; border-radius: 3px; font: inherit; font-size: .82rem; cursor: pointer;
}
.os-out button:hover { border-color: #fff; }

.os-main { max-width: 1240px; margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.4rem) clamp(1rem, 3vw, 2rem) 4rem; }
.os-foot { text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: .78rem; }

/* -------------------------------------------------------------- hero */
.eyebrow { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; font-weight: 600; }
.hero-os { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: end; margin-bottom: 2rem; }
.hero-os h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1.05; }
.hero-os .sub { color: var(--ink-2); margin: .7rem 0 0; max-width: 46ch; }
.hero-os.compact { grid-template-columns: 1fr; margin-bottom: 1.4rem; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: .7rem .8rem; }
.tile b { display: block; font-family: var(--fd); font-size: 1.6rem; line-height: 1; letter-spacing: -.03em; }
.tile span { font-size: .74rem; color: var(--muted); }

/* ------------------------------------------------------------- rooms */
.rooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.6rem; }

.room {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  border-radius: 4px;
  padding: 1rem 1rem .9rem;
  display: flex; flex-direction: column; gap: .7rem;
  transition: transform .25s ease, box-shadow .25s ease;
}
.room:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -22px rgba(20, 22, 15, .8); }

.room-top { display: flex; align-items: flex-start; gap: .65rem; }
.room-glyph {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 14%, white);
  color: var(--c); font-size: 1.05rem;
}
.room-id h3 { font-size: 1rem; line-height: 1.2; }
.room-id p { margin: .1rem 0 0; font-size: .78rem; color: var(--muted); }

.live {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
  padding: .2rem .5rem; border-radius: 99px;
}
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.live-kerja { background: #e3f4e8; color: #0a6b36; }
.live-kerja::before { animation: pulse 1.8s infinite; }
.live-idle { background: #f0eee2; color: var(--muted); }
.live-blokir { background: #fdeceb; color: var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.8); }
}

.room-focus { font-size: .84rem; color: var(--ink-2); margin: 0; }
.room-focus span { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: .4rem; }

.room-kpi { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: .5rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.room-kpi b { display: block; font-family: var(--fd); font-size: 1.15rem; line-height: 1.1; }
.room-kpi span { font-size: .7rem; color: var(--muted); }

.room-load { height: 3px; background: color-mix(in srgb, var(--c) 12%, white); border-radius: 99px; overflow: hidden; }
.room-load i { display: block; height: 100%; background: var(--c); border-radius: 99px; transition: width .4s ease; }

/* ------------------------------------------------------------ panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.panel-head h2 { font-size: 1.05rem; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; color: var(--green); text-decoration: none; cursor: pointer; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.feed li { display: flex; gap: .6rem; font-size: .85rem; color: var(--ink-2); border-bottom: 1px dashed var(--line); padding-bottom: .45rem; }
.feed li:last-child { border-bottom: 0; }
.feed li span { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.feed li b { color: var(--ink); font-weight: 600; }

/* -------------------------------------------------------- papan tugas */
.addtask {
  display: grid; grid-template-columns: 2fr .9fr .7fr .8fr auto; gap: .45rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: .6rem; margin-bottom: 1.2rem;
}
.addtask input, .addtask select {
  font: inherit; font-size: .86rem; padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: 3px; background: #fff; min-width: 0;
}
.addtask button, .approval-form button, .form-grid button, .auth button {
  font: inherit; font-size: .86rem; padding: .5rem .9rem; background: var(--ink); color: #f4f1e7;
  border: 1px solid var(--ink); border-radius: 3px; cursor: pointer;
}
.addtask button:hover, .form-grid button:hover, .auth button:hover { background: var(--green); border-color: var(--green); }

.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; align-items: start; }
.col { background: rgba(255, 254, 249, .55); border: 1px solid var(--line); border-radius: 4px; min-height: 160px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: .55rem .7rem; border-bottom: 1px solid var(--line); }
.col-head b { font-family: var(--fd); font-size: .95rem; color: var(--muted); }
.col-body { padding: .55rem; display: grid; gap: .5rem; }
.col-empty { margin: .4rem; font-size: .8rem; color: var(--muted); text-align: center; }

.st-pill { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; padding: .18rem .5rem; border-radius: 99px; }
.st-antri { background: #efeddf; color: #6a6b5c; }
.st-kerja { background: #e2eff5; color: #215a70; }
.st-review { background: #f6ecd9; color: #8a5a22; }
.st-selesai { background: #e3f4e8; color: #0a6b36; }

.task { background: #fff; border: 1px solid var(--line); border-left: 3px solid #b9b7a6; border-radius: 3px; padding: .6rem .65rem; }
.task.st-kerja { border-left-color: #3d7f9b; }
.task.st-review { border-left-color: #b98a3a; }
.task.st-selesai { border-left-color: #3fa267; opacity: .78; }
.task-top { display: flex; align-items: center; gap: .4rem; font-size: .7rem; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.task-div { flex: 1; letter-spacing: .04em; }
.task-prio { text-transform: uppercase; letter-spacing: .08em; font-size: .62rem; }
.task-prio.is-high { color: #b3261e; font-weight: 700; }
.task h4 { font-family: var(--ff); font-size: .9rem; font-weight: 600; letter-spacing: 0; margin: .35rem 0 .2rem; line-height: 1.35; }
.task-note { font-size: .78rem; color: var(--muted); margin: 0; }
.task-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .5rem; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.task-act { display: flex; gap: .2rem; }
.task-act form { display: contents; }
.task-act button {
  width: 24px; height: 24px; border: 1px solid var(--line); background: #fff; border-radius: 3px;
  cursor: pointer; font-size: .8rem; line-height: 1; color: var(--ink-2);
}
.task-act button:hover { border-color: var(--green); color: var(--green); }
.task-act .del:hover { border-color: #b3261e; color: #b3261e; }

/* ----------------------------------------------------------- approval */
.pending { display: grid; gap: .7rem; margin-bottom: 1.2rem; }
.approval { background: var(--card); border: 1px solid var(--line); border-left: 3px solid #c8451f; border-radius: 4px; padding: .9rem 1rem; }
.approval.is-done { border-left-color: #b9b7a6; opacity: .85; }
.approval header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.approval-div { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .2rem; display: flex; align-items: center; gap: .35rem; }
.approval h3 { font-size: 1rem; font-family: var(--ff); font-weight: 600; letter-spacing: 0; }
.approval-amount { margin: 0; font-family: var(--fd); font-size: 1.15rem; white-space: nowrap; }
.approval-amount small { display: block; font-family: var(--ff); font-size: .68rem; color: var(--muted); text-align: right; font-weight: 400; }
.approval-reason { font-size: .86rem; color: var(--ink-2); margin: .5rem 0 0; }
.approval-ev { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; }
.approval-form { display: flex; gap: .45rem; margin-top: .7rem; flex-wrap: wrap; }
.approval-form input { flex: 1; min-width: 160px; font: inherit; font-size: .84rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 3px; }
.btn-ok { background: var(--green) !important; border-color: var(--green) !important; }
.btn-no { background: #fff !important; color: #8c2f2a !important; border-color: #d9b3b0 !important; }
.approval-done { font-size: .82rem; color: var(--muted); margin: .6rem 0 0; }
.empty-note { color: var(--muted); font-size: .9rem; margin: 0 0 1.2rem; }

/* ---------------------------------------------------------------- log */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--card); }
.logtable { width: 100%; border-collapse: collapse; font-size: .84rem; }
.logtable th, .logtable td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.logtable th { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: #f5f3e9; }
.logtable code { font-size: .78rem; background: #f1efe3; padding: .1rem .3rem; border-radius: 2px; }

/* ----------------------------------------------------------- settings */
.form-grid { display: grid; gap: 1rem; max-width: 520px; }
.form-grid label { display: grid; gap: .3rem; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.form-grid input { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 3px; }
.form-grid small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.form-grid button { justify-self: start; }
.divtable { display: grid; gap: .5rem; }
.divrow { display: grid; grid-template-columns: 10px 180px 1fr 1fr; gap: .6rem; align-items: center; font-size: .86rem; border-bottom: 1px dashed var(--line); padding-bottom: .45rem; }
.divrow em { font-style: normal; color: var(--muted); font-size: .82rem; }

/* --------------------------------------------------------------- auth */
.auth-body { display: grid; place-items: center; min-height: 100vh; background: #101208; }
.auth { background: var(--card); padding: 2rem; border-radius: 6px; width: min(92vw, 380px); }
.auth h1 { font-size: 1.5rem; letter-spacing: .08em; }
.auth h1 span { color: var(--green); font-size: .8rem; letter-spacing: .2em; margin-left: .35rem; }
.auth p { color: var(--muted); font-size: .88rem; }
.auth form { display: grid; gap: .6rem; margin-top: 1rem; }
.auth input { font: inherit; padding: .65rem .7rem; border: 1px solid var(--line); border-radius: 3px; }

.flash { background: #fdecea; border: 1px solid #f0c6c0; color: #8c2f2a; padding: .6rem .8rem; border-radius: 3px; margin-bottom: 1rem; font-size: .86rem; }
.flash.is-err { background: #fdecea; }

/* ----------------------------------------------------------- responsif */
@media (max-width: 1080px) {
  .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-os { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .rooms, .board { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .addtask { grid-template-columns: 1fr 1fr; }
  .addtask input[name="title"] { grid-column: 1 / -1; }
  .os-tabs { order: 3; width: 100%; }
  .divrow { grid-template-columns: 10px 1fr; }
  .divrow span, .divrow em { grid-column: 2; }
}
