/* =========================================================
   KOS NYASRI — DESIGN SYSTEM
   Palet   : Navy dalam + Amber hangat + aksen status
   Tipe    : Poppins (display) / Inter (UI & body) / IBM Plex Mono (angka & struk)
   Konsep  : setiap "bukti" (status bayar, kuitansi) tampil sebagai
             tiket sobek bergaya struk kos — identitas berulang di seluruh app
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root{
  /* warna */
  --navy-900:#141b2e;
  --navy-800:#1e2a45;
  --navy-700:#2a3a5c;
  --navy-100:#e7ebf3;
  --amber-500:#f5a623;
  --amber-600:#dd8f0f;
  --amber-100:#fdf0d9;
  --success-600:#1f9d6c;
  --success-100:#e2f7ee;
  --danger-600:#e5484d;
  --danger-100:#fde4e4;
  --warning-600:#c97a12;
  --warning-100:#fbecd2;
  --bg:#f6f7fb;
  --surface:#ffffff;
  --line:#e6e8f0;
  --text-900:#181c26;
  --text-600:#565d6d;
  --text-400:#9aa1b1;

  /* tipografi */
  --f-display:'Poppins', sans-serif;
  --f-body:'Inter', sans-serif;
  --f-mono:'IBM Plex Mono', monospace;

  /* radius & bayangan */
  --r-lg:20px;
  --r-md:14px;
  --r-sm:10px;
  --shadow-card:0 2px 14px rgba(20,27,46,.06);
  --shadow-pop:0 10px 30px rgba(20,27,46,.18);

  --nav-h:64px;
  --bar-h:56px;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text-900);
  font-family:var(--f-body);
  -webkit-font-smoothing:antialiased;
  line-height:1.45;
}
h1,h2,h3,h4{ font-family:var(--f-display); margin:0; color:var(--navy-900); }
p{ margin:0; }
a{ color:inherit; text-decoration:none; }
button, input, select, textarea{ font-family:inherit; font-size:1rem; }
ul{ margin:0; padding:0; list-style:none; }
img{ max-width:100%; display:block; }

:focus-visible{ outline:2px solid var(--amber-500); outline-offset:2px; border-radius:6px; }

/* =========================== SHELL MOBILE-FIRST =========================== */
.app{
  max-width:480px;
  margin:0 auto;
  min-height:100vh;
  background:var(--bg);
  position:relative;
  padding-bottom:calc(var(--nav-h) + 14px);
  display:flex;
  flex-direction:column;
}

/* halaman tanpa bottom-nav (login) */
.app.no-nav{ padding-bottom:0; }

@media (min-width:481px){
  body{ background:var(--navy-900); }
  .app{ box-shadow:0 0 60px rgba(0,0,0,.35); min-height:100vh; }
}

/* =========================== TOP BAR =========================== */
.topbar{
  height:var(--bar-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 16px;
  background:var(--navy-800);
  color:#fff;
  position:sticky;
  top:0;
  z-index:20;
}
.topbar__title{ display:flex; flex-direction:column; }
.topbar__title span.eyebrow{
  font-size:.68rem; letter-spacing:.08em; text-transform:uppercase; color:var(--amber-500); font-weight:600;
}
.topbar__title strong{ font-family:var(--f-display); font-size:1.02rem; font-weight:600; }
.topbar__actions{ display:flex; align-items:center; gap:10px; }
.icon-btn{
  width:38px; height:38px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.08); border:none; color:#fff; cursor:pointer;
  position:relative; font-size:1.05rem;
}
.icon-btn:active{ background:rgba(255,255,255,.18); }
.icon-btn .dot{
  position:absolute; top:5px; right:6px;
  width:9px; height:9px; border-radius:50%;
  background:var(--danger-600); border:2px solid var(--navy-800);
  display:none;
}
.icon-btn .dot.show{ display:block; }

/* =========================== KONTEN =========================== */
.content{ padding:16px; display:flex; flex-direction:column; gap:16px; flex:1; }
.section-title{
  display:flex; align-items:center; justify-content:space-between; margin-bottom:2px;
}
.section-title h2{ font-size:1rem; font-weight:600; }
.section-title .link{ font-size:.82rem; color:var(--amber-600); font-weight:600; }

/* =========================== CARD =========================== */
.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  padding:16px;
  box-shadow:var(--shadow-card);
}
.card + .card{ margin-top:0; }
.card--flat{ box-shadow:none; }
.card__head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.card__head h3{ font-size:.95rem; font-weight:600; }

