:root {
  --brand-teal: #0b6e7a;
  --brand-teal-dark: #0a5a63;
  --brand-mint: #2bb8c8;
  --brand-gold: #c4a46a;
  --brand-ink: #0b1b2b;
  --brand-canvas: #eaf1f5;
  --brand-surface: #fbfcfd;
  --brand-slate: #3d5163;
  --brand-muted: #5a6d7c;
  --brand-line: #c5d4df;
  --brand-accent: #b42318;
  --shadow-sm: 0 4px 14px rgba(11, 27, 43, 0.06);
  --shadow-md: 0 12px 32px rgba(11, 27, 43, 0.08);
  --shadow-lg: 0 20px 48px rgba(11, 27, 43, 0.12);
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar-w: 272px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--brand-ink);
  background:
    radial-gradient(900px 480px at 8% -8%, rgba(43, 184, 200, 0.18) 0%, transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(196, 164, 106, 0.12) 0%, transparent 50%),
    var(--brand-canvas);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* Field umpan autofill browser — tidak terlihat */
input.autofill-trap {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card, .panel {
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-card {
  width: min(440px, 100%);
  padding: 36px 32px;
}

.brand { text-align: center; margin-bottom: 28px; }
.brand h1 { font-size: 1.4rem; margin: 14px 0 6px; font-weight: 800; color: var(--brand-ink); }
.brand p, .muted, .sidebar-meta span { color: var(--brand-muted); }

.app-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(11, 110, 122, 0.35);
  display: block;
}

.app-logo.sm {
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(11, 110, 122, 0.28);
}

label { display: block; font-size: 0.85rem; font-weight: 600; margin: 12px 0 6px; color: var(--brand-slate); }

input, select, textarea, button {
  font: inherit;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--brand-line);
  padding: 12px 14px;
  background: #fff;
  color: var(--brand-ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-mint);
  box-shadow: 0 0 0 3px rgba(43, 184, 200, 0.18);
}

button {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-teal-dark));
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
}

button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.error { color: var(--brand-accent); min-height: 1.2em; font-size: 0.9rem; }

/* ── App shell ── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* Konten selalu di kolom kanan — hindari loncatan layout sebelum sidebar di-inject */
.app > .content,
.app > #page-content {
  grid-column: 2;
  grid-row: 1;
}
.app > .sidebar {
  grid-column: 1;
  grid-row: 1;
}
.app > .mobile-bar,
.app > .nav-backdrop {
  grid-column: 1 / -1;
}

/* Sembunyikan sampai shell siap (cegah kedip FOUC saat pindah menu) */
html.admin-pending .app {
  opacity: 0;
}
html.admin-ready .app {
  opacity: 1;
  transition: opacity 0.14s ease;
}

#page-content.is-soft-loading {
  opacity: 0.72;
  transition: opacity 0.12s ease;
  /* Jangan pointer-events:none di seluruh app — sidebar harus tetap bisa diklik */
}
#page-content {
  transition: opacity 0.12s ease;
}
@media (prefers-reduced-motion: reduce) {
  html.admin-ready .app { transition: none; }
  .stat-card,
  .chart-card {
    animation: none !important;
  }
}

/* ── Sidebar ── */
.sidebar {
  background: linear-gradient(180deg, #0b1220 0%, #0b1b2b 42%, #0a5a63 100%);
  color: #e8f1f5;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 4px 0 24px rgba(11, 27, 43, 0.12);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.mobile-bar,
.nav-backdrop,
.sidebar-close {
  display: none;
}

.sidebar-top {
  padding: 22px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sidebar-brand strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sidebar-meta span {
  font-size: 0.78rem;
  color: rgba(234, 241, 245, 0.65);
}

.sidebar-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(43, 184, 200, 0.18);
  color: var(--brand-mint);
  border: 1px solid rgba(43, 184, 200, 0.25);
}

#school-picker-wrap {
  padding: 0 18px 12px;
}

#school-picker-wrap label {
  color: rgba(234, 241, 245, 0.55);
  font-size: 0.72rem;
  margin: 0 0 4px;
}

#school-picker {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.85rem;
  padding: 10px 12px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.sidebar nav button,
.sidebar nav a.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  color: rgba(234, 241, 245, 0.78);
  text-align: left;
  border: 1px solid transparent;
  margin: 0;
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar nav button:hover,
.sidebar nav a.nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  transform: translateX(2px);
}

.sidebar nav button.active,
.sidebar nav a.nav-link.active {
  background: linear-gradient(90deg, rgba(11, 110, 122, 0.55), rgba(43, 184, 200, 0.12));
  border-color: rgba(43, 184, 200, 0.28);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand-mint);
}

.sidebar nav button.active .nav-icon,
.sidebar nav a.nav-link.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(180, 35, 24, 0.16);
  border: 1px solid rgba(180, 35, 24, 0.28);
  color: #ffb4a8;
  margin: 0;
  font-size: 0.88rem;
  padding: 11px 14px;
}

.logout:hover {
  background: rgba(180, 35, 24, 0.26);
  filter: none;
}

/* ── Main content ── */
.content {
  padding: 28px 32px 40px;
  max-width: 1400px;
}

