/* ============================================================
   Login & CRUD — light admin theme
   Font: Plus Jakarta Sans (self-hosted, variable 400–700)
   ============================================================ */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f5fb;
  --bg-deep: #ffffff;
  --card: #ffffff;
  --line: #cbd5e1;
  --line-soft: #e2e8f0;
  --text: #0f172a;
  --muted: #5c6b82;
  --accent: #38bdf8;
  --accent-deep: #0369a1;
  --accent-ink: #082f49;
  --danger: #dc2626;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.view { min-height: 100vh; }

[hidden] { display: none !important; }

.muted { color: var(--muted); font-size: 13px; }

code {
  font-family: var(--mono);
  background: var(--card);
  border: 1px solid var(--line-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ============================================================
   LOGIN — split layout
   ============================================================ */

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

/* ---------- left: brand panel ---------- */

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  background-color: var(--bg-deep);
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.18) 1px, transparent 1px);
  background-size: 44px 44px;
  border-right: 1px solid var(--line-soft);
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  top: -180px;
  left: -120px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 65%);
  pointer-events: none;
}

.brand-inner { position: relative; max-width: 440px; margin-top: 8vh; }

.brand-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--accent-deep);
  border: 1px solid rgba(3, 105, 161, 0.35);
  border-radius: 999px;
  padding: 5px 12px;
}

.login-brand h2 {
  margin: 24px 0 14px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  text-wrap: pretty;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 40ch;
}

.brand-terminal {
  margin-top: 36px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  max-width: 420px;
}

.term-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.term-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}

.term-bar span:first-child { background: #f87171; }
.term-bar span:nth-child(2) { background: #fbbf24; }
.term-bar span:last-child { background: #34d399; }

.brand-terminal pre {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
  white-space: pre-wrap;
}

.term-prompt { color: var(--accent); }

.brand-foot {
  position: relative;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- right: form panel ---------- */

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-box {
  width: 100%;
  max-width: 380px;
  animation: rise 0.45s ease both;
}

.login-brand .brand-inner,
.login-brand .brand-foot { animation: rise 0.45s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 36px;
}

.logo-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--accent);
}

.login-box h1 {
  margin: 14px 0 6px;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-box .muted { margin: 0 0 28px; }

.login-box label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 16px;
}

.login-box input {
  width: 100%;
  margin-top: 7px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-box input::placeholder { color: #5c6b82; }

.login-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3);
}

.pw-wrap { position: relative; display: block; }

.pw-wrap input { padding-right: 46px; }

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.pw-toggle:hover { color: var(--text); background: rgba(148, 163, 184, 0.12); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.pw-toggle .eye-closed { display: none; }
.pw-wrap.show .eye-open { display: none; }
.pw-wrap.show .eye-closed { display: block; }

.form-error {
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: 9px;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.28);
  color: #b91c1c;
  font-size: 13.5px;
}

.login-box.shake { animation: shake 0.38s ease; }

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.btn {
  padding: 11px 18px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}

.btn:hover { border-color: var(--accent); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

#login-btn {
  width: 100%;
  height: 46px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

#login-btn:hover { background: #66c9f9; border-color: #66c9f9; }

#login-btn:disabled { opacity: 0.7; cursor: default; }

#login-btn.loading::before {
  content: '';
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(8, 47, 73, 0.3);
  border-top-color: var(--accent-ink);
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hint { color: var(--muted); font-size: 12.5px; margin-top: 22px; text-align: center; }

@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   DASHBOARD
   ============================================================ */

/* ============================================================
   APP SHELL — sidebar + topbar + konten + footer
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}

.app.rail { grid-template-columns: 72px minmax(0, 1fr); }

/* ---------- sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px 14px;
  background: var(--bg-deep);
  border-right: 1px solid var(--line-soft);
  z-index: 40;
}

/* ---------- rail sidebar (desktop) ---------- */

.app.rail .side-brand-text,
.app.rail .side-label,
.app.rail .nav-item > span,
.app.rail .side-user-meta,
.app.rail .btn.logout > span { display: none; }

.app.rail .side-brand,
.app.rail .nav-item,
.app.rail .side-user { justify-content: center; }
.app.rail .side-brand { padding: 0; }
.app.rail .sidebar { padding-inline: 10px; }

.app.rail .nav-item[data-tip],
.app.rail .btn.logout { position: relative; }

.app.rail [data-tip]:hover::after,
.app.rail [data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  z-index: 60;
  pointer-events: none;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}

.side-brand-text em { font-style: normal; color: var(--accent-deep); }

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted);
  padding: 0 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  border-radius: 9px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg { flex: 0 0 auto; }

.nav-item:hover { background: rgba(148, 163, 184, 0.09); color: var(--text); }

.nav-item.active {
  background: rgba(56, 189, 248, 0.1);
  color: var(--text);
}

.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(241, 245, 249, 0.9);
  min-width: 0;
}

.side-user-meta { display: flex; flex-direction: column; min-width: 0; }

.side-user-meta strong {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-user-meta .muted { font-size: 11.5px; }

.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #0b1220;
  font-weight: 700;
  font-size: 13.5px;
}

.avatar.top { width: 30px; height: 30px; font-size: 12px; }

/* menu akun di bawah avatar topbar */
.avatar-wrap { position: relative; display: flex; align-items: center; }

.avatar-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 168px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  z-index: 50;
}

