/* Skinvest Hub – mengikuti Brand Guideline Skinvest 2026 (Philosopher + Poppins, Dark Bronze & Light Grayish Orange) */
:root {
  --bronze: #503924;
  --bronze-2: #6b5646;
  --taupe: #7b6b60;
  --beige: #b49d8a;
  --cream: #efeae6;
  --bg: #f7f4f1;
  --surface: #ffffff;
  --line: #e4dbd3;
  --fg: #3a2a1c;
  --muted: #7b6b60;
  --danger: #a8442a;
  --ok: #3f6b4a;
  --display: "Philosopher", Georgia, serif;
  --body: "Poppins", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 14.5px; line-height: 1.55; }
a { color: var(--bronze); }
h1, h2, h3 { font-family: var(--display); color: var(--bronze); margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(135deg, #503924 0%, #6e5a4b 55%, #9c8471 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side img { width: 120px; }
.auth-side h1 { color: #fff; font-size: 44px; margin-top: 24px; }
.auth-side p { color: #efe6dc; max-width: 40ch; margin-top: 12px; }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 16px; }
.auth-card .switch { font-size: 13.5px; color: var(--muted); }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } .auth-side { padding: 28px 20px; } .auth-side h1 { font-size: 32px; } }

/* ---------- Form ---------- */
label.f { display: grid; gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--bronze); }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input, select, textarea { font: inherit; color: var(--fg); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--beige); box-shadow: 0 0 0 3px #b49d8a33; }
input[type=checkbox] { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.req::after { content: " *"; color: var(--danger); }

.btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 10px 18px; cursor: pointer; background: var(--bronze); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--bronze-2); }
.btn.ghost { background: transparent; color: var(--bronze); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--cream); }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--beige); outline-offset: 2px; }
.err { background: #f8e6e0; color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.note { background: var(--cream); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--bronze); color: #efe6dc; padding: 22px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.side .brand img { width: 40px; }
.side .brand b { font-family: var(--display); font-size: 20px; color: #fff; }
.side .group { display: grid; gap: 2px; }
.side .group > span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--beige); padding: 6px 10px; }
.side a { color: #efe6dc; text-decoration: none; padding: 9px 12px; border-radius: 9px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.side a:hover { background: #ffffff14; }
.side a.on { background: #fff; color: var(--bronze); font-weight: 600; }
.side .me { margin-top: auto; border-top: 1px solid #ffffff22; padding: 14px 10px 0; font-size: 13px; display: grid; gap: 8px; }
.side .me button { background: transparent; color: #efe6dc; border: 1px solid #ffffff33; border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
.main { min-width: 0; padding: 28px 32px 64px; display: grid; gap: 20px; align-content: start; }
.topbar { display: none; }
.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
.pagehead p { color: var(--muted); margin-top: 4px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: var(--bronze); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 20; }
  .topbar b { font-family: var(--display); font-size: 18px; }
  .topbar button { background: transparent; border: 1px solid #ffffff55; color: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; }
  .main { padding: 20px 16px 64px; }
}

/* ---------- Cards / list ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { font: inherit; font-size: 13px; border: 1.5px solid var(--line); background: #fff; color: var(--fg); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.tabs button.on { background: var(--bronze); border-color: var(--bronze); color: #fff; }
.tabs .count { opacity: .7; margin-left: 4px; }
.reqlist { display: grid; gap: 10px; }
.reqrow { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; text-decoration: none; color: inherit; }
.reqrow:hover { border-color: var(--beige); }
.reqrow .t { font-weight: 600; color: var(--bronze); }
.reqrow .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) {
  .reqrow { grid-template-columns: 1fr; }
  .reqrow > div:nth-child(2) { order: -1; justify-content: flex-start !important; }
}
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: #fff; white-space: nowrap; align-self: start; }
.badge.light { background: var(--cream); color: var(--bronze); }
.badge.urgent { background: var(--danger); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
dl.kv dt { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
dl.kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 560px) { dl.kv { grid-template-columns: 1fr; gap: 2px; } dl.kv dd { margin-bottom: 10px; } }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.files a { display: grid; gap: 4px; text-decoration: none; color: var(--fg); font-size: 12px; overflow-wrap: anywhere; }
.files .thumb { aspect-ratio: 1; background: var(--cream); border-radius: 10px; overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.files .thumb img { width: 100%; height: 100%; object-fit: cover; }
.comments { display: grid; gap: 10px; }
.cmt { background: var(--cream); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; }
.cmt.revisi { background: #f8e6e0; }
.cmt.sistem { background: #fff; border: 1px dashed var(--line); }
.cmt .h { font-size: 12px; color: var(--muted); }
.cmt .b { white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-img { width: 100%; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- Library ---------- */
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.libitem { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid; }
.libitem .img { aspect-ratio: 4/5; background: var(--cream); display: grid; place-items: center; color: var(--muted); font-size: 12px; overflow: hidden; }
.libitem .img img { width: 100%; height: 100%; object-fit: cover; }
.libitem .body { padding: 10px 12px; display: grid; gap: 4px; font-size: 12.5px; }
.libitem .body b { font-size: 13.5px; color: var(--bronze); }
.libitem .row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }

/* ---------- Table ---------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td .actions { display: flex; flex-wrap: wrap; gap: 6px; }
td input, td select { min-width: 84px; padding: 7px 9px; }
td input[data-f="name"] { min-width: 190px; }
td input[type=checkbox] { min-width: 0; }
.card > .btn, .card > .tabs + .chk { justify-self: start; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; font-size: 13px; white-space: nowrap; }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: #2a1d1299; display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; display: grid; gap: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--bronze); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; font-size: 14px; box-shadow: 0 6px 20px #00000033; max-width: calc(100vw - 32px); }
#toast.bad { background: var(--danger); }
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