.content > .tab > h2:first-child { display: none; }

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.dash-kicker {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-teal);
}

.dash-header h2 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--brand-ink);
}

.dash-date {
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-slate);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* ── Stat cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
  /* Animasi ringan — delay bertingkat bikin terasa “berkedip” saat navigasi */
  animation: cardIn 0.28s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.12;
  transform: translate(30%, -30%);
  background: var(--tone, var(--brand-teal));
}

.stat-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--tone, var(--brand-teal)) 14%, white);
  color: var(--tone, var(--brand-teal));
}

.stat-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.stat-num {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-muted);
}

.stat-card[data-tone="teal"] { --tone: var(--brand-teal); }
.stat-card[data-tone="mint"] { --tone: var(--brand-mint); }
.stat-card[data-tone="gold"] { --tone: var(--brand-gold); }
.stat-card[data-tone="slate"] { --tone: var(--brand-slate); }
.stat-card[data-tone="green"] { --tone: #15803d; }
.stat-card[data-tone="coral"] { --tone: #c45d6a; }

.dash-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-line);
  background:
    linear-gradient(135deg, rgba(11, 110, 122, 0.12) 0%, rgba(43, 184, 200, 0.08) 48%, rgba(196, 164, 106, 0.12) 100%),
    var(--brand-surface);
  box-shadow: var(--shadow-sm);
}
.dash-banner h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
}
.dash-banner p { margin: 0; }
.dash-banner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-slate);
}

.chart-card-sub { margin: -6px 0 10px; }

.gender-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.gender-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f3f8fb;
  color: var(--brand-slate);
}
.gender-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.chart-wrap-tall { height: 300px; }
.chart-wrap-tall canvas { max-height: 300px; }

/* ── Charts ── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.chart-card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  padding: 18px 18px 14px;
  box-shadow: var(--shadow-sm);
  animation: cardIn 0.28s ease both;
}

.chart-card h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand-ink);
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.chart-wrap canvas { max-height: 260px; }

.chart-card.wide { grid-column: 1 / -1; }

/* legacy .stats alias */
.stats { display: contents; }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel { padding: 18px; margin: 16px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.grid .full { grid-column: 1 / -1; }
.school-settings-panel .grid { margin-top: 4px; }
.school-settings-panel .grid label { margin-top: 0; }
.school-settings-panel label { font-size: 13px; font-weight: 600; }
.school-settings-panel button[type="submit"] { margin-top: 14px; max-width: 280px; }

.ach-student-search { margin-bottom: 14px; }
.ach-student-field { position: relative; }
.ach-student-field > input:not([type="hidden"]) { width: 100%; }
.ach-search-results {
  position: absolute;
  z-index: 20;
  left: 0; right: 0;
  top: calc(100% + 4px);
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.ach-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  margin: 0;
}
.ach-search-item:hover,
.ach-search-item.active {
  background: rgba(11, 110, 122, 0.08);
  transform: none;
  filter: none;
}
.ach-search-name { font-weight: 700; display: block; }
.ach-search-meta { font-size: 12px; color: var(--brand-muted); margin-top: 2px; }
.ach-search-id {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-teal);
  background: rgba(11, 110, 122, 0.08);
  padding: 4px 8px;
  border-radius: 8px;
}
.ach-search-empty { padding: 12px; font-size: 13px; color: var(--brand-muted); }

.ach-page-head { align-items: center; }
.ach-stat-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ach-stat-pill {
  min-width: 92px;
  padding: 10px 14px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ach-stat-pill strong {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-ink);
  line-height: 1.1;
}
.ach-stat-pill span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.ach-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ach-form-card {
  margin: 0;
  padding: 18px;
}
.ach-form-card h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 800;
}
.ach-form-card > .muted { margin: 0 0 14px; }
.ach-form-card label { margin-top: 10px; }
.ach-form-card input,
.ach-form-card select,
.ach-form-card textarea { margin: 0; }
.ach-form-card textarea { resize: vertical; min-height: 68px; }
.ach-form-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  margin-top: 4px;
}
.ach-form-row > div { min-width: 0; }
.ach-form-card .btn-primary {
  width: 100%;
  margin-top: 16px;
}
.ach-form-card .error { margin-top: 8px; }
.ach-picked.is-set {
  color: var(--brand-teal-dark);
  font-weight: 600;
}

.ach-list-col { min-width: 0; }
.ach-toolbar { margin-bottom: 12px; }
.ach-table-wrap { margin-top: 0; }
.ach-table-wrap.is-scrollable {
  max-height: calc(44px + (10 * 64px));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.ach-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0f6fa;
  box-shadow: 0 1px 0 var(--brand-line);
}
.ach-title,
.ach-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.ach-table th:nth-child(3),
.ach-table td:nth-child(3) { width: 78px; white-space: nowrap; }
.ach-table th:nth-child(4),
.ach-table td:nth-child(4) { width: 140px; }
.ach-table th:last-child,
.ach-table td:last-child { width: 88px; text-align: right; }
.ach-title {
  font-weight: 700;
  color: var(--brand-ink);
  line-height: 1.3;
}
.ach-desc {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--brand-muted);
  line-height: 1.35;
}
.ach-level-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(11, 110, 122, 0.1);
  color: #0a5a63;
  white-space: nowrap;
}
.ach-level-pill[data-level="Nasional"],
.ach-level-pill[data-level="Internasional"] {
  background: rgba(196, 164, 106, 0.22);
  color: #8a6a2a;
}
.ach-level-pill[data-level="Provinsi"] {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}
.btn-ach-del {
  padding: 7px 10px;
  font-size: 0.78rem;
  width: auto;
  margin: 0;
  min-width: 0;
  background: transparent;
  color: var(--brand-muted);
  border: 1px solid var(--brand-line);
}
.btn-ach-del:hover {
  color: var(--brand-accent);
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.06);
  transform: none;
}