.avatar-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.avatar-menu .menu-item:hover { background: rgba(148, 163, 184, 0.14); }

.avatar-menu .menu-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* logo sebagai pintu masuk halaman Profil */
.side-user[role='button'],
.avatar[role='button'] { cursor: pointer; }

.side-user[role='button']:hover { border-color: var(--accent); }

.avatar[role='button']:hover,
.avatar[role='button']:focus-visible,
.side-user[role='button']:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn.logout { display: flex; align-items: center; justify-content: center; gap: 8px; background: transparent; }
.btn.logout:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- app-main + topbar ---------- */

.app-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }

.icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover { border-color: var(--accent); }

/* tombol rail hanya untuk desktop; ≤900px hamburger yang berperan */
#sidebar-toggle { display: inline-flex; }

.crumb {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mono { font-family: var(--mono); }

.clock {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.search-top { position: relative; display: flex; align-items: center; min-width: 0; }

.search-top svg {
  position: absolute;
  left: 11px;
  color: var(--muted);
  pointer-events: none;
}

.search-top input {
  width: 312px;
  max-width: 34vw;
  padding: 9px 12px 9px 33px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-top input::placeholder { color: #5c6b82; }

.search-top input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3);
}

/* ---------- konten ---------- */

.content {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 24px 40px;
  flex: 1;
}

/* ---------- footer ---------- */

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 24px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  color: var(--muted);
}

.foot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

/* ---------- backdrop (mobile) ---------- */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 35;
  animation: fade 0.2s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar h2 { margin: 0; font-size: 18px; }

.toolbar .btn.primary { width: auto; }

.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.table th {
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.table tbody tr { transition: background 0.12s ease; }

.table tbody tr:hover { background: rgba(56, 189, 248, 0.05); }

.table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.badge.admin { border-color: var(--accent-deep); color: var(--accent-deep); }

.row-actions { display: flex; gap: 8px; }
.row-actions .btn { padding: 6px 10px; font-size: 13px; }

.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }

.error { color: var(--danger); font-size: 13px; margin: 8px 0 0; }

/* ============================================================
   MODAL
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  width: 460px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.modal h3 { margin-top: 0; }

.modal label {
  display: block;
  font-size: 13px;
  margin-bottom: 14px;
  color: var(--muted);
}

.modal input, .modal select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.modal input:focus, .modal select:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.modal-actions .btn.primary { width: auto; }

@media (max-width: 640px) {
  .table-wrap { overflow-x: auto; }
  .topbar { padding: 14px 16px; }
  .toolbar { flex-wrap: wrap; gap: 12px; }
  .filters { width: 100%; }
  .filters input[type='search'] { flex: 1 1 100%; width: auto; min-width: 0; }
}

/* ============================================================
   DASHBOARD — monitoring ganti KWH meter
   ============================================================ */

/* ---------- transisi panel + indikator menu aktif ---------- */

.panel-enter { animation: panelEnter 0.18s ease both; }

@keyframes panelEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #6366f1, #38bdf8);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
}

.nav-item.active svg { color: var(--accent-deep); }

