/* ==========================================================================
   RSKTM Parking System — tema VibeCoder (indigo/violet, glassmorphic)
   ========================================================================== */

:root {
  --ink: #1F1B3A;
  --ink-2: #635F82;
  --ink-3: #8B87A8;
  --indigo: #4F46E5;
  --violet: #8B5CF6;
  --skey: #38BDF8;
  --pink: #EC4899;
  --ok: #16A34A;
  --warn: #D97706;
  --bad: #DC2626;
  --radius: 18px;
  --radius-sm: 12px;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 40px -20px rgba(79, 70, 229, 0.35);
  --shadow-sm: 0 8px 20px -12px rgba(79, 70, 229, 0.35);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(165deg, #F3F0FF 0%, #FAF8FF 45%, #F1EEFF 100%);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.text-bad { color: var(--bad); font-weight: 600; }
.text-warn { color: var(--warn); font-weight: 600; }

/* ---------- Latar dekoratif ---------- */
.bg-decor { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-decor span { position: absolute; display: block; border-radius: 50%; filter: blur(90px); opacity: .55; }
.bg-decor .b1 { width: 460px; height: 460px; background: #A5B4FC; top: -140px; left: -120px; }
.bg-decor .b2 { width: 420px; height: 420px; background: #F9A8D4; top: 10%; right: -160px; opacity: .4; }
.bg-decor .b3 { width: 520px; height: 520px; background: #7DD3FC; bottom: -220px; left: 25%; opacity: .35; }

/* ---------- Kartu kaca ---------- */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  margin-bottom: 24px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.sub-head { margin: 22px 0 12px; color: var(--ink-2); text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }

/* ---------- Topbar ---------- */
.topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 26px;
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff; font-weight: 700; font-size: 19px;
  display: grid; place-items: center;
  box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .8);
  flex: 0 0 auto;
}
.brand-mark.big { width: 52px; height: 52px; border-radius: 16px; font-size: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; }
.brand-text small { color: var(--ink-2); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { font-weight: 600; font-size: 14px; }

.pill {
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: linear-gradient(135deg, rgba(79, 70, 229, .14), rgba(139, 92, 246, .18));
  color: var(--indigo);
}

/* ---------- Kerangka ---------- */
.shell {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 240px minmax(0, 1fr);
  gap: 26px; padding: 26px; max-width: 1500px; margin: 0 auto;
  align-items: start;
}
.sidebar {
  position: sticky; top: 20px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 550; font-size: 14px;
}
.nav-item:hover { background: rgba(79, 70, 229, .08); text-decoration: none; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, .16), rgba(139, 92, 246, .18));
  color: var(--indigo);
}
.nav-ikon { width: 20px; text-align: center; opacity: .8; font-size: 15px; }
.nav-label { flex: 1; }
.badge-count {
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center;
  padding: 0 6px;
}
.sidebar-foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(31, 27, 58, .08); }

.content { min-width: 0; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: 26px; flex-wrap: wrap;
}
.page-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.page-aksi { display: flex; gap: 10px; flex-wrap: wrap; }

.foot {
  position: relative; z-index: 2;
  text-align: center; color: var(--ink-2); font-size: 12.5px;
  padding: 8px 26px 34px;
}
.foot .dot { margin: 0 8px; opacity: .5; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff; box-shadow: 0 12px 26px -14px rgba(79, 70, 229, .9);
}
.btn-ghost {
  background: rgba(255, 255, 255, .65);
  border-color: rgba(79, 70, 229, .22);
  color: var(--indigo);
}
.btn-ghost:hover { background: rgba(79, 70, 229, .1); }
.btn-danger { background: rgba(220, 38, 38, .1); color: var(--bad); border-color: rgba(220, 38, 38, .25); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.link-btn {
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--indigo); font: inherit; font-weight: 600;
  text-decoration: underline; cursor: pointer;
}
.inline-form { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- Peringatan ---------- */
.alert {
  border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 20px;
  font-size: 14px; border: 1px solid transparent;
  background: rgba(255, 255, 255, .7);
}
.alert.big { padding: 18px 20px; font-size: 15px; }
.alert-ok { background: rgba(22, 163, 74, .1); border-color: rgba(22, 163, 74, .25); color: #14532D; }
.alert-bad { background: rgba(220, 38, 38, .1); border-color: rgba(220, 38, 38, .25); color: #7F1D1D; }
.alert-warn { background: rgba(217, 119, 6, .12); border-color: rgba(217, 119, 6, .28); color: #7C2D12; }
.alert-info { background: rgba(79, 70, 229, .1); border-color: rgba(79, 70, 229, .2); color: #312E81; }

/* ---------- Statistik ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; margin-bottom: 24px;
}
.card.stat { margin-bottom: 0; display: flex; flex-direction: column; gap: 6px; }
.stat-alert { background: rgba(254, 226, 226, .55); border-color: rgba(220, 38, 38, .28); }
.stat-label { font-size: 12.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.stat-value.sm { font-size: 22px; }
.stat-value small { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.stat-foot { font-size: 13px; color: var(--ink-2); }

/* ---------- Grid umum ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack .card { margin-bottom: 0; }

/* ---------- Bar progres ---------- */
.bar-row { margin-bottom: 18px; }
.bar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 8px; }
.bar-top span { color: var(--ink-2); }
.bar { height: 10px; border-radius: 999px; background: rgba(79, 70, 229, .12); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--indigo), var(--violet)); }

.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-top: 18px; }
.mini {
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius-sm); padding: 14px;
}
.mini-label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.mini-value { font-size: 19px; font-weight: 700; }
.mini-value.sm { font-size: 16px; }

/* ---------- Pengingat ---------- */
.reminder {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .85);
  margin-bottom: 12px; flex-wrap: wrap;
}
.reminder-sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.reminder-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid rgba(31, 27, 58, .1);
  white-space: nowrap;
}
.table td { padding: 13px 12px; border-bottom: 1px solid rgba(31, 27, 58, .06); vertical-align: top; }
.table tbody tr:hover { background: rgba(79, 70, 229, .05); }
.table tfoot th { border-top: 1px solid rgba(31, 27, 58, .12); font-size: 14px; }
.row-muted { opacity: .6; }
.row-active { background: rgba(79, 70, 229, .08); }
.table input[type="date"], .table select { padding: 6px 8px; font-size: 13px; border-radius: 8px; }

