/* Dapur Kisah — dashboard tim konten horor
   Dasar slate gelap, tile bento berwarna, aksen biru, Plus Jakarta Sans. */
:root {
  --bg: #14151b;
  --frame: #0e0f13;
  --surface: #1d1f27;
  --surface-2: #262935;
  --surface-3: #30344a;
  --line: #2c2f3d;
  --text: #eef0f6;
  --muted: #8d92a5;
  --faint: #5f6478;
  --accent: #2f7bff;
  --accent-soft: #1d2f55;

  /* Bento */
  --butter: #ffd84d;
  --coral: #ff8a4c;
  --lilac: #b9a1ff;
  --lime: #b8f05a;
  --sky: #7cd3ff;
  --pink: #ff7ab6;
  --ink: #15161c;

  /* Nama lama tetap dipakai di tampilan */
  --candle: var(--butter);
  --candle-dim: #3b3420;
  --blood: #ff6b6b;
  --blood-dim: #3d2025;
  --moss: var(--lime);
  --moss-dim: #26331a;

  --r-panel: 24px;
  --r-tile: 22px;
  --r-item: 16px;
  --r-input: 14px;
  --radius: var(--r-panel);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: var(--font);
  --sans: var(--font);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: #7fb0ff; text-decoration: none; }
a:hover { color: #a9c9ff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.85rem; letter-spacing: -.025em; }
h2 { font-size: 1.12rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

/* Layout: sidebar sebagai panel mengambang */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; gap: 0; }
.side { margin: 14px 0 14px 14px; background: var(--frame); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1.25rem .9rem; position: sticky; top: 14px; height: calc(100vh - 28px); overflow-y: auto; display: flex; flex-direction: column; }
.brand { font-size: 1.2rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: .6rem; margin: 0 .3rem .2rem; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand .mark { width: 34px; height: 34px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; flex: none; box-shadow: 0 6px 18px -6px rgba(47, 123, 255, .7); }
.brand .mark svg { width: 18px; height: 18px; color: #fff; }
.brand span { color: var(--text); }
.tagline { color: var(--faint); font-size: .78rem; margin: 0 .3rem 1.4rem 3.1rem; }
.nav a { display: flex; align-items: center; gap: .7rem; color: var(--muted); padding: .55rem .7rem; border-radius: 12px; margin-bottom: 2px; font-weight: 500; font-size: .93rem; }
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a .badge { margin-left: auto; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav a.active svg { color: var(--accent); opacity: 1; }
.nav .label { font-size: .74rem; color: var(--faint); margin: 1.1rem .7rem .35rem; font-weight: 600; }
.me { margin-top: auto; padding: .9rem .7rem .2rem; border-top: 1px solid var(--line); font-size: .85rem; }
.main { padding: 2rem 2.25rem 4rem; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.head p { margin: .2rem 0 0; color: var(--muted); }

/* Panel */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1.3rem 1.4rem; }
.card + .card { margin-top: 1rem; }
.card h2 { margin-bottom: .9rem; }
.grid { display: grid; gap: 1rem; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }

/* Tile statistik: default panel, varian bento berwarna */
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-tile); padding: 1rem 1.15rem; }
.stat .n { font-size: 2.1rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stat .l { color: var(--muted); font-size: .84rem; margin-top: .45rem; }
.stat.warn { border-color: #5a2a30; background: linear-gradient(180deg, #2a1d24, var(--surface-2)); }
.stat.warn .n { color: #ff9b9b; }

.bento { display: grid; gap: 1rem; grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.tile { border-radius: var(--r-tile); padding: 1.05rem 1.15rem 1.15rem; color: var(--ink); position: relative; overflow: hidden; min-height: 150px; display: flex; flex-direction: column; }
.tile .t-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .86rem; }
.tile .t-icon { width: 34px; height: 34px; border-radius: 11px; background: rgba(21, 22, 28, .12); display: grid; place-items: center; }
.tile .t-icon svg { width: 18px; height: 18px; }
.tile .t-num { font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: auto; padding-top: .8rem; }
.tile .t-sub { font-size: .8rem; font-weight: 600; opacity: .72; margin-top: .35rem; }
.tile a { color: inherit; }
.tile.butter { background: var(--butter); }
.tile.coral { background: var(--coral); }
.tile.lilac { background: var(--lilac); }
.tile.lime { background: var(--lime); }
.tile.sky { background: var(--sky); }
.tile.pink { background: var(--pink); }
.tile.accent { background: linear-gradient(145deg, #3d86ff, #1f5fe0 70%); color: #fff; }
.tile.accent .t-icon { background: rgba(255, 255, 255, .16); }
.tile.accent .t-sub { opacity: .85; }
.tile .btn { align-self: flex-start; margin-top: .9rem; }
.tile.accent .btn { background: #fff; color: #1d4fc2; border-color: #fff; }

/* Tombol */
.btn { display: inline-flex; align-items: center; gap: .45rem; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: .55rem 1.05rem; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 8px 22px -10px rgba(47, 123, 255, .9); }
.btn.primary:hover { background: #4a8dff; }
.btn.danger { color: #ff9b9b; border-color: #4a262c; background: transparent; }
.btn.danger:hover { background: var(--blood-dim); }
.btn.small { padding: .32rem .75rem; font-size: .8rem; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Form */
label { display: block; font-size: .84rem; color: var(--muted); margin-bottom: .35rem; font-weight: 500; }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=datetime-local], input[type=date], input[type=color], select, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-input); padding: .62rem .8rem; font: inherit;
}
input[type=color] { padding: 3px; height: 40px; }
textarea { min-height: 120px; resize: vertical; }
textarea.tall { min-height: 360px; font-size: 1rem; line-height: 1.75; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 123, 255, .22); }
.field { margin-bottom: 1rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; color: var(--text); font-size: .92rem; margin-bottom: .6rem; font-weight: 400; }
.check input { margin-top: .25rem; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.hint { font-size: .8rem; color: var(--faint); margin-top: .3rem; }
.error { color: #ff9b9b; font-size: .82rem; margin-top: .25rem; }

.flash { padding: .8rem 1.1rem; border-radius: var(--r-item); margin-bottom: 1rem; border: 1px solid; }
.flash.success { background: var(--moss-dim); border-color: #3e5524; color: #d9f7b0; }
.flash.error { background: var(--blood-dim); border-color: #5a2a30; color: #ffc9c9; }
.flash.warning { background: var(--candle-dim); border-color: #5e5228; color: #ffeaa3; }

.badge { display: inline-block; font-size: .73rem; font-weight: 600; padding: .16rem .6rem; border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge.candle { background: var(--butter); color: var(--ink); }
.badge.blood { background: #ff6b6b; color: var(--ink); }
.badge.moss { background: var(--lime); color: var(--ink); }
.dot { display: inline-block; width: .62rem; height: .62rem; border-radius: 50%; vertical-align: middle; margin-right: .35rem; }
.avatar { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; font-size: .75rem; font-weight: 800; color: var(--ink); flex: none; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .18rem .6rem; border-radius: 999px; color: var(--ink); background: var(--series, var(--surface-3)); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; border-bottom: 1px solid var(--line); padding: .55rem .55rem; }
td { border-bottom: 1px solid var(--line); padding: .6rem .55rem; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* Kanban */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.filters select { width: auto; border-radius: 999px; padding: .45rem 1rem; }
.board { display: grid; grid-template-columns: repeat(6, minmax(160px, 1fr)); gap: .8rem; overflow-x: auto; padding-bottom: 1rem; }
.col { background: var(--frame); border: 1px solid var(--line); border-radius: var(--r-panel); padding: .7rem; min-height: 62vh; transition: border-color .15s, background .15s; }
.col.over { border-color: var(--accent); background: #121a2c; }
.col-head { display: flex; justify-content: space-between; align-items: flex-start; padding: .3rem .35rem .75rem; }
.col-head strong { font-weight: 700; }
.col-head small { display: block; color: var(--faint); font-size: .72rem; margin-top: .1rem; }
.story-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-item); padding: .7rem .75rem .75rem; margin-bottom: .6rem; cursor: grab; position: relative; }
.story-card:hover { border-color: var(--surface-3); }
.story-card.dragging { opacity: .45; }
.story-card a.title { color: var(--text); font-weight: 700; display: block; margin: .5rem 0 .55rem; line-height: 1.3; font-size: .92rem; }
.story-card .meta { display: flex; justify-content: space-between; align-items: center; gap: .4rem; font-size: .76rem; color: var(--muted); }
.story-card .series-name { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--ink); background: var(--series); padding: .14rem .55rem; border-radius: 999px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; margin-top: .55rem; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* Kalender */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .7rem; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-tile); padding: .8rem; min-height: 230px; }
.day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.day .d { font-weight: 700; font-size: 1rem; }
.day .slot { font-size: .75rem; color: var(--faint); margin-bottom: .7rem; }
.day .item { background: var(--series); color: var(--ink); border-radius: 12px; padding: .5rem .6rem; margin-bottom: .45rem; font-size: .82rem; }
.day .item a { color: var(--ink); font-weight: 700; }
.day .item .muted { color: rgba(21, 22, 28, .7) !important; }

/* Bar */
.bars .row { display: grid; grid-template-columns: 140px 1fr 70px; gap: .7rem; align-items: center; margin-bottom: .55rem; font-size: .86rem; }
.bars .track { background: var(--surface-2); height: 14px; border-radius: 999px; overflow: hidden; }
.bars .fill { height: 100%; border-radius: 999px; }

/* Bacaan cerita */
.story-body { font-size: 1.02rem; line-height: 1.85; white-space: pre-wrap; }
.note { background: var(--candle-dim); border: 1px solid #5e5228; border-radius: var(--r-item); padding: .8rem 1rem; color: #ffeaa3; white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: .4rem .75rem; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Halaman tamu */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background:
  radial-gradient(600px 400px at 15% 10%, rgba(47, 123, 255, .18), transparent 70%),
  radial-gradient(500px 380px at 90% 90%, rgba(185, 161, 255, .14), transparent 70%), var(--bg); }
.guest .box { width: 100%; max-width: 420px; }
.guest .box.wide { max-width: 680px; }
.guest .brand { justify-content: center; font-size: 1.5rem; margin-bottom: .3rem; }
.guest .tagline { text-align: center; margin: 0 0 1.5rem; }

.empty { color: var(--faint); font-size: .88rem; padding: .5rem 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; }
.copy { cursor: pointer; }
.copy:hover { background: var(--surface-3); }

@media (max-width: 1200px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento .tile.accent { grid-column: span 2; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; margin: 10px 10px 0; padding: .9rem; }
  .tagline { display: none; }
  .brand { margin-bottom: .7rem; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav .label { display: none; }
  .nav a { padding: .4rem .65rem; font-size: .86rem; }
  .nav a svg { width: 16px; height: 16px; }
  .me { margin-top: .6rem; }
  .main { padding: 1.25rem 1rem 3rem; }
  .g2, .g3, .g4, .split { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr 1fr; }
  .tile { min-height: 128px; }
  .tile .t-num { font-size: 2.1rem; }
  .week { grid-template-columns: 1fr; }
  .bars .row { grid-template-columns: 100px 1fr 56px; }
  .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