.ach-table tbody tr.ach-row {
  cursor: pointer;
}
.ach-table tbody tr.ach-row:hover td {
  background: rgba(11, 110, 122, 0.07);
}

.ach-detail-card {
  width: min(560px, 100%);
  padding: 0;
  overflow: hidden;
}
.ach-detail-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px 16px;
  background: linear-gradient(135deg, #f4fafb 0%, #eef6f8 100%);
  border-bottom: 1px solid var(--brand-line);
}
.ach-detail-ring {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.ach-detail-hero-text { flex: 1; min-width: 0; }
.ach-detail-hero-text h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  line-height: 1.3;
}
.ach-detail-close { flex-shrink: 0; }
.ach-detail-body { padding: 18px 22px 8px; }
.ach-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ach-detail-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-muted);
  margin-bottom: 4px;
}
.ach-detail-meta strong {
  font-size: 0.92rem;
  color: var(--brand-ink);
  word-break: break-word;
}
.ach-detail-block {
  margin-bottom: 14px;
}
.ach-detail-block p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--brand-ink);
  white-space: pre-wrap;
}
.ach-detail-desc { color: var(--brand-slate); }
.ach-detail-card .modal-footer {
  padding: 12px 22px 18px;
  border-top: 1px solid var(--brand-line);
}
.ach-detail-card .modal-actions { margin: 0; }

@media (max-width: 640px) {
  .ach-detail-hero { flex-wrap: wrap; }
  .ach-detail-close { width: 100%; }
}

@media (max-width: 980px) {
  .ach-layout { grid-template-columns: 1fr; }
  .ach-page-head { flex-direction: column; align-items: stretch; }
}

.table-wrap {
  overflow: auto;
  background: var(--brand-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-line);
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--brand-line); text-align: left; font-size: 0.92rem; }
th { background: #f0f6fa; font-weight: 700; color: var(--brand-slate); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(43, 184, 200, 0.04); }

.hint {
  margin-top: 8px;
  background: var(--brand-surface);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--brand-line);
  box-shadow: var(--shadow-sm);
}

.hint h3 { margin: 0 0 10px; font-size: 0.95rem; }
.post-item { background: var(--brand-surface); border: 1px solid var(--brand-line); border-radius: var(--radius-md); padding: 14px; margin-bottom: 10px; }
code { background: #edf4f8; padding: 2px 6px; border-radius: 6px; font-size: 0.88em; color: var(--brand-teal-dark); }

.btn-ghost, .btn-secondary, .btn-edit, .file-btn {
  background: #edf4f8;
  color: var(--brand-teal-dark);
  border: 1px solid var(--brand-line);
  font-weight: 700;
  cursor: pointer;
  margin-top: 0;
  width: auto;
}

.btn-ghost:hover, .btn-secondary:hover, .btn-edit:hover, .file-btn:hover {
  background: #e2eef5;
  filter: none;
  transform: none;
}

.btn-edit { padding: 8px 12px; font-size: 0.85rem; }
.btn-secondary { margin-top: 10px; }
.file-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 12px; }

.avatar-sm, .avatar-lg {
  object-fit: cover;
  border-radius: 50%;
  background: #d9ebe8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--brand-line);
}

.avatar-sm { width: 36px; height: 36px; }
.avatar-lg { width: 88px; height: 88px; }

.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 16px;
}

