/* E-Surat Klinik Sihaj Group — design system (hijau/putih, profesional) */
:root {
  --green: #0F7B54;
  --green-dark: #0A5E40;
  --green-soft: #E8F5EF;
  --green-line: #CFE9DE;
  --ink: #12261F;
  --muted: #5B6B64;
  --line: #E3EBE7;
  --bg: #F4F8F6;
  --white: #fff;
  --amber: #B45309;
  --amber-soft: #FEF3C7;
  --orange: #C2410C;
  --orange-soft: #FFEDD5;
  --red: #B91C1C;
  --red-soft: #FEE2E2;
  --blue: #1D4ED8;
  --blue-soft: #DBEAFE;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 40, 32, .04), 0 8px 24px rgba(16, 40, 32, .06);
  --shadow-lg: 0 12px 40px rgba(16, 40, 32, .12);
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
img { max-width: 100%; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--white);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transition: transform .22s ease;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--green), #16A34A);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; letter-spacing: .5px;
  box-shadow: 0 6px 16px rgba(15, 123, 84, .25);
  flex: 0 0 38px;
}
.brand-text { line-height: 1.2; }
.brand-text strong { display: block; font-size: 14px; color: var(--ink); }
.brand-text span { font-size: 11px; color: var(--muted); }
.nav { padding: 12px 10px 24px; overflow-y: auto; flex: 1; }
.nav-group { margin-bottom: 14px; }
.nav-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: #8A9A93; padding: 6px 10px; font-weight: 600;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px;
  color: #2C4239; font-size: 13.5px; font-weight: 500;
  text-decoration: none; margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: #F1F7F4; text-decoration: none; }
