:root {
  --ink: #1f1b3a;
  --ink-2: #635f82;
  --ink-3: #8d89a8;
  --line: rgba(99, 95, 130, 0.14);
  --line-strong: rgba(99, 95, 130, 0.24);
  --indigo: #4f46e5;
  --violet: #8b5cf6;
  --grad: linear-gradient(135deg, #4f46e5, #8b5cf6);
  --ok: #0f9d6b;
  --warn: #c2760a;
  --info: #2563eb;
  --danger: #d64545;
  --surface: rgba(255, 255, 255, 0.62);
  --surface-solid: rgba(255, 255, 255, 0.88);
  --shadow: 0 18px 40px -24px rgba(31, 27, 58, 0.35);
  --shadow-sm: 0 8px 20px -14px rgba(31, 27, 58, 0.4);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: #f3f0ff;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #f6f3ff 0%, #efeaff 100%);
  z-index: -2;
}

.glow { position: fixed; border-radius: 50%; filter: blur(90px); opacity: 0.5; z-index: -1; pointer-events: none; }
html, body { overflow-x: hidden; }
.glow-1 { width: 460px; height: 460px; background: #c7c2ff; top: -160px; left: -120px; }
.glow-2 { width: 380px; height: 380px; background: #f3c6e8; bottom: -140px; right: 8%; opacity: 0.38; }
.glow-3 { width: 420px; height: 420px; background: #bfe0ff; top: 30%; right: -160px; opacity: 0.35; }

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16.5px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
code, .code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; background: rgba(79, 70, 229, 0.08); padding: 2px 6px; border-radius: 6px; color: #4338ca; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; }

.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.ta-right { text-align: right; }
.cell-clamp { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; align-items: flex-start; }

.sidebar {
  width: 256px;
  flex: 0 0 256px;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.7);
  z-index: 30;
}

.brand { display: flex; gap: 11px; align-items: center; padding: 4px 6px 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--grad); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 22px -12px rgba(79, 70, 229, 0.9);
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 13.5px; font-weight: 650; }
.brand-text small { font-size: 11.5px; color: var(--ink-3); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
  transition: background 0.16s, color 0.16s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.75); color: var(--ink); text-decoration: none; }
.nav-item.is-active {
  background: var(--grad); color: #fff; font-weight: 600;
  box-shadow: 0 12px 24px -14px rgba(79, 70, 229, 0.85);
}
.nav-item.is-active .icon { color: #fff; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.mini-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 13px; background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.8); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(79, 70, 229, 0.12); color: #4338ca;
  font-weight: 700; font-size: 12.5px;
}
.mini-user-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mini-user-txt strong { font-size: 12.8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-user-txt small { font-size: 11px; color: var(--ink-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 32px 10px;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title p { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.menu-toggle { display: none; flex-direction: column; gap: 4px; width: 38px; height: 38px; justify-content: center; align-items: center; background: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.9); }
.menu-toggle span { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--ink); }

.content { padding: 14px 32px 56px; display: flex; flex-direction: column; gap: 24px; max-width: 1240px; width: 100%; }
.content-wide { max-width: 1320px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pad { padding: 22px; }
.card-title { font-size: 16px; font-weight: 650; }
.card-sub { color: var(--ink-2); font-size: 12.8px; margin-top: 4px; }
.card-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 6px; }
.section-head h2 { font-size: 17px; }
.section-head p { margin-top: 2px; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
}
.stat::after { content: ''; position: absolute; inset: auto -30px -50px auto; width: 110px; height: 110px; border-radius: 50%; background: rgba(79,70,229,0.08); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.stat-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(79, 70, 229, 0.1); color: var(--indigo); }
.stat-value { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; }
.stat-hint { font-size: 11.8px; color: var(--ink-3); }
.stat-accent .stat-ico { background: var(--grad); color: #fff; }
.stat-info .stat-ico { background: rgba(37, 99, 235, 0.12); color: var(--info); }
.stat-ok .stat-ico { background: rgba(15, 157, 107, 0.12); color: var(--ok); }
.stat-warn .stat-ico { background: rgba(194, 118, 10, 0.14); color: var(--warn); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 11px;
  font-family: inherit; font-size: 13.3px; font-weight: 550;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.16s, background 0.16s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 12px 24px -14px rgba(79, 70, 229, 0.9); }
.btn-primary:hover { box-shadow: 0 16px 28px -14px rgba(79, 70, 229, 0.95); }
.btn-ghost { background: rgba(255, 255, 255, 0.72); color: var(--ink); border-color: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: rgba(214, 69, 69, 0.1); color: var(--danger); border-color: rgba(214, 69, 69, 0.22); }
.btn-danger:hover { background: rgba(214, 69, 69, 0.16); }
.btn-sm { padding: 6px 11px; font-size: 12.4px; border-radius: 9px; }
.btn-lg { padding: 12px 18px; font-size: 14px; }
.btn-block { width: 100%; }
.inline-form { display: inline; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.8);
  color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.icon-btn:hover { color: var(--ink); background: #fff; }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(214, 69, 69, 0.35); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.8px; font-weight: 550; color: var(--ink-2); }
.field-hint { font-size: 11.8px; color: var(--ink-3); }
.req { color: var(--danger); font-style: normal; }
.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.85);
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.input:focus { outline: none; border-color: rgba(79, 70, 229, 0.55); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); background: #fff; }
textarea.input { resize: vertical; min-height: 74px; }
.input:disabled { background: rgba(243, 240, 255, 0.8); color: var(--ink-3); }

.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-20 > * + * { margin-top: 20px; }
.stack-12, .stack-16, .stack-20 { display: flex; flex-direction: column; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.gap-16 { gap: 16px; }

.radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line-strong);
  font-size: 13.3px; cursor: pointer;
}
.radio-item input { accent-color: var(--indigo); margin: 0; }
.radio-item:has(input:checked) { border-color: rgba(79, 70, 229, 0.55); background: rgba(79, 70, 229, 0.08); }

.switch { display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  width: 40px; height: 22px; border-radius: 999px;
  background: rgba(99, 95, 130, 0.25); position: relative; transition: background 0.16s;
}
.switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform 0.16s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + span { background: var(--indigo); }
.switch input:checked + span::after { transform: translateX(18px); }

.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-actions.vertical { flex-direction: column; align-items: stretch; margin-top: 16px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px 20px; align-items: flex-end; }
.field-inline { display: flex; flex-direction: column; gap: 5px; font-size: 12.3px; color: var(--ink-2); font-weight: 550; }
.field-inline .input { min-width: 140px; padding: 8px 10px; font-size: 13px; }
.filter-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13.3px; }
.table th {
  text-align: left; padding: 14px 18px;
  font-size: 11.6px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.55); }
.table td strong { font-weight: 600; font-size: 13.4px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.6px; font-weight: 600; white-space: nowrap;
}
.badge-ok { background: rgba(15, 157, 107, 0.12); color: #0b7d55; }
.badge-info { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
.badge-warn { background: rgba(194, 118, 10, 0.14); color: #a16207; }
.badge-muted { background: rgba(99, 95, 130, 0.12); color: #55516e; }
.badge-accent { background: rgba(139, 92, 246, 0.14); color: #6d28d9; }

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; }

/* ---------- Dashboard widgets ---------- */
.grid-chart { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
.chart { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.bar-value { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.bar-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: rgba(79, 70, 229, 0.06); border-radius: 9px; overflow: hidden; }
.bar { width: 100%; background: var(--grad); border-radius: 9px; transition: height 0.4s ease; min-height: 3px; }
.bar-label { font-size: 11.5px; color: var(--ink-3); font-weight: 550; }
.rank { display: flex; flex-direction: column; gap: 15px; padding-top: 2px; }
.rank-row { display: flex; flex-direction: column; gap: 6px; }
.rank-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.8px; }
.rank-head span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-head strong { font-weight: 650; }
.progress { height: 7px; border-radius: 999px; background: rgba(79, 70, 229, 0.1); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--grad); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px; }
.form-card { display: flex; flex-direction: column; gap: 10px; }
.form-card-head { display: flex; justify-content: space-between; align-items: center; }
.form-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(79, 70, 229, 0.1); color: var(--indigo); }
.form-card h3 { font-size: 15px; }
.form-card p { flex: 1; font-size: 12.8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.form-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }

.empty { padding: 34px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(79, 70, 229, 0.1); color: var(--indigo); margin-bottom: 4px; }
.empty h3 { font-size: 15px; }
.empty p { color: var(--ink-2); font-size: 13px; max-width: 380px; }

/* ---------- Alerts ---------- */
.alert {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; border-radius: 12px; font-size: 13.2px;
  border: 1px solid transparent;
}
.alert-ok { background: rgba(15, 157, 107, 0.1); color: #0b7d55; border-color: rgba(15, 157, 107, 0.2); }
.alert-err { background: rgba(214, 69, 69, 0.09); color: #b02a2a; border-color: rgba(214, 69, 69, 0.22); }

/* ---------- Detail ---------- */
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 12.8px; color: var(--ink-2); font-weight: 550; width: fit-content; }
.back-link:hover { color: var(--indigo); text-decoration: none; }
.grid-form { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.grid-form > * { min-width: 0; }
.answers, .answer-value { overflow-wrap: anywhere; }
.side-note { display: flex; flex-direction: column; gap: 14px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.detail-head > div { min-width: 0; flex: 1 1 220px; }
.detail-head > .badge { flex: 0 0 auto; }
.answers { display: flex; flex-direction: column; }
.answer { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.answer:last-child { border-bottom: none; }
.answer-label { font-size: 11.8px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 600; margin-bottom: 3px; }
.answer-value { font-size: 14px; }
.meta-list { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.meta-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12.8px; }
.meta-list span { color: var(--ink-2); }
.note-box { background: rgba(79, 70, 229, 0.07); border: 1px solid rgba(79, 70, 229, 0.14); padding: 12px 14px; border-radius: 12px; font-size: 13px; }
.ticks { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 12.8px; color: var(--ink-2); }

/* ---------- Builder ---------- */
.field-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.field-row {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.65);
  display: flex; flex-direction: column; gap: 12px;
}
.field-row-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 64px; gap: 12px; align-items: end; }
.field-shrink { max-width: 70px; }
.field-row-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-tools { display: flex; gap: 6px; }

/* ---------- Popover ---------- */
.popover { position: relative; display: inline-block; }
.popover > summary { list-style: none; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-body {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 250px; z-index: 20;
  background: #fff; border: 1px solid var(--line);
  border-radius: 13px; padding: 14px;
  box-shadow: 0 24px 48px -20px rgba(31, 27, 58, 0.4);
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
}

/* ---------- Auth ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 32px 20px; }
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: center; max-width: 1040px; width: 100%; }
.auth-hero h1 { font-size: 36px; line-height: 1.16; margin: 16px 0 14px; letter-spacing: -0.03em; }
.auth-hero p { color: var(--ink-2); font-size: 14.5px; max-width: 440px; }
.pill {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 11.8px; font-weight: 600; color: #5b21b6; letter-spacing: 0.01em;
  box-shadow: var(--shadow-sm);
}
.auth-card { padding: 30px 28px; display: flex; flex-direction: column; gap: 18px; background: rgba(255, 255, 255, 0.72); }
.auth-brand { display: flex; gap: 11px; align-items: center; }
.auth-brand strong { display: block; font-size: 15px; }
.auth-brand small { font-size: 12px; color: var(--ink-3); }
.auth-hint {
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(79, 70, 229, 0.07); border: 1px dashed rgba(79, 70, 229, 0.28);
  border-radius: 12px; padding: 13px 15px; font-size: 12.5px; color: var(--ink-2);
}
.auth-hint strong { font-size: 12.5px; color: var(--ink); }
.auth-hint code { background: rgba(255, 255, 255, 0.9); }
.auth-hint small { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }

.notfound { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.notfound h1 { font-size: 56px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound p { color: var(--ink-2); margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-chart { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; gap: 28px; max-width: 440px; }
  .auth-hero h1 { font-size: 27px; }
  .auth-hero p { font-size: 13.5px; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; height: 100vh;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 24px 0 48px -24px rgba(31, 27, 58, 0.5);
    background: rgba(248, 246, 255, 0.96);
  }
  .sidebar.is-open { transform: translateX(0); }
  .menu-toggle { display: flex; }
  .topbar { padding: 16px 20px 6px; flex-wrap: wrap; }
  .topbar-actions { order: 3; width: 100%; }
  .content { padding: 12px 20px 44px; gap: 20px; }
  .grid-form, .grid-2 { grid-template-columns: 1fr; }
  .field-row-grid { grid-template-columns: 1fr; }
  .field-shrink { max-width: none; }
  .filter-actions { margin-left: 0; width: 100%; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .content { padding: 12px 16px 40px; }
  .topbar { padding: 14px 16px 4px; }
  .pad { padding: 17px; }
  h1 { font-size: 19px; }
  .table th, .table td { padding: 11px 12px; }
  .cell-clamp { max-width: 170px; }
  .btn { padding: 8px 13px; }
  .auth-card { padding: 24px 20px; }
}

/* ---------- Foto profil & logo ---------- */
.avatar-img { padding: 0; overflow: hidden; background: rgba(79, 70, 229, 0.1); }
.avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 34px; height: 34px; font-size: 12.5px; }
.avatar-xl {
  width: 92px; height: 92px; font-size: 30px;
  border-radius: 24px;
  box-shadow: 0 14px 28px -18px rgba(31, 27, 58, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.brand-mark-img { background: #fff; padding: 6px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.9); }
.brand-mark-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark-lg { width: 72px; height: 72px; border-radius: 20px; }

.topbar-user { display: inline-flex; border-radius: 50%; }
.topbar-user:hover { text-decoration: none; }

.upload-panel { display: flex; flex-direction: column; gap: 18px; }
.upload-panel.is-busy { opacity: 0.75; }
.upload-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.upload-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.upload-preview { flex: 0 0 auto; }
.upload-preview .avatar-xl img { border-radius: inherit; }
.upload-actions { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; min-width: 0; }
.upload-status {
  font-size: 12.5px; font-weight: 550;
  padding: 7px 12px; border-radius: 9px;
  background: rgba(79, 70, 229, 0.09); color: #4338ca;
}
.upload-status-ok { background: rgba(15, 157, 107, 0.12); color: #0b7d55; }
.upload-status-err { background: rgba(214, 69, 69, 0.1); color: #b02a2a; }

.logo-sample { display: flex; flex-direction: column; gap: 9px; padding-top: 16px; border-top: 1px solid var(--line); }
.logo-sample-bar {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 12px 16px; border-radius: 14px; width: fit-content;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 560px) {
  .upload-row { gap: 14px; }
  .avatar-xl { width: 74px; height: 74px; border-radius: 20px; font-size: 24px; }
  .upload-actions { width: 100%; }
  .upload-actions .btn { width: 100%; }
}

.preview-box { display: flex; flex-direction: column; gap: 9px; padding-top: 15px; border-top: 1px solid var(--line); }

.kop-preview {
  display: grid; grid-template-columns: 62px 1fr 62px; align-items: center; gap: 12px;
  padding: 16px 18px 12px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.kop-preview > img:first-child { grid-column: 1; }
.kop-preview:not(:has(> img)) { grid-template-columns: 62px 1fr 62px; }
.kop-preview > img:first-child { grid-column: 1; }
.kop-preview-text { text-align: center; display: flex; flex-direction: column; gap: 2px; color: #1a1a1a; }
.kop-preview-text strong { font-size: 15px; text-transform: uppercase; letter-spacing: 0.02em; }
.kop-preview-text span { font-size: 11.5px; color: #444; }
.kop-preview-addr { line-height: 1.4; }
.kop-preview-empty { color: var(--ink-3) !important; font-style: italic; }
.kop-preview-logo { width: 62px; height: 62px; object-fit: contain; }
.kop-preview::after { content: ''; grid-column: 1 / -1; border-top: 3px double #1a1a1a; margin-top: 10px; }

@media (max-width: 560px) {
  .kop-preview { grid-template-columns: 46px 1fr 46px; padding: 12px; }
  .kop-preview-logo { width: 46px; height: 46px; }
  .kop-preview-text strong { font-size: 13px; }
}

.login-preview {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px 22px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}
.login-preview .pill { align-self: flex-start; }
.login-preview strong { font-size: 19px; line-height: 1.28; letter-spacing: -0.02em; }
.login-preview span:not(.pill) { font-size: 12.8px; color: var(--ink-2); line-height: 1.5; }

@media (max-width: 560px) {
  .kop-preview {
  display: grid; grid-template-columns: 62px 1fr 62px; align-items: center; gap: 12px;
  padding: 16px 18px 12px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.kop-preview > img:first-child { grid-column: 1; }
.kop-preview:not(:has(> img)) { grid-template-columns: 62px 1fr 62px; }
.kop-preview > img:first-child { grid-column: 1; }
.kop-preview-text { text-align: center; display: flex; flex-direction: column; gap: 2px; color: #1a1a1a; }
.kop-preview-text strong { font-size: 15px; text-transform: uppercase; letter-spacing: 0.02em; }
.kop-preview-text span { font-size: 11.5px; color: #444; }
.kop-preview-addr { line-height: 1.4; }
.kop-preview-empty { color: var(--ink-3) !important; font-style: italic; }
.kop-preview-logo { width: 62px; height: 62px; object-fit: contain; }
.kop-preview::after { content: ''; grid-column: 1 / -1; border-top: 3px double #1a1a1a; margin-top: 10px; }

@media (max-width: 560px) {
  .kop-preview { grid-template-columns: 46px 1fr 46px; padding: 12px; }
  .kop-preview-logo { width: 46px; height: 46px; }
  .kop-preview-text strong { font-size: 13px; }
}

.login-preview { padding: 16px; }
  .login-preview strong { font-size: 16.5px; }
}

.check-line {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.check-line input { width: 16px; height: 16px; accent-color: var(--indigo); margin: 0; }

/* ---------- Pratinjau ekspor ---------- */
.table-preview { font-size: 12.8px; min-width: 860px; }
.table-preview th { white-space: nowrap; background: rgba(79, 70, 229, 0.05); }
.table-preview tbody td { vertical-align: top; }
.table-preview .cell-num { text-align: center; white-space: nowrap; }
.table-preview .cell-empty { text-align: center; color: var(--ink-3); }
.table-preview tfoot td {
  background: rgba(79, 70, 229, 0.06);
  border-top: 1px solid var(--line-strong);
  vertical-align: top;
}
.table-preview tfoot .small { font-size: 11px; margin-top: 2px; }
.row-summary strong { font-size: 12.6px; }

/* ---------- Periode ---------- */
.period-card { display: flex; flex-direction: column; gap: 10px; }
.period-card h3 { font-size: 15px; }
.period-card .progress { margin-top: 4px; }
.period-card .form-card-foot { border-top: none; padding-top: 4px; }
.text-ok { color: #0b7d55; }

.pick-list { display: flex; flex-direction: column; gap: 10px; }
.pick-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}
.pick-item > input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--indigo); margin: 0; }
.pick-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.pick-title { font-weight: 550; font-size: 13.5px; }
.pick-meta { display: flex; align-items: center; gap: 8px; }
.pick-wajib { font-size: 12.5px; white-space: nowrap; }

/* ---------- Bukti cetak (layar) ---------- */
.print-body { background: #e9e6f5; padding: 24px 16px 60px; }
.print-toolbar {
  max-width: 210mm; margin: 0 auto 16px;
  display: flex; justify-content: space-between; gap: 10px;
}
.print-page {
  max-width: 210mm; margin: 0 auto;
  background: #fff; color: #1a1a1a;
  padding: 18mm 16mm;
  border-radius: 6px;
  box-shadow: 0 20px 50px -28px rgba(31, 27, 58, 0.6);
  font-size: 12.5px;
}

.kop { display: grid; grid-template-columns: 76px 1fr 76px; align-items: center; gap: 14px; }
.kop-side { display: flex; align-items: center; justify-content: flex-start; }
.kop-logo { width: auto; height: auto; max-width: 68px; max-height: 68px; object-fit: contain; }
.kop-text { text-align: center; }
.kop-text h1 { font-size: 18px; letter-spacing: 0.02em; text-transform: uppercase; }
.kop-sub { font-size: 12.5px; margin-top: 2px; color: #333; }
.kop-addr { font-size: 11.5px; color: #444; margin-top: 2px; line-height: 1.4; }
.kop-rule { border-top: 3px double #1a1a1a; margin: 12px 0 18px; }

.doc-title { text-align: center; font-size: 15px; letter-spacing: 0.06em; text-decoration: underline; }
.doc-sub { text-align: center; font-size: 12.5px; margin-top: 4px; }
.doc-no { text-align: center; font-size: 12px; margin-top: 2px; color: #333; }

.doc-ident { width: 100%; margin: 16px 0 16px; border-collapse: collapse; font-size: 12px; }
.doc-ident th, .doc-ident td { border: 1px solid #777; padding: 5px 9px; vertical-align: middle; text-align: left; }
.doc-ident td { padding-left: 10px; }
.doc-ident th { background: #f0eefb; font-weight: 600; width: 118px; color: #222; white-space: nowrap; }
.doc-ident .w-nomor, .doc-ident .w-verif { width: 112px; }
.doc-ident .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; }
.doc-ident .status-ok { color: #0b6b4a; letter-spacing: 0.01em; white-space: nowrap; }
.doc-table-caption { font-size: 12px; font-weight: 600; margin: 0 0 6px; }

.doc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.doc-table th, .doc-table td { border: 1px solid #555; padding: 6px 9px; vertical-align: middle; }
.doc-table th { background: #f0eefb; font-weight: 600; text-align: left; letter-spacing: 0.01em; }
.doc-table tbody tr:nth-child(even) { background: #faf9ff; }
.doc-table tfoot td { background: #f0eefb; border-top: 2px solid #555; }
.doc-table .c { text-align: center; }
.doc-table th.c { white-space: nowrap; }
.doc-table .ta-right { text-align: right; }
.doc-table .muted { color: #777; font-size: 10.5px; }

.doc-note { margin-top: 14px; font-size: 12px; line-height: 1.6; text-align: justify; }

.signs { display: flex; justify-content: space-between; gap: 40px; margin-top: 26px; }
.sign { text-align: center; font-size: 12.5px; flex: 1; }
.sign-role { margin-top: 2px; }
.sign-space { height: 58px; }
.sign-name { font-weight: 600; text-decoration: underline; }
.doc-foot { margin-top: 22px; font-size: 10px; color: #777; text-align: center; }

@media (max-width: 720px) {
  .print-page { padding: 16px 14px; }
  .kop { grid-template-columns: 56px 1fr 56px; gap: 10px; }
  .kop-logo { max-width: 48px; max-height: 48px; }
  .kop-text h1 { font-size: 14.5px; }
  .signs { gap: 16px; }
  .doc-table, .doc-ident { font-size: 10.5px; }
  .doc-ident { table-layout: fixed; }
  .doc-ident th { width: 34%; white-space: normal; }
  .doc-ident .w-nomor, .doc-ident .w-verif { width: 32%; }
  .doc-ident td { word-break: break-word; }
  .doc-ident .status-ok { white-space: normal; font-size: 10px; }
  .doc-table th { white-space: normal; }
}

@media print {
  @page { size: A4 portrait; margin: 13mm 12mm; }
  .print-body { background: #fff; padding: 0; }
  .no-print, .print-toolbar { display: none !important; }
  .print-page {
    max-width: none; margin: 0; padding: 0;
    box-shadow: none; border-radius: 0; font-size: 11.5pt;
  }
  .kop { grid-template-columns: 66px 1fr 66px; }
  .kop-logo { max-width: 52px; max-height: 52px; }
  .kop-text h1 { font-size: 14pt; }
  .doc-ident { font-size: 10pt; table-layout: fixed; }
  .doc-ident th { width: 24%; white-space: nowrap; }
  .doc-ident .w-nomor, .doc-ident .w-verif { width: 24%; }
  .doc-ident td { word-break: normal; padding-left: 6px; padding-right: 6px; }
  .doc-ident .status-ok { font-size: 9.5pt; }
  .doc-table { font-size: 10pt; }
  .doc-table tr, .signs, .doc-ident tr { page-break-inside: avoid; }
  .doc-table thead { display: table-header-group; }
  .doc-table tfoot { display: table-row-group; }
  .kop-rule { border-top-width: 3px; }
  a { color: inherit; text-decoration: none; }
}

.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11.5px; }
.table .cell-num { text-align: center; }

/* ---------- Widget data dashboard ---------- */
.widget-grid .stat { padding-bottom: 16px; }
.stat-foot {
  font-size: 11px; color: var(--ink-3);
  margin-top: 2px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.widget-empty { border-style: dashed; }

/* ---------- Kotak centang (checkbox) ---------- */
.check-group { display: flex; flex-wrap: wrap; gap: 10px; }
.check-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line-strong);
  font-size: 13.3px; cursor: pointer;
}
.check-item input { accent-color: var(--indigo); margin: 0; }
.check-item:has(input:checked) { border-color: rgba(79, 70, 229, 0.55); background: rgba(79, 70, 229, 0.08); }
.check-group .muted { font-size: 13px; }

/* ---------- Riwayat revisi laporan ---------- */
.revision-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.revision-box .card-title { font-size: 14px; margin-bottom: 10px; }
.table-compact th, .table-compact td { padding: 9px 12px; font-size: 12.5px; }

/* ---------- Verifikasi massal ---------- */
.bulk-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: rgba(79, 70, 229, 0.04);
}
.bulk-count { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Pratinjau formulir ---------- */
.form-preview {
  border: 1px dashed var(--line-strong); border-radius: 12px;
  padding: 18px; background: rgba(255, 255, 255, 0.55);
  display: flex; flex-direction: column; gap: 14px;
}
.preview-title { font-size: 16px; }
.preview-desc { font-size: 12.8px; color: var(--ink-2); margin-top: -8px; }
.preview-fields { display: flex; flex-direction: column; gap: 14px; }
.preview-field { display: flex; flex-direction: column; gap: 6px; }
.preview-input {
  padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.9);
  color: var(--ink-3); font-size: 13px;
}
.preview-area { min-height: 64px; }
.preview-box-mark { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--line-strong); display: inline-block; }
.btn.is-disabled { opacity: 0.6; pointer-events: none; }

/* ---------- Tugas admin ---------- */
.task-list { display: flex; flex-direction: column; gap: 14px; }
.task-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  background: rgba(255, 255, 255, 0.62);
}
.task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.task-head strong { display: block; font-size: 13.8px; }
.task-head .muted { font-size: 12px; }
.task-item .ticks { margin-top: 10px; }

/* ---------- Aktivitas ---------- */
.activity-box { padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.activity-list li { display: flex; gap: 9px; align-items: flex-start; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto;
  background: var(--grad);
}
.activity-text { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; min-width: 0; }
.activity-text small { color: var(--ink-3); font-size: 11.5px; }

@media (max-width: 560px) {
  .bulk-actions { margin-left: 0; width: 100%; }
  .bulk-actions .btn { flex: 1 1 auto; }
  .form-preview { padding: 14px; }
}

.period-note {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 9px 12px; border-radius: 10px;
  background: rgba(79, 70, 229, 0.07); border: 1px solid rgba(79, 70, 229, 0.16);
  font-size: 12.5px; color: var(--ink-2);
}
.period-note .icon { color: var(--indigo); }

/* ---------- Akumulasi periode ---------- */
.acc-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 4px 0; font-size: 12.8px;
}
.acc-row + .acc-row { border-top: 1px dashed var(--line); }
.acc-row span { color: var(--ink-2); flex: 1; min-width: 0; }
.acc-row strong { font-variant-numeric: tabular-nums; }
.acc-row small { flex: 0 0 auto; }

.text-warn { color: #a16207; }

/* ---------- Tingkatan akun admin ---------- */
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.role-card {
  border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
  display: flex; flex-direction: column; gap: 8px;
}
.role-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-card p { font-size: 12.3px; line-height: 1.5; }

/* ---------- Progres jemaat pada kartu formulir ---------- */
.jemaat-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0 2px; border-top: 1px dashed var(--line); margin-top: 4px;
}
.jemaat-dots { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.jemaat-dots .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(99, 95, 130, 0.22);
  display: inline-block;
}
.jemaat-dots .dot-on { background: var(--grad); }