.modal.hidden { display: none !important; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(11, 27, 43, 0.45);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative; z-index: 1;
  width: min(760px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}

.modal-head { margin-bottom: 8px; gap: 12px; }
.modal-head h3 { margin: 0 0 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-actions button { width: auto; min-width: 120px; margin-top: 0; }

.modal-card-edit {
  width: min(840px, 100%);
  max-height: min(92vh, 960px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-card-edit .modal-head {
  margin: 0;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--brand-line);
  flex-shrink: 0;
}

.modal-card-edit .modal-head .dash-kicker { margin: 0 0 4px; }

.edit-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.edit-form-body {
  overflow: auto;
  padding: 18px 24px 8px;
  flex: 1;
}

.modal-footer {
  flex-shrink: 0;
  padding: 12px 24px 18px;
  border-top: 1px solid var(--brand-line);
  background: linear-gradient(180deg, #f8fbfc 0%, #fff 100%);
}

.modal-footer .error {
  min-height: 0;
  margin: 0 0 8px;
}

.modal-footer .modal-actions {
  margin: 0;
}

.edit-photo-card {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 0 0 18px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #f4fafb 0%, #eef6f8 100%);
  border-radius: 18px;
  border: 1px solid var(--brand-line);
}

.edit-photo-ring {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #0b6e7a, #c4a46a);
}

.edit-photo-ring .avatar-lg {
  width: 100%;
  height: 100%;
  display: block;
  border: 3px solid #fff;
  box-shadow: none;
}

.edit-photo-title {
  margin: 0 0 4px;
  font-weight: 800;
  color: var(--brand-ink);
}

.edit-photo-actions { flex: 1; min-width: 0; }
.edit-photo-actions .file-btn { margin-top: 10px; }
.edit-account-block { margin-top: 0; }

.modal .grid label { margin-top: 0; }
.modal .grid > div { display: flex; flex-direction: column; gap: 4px; }
.modal .grid input, .modal .grid select { margin: 0; }
.modal-card-wide {
  width: min(820px, 100%);
}

.crop-modal { z-index: 80; }

.photo-crop-card {
  width: min(460px, 100%);
  padding: 20px 22px 18px;
}

.photo-crop-card .modal-head { margin-bottom: 14px; }

.crop-stage {
  display: grid;
  place-items: center;
  padding: 22px 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(43, 184, 200, 0.16), transparent 62%),
    #0f2230;
  border-radius: 18px;
}

.crop-viewport {
  position: relative;
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  border-radius: 50%;
  overflow: hidden;
  cursor: grab;
  background: #1b3344;
  touch-action: none;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.92),
    0 16px 36px rgba(0, 0, 0, 0.35);
}

.crop-viewport.is-dragging { cursor: grabbing; }

.crop-viewport img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  user-select: none;
  pointer-events: none;
  will-change: transform;
}

.crop-controls { margin-top: 16px; }

.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crop-zoom-row input[type="range"] {
  flex: 1;
  margin: 0;
  accent-color: var(--brand-teal);
}

.crop-zoom-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 42px;
}

.crop-hint { text-align: center; margin: 8px 0 0; }

.photo-crop-card .modal-actions { margin-top: 16px; }

@media (max-width: 640px) {
  .edit-photo-card { flex-direction: column; text-align: center; }
  .edit-photo-actions .file-btn { width: 100%; }
}

.users-page-head { align-items: center; }

.users-toolbar-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.users-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.users-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  stroke: var(--brand-muted);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.users-search-wrap input[type="search"] {
  width: 100%;
  margin: 0;
  min-height: 42px;
  padding-left: 38px;
  background: #f4f8fb;
  border-color: transparent;
}

.users-search-wrap input[type="search"]:focus {
  background: #fff;
  border-color: var(--brand-teal);
}

.users-toolbar-card select {
  width: auto;
  min-width: 168px;
  margin: 0;
  min-height: 42px;
}

.users-table-wrap { margin-top: 0; }

.users-table th:last-child,
.users-table td:last-child {
  text-align: right;
  width: 268px;
}

.users-person-device {
  font-size: 0.72rem;
  color: var(--brand-muted);
}

.users-device-hint {
  margin: -8px 0 14px;
}

.btn-unbind {
  margin: 0;
  width: auto;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  background: #fff;
  color: var(--brand-teal-dark);
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  cursor: pointer;
}

.btn-unbind:hover {
  filter: none;
  transform: none;
  background: rgba(11, 110, 122, 0.08);
}

.users-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.users-row-actions .btn-edit,
.users-row-actions .btn-block,
.users-row-actions .btn-unbind {
  margin: 0;
}

.btn-block {
  margin: 0;
  width: auto;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  background: #fff;
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: 10px;
  cursor: pointer;
}

.btn-block:hover {
  filter: none;
  transform: none;
  background: rgba(180, 35, 24, 0.08);
}

.btn-block.is-on {
  background: #b42318;
  color: #fff;
  border-color: #b42318;
}

