/* Gawe — Dokumentasi Kegiatan Kerja */
:root {
  --brand: #0f5f58;
  --brand-2: #0f766e;
  --brand-soft: #e6f2f0;
  --accent: #f59e0b;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --text: #17201e;
  --muted: #63706d;
  --line: #e2e8e6;
  --danger: #b91c1c;
  --ok: #15803d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 22, .05), 0 4px 16px rgba(16, 24, 22, .05);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.ic { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 12px; color: var(--muted); margin-top: -2px; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: 14px; }
.topnav a:hover { background: var(--bg); color: var(--text); }
.topnav a.active { color: var(--brand); background: var(--brand-soft); }
.topnav .btn-nav-primary { background: var(--brand); color: #fff; margin: 0 6px; }
.topnav .btn-nav-primary:hover, .topnav .btn-nav-primary.active { background: var(--brand-2); color: #fff; }
.nav-logout span { display: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }

/* ---------- Bottom nav (HP) ---------- */
.bottomnav { display: none; }
@media (max-width: 860px) {
  .topnav { display: none; }
  .topbar-in { padding: 10px 16px; }
  .container { padding: 18px 14px calc(100px + var(--safe-b)); }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + var(--safe-b));
    box-shadow: 0 -4px 20px rgba(0,0,0,.05);
  }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 0; }
  .bottomnav a.active { color: var(--brand); }
  .bottomnav .fab .bn-ic {
    width: 56px; height: 56px; margin-top: -26px; border-radius: 50%;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(145deg, var(--brand-2), var(--brand));
    box-shadow: 0 6px 18px rgba(15, 95, 88, .4); border: 4px solid #fff;
  }
  .bottomnav .fab { color: var(--brand); }
  .desktop-only { display: none !important; }
}
@media (min-width: 861px) { .mobile-only { display: none !important; } }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 11px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(15,95,88,.25); }
.btn-primary:hover { background: var(--brand-2); }
.btn-primary:disabled { background: #9db5b1; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9d3d0; background: #fafbfb; }
.btn-danger-ghost { background: #fff; color: var(--danger); border-color: #f1d0d0; }
.btn-danger-ghost:hover { background: #fef2f2; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 18px; font-size: 16px; }
.btn-sm { padding: 7px 11px; font-size: 13px; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; position: relative; }
.field > span { font-size: 13px; font-weight: 600; color: #34403d; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
.field-link { position: absolute; right: 0; top: 0; font-size: 12.5px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
input[type=text], input[type=password], input[type=date], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  padding: 11px 12px; border-radius: 10px; border: 1px solid #cfd8d5; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
input[type=color] { width: 44px; height: 44px; padding: 3px; border: 1px solid #cfd8d5; border-radius: 10px; background: #fff; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }

/* ---------- Alerts ---------- */
.alert { padding: 12px 14px; border-radius: 11px; margin-bottom: 16px; font-size: 14px; font-weight: 500; transition: opacity .4s; }
.alert.fade { opacity: 0; }
.alert-success { background: #ecfdf3; color: #14532d; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; letter-spacing: -.02em; }
.page-head h1 .muted { font-weight: 500; font-size: .7em; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--brand-2); text-transform: uppercase; letter-spacing: .08em; }
.head-actions { display: flex; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; text-decoration: none; margin-bottom: 6px; font-weight: 600; }
@media (max-width: 860px) {
  .page-head h1 { font-size: 22px; }
  .head-actions .btn-primary { display: none; }
}

/* ---------- Period bar ---------- */
.period-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.year-form select { width: auto; padding: 9px 34px 9px 12px; font-weight: 700; }
.seg { display: inline-grid; grid-auto-flow: column; background: #e7ecea; padding: 4px; border-radius: 12px; gap: 2px; }
.seg a { padding: 7px 14px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 650; font-size: 14px; white-space: nowrap; }
.seg a.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
@media (max-width: 560px) {
  .period-bar { flex-wrap: nowrap; gap: 8px; }
  .year-form select { padding: 9px 26px 9px 10px; }
  .seg { flex: 1; grid-auto-columns: 1fr; }
  .seg a { padding: 7px 4px; text-align: center; font-size: 13px; }
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat-n { font-size: 28px; font-weight: 750; letter-spacing: -.02em; color: var(--brand); line-height: 1.1; }
.stat-sm .stat-n { color: var(--text); font-size: 22px; }
.stat-l { font-size: 12.5px; color: var(--muted); font-weight: 550; }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(6, 1fr); }
  .stats .stat { grid-column: span 3; }
  .stats .stat-sm { grid-column: span 2; padding: 10px 12px; }
}

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: thin; }
.chip { --c: var(--brand); display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 13.5px; white-space: nowrap; font-weight: 550; }
.chip b { font-weight: 700; color: var(--muted); font-size: 12px; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip.on { background: var(--text); border-color: var(--text); color: #fff; }
.chip.on b { color: #cbd5d2; }

/* ---------- Month grid ---------- */
.month { margin-bottom: 28px; }
.month-title { font-size: 17px; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }
.month-title span { font-size: 13px; color: var(--muted); font-weight: 550; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,24,22,.1); }
.card-img { aspect-ratio: 4 / 3; background: #e9eeec; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 10px 12px 12px; display: grid; gap: 5px; }
.card-date { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.card-title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { --c: var(--brand); justify-self: start; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .card-body { padding: 8px 9px 10px; }
  .card-title { font-size: 13px; }
  .badge { display: none; }
}

/* ---------- Empty ---------- */
.empty { text-align: center; background: #fff; border: 1px dashed #c9d3d0; border-radius: 18px; padding: 48px 20px; }
.empty-ic { width: 76px; height: 76px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty h2 { font-size: 19px; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 18px; }

/* ---------- Connect card ---------- */
.connect-card { display: flex; gap: 20px; align-items: center; background: linear-gradient(135deg, #0f5f58, #13807a); color: #fff; border-radius: 18px; padding: 20px 24px; margin-top: 30px; }
.connect-card h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.connect-card p { margin: 0 0 8px; opacity: .92; max-width: 640px; }
.connect-card .link { color: #fde68a; font-weight: 600; text-decoration: none; }
.qr { width: 132px; height: 132px; flex: none; background: #fff; border-radius: 12px; padding: 6px; display: grid; place-items: center; color: var(--text); word-break: break-all; }
.qr svg { width: 100%; height: 100%; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel-title { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.step { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; }

/* ---------- Upload ---------- */
.upload-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.upload-layout .panel { margin: 0; }
.upload-layout > *, .edit-layout > *, .settings-grid > * { min-width: 0; }
.upload-layout .field { margin-bottom: 14px; }
@media (max-width: 860px) { .upload-layout { grid-template-columns: 1fr; } }
.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picker {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 20px 10px; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed #b8c7c3; background: #fafcfb; color: var(--brand);
  transition: background .15s, border-color .15s;
}
.picker:hover { background: var(--brand-soft); border-color: var(--brand-2); }
.picker b { color: var(--text); font-size: 15px; margin-top: 4px; }
.picker small { color: var(--muted); font-size: 12px; }
.picker-cam { background: var(--brand); border: 0; color: #fff; }
.picker-cam b, .picker-cam small { color: #fff; }
.picker-cam small { opacity: .85; }
.picker-cam:hover { background: var(--brand-2); }
.dropzone { margin-top: 10px; padding: 14px; border: 1.5px dashed #d3ddda; border-radius: 12px; text-align: center; color: var(--muted); font-size: 13.5px; }
.dropzone.over { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand); }
.queue { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.q-item { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; position: relative; }
.q-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #eee; flex: none; }
.q-meta { flex: 1; min-width: 0; display: grid; gap: 4px; }
.q-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-date input { width: auto; padding: 6px 8px; font-size: 14px; }
.q-src { font-size: 11px; font-weight: 700; color: var(--brand-2); background: var(--brand-soft); padding: 2px 7px; border-radius: 5px; }
.q-st { font-size: 12.5px; color: var(--muted); }
.q-del { border: 0; background: #f1f4f3; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); flex: none; }
.q-del:hover { background: #fee2e2; color: var(--danger); }
.q-up { opacity: .8; }
.q-done { border-color: #bbf7d0; background: #f0fdf4; }
.q-done .q-st { color: var(--ok); font-weight: 700; }
.q-err, .q-toobig { border-color: #fecaca; background: #fef2f2; }
.q-err .q-st, .q-toobig .q-st { color: var(--danger); font-weight: 600; }
.submit-row { margin-top: 18px; display: grid; gap: 10px; }
.progress { height: 8px; background: #e5ecea; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), #22a094); transition: width .2s; }
.status { margin: 0; font-size: 14px; min-height: 1.2em; }
.status.success { color: var(--ok); font-weight: 600; }
.status.error { color: var(--danger); font-weight: 600; }
.status.info { color: #1d4ed8; font-weight: 600; }
@media (max-width: 860px) {
  .submit-row { position: sticky; bottom: calc(84px + var(--safe-b)); background: #fff; padding-top: 6px; }
}

/* ---------- Edit ---------- */
.edit-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .edit-layout { grid-template-columns: 1fr; } }
.photo-view { margin: 0; padding: 12px; }
.photo-view img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #111; border-radius: 10px; }
.photo-view figcaption { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.photo-view .muted { margin-left: auto; }
.inline { display: inline; }
.preview-caption { background: #f8faf9; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; text-align: center; }
.preview-caption p { margin: 4px 0 0; font-family: Calibri, Carlito, Arial, sans-serif; }
.danger-zone { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Kategori ---------- */
.cat-add { display: flex; gap: 10px; align-items: center; }
.cat-add input[type=text] { flex: 1; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cat-list li { display: flex; gap: 8px; align-items: flex-start; }
.cat-row { flex: 1; display: flex; gap: 10px; align-items: center; }
.cat-row input[type=text] { flex: 1; padding: 9px 11px; }
.cat-row .count { font-size: 12.5px; color: var(--muted); white-space: nowrap; min-width: 60px; text-align: right; }
.cat-del summary { list-style: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; color: var(--danger); }
.cat-del summary::-webkit-details-marker { display: none; }
.cat-del[open] { flex-basis: 100%; }
.cat-del form { margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px; background: #fef2f2; border-radius: 10px; }
.cat-del form select { width: auto; margin-left: 6px; font-size: 14px; padding: 6px 8px; }
.cat-list li:has(.cat-del[open]) { flex-wrap: wrap; }
@media (max-width: 560px) {
  .cat-add { flex-wrap: wrap; }
  .cat-add input[type=text] { flex-basis: calc(100% - 54px); }
  .cat-add .btn { width: 100%; }
  .cat-row { flex-wrap: wrap; }
  .cat-row input[type=text] { flex-basis: calc(100% - 54px); }
  .cat-row .count { text-align: left; flex: 1; }
}

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .settings-grid { grid-template-columns: 1fr; } }
.connect-inline { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.connect-inline .qr { border: 1px solid var(--line); }
.steps { margin: 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 6px; }
@media (max-width: 560px) { .connect-inline { flex-direction: column; align-items: center; } }

/* ---------- Auth ---------- */
body.bare { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #d7ece8 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #fdf1d6 0, transparent 60%), var(--bg); }
.auth-wrap { min-height: 100vh; display: grid; place-content: center; padding: 24px 16px; width: 100%; max-width: 440px; margin: 0 auto; }
.auth-card { background: #fff; border-radius: 22px; padding: 28px 24px; box-shadow: 0 10px 40px rgba(16,24,22,.08); border: 1px solid var(--line); }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand h1 { font-size: 22px; margin: 10px 0 4px; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 14px; }