/* =========================== BADGE / CHIP STATUS =========================== */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 12px; border-radius:999px;
  font-size:.78rem; font-weight:600; font-family:var(--f-body);
}
.badge--success{ background:var(--success-100); color:var(--success-600); }
.badge--danger{ background:var(--danger-100); color:var(--danger-600); }
.badge--warning{ background:var(--warning-100); color:var(--warning-600); }
.badge--muted{ background:var(--navy-100); color:var(--navy-700); }

/* =========================== STATUS HERO (dashboard penghuni) =========================== */
.status-hero{
  background:linear-gradient(150deg,var(--navy-800),var(--navy-900));
  color:#fff; border-radius:var(--r-lg); padding:20px;
  position:relative; overflow:hidden;
}
.status-hero::after{
  content:""; position:absolute; right:-40px; top:-40px; width:150px; height:150px;
  border-radius:50%; background:rgba(245,166,35,.18);
}
.status-hero .label{ font-size:.75rem; color:#aeb8d4; text-transform:uppercase; letter-spacing:.06em; font-weight:600;}
.status-hero .value{ font-family:var(--f-display); font-size:1.6rem; font-weight:700; margin-top:4px; display:flex; align-items:center; gap:8px;}
.status-hero .meta{ margin-top:14px; display:flex; justify-content:space-between; gap:10px; position:relative; z-index:1;}
.status-hero .meta div{ flex:1; }
.status-hero .meta .k{ font-size:.7rem; color:#aeb8d4; }
.status-hero .meta .v{ font-family:var(--f-mono); font-size:.95rem; font-weight:600; margin-top:2px; }
.status-hero .dot-live{ width:9px; height:9px; border-radius:50%; background:var(--success-600); box-shadow:0 0 0 4px rgba(31,157,108,.25); }
.status-hero.status-lunas .dot-live{ background:var(--success-600); }
.status-hero.status-jatuh_tempo .dot-live{ background:var(--warning-600); }
.status-hero.status-terlambat .dot-live{ background:var(--danger-600); }

/* grid ringkas 2 kolom (dashboard) */
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.mini-stat{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); padding:14px; }
.mini-stat .icon{ font-size:1.2rem; }
.mini-stat .num{ font-family:var(--f-display); font-size:1.25rem; font-weight:700; margin-top:6px; }
.mini-stat .cap{ font-size:.75rem; color:var(--text-600); margin-top:2px; }

/* menu list (dashboard shortcut) */
.menu-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.menu-item{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md);
  padding:12px 4px; font-size:.72rem; text-align:center; color:var(--text-600); font-weight:600;
}
.menu-item .ico{
  width:40px; height:40px; border-radius:12px; background:var(--amber-100); color:var(--amber-600);
  display:flex; align-items:center; justify-content:center; font-size:1.1rem;
}
.menu-item:active{ background:var(--navy-100); }

/* baris info generik (dipakai di dalam card biasa) */
.row{ display:flex; justify-content:space-between; align-items:center; padding:7px 0; font-size:.86rem; border-bottom:1px solid var(--line); }
.row:last-child{ border-bottom:none; }
.row .k{ color:var(--text-600); }
.row .v{ font-weight:600; }

/* =========================== TIKET / STRUK (signature element) =========================== */
.ticket{
  position:relative;
  background:var(--surface);
  border-radius:var(--r-md);
  border:1px solid var(--line);
  overflow:visible;
}
.ticket__top{ padding:16px 16px 14px; }
.ticket__divider{
  position:relative; height:0; border-top:2px dashed var(--line); margin:0 4px;
}
.ticket__divider::before,.ticket__divider::after{
  content:""; position:absolute; top:50%; transform:translateY(-50%);
  width:18px; height:18px; background:var(--bg); border-radius:50%;
}
.ticket__divider::before{ left:-25px; }
.ticket__divider::after{ right:-25px; }
.ticket__bottom{ padding:14px 16px 16px; }
.ticket .row{ display:flex; justify-content:space-between; align-items:center; font-size:.85rem; padding:4px 0; }
.ticket .row .k{ color:var(--text-600); }
.ticket .row .v{ font-weight:600; font-family:var(--f-mono); }
.ticket .amount{
  font-family:var(--f-mono); font-size:1.4rem; font-weight:700; color:var(--navy-900);
}
.ticket .amount small{ font-size:.7rem; color:var(--text-400); font-weight:500; }