.btn-block:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-pill.is-blocked {
  background: rgba(180, 35, 24, 0.12);
  color: #b42318;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) { width: 140px; }

.users-table th:nth-child(3),
.users-table td:nth-child(3) { width: 110px; }

.users-table th:nth-child(4),
.users-table td:nth-child(4) { width: 110px; }

.users-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.users-person-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.users-person-name {
  font-weight: 700;
  color: var(--brand-ink);
  line-height: 1.25;
}

.users-person-id {
  font-size: 0.78rem;
  color: var(--brand-muted);
  font-variant-numeric: tabular-nums;
}

.users-table .avatar-sm {
  flex-shrink: 0;
}

.role-pill, .status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.role-pill[data-role="student"] { background: rgba(11, 110, 122, 0.12); color: #0a5a63; }
.role-pill[data-role="teacher"] { background: rgba(43, 184, 200, 0.16); color: #0b6e7a; }
.role-pill[data-role="principal"] { background: rgba(196, 164, 106, 0.22); color: #8a6a2a; }
.role-pill[data-role="staff"] { background: rgba(61, 81, 99, 0.12); color: #3d5163; }
.role-pill[data-role="parent"] { background: rgba(99, 102, 241, 0.12); color: #4338ca; }

.status-pill.is-active { background: rgba(21, 128, 61, 0.12); color: #15803d; }
.status-pill.is-inactive { background: rgba(180, 35, 24, 0.1); color: #b42318; }

.users-table td { vertical-align: middle; }
.users-table tbody tr:hover td { background: rgba(11, 110, 122, 0.04); }

@media (max-width: 800px) {
  .users-page-head { flex-direction: column; align-items: stretch; }
  .users-page-head .btn-primary { width: 100%; }
  .users-toolbar-card { flex-direction: column; align-items: stretch; }
  .users-toolbar-card select { width: 100%; }
  .users-row-actions { flex-wrap: wrap; }
}

.btn-primary {
  background: linear-gradient(135deg, #0B6E7A, #2BB8C8);
  color: #fff;
  border: none;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  width: auto;
  margin: 0;
  box-shadow: 0 4px 14px rgba(11, 110, 122, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.modal .profile-block textarea {
  width: 100%;
  margin-top: 4px;
  margin-bottom: 8px;
}

.modal .profile-block > label {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-slate);
}
.profile-block h4 { margin: 0 0 10px; color: var(--brand-ink); }
.edit-form-body .profile-block {
  background: #fff;
  border: 1px solid var(--brand-line);
  border-radius: 16px;
  padding: 16px 16px 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.modal input[readonly],
.modal textarea[readonly] {
  background: #f3f7fa;
  color: var(--brand-slate);
}
.bio-subtitle {
  margin: 14px 0 8px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--brand-slate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.linked-parent-box {
  background: rgba(11, 110, 122, 0.08);
  border: 1px solid rgba(11, 110, 122, 0.18);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}
.profile-block textarea { width: 100%; margin-top: 10px; resize: vertical; }

.children-list {
  background: #f3f8fb; border: 1px solid var(--brand-line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 10px;
}

.children-list .child-row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--brand-line);
  color: var(--brand-ink);
}

.children-list .child-row:last-child { border-bottom: none; }
.small { font-size: 0.8rem; margin: 6px 0 0; }

.tab > h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--brand-ink);
}

@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
  .content { padding: 24px 20px 36px; }
  :root { --sidebar-w: 240px; }
  .sidebar nav button,
  .sidebar nav a.nav-link { font-size: 0.84rem; padding: 10px 10px; }
}

@media (max-width: 960px) {
  html, body { overflow-x: hidden; }
  .mobile-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 40;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: linear-gradient(180deg, #0b1220 0%, #0b1b2b 100%);
    color: #e8f1f5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(11, 27, 43, 0.18);
  }
  .mobile-bar-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .mobile-bar-text strong {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-bar-text span {
    font-size: 0.72rem;
    color: rgba(234, 241, 245, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-bar-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    margin: 0;
    flex-shrink: 0;
  }
  .nav-toggle {
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    display: grid;
    place-content: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: none;
  }
  .nav-toggle:hover { filter: none; transform: none; background: rgba(255, 255, 255, 0.14); }
  .nav-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: #e8f1f5;
  }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(11, 27, 43, 0.48);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .app.nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    font-size: 1.4rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e8f1f5;
    border-radius: 10px;
  }
  .sidebar-close:hover { filter: none; transform: none; background: rgba(255, 255, 255, 0.16); }

  .app {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    min-height: 100dvh;
  }
  .app > .content,
  .app > #page-content,
  .app > .sidebar,
  .app > .mobile-bar,
  .app > .nav-backdrop {
    grid-column: auto;
    grid-row: auto;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 80;
    width: min(300px, 86vw);
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.26s ease;
    box-shadow: 16px 0 40px rgba(11, 27, 43, 0.28);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .sidebar nav button:hover,
  .sidebar nav a.nav-link:hover { transform: none; }
  .content {
    width: 100%;
    max-width: none;
    padding: 16px 14px calc(28px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  .dash-header { flex-direction: column; align-items: stretch; }
  .dash-header h2 { font-size: 1.32rem; }
  .dash-date { width: 100%; text-align: center; white-space: normal; }
  .dash-banner { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-num { font-size: 1.45rem; }
  .edit-photo-row { flex-direction: column; align-items: flex-start; }
  .schedule-grid-wrap { overflow-x: auto; }
  .panel { padding: 14px; }
  .modal { padding: 10px; align-items: end; }
  .modal-card,
  .modal-card-edit,
  .modal-card-wide,
  .photo-crop-card {
    width: 100%;
    max-height: min(92dvh, 920px);
    border-radius: 18px 18px 12px 12px;
  }
  .academic-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .academic-nav-btn { flex: 0 0 auto; }
  .att-toolbar-card { flex-direction: column; align-items: stretch; }
  .att-segment { width: 100%; }
  .att-type-btn { flex: 1; }
  .att-toolbar-card select { width: 100%; }
  .att-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .att-date-card { width: 100%; min-width: 0; }
  .feed-phone-column { align-items: center; }
  .feed-phone-device { width: min(100%, 340px); margin: 0 auto; }
  .users-table .users-person-id { font-size: 0.72rem; }
  body.nav-locked { overflow: hidden; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .login-wrap { padding: 16px; }
  .login-card { padding: 24px 18px; }
  .ach-form-row { grid-template-columns: 1fr; }
  .btn-primary { width: 100%; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; min-width: 0; }
}

/* ── Akademik ── */
.academic-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.academic-nav-btn {
  width: auto;
  margin: 0;
  padding: 10px 16px;
  font-size: 0.85rem;
  background: var(--brand-surface);
  color: var(--brand-slate);
  border: 1px solid var(--brand-line);
  box-shadow: var(--shadow-sm);
}

.academic-nav-btn.active {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-teal-dark));
  color: #fff;
  border-color: transparent;
}

.academic-panel h3 { color: var(--brand-ink); }

.schedule-grid-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  background: #f8fbfd;
}

.schedule-grid {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.schedule-grid th,
.schedule-grid td {
  border: 1px solid var(--brand-line);
  padding: 6px;
  vertical-align: top;
  background: var(--brand-surface);
}

.schedule-grid th {
  background: #eef4f8;
  font-weight: 700;
  text-align: center;
  font-size: 0.75rem;
}

.schedule-grid .time-col {
  width: 88px;
  text-align: center;
  font-weight: 600;
  color: var(--brand-teal-dark);
  background: #f3f8fb;
}

.schedule-grid input,
.schedule-grid select {
  padding: 6px 8px;
  font-size: 0.78rem;
  margin: 0;
  border-radius: 8px;
}

.schedule-grid input { margin-bottom: 4px; }

.btn-danger {
  background: rgba(180, 35, 24, 0.12);
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.25);
  padding: 6px 10px;
  font-size: 0.78rem;
  width: auto;
  margin: 0;
}

.btn-danger:hover { filter: none; background: rgba(180, 35, 24, 0.2); }

.badge-ok {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(21, 128, 61, 0.12);
  color: #15803d;
}

.badge-warn {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

.att-page-head { align-items: flex-start; }

.att-date-card {
  min-width: 240px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.att-date-card label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.att-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.att-date-row input[type="date"] {
  margin: 0;
  min-height: 42px;
  flex: 1;
  min-width: 0;
}

.att-date-row .btn-ghost {
  margin: 0;
  min-height: 42px;
  padding: 0 12px;
  white-space: nowrap;
}

.att-date-label {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-slate);
}

.att-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.att-summary-card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.att-summary-card strong {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--brand-ink);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-summary-card span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.att-summary-card[data-tone="teal"] { border-top: 3px solid var(--brand-teal); }
.att-summary-card[data-tone="mint"] { border-top: 3px solid var(--brand-mint); }
.att-summary-card[data-tone="gold"] { border-top: 3px solid var(--brand-gold); }
.att-summary-card[data-tone="slate"] { border-top: 3px solid var(--brand-slate); }

.att-toolbar-card {
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.att-segment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f0f6fa;
  border-radius: 12px;
  flex-shrink: 0;
}

.att-type-btn {
  margin: 0;
  width: auto;
  border: none;
  background: transparent;
  color: var(--brand-slate);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

.att-type-btn:hover {
  filter: none;
  transform: none;
  background: rgba(255, 255, 255, 0.7);
}

.att-type-btn.active {
  background: #fff;
  color: var(--brand-teal-dark);
  box-shadow: var(--shadow-sm);
}

.att-toolbar-card select {
  width: auto;
  min-width: 168px;
  margin: 0;
  min-height: 42px;
}

.att-table-wrap {
  margin-top: 0;
  max-height: min(68vh, 720px);
}

.att-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f0f6fa;
}

.att-table th:nth-child(3),
.att-table td:nth-child(3) { width: 120px; }

.att-table th:nth-child(4),
.att-table td:nth-child(4) { width: 120px; }

.att-table th:nth-child(5),
.att-table td:nth-child(5) {
  width: 88px;
  text-align: right;
}

.att-table td { vertical-align: middle; }

.att-class-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(11, 110, 122, 0.1);
  color: #0a5a63;
}

.att-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.att-status-pill[data-tone="hadir"] { background: rgba(21, 128, 61, 0.12); color: #15803d; }
.att-status-pill[data-tone="izin"] { background: rgba(196, 164, 106, 0.22); color: #8a6a2a; }
.att-status-pill[data-tone="sakit"] { background: rgba(43, 184, 200, 0.16); color: #0b6e7a; }
.att-status-pill[data-tone="alfa"] { background: rgba(180, 35, 24, 0.12); color: #b42318; }
.att-status-pill[data-tone="dispen"] { background: rgba(61, 81, 99, 0.12); color: #3d5163; }

.att-note {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--brand-muted);
}

.att-time {
  display: block;
  font-weight: 800;
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
}

.att-time-zone {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.att-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--brand-line);
  display: block;
  margin-left: auto;
}

.att-photo-link {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: auto;
  cursor: zoom-in;
  display: inline-flex;
}

.att-photo-link:hover {
  filter: none;
  transform: none;
}

.att-photo-link:hover .att-thumb {
  box-shadow: 0 0 0 3px rgba(43, 184, 200, 0.28);
}

.att-photo-none {
  font-size: 0.78rem;
  color: var(--brand-muted);
}

.att-empty {
  background: var(--brand-surface);
  border: 1px dashed var(--brand-line);
  border-radius: var(--radius-md);
  padding: 48px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.att-empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(11, 110, 122, 0.1);
  color: var(--brand-teal);
}

.att-empty-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.att-empty h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.att-empty p { margin: 0; }

.att-photo-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.att-photo-modal.hidden { display: none; }

.att-photo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 27, 43, 0.72);
}

.att-photo-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 480px);
  background: var(--brand-surface);
  border-radius: 18px;
  padding: 12px 12px 14px;
  box-shadow: var(--shadow-lg);
}

.att-photo-dialog img {
  width: 100%;
  max-height: min(68vh, 560px);
  object-fit: contain;
  border-radius: 12px;
  display: block;
  background: #0b1b2b;
}

.att-photo-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 6px 2px;
}

.att-photo-meta strong {
  font-size: 0.95rem;
  color: var(--brand-ink);
}

.att-photo-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  border: none;
  background: rgba(11, 27, 43, 0.62);
  color: #fff;
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.att-photo-close:hover { filter: none; transform: none; background: rgba(11, 27, 43, 0.82); }

/* ——— Feed / Post Beranda ——— */
.feed-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.feed-stats-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.feed-stat-pill {
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-slate);
}

.feed-stat-pill strong {
  color: var(--brand-teal-dark);
  margin-right: 4px;
}

.feed-composer {
  padding: 20px;
  margin-bottom: 16px;
}

.feed-workspace {
  display: grid;
  grid-template-columns: 340px minmax(300px, 1fr) minmax(260px, 320px);
  gap: 20px;
  margin-top: 8px;
  align-items: start;
}

.feed-phone-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-admin-column {
  flex: 1;
  min-width: 0;
  max-width: none;
}

.feed-side-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-side-column .panel {
  margin: 0;
  padding: 16px;
}

.feed-side-column h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
}

.feed-insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.feed-insight-item {
  background: linear-gradient(180deg, #f4fafb 0%, #eef6f8 100%);
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}

.feed-insight-item strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-ink);
  line-height: 1.1;
}

.feed-insight-item span {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.feed-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 340px;
  overflow-y: auto;
}

.feed-recent-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px;
  text-align: left;
  background: #f6fafc;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  color: inherit;
  cursor: pointer;
  font-weight: 500;
  box-shadow: none;
}

.feed-recent-item:hover {
  background: #eef7f9;
  transform: none;
  filter: none;
}

.feed-recent-item strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--brand-ink);
}

.feed-recent-item span {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--brand-muted);
}