/* ---------- kartu statistik ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--tone, var(--line));
  opacity: 0.85;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line);
}

.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.stat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
}

.stat-chip {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--tone-soft, rgba(148, 163, 184, 0.12));
  color: var(--tone, var(--muted));
  flex: 0 0 auto;
}

.stat-value {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-meta { font-size: 12px; color: var(--muted); }

.tone-total   { --tone: #818cf8; --tone-soft: rgba(129, 140, 248, 0.14); }
.tone-belum   { --tone: #fbbf24; --tone-soft: rgba(251, 191, 36, 0.13); }
.tone-proses  { --tone: #38bdf8; --tone-soft: rgba(56, 189, 248, 0.13); }
.tone-sudah   { --tone: #34d399; --tone-soft: rgba(52, 211, 153, 0.13); }

/* kontras ikon chip: keempat nada dibuat lebih gelap supaya terbaca di atas latar chip terang */
.tone-total  .stat-chip { color: #6366f1; }
.tone-belum  .stat-chip { color: #b45309; }
.tone-proses .stat-chip { color: #0369a1; }
.tone-sudah  .stat-chip { color: #047857; }

.stat-value.amber { color: #d97706; }
.stat-value.sky { color: var(--accent-deep); }
.stat-value.green { color: #059669; }

/* ---------- progress ---------- */

.progress-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.progress-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.progress-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.progress-head strong {
  color: var(--accent-deep);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.progress {
  height: 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 0.6s ease;
}

/* ---------- filter ---------- */

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filters input[type='search'],
.filters select {
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filters input[type='search'] { width: 265px; }

.filters input::placeholder { color: #5c6b82; }

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3);
}

.filters .btn.primary { width: auto; }

/* ---------- badge status ---------- */

.badge.belum {
  border-color: rgba(180, 83, 9, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.badge.proses {
  border-color: rgba(3, 105, 161, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-deep);
}

.badge.sudah {
  border-color: rgba(4, 120, 87, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

/* ---------- tabel meter ---------- */

.num {
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
}

.empty {
  text-align: center;
  padding: 36px 16px !important;
  color: var(--muted);
}

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================================
   SHELL RESPONSIF — sidebar off-canvas di layar kecil
   ============================================================ */

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 264px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 24px 0 48px rgba(15, 23, 42, 0.16);
  }

  .sidebar.open { transform: none; }

  .sidebar-backdrop { display: block; }

  .app.rail { grid-template-columns: minmax(0, 1fr); }

  .icon-btn { display: inline-flex; }

  #sidebar-toggle { display: none; }

  .content { padding: 20px 14px 32px; }

  .topbar { padding: 10px 14px; gap: 10px; }

  .crumb { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .app { transition: none; }
}

@media (max-width: 640px) {
  .clock { display: none; }
  .search-top input { width: 160px; }
  .app-footer { justify-content: center; text-align: center; }
}

/* ---------- panel profil (tab Profil) ---------- */

#panel-profil .toolbar h2 { font-size: 20px; letter-spacing: -0.01em; }
.toolbar-sub { margin: 5px 0 0; font-size: 13px; color: var(--muted); }

/* hero identitas */
.profil-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 16px;
  padding: 26px 28px;
  border-radius: 18px;
  background: linear-gradient(115deg, #0f172a 0%, #12324f 55%, #0369a1 135%);
  color: #e2e8f0;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(320px 170px at 88% -35%, rgba(56, 189, 248, 0.38), transparent 70%),
    radial-gradient(260px 150px at 6% 135%, rgba(99, 102, 241, 0.32), transparent 70%);
}

.profil-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #0b1220;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16), 0 12px 26px rgba(2, 132, 199, 0.4);
}

.hero-id { position: relative; min-width: 0; }

.hero-id h3 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: -0.015em;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-meta {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 13px;
}

.hero-meta .badge.role {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  font-weight: 600;
  text-transform: capitalize;
}

.hero-user { color: #94a3b8; }

.hero-sep { width: 1px; height: 14px; background: rgba(148, 163, 184, 0.4); }

.hero-joined { color: #94a3b8; }
.hero-joined strong { color: #e2e8f0; font-weight: 600; }

/* kartu form */
.profil-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.profil-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 20px 22px 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.profil-card:hover {
  transform: translateY(-2px);
  border-color: #dbe4ef;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.card-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-deep);
}

.card-head h3 { margin: 0; font-size: 15.5px; letter-spacing: -0.01em; }
.card-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }

.profil-card form { display: grid; gap: 13px; }

.profil-card label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}

.profil-card input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--line-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.profil-card input::placeholder { color: #9aa8bd; }

.profil-card input:hover { border-color: var(--line); }

.profil-card input:focus {
  outline: none;
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(56, 189, 248, 0.22);
}

#panel-profil .btn.primary {
  width: auto;
  justify-self: start;
  margin-top: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

#panel-profil .btn.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.34);
}

#panel-profil .btn.primary:active { transform: translateY(0); }

@media (max-width: 560px) {
  .profil-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
  }
  .profil-card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .profil-card,
  #panel-profil .btn.primary { transition: none; }
  .profil-card:hover,
  #panel-profil .btn.primary:hover { transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  #panel-profil.panel-enter .profil-hero { animation: profilIn 0.26s ease backwards; }
  #panel-profil.panel-enter .profil-card { animation: profilIn 0.26s ease backwards; }
  #panel-profil.panel-enter .profil-card:nth-child(2) { animation-delay: 0.07s; }
}

@keyframes profilIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}


/* ---------- rekap blokir ---------- */
.badge.diblokir {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}
.badge.dibuka {
  border-color: rgba(4, 120, 87, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}
.tone-diblokir {
  --tone: #f87171;
  --tone-soft: rgba(248, 113, 113, 0.14);
}
.tone-dibuka {
  --tone: #34d399;
  --tone-soft: rgba(52, 211, 153, 0.13);
}
.stats.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#st-block-amount {
  font-size: 30px;
}
.row-actions .btn {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .stats.three {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .stats.three {
    grid-template-columns: 1fr;
  }
  #st-block-amount {
    font-size: 26px;
  }
}

/* cetak rekap blokir */
@media print {
  .sidebar,
  .topbar,
  .sidebar-backdrop,
  .avatar-wrap,
  .filters,
  .row-actions {
    display: none !important;
  }
  .app {
    display: block !important;
    padding: 0 !important;
  }
  .content {
    padding: 0 !important;
  }
  .table-wrap {
    overflow: visible !important;
  }
  .stats {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  body {
    background: #fff !important;
  }
}