/* ---------- Badge ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  background: rgba(99, 95, 130, .14); color: var(--ink-2);
}
.badge-ok { background: rgba(22, 163, 74, .14); color: #166534; }
.badge-bad { background: rgba(220, 38, 38, .14); color: #991B1B; }
.badge-warn { background: rgba(217, 119, 6, .16); color: #92400E; }
.badge-info { background: rgba(79, 70, 229, .14); color: #3730A3; }
.badge-new { background: rgba(56, 189, 248, .18); color: #075985; }
.badge-muted { background: rgba(99, 95, 130, .14); color: var(--ink-2); }

/* ---------- Peta lahan ---------- */
.lahan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.lahan {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.lahan:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 16px 30px -18px rgba(79, 70, 229, .6); }
.lahan-kosong { border-style: dashed; border-color: rgba(79, 70, 229, .3); background: rgba(255, 255, 255, .35); }
.lahan-terisi { background: linear-gradient(150deg, rgba(79, 70, 229, .1), rgba(139, 92, 246, .12)); }
.lahan-kode { font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.lahan-nama { font-size: 13.5px; font-weight: 550; }
.lahan-meta { font-size: 12px; color: var(--ink-2); }
.lahan .badge { align-self: flex-start; }

.legend { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; font-size: 13px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.dot-kosong { border: 2px dashed rgba(79, 70, 229, .5); }
.dot-terisi { background: linear-gradient(135deg, var(--indigo), var(--violet)); }

/* ---------- Rekening ---------- */
.rekening {
  background: linear-gradient(140deg, rgba(79, 70, 229, .12), rgba(139, 92, 246, .16));
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.rekening-label { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--indigo); font-weight: 700; }
.rekening-body { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; }
.rekening-bank { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rekening-nomor { font-size: 25px; font-weight: 700; letter-spacing: .02em; }
.rekening-nama { font-size: 13.5px; color: var(--ink-2); }
.rekening-note { font-size: 12.5px; color: var(--ink-2); margin: 8px 0 0; }

/* ---------- Profil / detail ---------- */
.profile-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.profile-tags { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.dl { display: block; font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.dv { display: block; font-size: 14.5px; font-weight: 600; margin-top: 2px; }

/* ---------- Form ---------- */
.form-grid { display: flex; flex-direction: column; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.form-row.three { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; font-size: 13.5px; }
.field > span { font-weight: 600; color: var(--ink-2); }
.field em { color: var(--bad); font-style: normal; }
.field input, .field select, .field textarea, .search input, .search select, .inline-label input, .inline-label select {
  font: inherit; color: var(--ink);
  padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid rgba(79, 70, 229, .2);
  background: rgba(255, 255, 255, .8);
  width: 100%;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus, .search select:focus {
  outline: none; border-color: var(--indigo); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
.hint { color: var(--ink-2); font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; margin-bottom: 16px; }
.check input { width: 18px; height: 18px; accent-color: var(--indigo); }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.info-box {
  background: rgba(255, 255, 255, .6); border: 1px solid rgba(255, 255, 255, .85);
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; color: var(--ink-2);
  margin-bottom: 18px;
}
.inline-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }

.paket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 20px; }
.paket {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 16px; border-radius: var(--radius-sm); cursor: pointer;
  background: rgba(255, 255, 255, .7); border: 1.5px solid rgba(79, 70, 229, .18);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.paket.aktif, .paket:has(input:checked) {
  border-color: var(--indigo);
  background: linear-gradient(140deg, rgba(79, 70, 229, .12), rgba(139, 92, 246, .14));
  box-shadow: var(--shadow-sm);
}
.paket input { position: absolute; opacity: 0; pointer-events: none; }
.paket-nama { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.paket-harga { font-size: 18px; font-weight: 700; }

/* ---------- Toolbar / tab ---------- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; margin-bottom: 22px;
}
.tab-group {
  display: inline-flex; gap: 4px; padding: 4px;
  background: rgba(255, 255, 255, .6); border-radius: 999px;
  border: 1px solid var(--glass-border);
}
.tab { padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.tab:hover { text-decoration: none; background: rgba(79, 70, 229, .08); }
.tab.active { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; }
.search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search input[type="text"] { min-width: 210px; }
.search select, .search input[type="month"] { width: auto; }

.empty { color: var(--ink-2); font-size: 14px; margin: 6px 0; }
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.steps li { margin-bottom: 8px; }
.steps strong { color: var(--ink); }

/* ---------- Kartu tagihan penyewa ---------- */
.tagihan-besar {
  background: rgba(255, 255, 255, .6); border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--radius-sm); padding: 20px;
}
.tagihan-periode { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.tagihan-jumlah { font-size: 32px; font-weight: 700; margin: 6px 0; letter-spacing: -0.02em; }
.tagihan-meta { font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Halaman login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 30px 20px; }
.login-wrap { position: relative; z-index: 2; width: 100%; max-width: 430px; }
.login-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 24px; padding: 34px 32px;
  box-shadow: 0 30px 60px -28px rgba(79, 70, 229, .55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
.login-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.login-brand h1 { font-size: 19px; }
.login-brand p { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; }
.login-intro { color: var(--ink-2); font-size: 13.5px; margin: 0 0 20px; }
.form-login .field { margin-bottom: 16px; }
.form-login .btn { margin-top: 6px; }
.login-info {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(31, 27, 58, .1);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.6;
}
.login-info strong { display: block; color: var(--ink); margin-bottom: 4px; }
.login-foot { text-align: center; color: var(--ink-2); font-size: 12px; margin-top: 22px; }

/* ---------- Responsif ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 18px; gap: 20px; }
  .sidebar {
    position: static; flex-direction: row; overflow-x: auto;
    gap: 4px; padding: 10px;
  }
  .nav-item { white-space: nowrap; padding: 9px 12px; }
  .nav-ikon { display: none; }
  .sidebar-foot { margin: 0; padding: 0; border: 0; }
}
@media (max-width: 620px) {
  .topbar { padding: 12px 16px; }
  .brand-text small { display: none; }
  .who { display: none; }
  h1 { font-size: 20px; }
  .card { padding: 18px; }
  .stat-value { font-size: 26px; }
  .table th, .table td { padding: 10px; }
}