.feed-guide-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--brand-slate);
  line-height: 1.45;
}

.feed-guide-list li + li { margin-top: 8px; }
.feed-guide-list strong { color: var(--brand-ink); }

.feed-phone-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--brand-slate);
}

.feed-phone-device {
  width: 340px;
  border-radius: 32px;
  background: linear-gradient(160deg, #1a2332 0%, #0f1623 100%);
  padding: 10px 10px 14px;
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.feed-phone-notch {
  width: 96px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin: 4px auto 10px;
}

.feed-phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 10px;
  color: #fff;
  font-size: 0.82rem;
}

.feed-phone-header strong {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.feed-phone-screen {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  max-height: min(72vh, 640px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 110, 122, 0.35) transparent;
}

.feed-phone-screen::-webkit-scrollbar {
  width: 5px;
}

.feed-phone-screen::-webkit-scrollbar-thumb {
  background: rgba(11, 110, 122, 0.35);
  border-radius: 999px;
}

.feed-phone-bar {
  width: 110px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 12px auto 0;
}

.feed-phone-empty {
  text-align: center;
  padding: 48px 20px;
  font-size: 0.85rem;
  color: var(--brand-slate);
}

.feed-admin-hint {
  padding: 16px 18px;
}

.feed-hint-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.feed-hint-list li + li {
  margin-top: 6px;
}

.feed-avatar-sm,
.feed-avatar-fallback.feed-avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 0.82rem;
}

.feed-composer-head {
  margin-bottom: 14px;
}

.feed-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2eef5;
  border: 2px solid rgba(11, 110, 122, 0.15);
  flex-shrink: 0;
}

