/* ================================================================
   SIMADes — Sistem Administrasi Pemerintahan Desa
   ================================================================ */
:root {
  --green-950: #082417;
  --green-900: #0c3321;
  --green-850: #103d28;
  --green-800: #14532d;
  --green-700: #166534;
  --green-600: #15803d;
  --green-500: #22c55e;
  --green-100: #dcfce7;
  --green-50: #f0fdf4;
  --sand-100: #f7f3e8;
  --sand-200: #efe6cf;
  --gold-600: #b45309;
  --gold-500: #d97706;
  --gold-100: #fef3c7;
  --ink: #14231b;
  --ink-soft: #2b3a31;
  --muted: #68796e;
  --muted-2: #8a998f;
  --line: #e1e8e2;
  --line-soft: #edf2ee;
  --bg: #f4f7f4;
  --card: #ffffff;
  --red: #b91c1c;
  --red-50: #fef2f2;
  --blue: #1d4ed8;
  --blue-50: #eff6ff;
  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(17, 45, 30, 0.06), 0 1px 3px rgba(17, 45, 30, 0.05);
  --shadow: 0 10px 28px -16px rgba(12, 51, 33, 0.28), 0 2px 8px rgba(12, 51, 33, 0.06);
  --shadow-lg: 0 30px 70px -30px rgba(8, 36, 23, 0.35);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Lora", Georgia, serif;
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }
::selection { background: #bbf7d0; color: #052e16; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d5cb; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #a9bdad; }

/* ============================== Komponen dasar ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.05s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.btn:focus-visible { outline: 3px solid #bbf7d0; outline-offset: 1px; }
.btn-primary { background: var(--green-800); color: #fff; border-color: var(--green-800); box-shadow: 0 4px 12px -6px rgba(20, 83, 45, 0.55); }
.btn-primary:hover { background: var(--green-700); border-color: var(--green-700); }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink-soft); }
.btn-secondary:hover { border-color: #b9cbbd; background: #fbfdfb; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-danger-soft { background: var(--red-50); border-color: #fecaca; color: var(--red); }
.btn-danger-soft:hover { background: #fee2e2; }
.btn-gold { background: var(--gold-600); border-color: var(--gold-600); color: #fff; }
.btn-gold:hover { background: #92400e; }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: 12px; border-radius: 8px; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { min-height: 46px; font-size: 14px; padding: 12px 18px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  flex: 0 0 auto;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn:focus-visible { outline: 3px solid #bbf7d0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.pill-light { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); color: #d7ecdd; backdrop-filter: blur(6px); }
.pill-place {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 12px;
  border-radius: 12px;
  font-weight: 400;
  line-height: 1.35;
}
.pill-place strong { font-size: 11.5px; font-weight: 800; color: #f2faf4; letter-spacing: 0.012em; }
.pill-place > span { font-size: 10.5px; font-weight: 500; color: #b7d4c1; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-green { background: #e7f6ec; color: #166534; }
.badge-amber { background: var(--gold-100); color: #92400e; }
.badge-blue { background: var(--blue-50); color: #1e40af; }
.badge-gray { background: #f1f5f2; color: #4b5c50; }
.badge-red { background: var(--red-50); color: var(--red); }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #166534, #22c55e);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.avatar-gold { background: linear-gradient(135deg, #b45309, #f59e0b); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f7e0a4, #d9a441);
  color: #14532d;
  flex: 0 0 auto;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-mark-lg { width: 52px; height: 52px; border-radius: 15px; }
.brand-mark-lg svg { width: 33px; height: 33px; }

/* Logo instansi (lambang Kabupaten Sragen & logo Desa Slendro) */
.logo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  border-radius: 13px;
  padding: 2px;
  box-shadow: none;
}
.logo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.65)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  transition: transform 0.25s ease, filter 0.25s ease;
}
.logo-tile:hover img,
.logo-tile:focus-visible img {
  transform: scale(1.18);
  filter: drop-shadow(0 9px 14px rgba(0, 0, 0, 0.7)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}
.logo-tile-crest { width: 54px; height: 54px; }
.logo-tile-desa { width: 112px; height: 42px; padding: 5px 8px; border-radius: 11px; }
.logo-pair { display: inline-flex; align-items: center; gap: 10px; }
.sidebar-brand .logo-tile img { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)); }
.sidebar-brand .logo-tile:hover img { filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.8)); }
.login-brand .logo-tile { display: inline-flex; margin-top: 0; }

