:root {
  --bg: #f6f5f2; --card: #fff; --line: #e6e3dc; --line2: #d3d0c7; --text: #23221f; --muted: #6b6a64; --soft: #f1efe8;
  --brand: #c8203f; --brand-d: #a3182f; --ok: #1d9e75; --bad: #d23b3a; --r: 10px;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 30%, transparent); border-color: var(--brand); }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--soft); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { background: var(--brand-d); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost.on { background: #fff; border-color: var(--line2); font-weight: 600; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); white-space: nowrap; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin-bottom: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.hidden { display: none !important; }

/* ---------- topbar admin ---------- */
.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--brand); margin-right: 4px; }
.top select { width: auto; min-width: 150px; }
.tabs { display: flex; gap: 2px; background: var(--soft); padding: 3px; border-radius: 9px; }
.spacer { flex: 1; }
main { padding: 16px; max-width: 1400px; margin: 0 auto; }

/* ---------- ringkasan ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ccard { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ccard h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat { background: var(--soft); border-radius: 8px; padding: 6px 8px; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 11px; color: var(--muted); }
.stat.warn b { color: #ba7517; } .stat.bad b { color: var(--bad); }
.feed { margin-top: 20px; }
.feed-item { padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.feed-item:hover { background: var(--soft); }
h2 { font-size: 16px; margin: 0 0 10px; }

/* ---------- kalender ---------- */
.calhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.calhead h2 { margin: 0 8px; min-width: 150px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal .dow { padding: 6px 8px; font-size: 11px; color: var(--muted); background: var(--soft); }
.day { min-height: 110px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 4px; cursor: pointer; }
.day:nth-child(7n+1) { border-left: 0; }
.day.out { background: #faf9f6; color: #b4b2a9; }
.day.today .num { background: var(--brand); color: #fff; border-radius: 99px; padding: 0 6px; }
.day .num { font-size: 12px; display: inline-block; margin: 2px; }
.day.drop { background: color-mix(in srgb, var(--brand) 8%, #fff); }
.chip { display: flex; gap: 4px; align-items: center; font-size: 11.5px; padding: 3px 6px; border-radius: 6px; margin-top: 3px; background: color-mix(in srgb, var(--c) 13%, #fff); color: color-mix(in srgb, var(--c) 75%, #000); border-left: 3px solid var(--c); cursor: grab; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip .p { font-weight: 700; flex: none; }
.chip .t { overflow: hidden; text-overflow: ellipsis; }
.unsched { margin-top: 14px; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.col { background: var(--soft); border-radius: var(--r); padding: 8px; min-height: 300px; }
.col.drop { outline: 2px dashed var(--brand); }
.col h3 { font-size: 13px; margin: 2px 4px 8px; display: flex; justify-content: space-between; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; cursor: grab; display: flex; gap: 8px; }
.kcard img, .thumb0 { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; flex: none; background: var(--soft); }
.kcard .ttl { font-weight: 600; font-size: 13px; }
.kcard .meta { font-size: 11.5px; color: var(--muted); }

/* ---------- daftar ---------- */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.tbl th { background: var(--soft); font-size: 12px; color: var(--muted); font-weight: 600; }
.tbl tr.click:hover td { background: #fcfbf8; cursor: pointer; }
.filters { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 18, 15, .45); z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: 30px 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 1040px; }
.modal.narrow { max-width: 720px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h h2 { margin: 0; flex: 1; }
.modal-b { padding: 18px; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.ed { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.media-list { display: flex; gap: 8px; flex-wrap: wrap; }
.mitem { position: relative; width: 92px; height: 92px; }
.mitem img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.mitem .mx { position: absolute; top: 3px; right: 3px; display: flex; gap: 2px; }
.mitem .mx button { border: 0; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 5px; font-size: 11px; padding: 1px 6px; cursor: pointer; }
.upl { width: 92px; height: 92px; border: 2px dashed var(--line2); border-radius: 8px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: var(--muted); cursor: pointer; }
.upl:hover { border-color: var(--brand); color: var(--brand); }
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; margin-bottom: 10px; }
.msg { padding: 8px 10px; border-radius: 10px; background: var(--soft); font-size: 13px; }
.msg.client { background: #fff7e6; border: 1px solid #f3dfb5; }
.msg.approve { background: #e6f5ee; border: 1px solid #b8e3cf; }
.msg.revision { background: #fdecec; border: 1px solid #f4c3c3; }
.msg.internal { background: #eef0fb; border: 1px dashed #b5bce8; }
.msg .who { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.counter { font-size: 11px; color: var(--muted); text-align: right; }

/* ---------- pratinjau IG / FB ---------- */
.pv { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 420px; }
.pv-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 13px; }
.pv-plat { margin-left: auto; font-size: 11px; color: var(--muted); }
.av { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: #f1efe8; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; }
.pv.tall .slide { aspect-ratio: 9 / 16; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide.empty { color: var(--muted); font-size: 13px; aspect-ratio: 4 / 3; }
.dots { display: flex; justify-content: center; gap: 4px; padding: 7px 0 0; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #d3d1c7; }
.dots i.on { background: #378add; }
.pv-cap { padding: 8px 12px 12px; font-size: 13px; white-space: normal; word-break: break-word; }
.pv.fb .pv-cap { padding-top: 0; }

/* ---------- login ---------- */
.login { max-width: 360px; margin: 12vh auto; padding: 28px; }
.login h1 { font-size: 20px; margin: 0 0 4px; color: var(--brand); }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px); background: #23221f; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 99; transition: transform .25s; max-width: 90vw; }
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--bad); }

/* ---------- halaman klien ---------- */
.k-top { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 16px; }
.k-top .in { max-width: 980px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.k-main { max-width: 980px; margin: 0 auto; padding: 16px; }
.k-item { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; padding: 16px; margin-bottom: 16px; }
.k-month { font-size: 15px; font-weight: 700; margin: 22px 0 10px; color: var(--muted); }
.igrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; max-width: 520px; margin: 0 auto; }
.igrid div { aspect-ratio: 4 / 5; background: #e6e3dc; position: relative; overflow: hidden; cursor: pointer; }
.igrid img { width: 100%; height: 100%; object-fit: cover; }
.igrid span { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 1px 5px; border-radius: 4px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }

@media (max-width: 760px) {
  .ed, .k-item, .grid2 { grid-template-columns: 1fr; }
  .day { min-height: 70px; }
  .chip .t { display: none; }
  .top { gap: 6px; }
  .top select { min-width: 0; flex: 1; }
  main { padding: 10px; }
  .modal-bg { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .hide-m { display: none; }
  #kTabs { width: 100%; }
  #kTabs .btn { flex: 1; justify-content: center; padding: 7px 6px; }
  .tabs { overflow-x: auto; max-width: 100%; }
}