.feed-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0B6E7A, #2BB8C8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.feed-author-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.feed-author-name {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--brand-ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.feed-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1d9bf0;
  color: #fff;
  flex-shrink: 0;
}

.feed-verified svg {
  width: 10px;
  height: 10px;
}

.feed-composer textarea {
  width: 100%;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 96px;
  background: #fafcfd;
}

.feed-composer-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--brand-line);
}

.feed-media-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  cursor: pointer;
}

.feed-media-btn svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.feed-audience-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--brand-line);
}

.feed-audience-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.feed-audience-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feed-aud-chip {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--brand-line);
  background: #edf4f8;
  color: var(--brand-teal-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.feed-aud-chip svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.feed-aud-chip.active {
  background: rgba(11, 110, 122, 0.14);
  border-color: rgba(11, 110, 122, 0.45);
  color: var(--brand-teal-dark);
  box-shadow: 0 0 0 2px rgba(43, 184, 200, 0.18);
}

.feed-aud-chip:hover {
  transform: translateY(-1px);
}

.feed-audience-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.feed-aud-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(11, 110, 122, 0.1);
  border: 1px solid rgba(11, 110, 122, 0.18);
  color: var(--brand-teal-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feed-aud-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.feed-audience-select {
  flex: 1;
  min-width: 160px;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-line);
  background: #fff;
  font-family: inherit;
  font-size: 0.88rem;
}

.feed-publish-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #0B6E7A, #2BB8C8);
  border: none;
  color: #fff;
  font-weight: 800;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  width: auto;
  box-shadow: 0 4px 14px rgba(11, 110, 122, 0.25);
}