/* ================================ LOGIN ================================ */
.login {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  min-height: 100vh;
  background: #fff;
}
.login-art {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 42px 54px 30px;
  color: #fff;
  background:
    radial-gradient(1100px 600px at 10% 0%, #1b6b3d 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 100%, #0a3a24 0%, transparent 65%),
    linear-gradient(150deg, #0b2e1d 0%, #14532d 55%, #0e3b25 100%);
}
.login-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.09) 1px, transparent 1.5px),
    linear-gradient(115deg, transparent 48%, rgba(255, 255, 255, 0.04) 49%, transparent 50%);
  background-size: 34px 34px, 140px 140px;
  opacity: 0.6;
  pointer-events: none;
}
.login-art-pattern {
  position: absolute;
  right: -180px;
  top: -160px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  border: 1px solid rgba(245, 199, 107, 0.18);
  box-shadow: 0 0 0 70px rgba(245, 199, 107, 0.05), 0 0 0 150px rgba(245, 199, 107, 0.035), 0 0 0 240px rgba(245, 199, 107, 0.02);
  pointer-events: none;
}
.login-art::after {
  content: "";
  position: absolute;
  left: -80px;
  bottom: -140px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.login-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1;
}
.login-brand-text { min-width: 0; }
.login-brand-text strong {
  display: block;
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.01em;
}
.login-brand-text span { display: block; font-size: 11px; color: #b7d4c1; margin-top: 2px; letter-spacing: 0.03em; text-transform: uppercase; }
.login-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
  max-width: 610px;
  padding: 50px 0 36px;
}
.login-copy h1 {
  margin: 22px 0 16px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.1vw, 56px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.login-copy h1 em { color: #f5c76b; font-style: normal; }
.login-copy > p { max-width: 480px; color: #c3dbc9; font-size: 15px; line-height: 1.7; }
.login-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}
.login-features li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(4px);
}
.feature-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(245, 199, 107, 0.14);
  color: #f5c76b;
  flex: 0 0 auto;
}
.feature-ic svg { width: 17px; height: 17px; }
.login-features strong { display: block; font-size: 12.5px; font-weight: 700; color: #eef7f0; }
.login-features small { display: block; margin-top: 2px; font-size: 11px; color: #a9c6b3; line-height: 1.45; }
.login-art-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  color: #9dbdab;
}

.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px;
  background: #fbfcf9;
  position: relative;
}
.login-card { width: min(424px, 100%); }
.login-card-head { margin-bottom: 26px; }
.login-card-logos { display: none; margin-bottom: 18px; }
.login-card-head h2 { font-family: var(--serif); font-size: 29px; font-weight: 600; letter-spacing: -0.01em; }
.login-card-head p { margin-top: 7px; color: var(--muted); font-size: 13.5px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; color: var(--ink-soft); letter-spacing: 0.01em; }
.field > span .req { color: var(--red); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-ic {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  pointer-events: none;
  z-index: 1;
}
.input-ic svg { width: 18px; height: 18px; }
.input-wrap input,
.input-wrap select,
.field input[type="text"],
.field input[type="date"],
.field input[type="password"],
.field select,
.field textarea,
.input {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* Padding harus mengalahkan aturan .field input[type=...] di atas agar teks tidak menimpa ikon. */
.input-wrap input,
.field .input-wrap input,
.field .input-wrap input[type="text"],
.field .input-wrap input[type="password"] { padding-left: 42px; padding-right: 42px; }
.input-wrap input:focus, .field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.11);
}
.input-wrap input::placeholder, .field input::placeholder, .field textarea::placeholder { color: #9fada4; }
.input-action {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
}
.input-action:hover { background: var(--line-soft); color: var(--ink); }
.input-action svg { width: 17px; height: 17px; }

.login-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 2px 0 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--red-50);
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 12.5px;
  line-height: 1.5;
}
.login-error svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }

.btn-block.btn-lg { margin-top: 4px; }
.demo-box {
  margin-top: 26px;
  padding: 14px;
  border: 1px dashed #cddccf;
  border-radius: 13px;
  background: #f6faf6;
}
.demo-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.demo-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 3px #d7f2df; }
.demo-head strong { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--green-700); }
.demo-head small { margin-left: auto; font-size: 10.5px; color: var(--muted-2); }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.demo-chip:hover { border-color: var(--green-600); box-shadow: 0 2px 10px -6px rgba(20, 83, 45, 0.4); }
.demo-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #dcfce7;
  color: #14532d;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}