.nav a.active { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.nav a.active svg { color: var(--green); }
.nav svg { width: 17px; height: 17px; flex: 0 0 17px; color: #6B7E76; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10.5px; border-radius: 20px; padding: 1px 6px; font-weight: 700;
}
.sidebar-foot {
  border-top: 1px solid var(--line); padding: 12px 16px;
  font-size: 11px; color: var(--muted);
}
.main-area { margin-left: var(--sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 30;
}
.topbar .title-block { min-width: 0; }
.topbar h1 { font-size: 17px; }
.topbar .crumb { font-size: 11.5px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff; color: #3D544B; cursor: pointer;
  position: relative;
}
.icon-btn:hover { background: var(--green-soft); border-color: var(--green-line); color: var(--green-dark); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
  background: var(--red); color: #fff; border-radius: 9px; font-size: 10px;
  display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; font-weight: 700;
}
.user-chip {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); background: #fff; border-radius: 11px;
  padding: 4px 10px 4px 4px; cursor: pointer; color: var(--ink);
}
.user-chip:hover { text-decoration: none; background: #F7FBF9; }
.avatar {
  width: 30px; height: 30px; border-radius: 9px; background: var(--green-soft);
  color: var(--green-dark); display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.user-meta { line-height: 1.15; text-align: left; }
.user-meta strong { display: block; font-size: 12.5px; }
.user-meta span { font-size: 10.5px; color: var(--muted); }
.content { padding: 22px 24px 40px; max-width: 1320px; width: 100%; margin: 0 auto; }
.hamburger { display: none; }

/* ---------- Cards & sections ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head {
  padding: 15px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { font-size: 14.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 12px 16px; }
.section { margin-bottom: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid > *, .stack > * { min-width: 0; }
.table-wrap { max-width: 100%; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }

/* ---------- Dashboard cards ---------- */
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 13px; align-items: flex-start;
  min-height: 96px;
}
.stat .ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--green-soft); color: var(--green); flex: 0 0 40px;
}
.stat .ico svg { width: 20px; height: 20px; }
.stat .ico.amber { background: var(--amber-soft); color: var(--amber); }
.stat .ico.red { background: var(--red-soft); color: var(--red); }
.stat .ico.blue { background: var(--blue-soft); color: var(--blue); }
.stat .val { font-size: 24px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.stat .lbl { font-size: 12px; color: var(--muted); }
.stat .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--green); color: #fff; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  font-family: inherit; line-height: 1.2;
}
.btn:hover { background: var(--green-dark); text-decoration: none; color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 11px 18px; font-size: 14px; }
.btn-outline { background: #fff; border-color: var(--line); color: #2C4239; }
.btn-outline:hover { background: var(--green-soft); border-color: var(--green-line); color: var(--green-dark); }
.btn-ghost { background: transparent; color: var(--green-dark); }
.btn-ghost:hover { background: var(--green-soft); color: var(--green-dark); }
.btn-danger { background: #DC2626; }
.btn-danger:hover { background: #B91C1C; }
.btn-danger-outline { background: #fff; border-color: #FECACA; color: var(--red); }
.btn-danger-outline:hover { background: var(--red-soft); color: var(--red); }
.btn-amber { background: #D97706; }
.btn-amber:hover { background: #B45309; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.link { color: var(--green); font-weight: 600; font-size: 12.5px; }
.link:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .col-span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: #314A40; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.req { color: var(--red); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="tel"], input[type="url"], input[type="search"],
select, textarea {
  width: 100%; font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: #fff; border: 1px solid #D7E2DC; border-radius: 9px;
  padding: 9px 11px; transition: border-color .15s, box-shadow .15s;
  min-height: 38px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 123, 84, .12);
}
input[readonly], input:disabled, select:disabled, textarea:disabled { background: #F5F8F6; color: #6B7E76; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235B6B64' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.checkbox { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.checkbox input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--green); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #D7E2DC; padding: 7px 11px; border-radius: 9px; font-size: 12.5px; cursor: pointer; background:#fff; }
.radio-pill input { accent-color: var(--green); }
.radio-pill:has(input:checked) { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding-top: 4px; }
.field-error { color: var(--red); font-size: 11.5px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 160px; }

/* Selector multi user */
.picker { border: 1px solid #D7E2DC; border-radius: 10px; max-height: 220px; overflow-y: auto; background: #fff; }
.picker label { display: flex; gap: 9px; align-items: flex-start; padding: 8px 11px; border-bottom: 1px solid #F0F5F2; cursor: pointer; font-size: 13px; }
.picker label:last-child { border-bottom: 0; }
.picker label:hover { background: #F7FBF9; }
.picker input { margin-top: 3px; accent-color: var(--green); }
.picker .who { line-height: 1.25; }
.picker .who span { display: block; font-size: 11px; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: #6B7E76; font-weight: 600; padding: 10px 12px;
  border-bottom: 1px solid var(--line); background: #FAFCFB; white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid #EEF4F1; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #FAFDFB; }
table.data td .title { font-weight: 600; color: var(--ink); display: block; }
table.data td .sub { font-size: 11.5px; color: var(--muted); }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; }
table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain th, table.plain td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #EEF4F1; vertical-align: top; }
table.plain th { width: 34%; color: var(--muted); font-weight: 600; font-size: 12px; }
table.plain tr:last-child th, table.plain tr:last-child td { border-bottom: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; border-radius: 20px; padding: 2px 9px;
  border: 1px solid transparent; white-space: nowrap; line-height: 1.6;
}
.badge.biasa { background: #F1F5F3; color: #46584F; border-color: #E1EAE5; }
.badge.penting { background: var(--amber-soft); color: var(--amber); border-color: #FDE68A; }
.badge.segera { background: var(--orange-soft); color: var(--orange); border-color: #FED7AA; }
.badge.rahasia { background: var(--red-soft); color: var(--red); border-color: #FECACA; }
.badge.draf { background: #F1F5F3; color: #46584F; border-color: #E1EAE5; }
.badge.diajukan { background: var(--blue-soft); color: var(--blue); border-color: #BFDBFE; }
.badge.revisi { background: var(--amber-soft); color: var(--amber); border-color: #FDE68A; }
.badge.ditolak { background: var(--red-soft); color: var(--red); border-color: #FECACA; }
.badge.disetujui { background: var(--green-soft); color: var(--green-dark); border-color: var(--green-line); }
.badge.terdistribusi { background: #E0F2FE; color: #0369A1; border-color: #BAE6FD; }
.badge.muted { background: #F1F5F3; color: #5B6B64; border-color: #E1EAE5; }
.badge.warning { background: var(--amber-soft); color: var(--amber); border-color: #FDE68A; }
.badge.danger { background: var(--red-soft); color: var(--red); border-color: #FECACA; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: #F1F7F4; border: 1px solid var(--line); color: #314A40; border-radius: 8px; padding: 3px 8px; font-size: 11.5px; }
.chip button { border: 0; background: none; color: #8A9A93; cursor: pointer; padding: 0; font-size: 13px; line-height: 1; }

/* ---------- Alerts / flash ---------- */
.alert { border-radius: 11px; padding: 11px 14px; font-size: 13px; margin-bottom: 16px; display: flex; gap: 9px; align-items: flex-start; border: 1px solid; }
.alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.alert.success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.alert.error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.alert.warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.alert.info { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button {
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
  border: 0; background: none; border-bottom: 2px solid transparent; cursor: pointer;
  white-space: nowrap; text-decoration: none;
}
.tabs a:hover, .tabs button:hover { color: var(--green-dark); text-decoration: none; }
.tabs a.active, .tabs button.active { color: var(--green-dark); border-bottom-color: var(--green); }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.toolbar .field { flex: 0 1 180px; }
.toolbar .field.wide { flex: 1 1 240px; }
.toolbar .spacer { flex: 1; }
.search-box { position: relative; flex: 1 1 260px; }
.search-box input { padding-left: 34px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: #8A9A93; pointer-events: none; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; padding: 14px 4px 4px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 32px; height: 32px; display: inline-grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--line); background: #fff;
  font-size: 12.5px; color: #314A40; padding: 0 8px;
}
.pagination a:hover { background: var(--green-soft); border-color: var(--green-line); text-decoration: none; }
.pagination .current { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.pagination .disabled { opacity: .45; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .ico { width: 46px; height: 46px; border-radius: 14px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 10px; }
.empty .ico svg { width: 22px; height: 22px; }
.empty strong { display: block; color: var(--ink); margin-bottom: 3px; font-size: 14px; }

/* ---------- Timeline / disposisi ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--green-line); }
.tl-item { position: relative; padding: 0 0 20px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -26px; top: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; border: 3px solid var(--green); box-shadow: 0 0 0 3px #F4F8F6;
}
.tl-item.muted::before { border-color: #B9C7C1; }
.tl-card { background: #FBFDFC; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.tl-card .who { font-weight: 650; font-size: 13px; }
.tl-meta { font-size: 11.5px; color: var(--muted); }
.tl-body { font-size: 13px; margin-top: 6px; }
.branch { margin-left: 18px; border-left: 2px dashed var(--green-line); padding-left: 16px; margin-top: 4px; }
.thread-steps { display: grid; gap: 10px; }

/* ---------- Letter preview (A4) ---------- */
.doc-preview { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px 26px; font-size: 13px; line-height: 1.7; }
.doc-preview .kop-render { border-bottom: 0; padding-bottom: 6px; margin-bottom: 10px; }
.doc-preview .kop-render img { max-width: none; }
.doc-preview .org { text-align: center; border-bottom: 2px solid var(--green); padding-bottom: 10px; margin-bottom: 14px; }
.doc-preview .org strong { color: var(--green-dark); font-size: 15px; letter-spacing: .02em; }
.doc-preview .org div { font-size: 11px; color: var(--muted); }
.doc-preview table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.doc-preview table td, .doc-preview table th { border: 1px solid #DCE7E2; padding: 5px 7px; vertical-align: top; }
.doc-preview ol, .doc-preview ul { padding-left: 20px; margin: 6px 0; }
.doc-preview p { margin: 0 0 8px; }
.doc-preview h1, .doc-preview h2, .doc-preview h3 { margin: 10px 0 6px; }
.sign-block { margin-top: 26px; display: flex; justify-content: flex-end; text-align: left; }
.sign-block > div { width: 230px; font-size: 12.5px; }
.sign-qr { width: 68px; height: 68px; margin: 4px 0; border: 1px solid #E3EBE7; border-radius: 4px; padding: 3px; }
.hash-line { font-family: ui-monospace, monospace; font-size: 9.5px; color: #8A9A93; word-break: break-all; }

/* ---------- File list ---------- */
.file-item { display: flex; gap: 11px; align-items: center; padding: 10px 0; border-bottom: 1px solid #EEF4F1; }
.file-item:last-child { border-bottom: 0; }
.file-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-size: 10px; font-weight: 700; flex: 0 0 34px; }
.file-item .nm { font-size: 12.5px; font-weight: 600; word-break: break-word; }
.file-item .meta { font-size: 11px; color: var(--muted); }
.file-item .act { margin-left: auto; display: flex; gap: 5px; }
.thumb { width: 100%; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.pdf-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #F7FAF8; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-hero {
  background:
    radial-gradient(680px 420px at 18% 12%, rgba(255,255,255,.22), transparent 60%),
    radial-gradient(520px 380px at 82% 88%, rgba(22, 163, 74, .35), transparent 65%),
    linear-gradient(150deg, #0B5D41 0%, #0F7B54 48%, #16A34A 100%);
  color: #fff; padding: 52px 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-hero .brandline { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .02em; }
.auth-hero .brandline .mark { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.16); display: grid; place-items: center; backdrop-filter: blur(6px); }
.auth-hero h2 { color: #fff; font-size: 31px; line-height: 1.25; margin: 0 0 14px; max-width: 460px; letter-spacing: -0.02em; }
.auth-hero p { color: rgba(255,255,255,.85); font-size: 14px; max-width: 440px; }
.auth-hero ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 11px; }
.auth-hero li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: rgba(255,255,255,.92); }
.auth-hero li svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 2px; color: #BBF7D0; }
.auth-hero .foot { font-size: 11.5px; color: rgba(255,255,255,.6); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 34px 28px; background: var(--bg); }
.auth-card { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px 30px 26px; }
.auth-card h1 { font-size: 21px; margin-bottom: 4px; }
.auth-card .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 20px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { width: 100%; }
.demo-accounts { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 15px; }
.demo-accounts .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #8A9A93; font-weight: 700; margin-bottom: 8px; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.demo-btn { text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #FBFDFC; cursor: pointer; font-size: 11.5px; line-height: 1.25; color: #314A40; font-family: inherit; }
.demo-btn:hover { background: var(--green-soft); border-color: var(--green-line); }
.demo-btn strong { display: block; font-size: 11.5px; color: var(--green-dark); }
.demo-btn span { color: var(--muted); font-size: 10.5px; }
.auth-links { display: flex; justify-content: space-between; font-size: 12px; margin-top: 12px; }

/* ---------- Editor WYSIWYG ---------- */
.editor-shell { border: 1px solid #D7E2DC; border-radius: 11px; overflow: hidden; background: #fff; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 7px; border-bottom: 1px solid var(--line); background: #FAFCFB; align-items: center; }
.editor-toolbar button {
  min-width: 30px; height: 29px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; cursor: pointer; font-size: 12.5px; color: #314A40; padding: 0 7px;
  display: inline-flex; align-items: center; gap: 4px; font-family: inherit;
}
.editor-toolbar button:hover { background: var(--green-soft); }
.editor-toolbar button.active { background: var(--green-soft); border-color: var(--green-line); color: var(--green-dark); }
.editor-toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.editor-area { min-height: 320px; padding: 16px 18px; font-size: 13.5px; line-height: 1.7; outline: none; }
.editor-area:focus { background: #FDFFFE; }
.editor-area p { margin: 0 0 9px; }
.editor-area ol, .editor-area ul { padding-left: 22px; }
.editor-area table { border-collapse: collapse; width: 100%; }
.editor-area table td, .editor-area table th { border: 1px solid #CBD5E1; padding: 5px 7px; }
.var-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.var-btn { border: 1px dashed #BFD8CC; background: #F7FBF9; color: var(--green-dark); border-radius: 6px; font-size: 11px; padding: 2px 7px; cursor: pointer; font-family: ui-monospace, monospace; }
.var-btn:hover { background: var(--green-soft); }

/* ---------- Editor tabel ---------- */
.editor-area table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 12.8px; }
.editor-area table td, .editor-area table th { border: 1px solid #94a3b8; padding: 5px 7px; vertical-align: top; min-width: 28px; }
.editor-area table th { background: #E8F5EF; font-weight: 700; }
.editor-area table td:empty::after { content: '\00a0'; }
.editor-area:focus td:focus, .editor-area:focus th:focus { outline: 2px solid rgba(15,123,84,.35); }
.table-picker { position: relative; display: inline-block; }
.table-picker .picker-toggle { border: 1px solid transparent; }
.table-picker .picker-panel {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 10px; min-width: 190px;
}
.table-picker.open .picker-panel { display: block; }
.table-picker .picker-panel label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; margin-bottom: 6px; color: #314A40; font-weight: 500;
}
.table-picker .picker-panel input[type="number"] { width: 68px; min-height: 30px; padding: 4px 7px; }
.table-picker .picker-panel .checkbox { font-size: 12px; justify-content: flex-start; }
.table-picker .picker-panel .btn { width: 100%; margin-top: 4px; }
.ico-inline { vertical-align: -2px; margin-right: 3px; }

/* ---------- Langkah (stepper) & field terkunci ---------- */
.steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; min-width: 0; }
.step .step-no {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; display: grid; place-items: center;
  background: #EEF4F1; color: #5B6B64; font-size: 11.5px; font-weight: 700;
}
.step .step-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.step .step-txt strong { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.step .step-txt span { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.step.done { background: var(--green-soft); border-color: var(--green-line); }
.step.done .step-no { background: var(--green); color: #fff; }
.step.done .step-txt strong { color: var(--green-dark); }
.step.active { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,123,84,.08); }
.step.active .step-no { background: var(--green-dark); color: #fff; }
.step-arrow { color: #B9C7C1; display: grid; place-items: center; }
.steps a.step:hover { text-decoration: none; background: var(--green-soft); }
.locked-field {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--green-line);
  background: #F7FBF9; border-radius: 9px; padding: 6px 10px; min-height: 46px;
}
@media (max-width: 780px) {
  .steps { gap: 7px; }
  .step { flex: 1 1 100%; }
  .step-arrow { display: none; }
}

/* ---------- Pemilihan template surat ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tpl-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px;
  min-width: 0; transition: box-shadow .16s, border-color .16s, transform .16s;
}
.tpl-card:hover { border-color: var(--green-line); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.tpl-head { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.tpl-mark {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--green), #16A34A); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.tpl-name { font-size: 14.5px; line-height: 1.3; margin-bottom: 2px; word-break: break-word; }
.tpl-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; min-height: 34px; }
.tpl-preview { background: #F7FBF9; border: 1px dashed var(--green-line); border-radius: 10px; padding: 10px 12px; }
.tpl-preview-label { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: #8A9A93; font-weight: 700; margin-bottom: 5px; }
.tpl-snippet { font-size: 11.5px; color: #3D544B; line-height: 1.6; }
.tpl-preview details { margin-top: 8px; }
.tpl-preview summary { font-size: 11.5px; color: var(--green-dark); font-weight: 600; cursor: pointer; }
.tpl-full { margin-top: 8px; font-size: 11.5px; padding: 12px 14px; max-height: 340px; overflow-y: auto; background: #fff; }
.tpl-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.tpl-meta .chip { font-size: 10.5px; }
.tpl-actions { margin-top: auto; }
.tpl-actions .btn { width: 100%; }
@media (max-width: 1100px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px) {
  .tpl-grid { grid-template-columns: 1fr; gap: 14px; }
  .tpl-desc { min-height: 0; }
}

/* ---------- Lampiran (halaman berikutnya) ---------- */
.appendix-item { border: 1px solid var(--line); border-radius: 12px; background: #FBFDFC; overflow: hidden; }
.appendix-head { display: flex; gap: 9px; align-items: center; padding: 10px 12px; background: #F4F9F6; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.appendix-head .appendix-title { flex: 1 1 220px; min-width: 0; background: #fff; }
.appendix-item .editor-shell { border: 0; border-radius: 0; }
.appendix-item .editor-area { min-height: 180px; background: #fff; }
.impor-template { border: 1px dashed var(--green-line); background: #F7FBF9; border-radius: 11px; padding: 12px 14px; }
.impor-template input[type=file] { background: #fff; }
.appendix-preview { border-top: 2px dashed var(--line); margin-top: 22px; padding-top: 18px; }
.appendix-preview .ap-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #8A9A93; font-weight: 700; text-align: center; margin-bottom: 8px; }
.appendix-preview h4 { text-align: center; font-size: 13.5px; margin: 0 0 10px; }

/* ---------- Kop editor ---------- */
.kop-lines { display: grid; gap: 8px; }
.kop-line { display: grid; grid-template-columns: minmax(0,1fr) 74px 62px 96px 34px; gap: 6px; align-items: center; }
.kop-line input[type="text"] { min-height: 34px; font-size: 12.5px; }
.kop-line input[type="number"] { min-height: 34px; font-size: 12.5px; padding: 4px 6px; }
.kop-line select { min-height: 34px; font-size: 12px; padding: 4px 24px 4px 8px; }
.kop-line .checkbox { font-size: 11.5px; gap: 4px; }
.kop-preview { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; }
.kop-preview .rule { border-top: 2px solid var(--green); margin-top: 8px; }
.kop-preview .rule.double { border-top: 3px double var(--green); }
@media (max-width: 900px) {
  .kop-line { grid-template-columns: 1fr 1fr; }
  .kop-line input[type="text"] { grid-column: 1 / -1; }
}
@media (max-width: 780px) {
  .editor-toolbar button { font-size: 11.5px; padding: 0 6px; min-width: 26px; }
  .appendix-head .appendix-title { flex: 1 1 100%; }
}

/* ---------- Misc ---------- */
.kv { display: grid; grid-template-columns: 132px 1fr; gap: 7px 12px; font-size: 13px; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; font-weight: 500; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.list-reset { list-style: none; padding: 0; margin: 0; }
.list-reset li { padding: 9px 0; border-bottom: 1px solid #EEF4F1; font-size: 13px; }
.list-reset li:last-child { border-bottom: 0; }
.mini-chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend .sw { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.progress { height: 7px; border-radius: 5px; background: #EEF4F1; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #22C55E); border-radius: 5px; }
.scroll-y { max-height: 340px; overflow-y: auto; }
.note { background: #F7FBF9; border: 1px dashed var(--green-line); border-radius: 10px; padding: 11px 13px; font-size: 12.5px; color: #40564C; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.overlay { position: fixed; inset: 0; background: rgba(12, 32, 24, .45); z-index: 35; display: none; }
.overlay.show { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
@media (max-width: 780px) {
  :root { --sidebar: 264px; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .hamburger { display: grid; }
  .content { padding: 16px 14px 34px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar h1 { font-size: 15px; }
  .topbar .crumb { display: none; }
  .user-meta { display: none; }
  .user-chip { padding: 4px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .card-pad, .card-body { padding: 14px; }
  .card-head { padding: 12px 14px; }
  .toolbar .field { flex: 1 1 100%; }
  .toolbar .spacer { display: none; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; }
  .doc-preview { padding: 18px 16px; font-size: 12.5px; }
  .sign-block { justify-content: flex-start; }
  .demo-grid { grid-template-columns: 1fr; }
  h1 { font-size: 19px; }
}
@media print {
  .sidebar, .topbar, .no-print, .overlay { display: none !important; }
  .main-area { margin-left: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}