.feed-publish-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feed-card {
  background: #fff;
  border: none;
  border-bottom: 1px solid var(--brand-line);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.feed-card:last-child {
  border-bottom: none;
}

.feed-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 0;
}

.feed-card-body {
  padding: 8px 12px 0;
}

.feed-card-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: 0.82rem;
}

.feed-card-media {
  margin: 8px 0 0;
  border-radius: 0;
  overflow: hidden;
  border: none;
  width: 100%;
  aspect-ratio: var(--media-aspect, 0.8);
  background: #111827;
}

.feed-card-media img,
.feed-card-media video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  background: #111827;
}

.feed-card-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-top: none;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--brand-slate);
}

.feed-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.feed-stat svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  opacity: 0.75;
}

.feed-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 10px;
  flex-wrap: wrap;
}

.feed-audience-badge {
  display: inline-flex;
  align-items: center;
  padding: 0;
  background: transparent;
  border: none;
  margin-top: 0;
  flex-shrink: 0;
}

.feed-btn-comments {
  background: #edf4f8;
  color: var(--brand-teal-dark);
  border: 1px solid var(--brand-line);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  width: auto;
}

.feed-btn-delete-post {
  background: transparent;
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.22);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  width: auto;
  margin-left: auto;
}

.feed-phone-screen .feed-author-name {
  font-size: 0.84rem;
}

.feed-phone-screen .feed-author-role {
  font-size: 0.72rem;
}

.feed-btn-comments.active {
  background: rgba(43, 184, 200, 0.15);
  border-color: rgba(11, 110, 122, 0.35);
}

.feed-btn-delete-post:hover {
  background: rgba(180, 35, 24, 0.06);
}

.feed-comments {
  border-top: 1px solid var(--brand-line);
  background: #f8fbfc;
  padding: 10px 12px 12px;
}

.feed-comment-avatar {
  width: 28px;
  height: 28px;
}

.feed-comment-name {
  font-size: 0.78rem;
}

.feed-comment-text {
  font-size: 0.8rem;
}

.feed-comment-replies {
  margin-left: 34px;
}

@media (max-width: 1180px) {
  .feed-workspace {
    grid-template-columns: 340px minmax(0, 1fr);
  }
  .feed-side-column {
    grid-column: 2;
  }
}

@media (max-width: 960px) {
  .feed-workspace {
    flex-direction: column;
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .feed-phone-column {
    align-items: flex-start;
  }

  .feed-phone-device {
    width: min(340px, 100%);
  }

  .feed-admin-column {
    max-width: none;
  }

  .feed-side-column {
    grid-column: auto;
  }
}

.feed-comments.hidden {
  display: none;
}

.feed-comments-loading {
  font-size: 0.88rem;
  color: var(--brand-slate);
  padding: 8px 0;
}

.feed-comment {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.feed-comment:last-child {
  border-bottom: none;
}

.feed-comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2eef5;
}

.feed-comment-body {
  flex: 1;
  min-width: 0;
}

.feed-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.feed-comment-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.feed-comment-role {
  font-size: 0.75rem;
  color: var(--brand-slate);
}

.feed-comment-time {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: auto;
}

.feed-comment-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--brand-slate);
}

.feed-comment-replies {
  margin-left: 46px;
  padding-left: 12px;
  border-left: 2px solid rgba(11, 110, 122, 0.15);
}

.feed-btn-delete-comment {
  background: transparent;
  border: none;
  color: #b42318;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  width: auto;
  margin: 0;
}

.feed-btn-delete-comment:hover {
  background: rgba(180, 35, 24, 0.08);
}

.feed-comments-empty {
  font-size: 0.88rem;
  color: var(--brand-slate);
  text-align: center;
  padding: 12px 0;
}

/* SPPG / MBG */
.sppg-orgs-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.sppg-org-card {
  background: var(--surface, #fff);
  border: 1px solid rgba(11, 110, 122, 0.14);
  border-radius: 14px;
  padding: 14px 16px;
}

.sppg-org-card.active {
  border-color: rgba(11, 110, 122, 0.45);
  box-shadow: 0 0 0 2px rgba(11, 110, 122, 0.12);
}

.sppg-org-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sppg-schools-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 4px;
}

.sppg-school-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid rgba(11, 110, 122, 0.12);
  border-radius: 10px;
  background: rgba(11, 110, 122, 0.03);
  cursor: pointer;
}

.sppg-school-check input {
  margin-top: 3px;
  width: auto;
}

.sppg-school-check small {
  display: block;
  color: var(--brand-slate, #5a6b75);
  margin-top: 2px;
}

.btn-sm {
  width: auto;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(11, 110, 122, 0.2);
  color: var(--brand-teal, #0B6E7A);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  width: auto;
}

.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.check-inline input {
  width: auto;
}

.sppg-pos-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-slate, #5a6b75);
}

.sppg-pos-label select {
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(11, 110, 122, 0.2);
  background: #fff;
}