.demo-avatar-user { background: var(--gold-100); color: #92400e; }
.demo-chip strong { display: block; font-size: 11.5px; }
.demo-chip small { display: block; margin-top: 1px; font-size: 10.5px; color: var(--muted); }
.demo-note { margin-top: 9px; font-size: 10.5px; color: var(--muted-2); line-height: 1.5; }
.login-panel-footer { position: absolute; bottom: 20px; font-size: 10.5px; color: #9caaa1; }

/* ================================ APP SHELL ================================ */
.app { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: 18px 14px 14px;
  background:
    radial-gradient(700px 380px at 0% 0%, rgba(34, 197, 94, 0.14), transparent 70%),
    linear-gradient(180deg, #0b2e1d 0%, #0e3a24 55%, #0a2c1b 100%);
  color: #e8f2ea;
  transition: transform 0.24s ease;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.4;
}
.sidebar-brand { position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 6px 16px; }
.sidebar-brand .logo-tile-sidebar { width: 38px; height: 38px; padding: 4px; border-radius: 11px; }
.logo-pair-sidebar { gap: 6px; }
.logo-tile-desa-sidebar { width: 58px; height: 23px; padding: 3px 4px; border-radius: 7px; }
.sidebar-brand-text { min-width: 0; }
.sidebar-brand-text strong { display: block; font-family: var(--serif); font-size: 19px; letter-spacing: 0.01em; }
.sidebar-brand-text span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: #9fc2ab; margin-top: 1px; }
.sidebar-close { display: none; margin-left: auto; color: #cfe4d5; }

.sidebar-village {
  position: relative;
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 2px 4px 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.village-dot { width: 8px; height: 8px; border-radius: 50%; background: #f5c76b; box-shadow: 0 0 0 4px rgba(245, 199, 107, 0.14); flex: 0 0 auto; }
.sidebar-village strong { display: block; font-size: 12px; font-weight: 700; color: #eef7f0; }
.sidebar-village small { display: block; font-size: 10.5px; color: #9fc2ab; margin-top: 1px; }

.sidebar-nav { position: relative; flex: 1; overflow-y: auto; padding: 0 2px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border: 0; }
.nav-group { margin-bottom: 18px; }
.nav-label {
  display: block;
  padding: 0 12px 7px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #7fa88d;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  margin-bottom: 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #c6dccd;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 18px; height: 18px; color: #8fb59b; transition: color 0.15s; flex: 0 0 auto; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.11); color: #fff; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 4px;
  background: #f5c76b;
}
.nav-item.active svg { color: #f5c76b; }
.nav-code {
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 9.5px;
  font-weight: 700;
  color: #a9c9b5;
  letter-spacing: 0.02em;
}
.nav-item.active .nav-code { background: rgba(245, 199, 107, 0.16); color: #f5c76b; }

.sidebar-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-user .avatar { width: 32px; height: 32px; font-size: 11px; }
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-info strong { display: block; font-size: 11.5px; color: #eef7f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { display: block; margin-top: 1px; font-size: 10px; color: #9fc2ab; }
.sidebar-user .icon-btn { color: #9fc2ab; width: 30px; height: 30px; }
.sidebar-user .icon-btn:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 12px 28px;
  background: rgba(244, 247, 244, 0.86);
  border-bottom: 1px solid rgba(225, 232, 226, 0.9);
  backdrop-filter: blur(12px);
}
.menu-btn { display: none; }
.topbar-title { min-width: 0; }
.breadcrumb { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); margin-bottom: 2px; }
.topbar-title h1 { font-size: 18px; font-weight: 800; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-date {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.user-chip:hover { border-color: #bccdc0; box-shadow: var(--shadow-sm); }
.user-chip .avatar { width: 32px; height: 32px; font-size: 11px; }
.user-chip-text strong { display: block; font-size: 11.5px; font-weight: 700; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text small { display: block; font-size: 10px; color: var(--muted-2); margin-top: 1px; text-transform: capitalize; }
.user-chip > svg { width: 14px; height: 14px; color: var(--muted-2); }

.dropdown {
  position: absolute;
  top: 62px;
  right: 28px;
  z-index: 80;
  width: 236px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: pop 0.14s ease;
}
.dropdown-head { padding: 9px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 5px; }
.dropdown-head strong { display: block; font-size: 12.5px; }
.dropdown-head small { display: block; font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
}
.dropdown-item svg { width: 16px; height: 16px; color: var(--muted); }
.dropdown-item:hover { background: var(--line-soft); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger svg { color: var(--red); }
.dropdown-item:disabled { opacity: 0.4; }
.dropdown-sep { height: 1px; background: var(--line-soft); margin: 5px 0; }

/* Menu kontekstual (ekspor / tindakan tabel) */
.popmenu {
  z-index: 210;
  width: 232px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: pop 0.13s ease;
}
.popmenu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.popmenu-item svg { width: 16px; height: 16px; color: var(--green-700); flex: 0 0 auto; }
.popmenu-item span { flex: 1; }
.popmenu-item small { display: block; font-size: 9.5px; font-weight: 500; color: var(--muted-2); margin-top: 1px; }
.popmenu-item:hover { background: #f4f9f5; }
.popmenu-item.danger { color: var(--red); }
.popmenu-item.danger svg { color: var(--red); }
.popmenu-sep { height: 1px; background: var(--line-soft); margin: 4px 2px; }

.content { width: 100%; max-width: 1440px; padding: 26px 28px 40px; flex: 1; }

/* ================================ PAGE ================================ */
.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head-main { min-width: 0; flex: 1; }
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-700);
}
.page-eyebrow .code { padding: 2px 6px; border-radius: 4px; background: var(--green-100); color: var(--green-800); }
.page-head h2 { font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.18; }
.page-head p { margin-top: 5px; color: var(--muted); font-size: 12.5px; max-width: 720px; line-height: 1.6; }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

/* ================================ DASHBOARD ================================ */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(700px 300px at 90% 0%, rgba(245, 199, 107, 0.18), transparent 60%),
    linear-gradient(120deg, #0c3321 0%, #14532d 60%, #1a6438 100%);
  color: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 1px, transparent 1.3px);
  background-size: 26px 26px;
  opacity: 0.4;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -120px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 1px solid rgba(245, 199, 107, 0.2);
  box-shadow: 0 0 0 55px rgba(245, 199, 107, 0.05), 0 0 0 110px rgba(245, 199, 107, 0.03);
}
.hero-content { position: relative; flex: 1; min-width: 0; }
.hero-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #a8d3b5; }
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: #f5c76b; }
.hero h2 { margin: 10px 0 6px; font-family: var(--serif); font-size: clamp(24px, 2.6vw, 33px); font-weight: 600; letter-spacing: -0.015em; }
.hero p { color: #bdd8c5; font-size: 12.5px; max-width: 590px; line-height: 1.65; }
.hero-actions { position: relative; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.hero-actions .btn-primary { background: #f5c76b; border-color: #f5c76b; color: #3c2a07; box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.6); }
.hero-actions .btn-primary:hover { background: #f8d88e; border-color: #f8d88e; }
.hero-actions .btn-secondary { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.18); color: #eaf5ec; }
.hero-actions .btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }
.hero-illustration { position: relative; width: 224px; flex: 0 0 auto; opacity: 0.95; display: none; align-items: center; gap: 14px; }
.hero-illustration img { width: auto; height: auto; filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.35)); }
.hero-illustration .hero-crest { width: 92px; }
.hero-illustration .hero-wordmark { width: 118px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cfdcd2; }
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  flex: 0 0 auto;
}
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.green { background: #e8f6ec; color: #166534; }
.stat-icon.amber { background: #fdf3da; color: #92400e; }
.stat-icon.blue { background: #eaf1ff; color: #1e40af; }
.stat-icon.rose { background: #fdecec; color: #b91c1c; }
.stat-body { min-width: 0; flex: 1; }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.stat-meta { margin-top: 5px; font-size: 10.5px; color: var(--muted-2); }
.stat-meta b { color: var(--green-700); font-weight: 700; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-bottom: 20px; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; }
.panel-head-main { min-width: 0; flex: 1; }
.panel-title { font-size: 13.5px; font-weight: 800; letter-spacing: -0.005em; }
.panel-sub { margin-top: 3px; font-size: 11px; color: var(--muted); }
.panel-body { padding: 0 18px 18px; }
.panel-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--green-700); }
.panel-link svg { width: 14px; height: 14px; }
.panel-link:hover { color: var(--green-600); }

.chart { padding: 8px 4px 0; }
.chart-plot { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 8px 0 22px; border-bottom: 1px solid var(--line-soft); }
.chart-grid { position: absolute; inset: 8px 0 22px; pointer-events: none; }
.chart-grid span { position: absolute; left: 0; right: 0; border-top: 1px dashed #edf1ed; }
.chart-col { position: relative; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; }
.chart-bar {
  width: 42%;
  max-width: 11px;
  min-height: 2px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #2f8a55, #14532d);
  transition: height 0.4s ease, filter 0.15s;
}
.chart-bar.masuk { background: linear-gradient(180deg, #f0bd57, #b45309); }
.chart-col:hover .chart-bar { filter: brightness(1.08); }
.chart-labels { display: flex; gap: 6px; padding-top: 6px; }
.chart-labels span { flex: 1; text-align: center; font-size: 9px; color: var(--muted-2); font-weight: 600; }
.chart-legend { display: flex; gap: 14px; padding-top: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; background: #14532d; }
.legend-dot.amber { background: #d97706; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 180px; color: var(--muted-2); font-size: 12px; }

.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.activity-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.activity-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f1f6f2;
  color: var(--green-700);
  flex: 0 0 auto;
}
.activity-ic svg { width: 15px; height: 15px; }
.activity-ic.amber { background: #fdf5e3; color: #92400e; }
.activity-ic.blue { background: #eef3ff; color: #1e40af; }
.activity-ic.red { background: #fdeeee; color: #b91c1c; }
.activity-body { min-width: 0; flex: 1; }
.activity-body strong { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink); }
.activity-body p { margin-top: 2px; font-size: 10.5px; color: var(--muted); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.activity-time { margin-top: 2px; font-size: 9.5px; color: var(--muted-2); }
.activity-empty { padding: 22px 0; text-align: center; color: var(--muted-2); font-size: 11.5px; }

/* Buku cards */
.book-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.book-card:hover { transform: translateY(-2px); border-color: #cddccf; box-shadow: var(--shadow); }
.book-card-top { display: flex; align-items: center; gap: 9px; }
.book-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: #edf6ef; color: var(--green-700); flex: 0 0 auto; }
.book-card-icon svg { width: 18px; height: 18px; }
.book-code { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; color: var(--muted-2); }
.book-card h3 { font-size: 12.5px; font-weight: 800; line-height: 1.35; letter-spacing: -0.005em; }
.book-card p { font-size: 10.5px; color: var(--muted); line-height: 1.5; flex: 1; }
.book-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.book-count { font-size: 10.5px; color: var(--muted); }
.book-count b { font-size: 14px; color: var(--ink); font-weight: 800; margin-right: 2px; }
.book-open { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--green-700); }
.book-open svg { width: 13px; height: 13px; }

/* Recent table inside dashboard */
.recent-wrap { overflow-x: auto; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mini-table th { padding: 8px 10px; text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mini-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table .num { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.mini-table .title { font-weight: 600; max-width: 430px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================ TOOLBAR & TABLE ================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar-main { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; min-width: 0; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { position: relative; display: flex; align-items: center; min-width: 230px; flex: 1; max-width: 360px; }
.search-box > svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
.search-box input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px 8px 35px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 12.5px;
}
.search-box input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.1); }
.select {
  min-height: 38px;
  padding: 8px 30px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2368796e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
  font-size: 12px;
  font-weight: 500;
  appearance: none;
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.1); }

.table-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  padding: 11px 13px;
  text-align: left;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--muted);
  background: #f8faf8;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table th.right, .data-table td.right { text-align: right; }
.data-table th.center, .data-table td.center { text-align: center; }
.data-table td { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: #fafcfa; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.cell-title { display: block; font-weight: 600; color: var(--ink); line-height: 1.5; max-width: 430px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cell-sub { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted-2); line-height: 1.4; }
.cell-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.cell-date { font-size: 11px; color: var(--muted); white-space: nowrap; line-height: 1.5; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  transition: background 0.13s, color 0.13s;
}
.icon-action svg { width: 15px; height: 15px; }
.icon-action:hover { background: var(--line-soft); color: var(--ink); }
.icon-action.edit:hover { background: #eaf4ed; color: var(--green-700); }
.icon-action.del:hover { background: var(--red-50); color: var(--red); }
.empty-row td { padding: 46px 20px !important; }

.pagination { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line-soft); background: #fcfdfc; }
.page-info { font-size: 11.5px; color: var(--muted); }
.page-info b { color: var(--ink); }
.page-controls { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.page-btn:hover { background: var(--line-soft); color: var(--ink); }
.page-btn.active { background: var(--green-800); color: #fff; border-color: var(--green-800); }
.page-btn svg { width: 14px; height: 14px; }
.page-btn:disabled { opacity: 0.4; pointer-events: none; }
.page-size { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted-2); }
.page-size .select { min-height: 30px; padding: 4px 26px 4px 8px; font-size: 11px; }
.page-ellipsis { padding: 0 4px; color: var(--muted-2); font-size: 11px; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 54px 24px; text-align: center; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 16px; background: #f0f6f1; color: var(--green-700); margin-bottom: 13px; }
.empty-icon svg { width: 27px; height: 27px; }
.empty-state h3 { font-size: 14px; font-weight: 800; }
.empty-state p { margin: 5px 0 14px; max-width: 360px; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.empty-mini { padding: 24px 0; text-align: center; color: var(--muted-2); font-size: 11.5px; }

/* ================================ MODAL ================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 18px 30px;
  background: rgba(8, 30, 19, 0.5);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  animation: fade 0.15s ease;
}
.modal {
  width: min(620px, 100%);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: pop 0.18s ease;
  overflow: hidden;
}
.modal-lg { width: min(860px, 100%); }
.modal-xl { width: min(1220px, 100%); }
.modal-sm { width: min(430px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 15px; border-bottom: 1px solid var(--line-soft); }
.modal-head-main { flex: 1; min-width: 0; }
.modal-head h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.25; }
.modal-head p { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.modal-close { flex: 0 0 auto; }
.modal-body { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line-soft); background: #fcfdfc; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }

/* Pratinjau berkas: modal lebar, tinggi menyesuaikan layar perangkat. */
.preview-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  max-height: none;
  height: calc(100vh - 215px);
  height: calc(100dvh - 215px);
  min-height: 300px;
  overflow: hidden;
  background: #eef2ef;
}
.preview-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.preview-image { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.preview-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 36px 24px; text-align: center; color: var(--muted); width: 100%; }
.preview-fallback strong { font-size: 14px; color: var(--ink); }
.preview-fallback p { max-width: 380px; font-size: 12px; line-height: 1.6; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 13px; }
.field textarea { min-height: 76px; resize: vertical; }
.field select { cursor: pointer; }
.field-hint { margin-top: 5px; font-size: 10.5px; color: var(--muted-2); line-height: 1.45; }
.field-hint[data-pihak-info] { color: var(--green-700); font-weight: 600; }
.field-hint[data-pihak-info] b { color: var(--green-800); }
.field-hint[data-pihak-hint] { margin-top: 4px; }
.field-error { margin-top: 4px; font-size: 10.5px; color: var(--red); font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #fca5a5; background: #fffafa; }

.auto-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 15px;
  border: 1px dashed #c9ddcf;
  border-radius: 10px;
  background: #f6fbf7;
}
.auto-box-head { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--green-700); white-space: nowrap; }
.auto-box-head svg { width: 14px; height: 14px; }
.auto-chips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.auto-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: #fff; border: 1px solid #d6e7da; font-size: 10.5px; color: var(--muted); }
.auto-chip b { color: var(--green-800); font-weight: 800; }
.auto-refresh { margin-left: auto; }
.auto-note { width: 100%; font-size: 10px; color: var(--muted-2); line-height: 1.45; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 28px 18px;
  border: 1.5px dashed #c8d9cd;
  border-radius: 12px;
  background: #f9fcf9;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--green-600); background: #f2faf4; }
.dropzone-ic { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: #e8f5ec; color: var(--green-700); }
.dropzone-ic svg { width: 23px; height: 23px; }
.dropzone strong { font-size: 12.5px; }
.dropzone small { font-size: 10.5px; color: var(--muted-2); }
.file-picked { display: flex; align-items: center; gap: 9px; padding: 10px 12px; margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 11.5px; }
.file-picked svg { width: 17px; height: 17px; color: var(--green-700); }
.file-picked b { font-weight: 700; }
.file-picked span { color: var(--muted-2); font-size: 10.5px; }
.file-picked button { margin-left: auto; }

/* ============================ BERKAS DOKUMEN ============================ */
.icon-action.attach { position: relative; }
.icon-action.attach.has-files { color: var(--green-700); background: #eef7f1; }
.icon-action.attach:hover { background: #e4f2e8; color: var(--green-800); }
.attach-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border: 1.5px solid #fff;
  border-radius: 999px;
  background: var(--green-700);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  line-height: 11px;
  text-align: center;
}
.attach-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1.5px dashed #c8d9cd;
  border-radius: 12px;
  background: #f9fcf9;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}
.attach-drop.dragover { border-color: var(--green-600); background: #f2faf4; }
.attach-drop.busy { opacity: 0.65; pointer-events: none; }
.attach-drop-ic { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 11px; background: #e8f5ec; color: var(--green-700); }
.attach-drop-ic svg { width: 21px; height: 21px; }
.attach-drop-main { flex: 1; min-width: 0; }
.attach-drop-main strong { display: block; font-size: 12.5px; font-weight: 800; }
.attach-drop-main small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.attach-progress { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: #f0f7ff; border: 1px solid #d3e6fb; color: #1e4d7b; font-size: 11px; }
.attach-progress svg { width: 15px; height: 15px; flex: 0 0 auto; }
.attach-alert { margin-top: 10px; margin-bottom: 0; }
.attach-list { margin-top: 14px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.attach-loading { padding: 14px; }
.attach-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: #f8faf8; border-bottom: 1px solid var(--line-soft); font-size: 10.5px; color: var(--muted); font-weight: 600; }
.attach-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); background: #fff; }
.attach-item:last-child { border-bottom: 0; }
.attach-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; background: #f1f5f2; color: #4b5c50; }
.attach-ic svg { width: 17px; height: 17px; }
.attach-ic.pdf { background: #fdeeee; color: #b91c1c; }
.attach-ic.image { background: #eef6ff; color: #1d4ed8; }
.attach-ic.doc { background: #eef3ff; color: #1e40af; }
.attach-ic.sheet { background: #eefaf1; color: #166534; }
.attach-ic.slide { background: #fff4ed; color: #c2410c; }
.attach-ic.archive { background: #f8f1ff; color: #6b21a8; }
.attach-main { flex: 1; min-width: 0; }
.attach-main strong { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-main span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted-2); line-height: 1.4; }
.attach-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.attach-empty { padding: 30px 18px; text-align: center; }
.attach-empty-ic { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: #f0f6f1; color: var(--green-700); margin-bottom: 9px; }
.attach-empty-ic svg { width: 22px; height: 22px; }
.attach-empty strong { display: block; font-size: 12.5px; font-weight: 800; }
.attach-empty p { margin: 4px auto 0; max-width: 320px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.attach-foot-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 13px; padding: 9px 11px; border-radius: 8px; background: #f8faf8; color: var(--muted); font-size: 10px; line-height: 1.5; }
.attach-foot-note svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; color: var(--green-700); }
.attach-pending { margin-top: 5px; padding: 12px; border: 1px dashed #c9ddcf; border-radius: 11px; background: #f6fbf7; }
.attach-pending.dragover { border-color: var(--green-600); background: #f2faf4; }
.attach-pending-head { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--green-700); }
.attach-pending-head svg { width: 14px; height: 14px; }
.attach-pending-head .badge { margin-left: 2px; text-transform: none; letter-spacing: 0; }
.attach-pending-note { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 9px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.attach-pending-note svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; color: var(--green-700); }
.attach-pending-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.attach-limit { font-size: 9.5px; color: var(--muted-2); }
.attach-pending-list { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.attach-pending-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.attach-pending-item .attach-ic { width: 29px; height: 29px; border-radius: 7px; }
.attach-pending-item .attach-ic svg { width: 14px; height: 14px; }
.attach-pending-main { flex: 1; min-width: 0; }
.attach-pending-main strong { display: block; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-pending-main span { display: block; font-size: 9.5px; color: var(--muted-2); }
.detail-attach-bar { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.detail-attach-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.detail-attach-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; background: #eef7f1; color: var(--green-700); }
.detail-attach-icon svg { width: 17px; height: 17px; }
.detail-attach-main strong { display: block; font-size: 11.5px; font-weight: 800; }
.detail-attach-main span { display: block; margin-top: 1px; font-size: 10px; color: var(--muted); }

.alert { display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: 9px; font-size: 11.5px; line-height: 1.55; margin-bottom: 12px; }
.alert svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.alert-info { background: #f0f7ff; border: 1px solid #d3e6fb; color: #1e4d7b; }
.alert-warn { background: #fffaeb; border: 1px solid #fde9b8; color: #8a5a09; }
.alert-success { background: #f0fbf3; border: 1px solid #c9ecd3; color: #166534; }
.alert-error { background: var(--red-50); border: 1px solid #fecaca; color: #991b1b; }

.import-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.summary-box { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; text-align: center; }
.summary-box b { display: block; font-size: 20px; font-weight: 800; line-height: 1.2; }
.summary-box span { font-size: 10px; color: var(--muted); font-weight: 600; }
.summary-box.ok b { color: var(--green-700); }
.summary-box.skip b { color: var(--gold-600); }
.summary-box.fail b { color: var(--red); }
.error-list { max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; }
.error-item { display: flex; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); font-size: 10.5px; line-height: 1.5; }
.error-item:last-child { border-bottom: 0; }
.error-item b { color: var(--red); white-space: nowrap; }
.error-item span { color: var(--muted); }

/* Detail */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.detail-item { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.detail-item.full { grid-column: 1 / -1; }
.detail-label { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-2); margin-bottom: 3px; }
.detail-value { font-size: 12.5px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-value.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }

/* Confirm */
.confirm-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: var(--red-50); color: var(--red); margin-bottom: 12px; }
.confirm-icon svg { width: 23px; height: 23px; }
.confirm-title { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.confirm-text { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ================================ SETTINGS / USERS ================================ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-head { display: flex; align-items: flex-start; gap: 11px; padding: 16px 18px 13px; border-bottom: 1px solid var(--line-soft); }
.card-head-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: #edf6ef; color: var(--green-700); flex: 0 0 auto; }
.card-head-icon svg { width: 18px; height: 18px; }
.card-head h3 { font-size: 13.5px; font-weight: 800; }
.card-head p { margin-top: 2px; font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.card-body { padding: 16px 18px; }
.card-body .form-grid { gap: 0 12px; }
.card-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-soft); background: #fcfdfc; }
.settings-full { grid-column: 1 / -1; }
.settings-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; padding: 9px 11px; border-radius: 8px; background: #f7faf7; border: 1px solid var(--line-soft); font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.settings-note svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--green-700); margin-top: 1px; }
.settings-note code { padding: 1px 4px; border-radius: 3px; background: #e9f1eb; font-family: ui-monospace, Consolas, monospace; font-size: 10px; }

.role-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; }
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green-500); }
.status-dot.off::before { background: #b0bdb4; }
.muted { color: var(--muted-2); }
.nowrap { white-space: nowrap; }

/* ================================ TOAST ================================ */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  min-width: 260px;
  max-width: 390px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  line-height: 1.5;
  animation: toastIn 0.22s ease;
  pointer-events: auto;
}
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.toast-success { border-color: #c9ecd3; }
.toast-success svg { color: var(--green-600); }
.toast-error { border-color: #fecaca; }
.toast-error svg { color: var(--red); }
.toast-info svg { color: var(--blue); }
.toast-warn svg { color: var(--gold-600); }
.toast-close { margin-left: auto; width: 22px; height: 22px; border: 0; background: transparent; color: var(--muted-2); display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; }
.toast-close:hover { background: var(--line-soft); }

/* ============================== PERSETUJUAN ============================== */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #f5c76b;
  color: #3f2a05;
  font-size: 9.5px;
  font-weight: 800;
  text-align: center;
  line-height: 15px;
}
.nav-badge[hidden] { display: none; }
.nav-item .nav-badge + .nav-code { margin-left: 6px; }

.pending-mark {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--gold-600);
  vertical-align: middle;
  box-shadow: 0 0 0 2px var(--gold-100);
}

.approval-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.approval-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.approval-tab:hover { border-color: var(--green-200); color: var(--green-700); }
.approval-tab.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.approval-tab-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--line-soft);
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}
.approval-tab.active .approval-tab-count { background: rgba(255,255,255,0.22); }

.approval-list { display: flex; flex-direction: column; gap: 12px; }
.approval-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
.approval-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.approval-head-main { min-width: 0; flex: 1; }
.approval-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.approval-title strong { font-size: 12.5px; color: var(--ink); }
.approval-actions { display: flex; gap: 6px; align-items: center; }
.approval-summary {
  margin-top: 10px;
  padding: 8px 11px;
  border-radius: 8px;
  background: #f7faf7;
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.5;
}
.approval-diff { margin-top: 10px; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.approval-diff-head, .approval-diff-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 10px;
  padding: 7px 11px;
  font-size: 10.5px;
  line-height: 1.5;
}
.approval-diff-head {
  background: #f8faf8;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.approval-diff-row { border-bottom: 1px solid var(--line-soft); }
.approval-diff-row:last-child { border-bottom: 0; }
.approval-diff-label { font-weight: 700; color: var(--ink-soft); }
.approval-before { color: var(--muted); text-decoration: line-through; word-break: break-word; }
.approval-after { color: var(--green-700); font-weight: 700; word-break: break-word; }
.approval-review {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

/* ================================ ANIMASI ================================ */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton { position: relative; overflow: hidden; background: #eef3ef; border-radius: 6px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent); animation: shimmer 1.3s infinite; }

/* ================================ RESPONSIVE ================================ */
@media (min-width: 1400px) {
  .hero-illustration { display: flex; }
}
@media (max-width: 1240px) {
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
  .login-art { padding: 34px 38px 26px; }
  .login-features { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: inline-flex; }
  .sidebar-brand { gap: 8px; }
  .sidebar-brand-text span { display: none; }
  .sidebar-brand-text strong { font-size: 17px; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .sidebar-scrim { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(8,30,19,0.45); backdrop-filter: blur(2px); }
  .app.sidebar-open .sidebar-scrim { display: block; }
  .topbar { padding: 10px 18px; }
  .content { padding: 20px 18px 34px; }
  .topbar-date { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card-head .login-card-logos { display: inline-flex; }
  .login-panel { min-height: 100vh; padding: 28px 22px 60px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-full { grid-column: auto; }
}
@media (max-width: 760px) {
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head h2 { font-size: 23px; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.full { grid-column: auto; }
  .hero { padding: 21px; }
  .hero-actions .btn { flex: 1; }
  .user-chip-text { display: none; }
  .user-chip { padding: 4px; border: 0; background: transparent; }
  .user-chip > svg { display: none; }
  .data-table .hide-sm { display: none; }
  .toolbar-main, .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; }
  .search-box { max-width: none; }
  .pagination { justify-content: center; }
  .page-controls { margin-left: 0; }
  .page-info { width: 100%; text-align: center; }
  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 94vh; }
  .modal-body { max-height: 68vh; }
  .preview-body { height: 72vh; height: 72dvh; min-height: 240px; max-height: none; }
  .modal-xl .modal-head { padding: 14px 16px 12px; }
  .modal-xl .modal-foot { padding: 11px 16px; }
  .login-copy { padding: 30px 0; }
  .dropdown { right: 14px; top: 60px; }
  .approval-diff-head, .approval-diff-row { grid-template-columns: 1fr; gap: 2px; }
  .approval-diff-head span:not(:first-child) { display: none; }
  .approval-head { flex-direction: column; }
  .approval-actions { width: 100%; }
  .approval-actions .btn { flex: 1; }
}
@media (max-width: 520px) {
  .book-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 13px; }
  .stat-value { font-size: 22px; }
  .stat-icon { width: 36px; height: 36px; }
  .login-panel { padding: 24px 16px 50px; }
  .login-card-head h2 { font-size: 25px; }
  .demo-grid { grid-template-columns: 1fr; }
  .login-panel-footer { display: none; }
  .topbar-title h1 { font-size: 16px; }
  .import-summary { grid-template-columns: 1fr; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .spacer { display: none; }
  .chart-bar { max-width: 7px; }
  .chart-labels span { font-size: 8px; }
  .page-head-actions .btn { font-size: 11.5px; padding: 8px 10px; }
  .auto-refresh { margin-left: 0; }
}

/* ====================== TAMPILAN HP (KARTU TABEL) ====================== */
@media (max-width: 760px) {
  /* Nyaman di layar sentuh */
  .content { padding: 16px 12px calc(30px + env(safe-area-inset-bottom)); }
  .topbar { padding: 8px 12px; }
  .topbar-title h1 { font-size: 17px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head-actions { padding-top: 0; }
  .page-head-actions .btn { min-height: 40px; }
  .page-head h2 { font-size: 21px; }
  .page-head p { font-size: 12px; }
  .hero { padding: 18px; }
  .hero h2 { font-size: 22px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .toolbar { gap: 7px; padding: 10px; }
  .toolbar-main { gap: 7px; }
  .toolbar-main .search-box { flex: 1 1 100%; max-width: none; min-width: 0; }
  .toolbar-main .select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .toolbar-actions { gap: 7px; }
  .toolbar-actions .btn { flex: 1; min-height: 40px; }
  .search-box input, .field input, .field select, .field textarea, .input-wrap input {
    font-size: 16px; /* mencegah iOS memperbesar halaman saat mengetik */
  }
  .btn { min-height: 40px; }
  .icon-btn { width: 40px; height: 40px; }
  .modal { width: 100%; }
  .modal-foot { padding-bottom: calc(11px + env(safe-area-inset-bottom)); }
  .pagination { flex-wrap: wrap; gap: 10px; }
  .page-size { margin-left: auto; }
  .detail-value, .cell-title, .cell-sub { word-break: break-word; }
  .toast-root { bottom: calc(14px + env(safe-area-inset-bottom)); }

  /* Tabel buku & admin berubah menjadi kartu per baris */
  .table-card { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .table-wrap { overflow: visible; }
  .data-table { display: block; width: 100%; font-size: 12.5px; }
  .data-table thead { display: none; }
  .data-table tbody { display: block; }
  .data-table tbody tr {
    display: block;
    margin-bottom: 10px;
    padding: 5px 13px 7px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow-sm);
  }
  .data-table tbody tr:hover { background: var(--card); }
  .data-table tbody tr:last-child { margin-bottom: 0; }
  .data-table td,
  .data-table td.hide-sm,
  .data-table td.center,
  .data-table td.right {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line-soft);
    text-align: left;
    vertical-align: top;
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before {
    content: attr(data-label);
    padding-top: 2px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted-2);
    line-height: 1.45;
  }
  .data-table td[data-label="No"] { grid-template-columns: 98px minmax(0, 1fr); }
  .data-table .cell-title { -webkit-line-clamp: 3; }
  .data-table .cell-sub { margin-top: 2px; }
  .data-table td .row-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .data-table td .row-actions .icon-action { width: 40px; height: 40px; border-radius: 10px; }
  .data-table td .row-actions .attach-count { top: 3px; right: 3px; }
  .data-table td[data-label="Aksi"]::before { padding-top: 10px; }

  /* Tabel ringkas di dasbor */
  .mini-table th, .mini-table td { padding: 7px 6px; }
  .mini-table th:first-child, .mini-table td:first-child { display: none; }
  .mini-table .title {
    max-width: none;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ============ LOGIN DI HP/TABLET: PANEL HIJAU TETAP TAMPIL ============ */
@media (max-width: 980px) {
  .login {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    min-height: 100dvh;
    background: #fbfcf9;
  }
  .login-art {
    display: flex;
    flex: 0 0 auto;
    padding: calc(18px + env(safe-area-inset-top)) 20px 22px;
    border-radius: 0 0 26px 26px;
    box-shadow: 0 14px 30px -20px rgba(10, 58, 36, 0.65);
  }
  .login-art-pattern {
    width: 360px;
    height: 360px;
    right: -150px;
    top: -210px;
  }
  .login-art::after { display: none; }
  .login-brand { gap: 10px; }
  .login-brand .logo-tile-crest { width: 42px; height: 42px; }
  .login-brand .logo-tile-desa { width: 96px; height: 35px; }
  .login-brand-text strong { font-size: 21px; }
  .login-brand-text span { font-size: 9px; letter-spacing: 0.045em; }
  .login-copy {
    display: block;
    margin: 16px 0 0;
    padding: 0;
    max-width: none;
  }
  .login-copy .pill-place { padding: 6px 10px; }
  .login-copy .pill-place strong { font-size: 11px; }
  .login-copy .pill-place > span { font-size: 10px; }
  .login-copy h1 {
    margin: 9px 0 0;
    font-size: 19px;
    line-height: 1.28;
    letter-spacing: -0.01em;
  }
  .login-copy > p,
  .login-features,
  .login-art-footer { display: none; }
  .login-panel {
    justify-content: flex-start;
    min-height: 0;
    padding: 26px 18px calc(40px + env(safe-area-inset-bottom));
    background: transparent;
  }
  .login-card { width: min(424px, 100%); margin: 0 auto; }
  .login-card-logos { display: none !important; }
  .login-card-head { margin-bottom: 20px; }
  .login-card-head h2 { font-size: 25px; }
  .login-card-head p { font-size: 13px; }
}