/* baris info WiFi bertema gelap (dipakai di kartu WiFi info kos) */
.wifi-row{
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 0; border-bottom:1px solid rgba(255,255,255,.12); font-size:.85rem;
}
.wifi-row:last-child{ border-bottom:none; }
.wifi-row .k{ color:#aeb8d4; }
.wifi-row .v{ color:#fff; font-family:var(--f-mono); font-weight:600; }

/* =========================== FORM =========================== */
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:.8rem; font-weight:600; color:var(--text-600); }
.field input, .field select, .field textarea{
  border:1.5px solid var(--line); border-radius:var(--r-sm); padding:12px 14px;
  background:var(--surface); color:var(--text-900); width:100%;
}
.field input:focus, .field select:focus, .field textarea:focus{ border-color:var(--amber-500); }
.field textarea{ resize:vertical; min-height:90px; }
.field-row{ display:flex; gap:10px; }
.field-row .field{ flex:1; }
.hint{ font-size:.74rem; color:var(--text-400); }
.error-text{ font-size:.78rem; color:var(--danger-600); font-weight:600; min-height:1.1em; }

/* =========================== BUTTON =========================== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border:none; border-radius:var(--r-sm); padding:13px 18px;
  font-weight:600; font-size:.92rem; cursor:pointer; width:100%;
  font-family:var(--f-body);
}
.btn:active{ transform:scale(.98); }
.btn-primary{ background:var(--amber-500); color:var(--navy-900); }
.btn-primary:active{ background:var(--amber-600); }
.btn-dark{ background:var(--navy-800); color:#fff; }
.btn-outline{ background:transparent; border:1.5px solid var(--line); color:var(--text-900); }
.btn-danger{ background:var(--danger-100); color:var(--danger-600); }
.btn-success{ background:var(--success-100); color:var(--success-600); }
.btn-sm{ padding:9px 14px; font-size:.82rem; width:auto; }
.btn-block-group{ display:flex; gap:10px; }
.btn-block-group .btn{ flex:1; }
.btn[disabled]{ opacity:.5; pointer-events:none; }

/* =========================== BOTTOM NAV =========================== */
.bottom-nav{
  position:fixed; bottom:0; left:0; right:0;
  max-width:480px; margin:0 auto;
  height:var(--nav-h);
  background:var(--surface);
  border-top:1px solid var(--line);
  display:flex;
  z-index:30;
  box-shadow:0 -6px 20px rgba(20,27,46,.06);
}
.bottom-nav a{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  font-size:.64rem; color:var(--text-400); font-weight:600; position:relative;
}
.bottom-nav a .ico{ font-size:1.15rem; }
.bottom-nav a.active{ color:var(--amber-600); }
.bottom-nav a.active::before{
  content:""; position:absolute; top:2px; width:26px; height:3px; border-radius:3px; background:var(--amber-500);
}
.bottom-nav a .badge-dot{
  position:absolute; top:2px; right:calc(50% - 18px); width:8px; height:8px; border-radius:50%; background:var(--danger-600); display:none;
}
.bottom-nav a .badge-dot.show{ display:block; }

/* =========================== LIST ITEM =========================== */
.list-item{
  display:flex; align-items:center; gap:12px; padding:12px 4px; border-bottom:1px solid var(--line);
}
.list-item:last-child{ border-bottom:none; }
.list-item .avatar{
  width:40px; height:40px; border-radius:12px; background:var(--navy-100); color:var(--navy-800);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-family:var(--f-display); flex-shrink:0;
}
.list-item .body{ flex:1; min-width:0; }
.list-item .body .title{ font-weight:600; font-size:.9rem; }
.list-item .body .sub{ font-size:.76rem; color:var(--text-600); margin-top:2px; }
.list-item .end{ text-align:right; flex-shrink:0; }
.list-item .end .amt{ font-family:var(--f-mono); font-weight:600; font-size:.85rem; }
.list-item .end .date{ font-size:.7rem; color:var(--text-400); margin-top:2px; }

/* =========================== TOAST & NOTIF PANEL =========================== */
.toast-wrap{
  position:fixed; top:14px; left:50%; transform:translateX(-50%);
  max-width:440px; width:calc(100% - 32px); z-index:100; display:flex; flex-direction:column; gap:8px;
}
.toast{
  background:var(--navy-900); color:#fff; padding:12px 16px; border-radius:var(--r-sm);
  font-size:.84rem; box-shadow:var(--shadow-pop); display:flex; align-items:center; gap:10px;
  animation:toast-in .25s ease;
}
.toast.success{ background:var(--success-600); }
.toast.danger{ background:var(--danger-600); }
@keyframes toast-in{ from{ opacity:0; transform:translateY(-10px);} to{opacity:1; transform:translateY(0);} }

.notif-panel{
  position:fixed; inset:0; background:rgba(20,27,46,.55); z-index:90; display:none;
}
.notif-panel.open{ display:block; }
.notif-panel__sheet{
  position:absolute; top:0; right:0; height:100%; width:86%; max-width:360px;
  background:var(--surface); padding:16px; overflow-y:auto;
  animation:slide-in .22s ease;
}
@keyframes slide-in{ from{ transform:translateX(100%);} to{ transform:translateX(0);} }
.notif-panel__head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.notif-item{ padding:12px 0; border-bottom:1px solid var(--line); }
.notif-item .txt{ font-size:.86rem; }
.notif-item .t{ font-size:.72rem; color:var(--text-400); margin-top:3px; }
.notif-item.unread .txt{ font-weight:600; }
.notif-item.unread::before{ content:"●"; color:var(--amber-500); margin-right:6px; font-size:.6rem; }

/* =========================== MODAL =========================== */
.modal{ position:fixed; inset:0; background:rgba(20,27,46,.55); z-index:95; display:none; align-items:flex-end; justify-content:center; }
.modal.open{ display:flex; }
.modal__sheet{
  background:var(--surface); width:100%; max-width:480px; border-radius:20px 20px 0 0;
  padding:18px 16px 22px; max-height:88vh; overflow-y:auto; animation:sheet-up .22s ease;
}
@keyframes sheet-up{ from{ transform:translateY(30px); opacity:0;} to{ transform:translateY(0); opacity:1; } }
.modal__head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.modal__head h3{ font-size:1.02rem; }
.modal__close{ background:var(--navy-100); border:none; width:32px; height:32px; border-radius:50%; font-size:1rem; cursor:pointer; }

/* =========================== EMPTY STATE =========================== */
.empty{ text-align:center; padding:34px 12px; color:var(--text-400); }
.empty .ico{ font-size:2rem; margin-bottom:8px; }
.empty .t{ font-weight:600; color:var(--text-600); }
.empty .s{ font-size:.82rem; margin-top:4px; }

/* =========================== LOGIN =========================== */
.login-screen{
  min-height:100vh; display:flex; flex-direction:column; justify-content:center;
  padding:28px 22px; background:radial-gradient(circle at 20% 0%, #26355a, var(--navy-900) 60%);
  color:#fff;
}
.login-brand{ text-align:center; margin-bottom:26px; }
.login-brand .mark{
  width:58px; height:58px; border-radius:18px; background:var(--amber-500); margin:0 auto 12px;
  display:flex; align-items:center; justify-content:center; font-size:1.6rem;
}
.login-brand h1{ color:#fff; font-size:1.3rem; }
.login-brand p{ color:#aeb8d4; font-size:.82rem; margin-top:4px; }
.role-switch{ display:flex; background:rgba(255,255,255,.08); border-radius:999px; padding:4px; margin-bottom:18px; }
.role-switch button{
  flex:1; border:none; background:transparent; color:#aeb8d4; padding:10px; border-radius:999px; font-weight:600; font-size:.85rem; cursor:pointer;
}
.role-switch button.active{ background:var(--amber-500); color:var(--navy-900); }
.login-card{ background:var(--surface); border-radius:var(--r-lg); padding:20px; color:var(--text-900); }
.login-card .field{ margin-bottom:14px; }
.login-foot{ text-align:center; margin-top:18px; font-size:.76rem; color:#aeb8d4; }
.dev-flag{ text-align:center; margin-top:10px; font-size:.7rem; color:var(--amber-500); }

/* =========================== UTIL =========================== */
.mt-4{margin-top:4px;} .mt-8{margin-top:8px;} .mt-12{margin-top:12px;} .mt-16{margin-top:16px;}
.flex{display:flex;} .items-center{align-items:center;} .justify-between{justify-content:space-between;}
.gap-8{gap:8px;} .gap-10{gap:10px;} .text-center{text-align:center;}
.muted{ color:var(--text-600); font-size:.85rem; }
.small{ font-size:.78rem; }
.w-full{ width:100%; }
