/* Boarding House – sidebar theme */
:root{
  --primary:#4f46e5;--primary-dark:#4338ca;--primary-soft:#eef2ff;
  --side:#0f172a;--side-2:#1e293b;--side-w:260px;
  --bg:#f1f5f9;--surface:#fff;--line:#e2e8f0;--text:#0f172a;--muted:#64748b;
  --green:#16a34a;--red:#dc2626;--radius:12px;
  --shadow:0 1px 2px rgba(15,23,42,.05),0 4px 14px rgba(15,23,42,.06);
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:var(--primary);text-decoration:none}a:hover{text-decoration:underline}

/* ---------- Sidebar ---------- */
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--side-w);background:linear-gradient(180deg,var(--side),var(--side-2));color:#cbd5e1;display:flex;flex-direction:column;padding:1.2rem .9rem;z-index:40;transition:transform .25s}
.logo{display:flex;align-items:center;gap:.7rem;color:#fff;text-decoration:none!important;font-weight:700;font-size:1.05rem;line-height:1.15;padding:.3rem .5rem 1.3rem;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:1.1rem}
.logo small{font-weight:500;font-size:.72rem;color:#94a3b8;letter-spacing:.4px}
.logo-mark{display:grid;place-items:center;width:40px;height:40px;border-radius:11px;background:linear-gradient(135deg,var(--primary),#818cf8);font-size:1.25rem;box-shadow:0 4px 12px rgba(79,70,229,.45)}
.nav-label{font-size:.68rem;text-transform:uppercase;letter-spacing:1.2px;color:#64748b;padding:0 .7rem;margin-bottom:.5rem}
.sidebar nav{display:flex;flex-direction:column;gap:.2rem;flex:1}
.sidebar nav a{display:flex;align-items:center;gap:.75rem;padding:.7rem .8rem;border-radius:10px;color:#cbd5e1;font-size:.93rem;font-weight:500;text-decoration:none;transition:.15s}
.sidebar nav a .ico{width:1.5rem;text-align:center;font-size:1.05rem}
.sidebar nav a:hover{background:rgba(255,255,255,.07);color:#fff}
.sidebar nav a.active{background:linear-gradient(90deg,var(--primary),#6366f1);color:#fff;box-shadow:0 4px 14px rgba(79,70,229,.4)}
.side-user{display:flex;align-items:center;gap:.7rem;padding:.8rem;margin-top:1rem;background:rgba(255,255,255,.06);border-radius:12px}
.side-user .who{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.side-user .who b{color:#fff;font-size:.88rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-user .who small{color:#94a3b8;font-size:.74rem}
.logout{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;color:#cbd5e1!important;font-size:1.15rem;text-decoration:none!important;transition:.15s}
.logout:hover{background:var(--red);color:#fff!important}
.avatar{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:50%;background:linear-gradient(135deg,#6366f1,#a78bfa);color:#fff;font-weight:700;font-size:.85rem}
.avatar.sm{width:32px;height:32px;font-size:.74rem}

/* ---------- Content area ---------- */
.content{margin-left:var(--side-w);min-height:100vh;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:1rem;padding:.9rem 2rem;background:rgba(255,255,255,.85);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.crumb{font-weight:600;color:var(--muted);font-size:.92rem}.today{margin-left:auto;color:var(--muted);font-size:.85rem}
.menu-btn{display:none;background:var(--primary-soft);color:var(--primary);box-shadow:none;padding:.4rem .7rem;font-size:1.1rem}
.menu-btn:hover{background:#e0e7ff}
.overlay{display:none}
main{flex:1;width:100%;max-width:1150px;margin:0 auto;padding:1.8rem 2rem}
main.guest{max-width:520px;padding-top:3rem}
h1{font-size:1.7rem;font-weight:700;letter-spacing:-.4px;margin:0 0 1.3rem}
h2{font-size:1.05rem;font-weight:600;margin:0}
footer{text-align:center;color:var(--muted);padding:1.8rem 0;font-size:.8rem}

/* ---------- Cards, stats ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:1.3rem 1.5rem;margin-bottom:1.3rem;box-shadow:var(--shadow)}
.card-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:.5rem;margin-bottom:1rem}
.hint{color:var(--muted);font-size:.8rem}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:1rem;margin-bottom:1.4rem}
.stat{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:1.1rem 1.2rem 1.1rem 1.5rem;box-shadow:var(--shadow);color:var(--muted);font-size:.76rem;font-weight:600;text-transform:uppercase;letter-spacing:.6px;overflow:hidden;transition:transform .15s,box-shadow .15s}
.stat::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:linear-gradient(var(--primary),#818cf8)}
.stat:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(15,23,42,.1)}
.stat b{display:block;margin-top:.25rem;font-size:1.7rem;font-weight:700;letter-spacing:-.5px;color:var(--text);text-transform:none}
.stat em{font-style:normal;font-size:.78rem;text-transform:none;letter-spacing:0;font-weight:500}

/* ---------- Tabs ---------- */
.tabs{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:1rem}
.tabs a{display:inline-flex;align-items:center;gap:.5rem;padding:.45rem .95rem;border-radius:99px;background:var(--surface);border:1px solid var(--line);color:var(--muted);font-size:.85rem;font-weight:600;text-decoration:none!important;transition:.15s}
.tabs a span{background:#e2e8f0;color:#475569;border-radius:99px;padding:0 .5rem;font-size:.72rem}
.tabs a:hover{border-color:var(--primary);color:var(--primary)}
.tabs a.on{background:var(--primary);border-color:var(--primary);color:#fff}.tabs a.on span{background:rgba(255,255,255,.25);color:#fff}

/* ---------- Tables ---------- */
.tablewrap{overflow-x:auto;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:1.5rem}
table{width:100%;border-collapse:collapse}
th,td{padding:.8rem 1rem;text-align:left;font-size:.9rem;vertical-align:middle;border-bottom:1px solid var(--line)}
th{background:#f8fafc;color:var(--muted);font-size:.72rem;font-weight:600;text-transform:uppercase;letter-spacing:.6px;white-space:nowrap}
tr:last-child td{border-bottom:0}table tr:hover td{background:#f8fafc}
td small{color:var(--muted);display:block;font-size:.78rem}
.person{display:flex;align-items:center;gap:.7rem}.person div{line-height:1.25}
.empty{text-align:center;color:var(--muted);padding:2.2rem!important}
.actions{display:flex;gap:.35rem}

/* ---------- Forms & buttons ---------- */
input,select,textarea{padding:.6rem .75rem;border:1px solid #cbd5e1;border-radius:8px;font:inherit;font-size:.92rem;color:var(--text);background:#fff;max-width:100%;transition:border-color .15s,box-shadow .15s}
input:focus,select:focus,textarea:focus{outline:0;border-color:var(--primary);box-shadow:0 0 0 3px rgba(79,70,229,.18)}
form.row{display:flex;flex-wrap:wrap;gap:.8rem;align-items:flex-end}
form.row label{display:flex;flex-direction:column;gap:.3rem;font-size:.74rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.4px}
td input,td select{padding:.4rem .55rem;font-size:.86rem}
button,.btn{display:inline-block;background:var(--primary);color:#fff;border:0;border-radius:8px;padding:.62rem 1.1rem;font:inherit;font-size:.9rem;font-weight:600;cursor:pointer;text-decoration:none;transition:background .15s,transform .05s;box-shadow:0 1px 2px rgba(79,70,229,.3)}
button:hover,.btn:hover{background:var(--primary-dark);text-decoration:none}button:active{transform:translateY(1px)}
button.danger{background:var(--red);box-shadow:none}button.danger:hover{background:#b91c1c}
button.green{background:var(--green);box-shadow:none}button.green:hover{background:#15803d}
button.small{padding:.35rem .7rem;font-size:.8rem;border-radius:6px}

/* ---------- Flash, badges ---------- */
.flash{padding:.8rem 1.1rem;border-radius:10px;margin-bottom:1.2rem;font-size:.92rem;font-weight:500;border:1px solid;animation:slide .3s ease}
.flash.ok{background:#f0fdf4;color:#166534;border-color:#bbf7d0}.flash.err{background:#fef2f2;color:#991b1b;border-color:#fecaca}
@keyframes slide{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.badge{display:inline-flex;align-items:center;gap:.35rem;padding:.2rem .65rem;border-radius:99px;font-size:.75rem;font-weight:600;text-transform:capitalize;background:#e2e8f0;color:#475569}
.badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.badge.active,.badge.confirmed,.badge.resolved{background:#dcfce7;color:#166534}
.badge.pending,.badge.open,.badge.in_progress{background:#fef3c7;color:#92400e}
.badge.rejected,.badge.moved_out{background:#fee2e2;color:#991b1b}

/* ---------- Login / Register ---------- */
body:has(.authbox){background:radial-gradient(1000px 500px at 10% -10%,#c7d2fe 0,transparent 60%),radial-gradient(800px 500px at 100% 0,#bae6fd 0,transparent 55%),var(--bg);min-height:100vh}
main.guest h1{text-align:center;margin-bottom:0}
.authbox{max-width:410px;margin:1.5rem auto;padding:2rem 1.8rem;border-radius:16px;box-shadow:0 20px 45px rgba(15,23,42,.12)}
.authbox input{width:100%;margin-bottom:.9rem;padding:.75rem .9rem}
.authbox button{width:100%;padding:.8rem;font-size:.95rem}
.authbox p{text-align:center;color:var(--muted);font-size:.88rem;margin:1.2rem 0 0}

/* ---------- Responsive ---------- */
@media(max-width:900px){
  .sidebar{transform:translateX(-100%)}
  body.nav-open .sidebar{transform:none;box-shadow:0 0 40px rgba(0,0,0,.4)}
  body.nav-open .overlay{display:block;position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:30}
  .content{margin-left:0}.menu-btn{display:inline-block}
  .topbar{padding:.7rem 1rem}.today{display:none}
  main{padding:1.2rem 1rem}
}
@media(max-width:600px){form.row{flex-direction:column;align-items:stretch}form.row input,form.row select,form.row textarea{width:100%}}
@media print{.sidebar,.topbar,footer,button{display:none!important}.content{margin:0}body{background:#fff}}

/* ---------- Extras: hero, panels, room cards ---------- */
.hero{position:relative;overflow:hidden;border-radius:18px;padding:1.8rem 2rem;margin-bottom:1.5rem;color:#fff;background:linear-gradient(120deg,#4f46e5 0%,#7c3aed 55%,#a855f7 100%);box-shadow:0 14px 34px rgba(79,70,229,.35)}
.hero::after{content:"";position:absolute;right:-60px;top:-70px;width:260px;height:260px;border-radius:50%;background:rgba(255,255,255,.12)}
.hero::before{content:"";position:absolute;right:120px;bottom:-90px;width:200px;height:200px;border-radius:50%;background:rgba(255,255,255,.08)}
.hero h2{font-size:1.5rem;font-weight:700;letter-spacing:-.3px;margin-bottom:.3rem;position:relative}
.hero p{margin:0;color:#e0e7ff;position:relative;font-size:.95rem}
.hero .pill{position:relative;display:inline-block;margin-top:1rem;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.3);padding:.3rem .8rem;border-radius:99px;font-size:.82rem;font-weight:600}
.stat-ico{position:absolute;right:1rem;top:1rem;display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:var(--primary-soft);font-size:1.2rem}
.panels{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:1.2rem;margin-bottom:1.5rem}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:1.2rem 1.3rem}
.panel h3{margin:0 0 .8rem;font-size:1rem;font-weight:600;display:flex;justify-content:space-between;align-items:center}
.panel h3 a{font-size:.8rem;font-weight:600}
.feed{list-style:none;margin:0;padding:0}
.feed li{display:flex;align-items:center;gap:.8rem;padding:.65rem 0;border-bottom:1px solid var(--line)}
.feed li:last-child{border-bottom:0}.feed .grow{flex:1;min-width:0;line-height:1.3}
.feed .grow small{display:block;color:var(--muted);font-size:.78rem}.feed .amt{font-weight:700}
.rooms{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:1rem;margin-bottom:1.5rem}
.room-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:1.2rem;box-shadow:var(--shadow);transition:transform .15s,box-shadow .15s}
.room-card:hover{transform:translateY(-3px);box-shadow:0 12px 26px rgba(15,23,42,.12)}
.room-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:.8rem}
.room-no{font-size:1.5rem;font-weight:700;letter-spacing:-.5px}
.room-type{font-size:.75rem;font-weight:600;color:var(--primary);background:var(--primary-soft);padding:.2rem .65rem;border-radius:99px}
.room-rate{font-size:1.15rem;font-weight:700;color:var(--text)}.room-rate small{font-weight:500;color:var(--muted);font-size:.78rem}
.bar{height:8px;border-radius:99px;background:#e2e8f0;overflow:hidden;margin:.9rem 0 .35rem}
.bar i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#22c55e,#16a34a)}
.bar.full i{background:linear-gradient(90deg,#f97316,#dc2626)}
.room-foot{display:flex;justify-content:space-between;align-items:center;font-size:.8rem;color:var(--muted)}

/* ======== v2 additions ======== */
.sidebar nav{overflow-y:auto;min-height:0;padding-right:2px}
.sidebar nav::-webkit-scrollbar{width:4px}.sidebar nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.2);border-radius:4px}
.sidebar nav a .count,.chat-list .count{margin-left:auto;background:#ef4444;color:#fff;border-radius:99px;font-size:.7rem;font-weight:700;padding:.05rem .5rem;min-width:20px;text-align:center}
.side-user{margin-top:.8rem}
.logout-btn{display:flex;align-items:center;justify-content:center;gap:.6rem;margin-top:.7rem;padding:.75rem;border-radius:11px;background:#ef4444;color:#fff!important;font-weight:700;font-size:.95rem;text-decoration:none!important;box-shadow:0 4px 12px rgba(239,68,68,.35);transition:.15s}
.logout-btn:hover{background:#dc2626;transform:translateY(-1px)}.logout-btn span{font-size:1.1rem}
.logout-top{display:inline-flex;align-items:center;gap:.4rem;padding:.45rem .9rem;border-radius:9px;background:#fff;color:#dc2626!important;border:1.5px solid #fecaca;font-weight:700;font-size:.85rem;text-decoration:none!important;transition:.15s}
.logout-top:hover{background:#dc2626;color:#fff!important;border-color:#dc2626}
.bell{position:relative;display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:var(--primary-soft);text-decoration:none!important;font-size:1.1rem}
.bell i{position:absolute;top:-5px;right:-5px;background:#ef4444;color:#fff;font-style:normal;font-size:.68rem;font-weight:700;border-radius:99px;padding:0 .4rem;min-width:18px;text-align:center}
.chip{display:inline-flex;align-items:center;gap:.5rem;font-size:.85rem;font-weight:600;color:var(--text)}
.chip em{font-style:normal;font-size:.7rem;background:var(--primary-soft);color:var(--primary);padding:.1rem .5rem;border-radius:99px}
.topbar .today{margin-left:auto}
@media(max-width:900px){.chip{display:none}.topbar{gap:.6rem}}
.flash.info{background:#eff6ff;color:#1e40af;border-color:#bfdbfe}
.alert{padding:.9rem 1.2rem;border-radius:12px;margin-bottom:1.2rem;font-size:.93rem;border:1px solid}
.alert.danger{background:#fef2f2;color:#991b1b;border-color:#fecaca}.alert.warn{background:#fffbeb;color:#92400e;border-color:#fde68a}
.pill.warn{background:rgba(239,68,68,.35)!important;margin-left:.5rem}
.hint.center,.center{text-align:center}
.card.empty{text-align:center;color:var(--muted)}

/* landing + login */
main.guest.wide{max-width:1050px}
.landing{padding:1rem 0 2rem}
.land-hero{text-align:center;padding:3.2rem 1.5rem;border-radius:22px;color:#fff;background:linear-gradient(125deg,#312e81,#4f46e5 55%,#7c3aed);box-shadow:0 20px 45px rgba(79,70,229,.35);position:relative;overflow:hidden}
.land-hero::after{content:"";position:absolute;right:-80px;top:-90px;width:300px;height:300px;border-radius:50%;background:rgba(255,255,255,.1)}
.land-hero h1{font-size:2.3rem;line-height:1.2;margin:.8rem auto;max-width:760px;position:relative}
.land-hero p{color:#e0e7ff;font-size:1.05rem;position:relative}
.eyebrow{display:inline-block;background:rgba(255,255,255,.18);padding:.3rem .9rem;border-radius:99px;font-weight:600;font-size:.85rem}
.land-cta{display:flex;gap:.8rem;justify-content:center;flex-wrap:wrap;margin-top:1.6rem;position:relative}
.btn.big{padding:.85rem 1.8rem;font-size:1rem;background:#fff;color:var(--primary)!important}.btn.big:hover{background:#eef2ff}
.btn.big.ghost{background:transparent;color:#fff!important;border:2px solid rgba(255,255,255,.6)}.btn.big.ghost:hover{background:rgba(255,255,255,.15)}
.feature-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem;margin-top:1.6rem}
.feature{background:#fff;border:1px solid var(--line);border-radius:14px;padding:1.2rem;box-shadow:var(--shadow)}
.feature span{font-size:1.6rem}.feature b{display:block;margin:.4rem 0 .2rem}.feature p{margin:0;color:var(--muted);font-size:.88rem}
.auth-title{text-align:center;margin-bottom:1.3rem}.auth-title .logo-mark{margin:0 auto .8rem;width:52px;height:52px;font-size:1.6rem}
.auth-title h2{font-size:1.05rem;line-height:1.35}.auth-title p{margin:.3rem 0 0;color:var(--muted);font-size:.88rem}

/* rules */
.rules{display:grid;gap:.8rem}
.rule{display:flex;gap:1rem;align-items:flex-start;background:#fff;border:1px solid var(--line);border-radius:14px;padding:1.1rem 1.3rem;box-shadow:var(--shadow)}
.rule-no{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,var(--primary),#818cf8);color:#fff;font-weight:700}
.rule h3{margin:0 0 .2rem;font-size:1rem}.rule p{margin:0;color:var(--muted);font-size:.92rem}.rule>div{flex:1}

/* notifications */
.notifs{display:grid;gap:.5rem}
.notif{display:flex;align-items:center;gap:.9rem;background:#fff;border:1px solid var(--line);border-radius:12px;padding:.85rem 1.1rem;color:var(--text);text-decoration:none!important;transition:.15s}
.notif:hover{box-shadow:var(--shadow);transform:translateX(2px)}
.notif.unread{border-left:4px solid var(--primary);background:#f8faff}.notif.overdue.unread{border-left-color:#dc2626;background:#fef8f8}.notif.upcoming.unread{border-left-color:#f59e0b;background:#fffdf5}
.n-ico{font-size:1.3rem}.n-body{flex:1;font-size:.92rem}.n-body small{display:block;color:var(--muted);font-size:.76rem;margin-top:.1rem}
.dot{width:10px;height:10px;border-radius:50%;background:var(--primary)}

/* chat */
.chat-wrap{display:grid;grid-template-columns:1fr;gap:1rem;height:calc(100vh - 210px);min-height:420px}
.chat-wrap.with-list{grid-template-columns:260px 1fr}
.chat-list{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow-y:auto}
.chat-list a{display:flex;align-items:center;gap:.7rem;padding:.8rem 1rem;color:var(--text);text-decoration:none!important;border-bottom:1px solid var(--line)}
.chat-list a:hover{background:#f8fafc}.chat-list a.on{background:var(--primary-soft);font-weight:600}.chat-list .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-box{display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;min-height:0}
.chat-head{display:flex;align-items:center;gap:.7rem;padding:.8rem 1.1rem;border-bottom:1px solid var(--line);background:#f8fafc}.chat-head small{margin-left:auto;color:var(--muted);font-size:.74rem}
.chat-msgs{flex:1;overflow-y:auto;padding:1rem 1.1rem;background:#f1f5f9;display:flex;flex-direction:column;gap:.6rem}
.msg{display:flex;flex-direction:column;max-width:75%}.msg.mine{align-self:flex-end;align-items:flex-end}.msg.theirs{align-self:flex-start}
.bubble{padding:.6rem .9rem;border-radius:16px;font-size:.92rem;word-break:break-word;white-space:pre-wrap}
.mine .bubble{background:linear-gradient(135deg,var(--primary),#6366f1);color:#fff;border-bottom-right-radius:4px}.theirs .bubble{background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px}
.msg small{color:var(--muted);font-size:.7rem;margin-top:.15rem}
.chat-form{display:flex;gap:.6rem;padding:.8rem;border-top:1px solid var(--line)}.chat-form input{flex:1}
@media(max-width:800px){.chat-wrap.with-list{grid-template-columns:1fr;height:auto}.chat-list{max-height:170px}.chat-box{height:60vh}}

/* map + forms */
#map{height:440px;border-radius:10px;z-index:1}
.stack{display:flex;flex-direction:column;gap:.6rem;margin-top:.8rem}.stack input,.stack select{width:100%}
.two{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}
.radio{display:inline-flex;align-items:center;gap:.4rem;margin-right:1rem;font-size:.88rem;font-weight:600}
.lbl{display:flex;flex-direction:column;gap:.3rem;font-size:.76rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.4px}
.dotc{width:12px;height:12px;border-radius:50%;flex:none}
.feed form{margin:0}

/* billing calculator */
.calc li b{font-size:1.02rem}
.calc li.total{margin-top:.3rem;padding:.9rem 1rem;border:0;border-radius:10px;background:linear-gradient(120deg,#4f46e5,#7c3aed);color:#fff}
.calc li.total .grow,.calc li.total b{color:#fff;font-size:1.1rem}

/* amount due card + delete buttons */
.due-card{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;border-radius:18px;padding:1.5rem 1.8rem;margin-bottom:1.3rem;color:#fff;box-shadow:0 14px 34px rgba(15,23,42,.18)}
.due-card.owe{background:linear-gradient(120deg,#d97706,#f59e0b)}.due-card.late{background:linear-gradient(120deg,#b91c1c,#ef4444)}.due-card.clear{background:linear-gradient(120deg,#15803d,#22c55e)}
.due-card span{display:block;font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:1px;opacity:.9}
.due-card b{display:block;font-size:2.4rem;letter-spacing:-1px;line-height:1.2}.due-card small{opacity:.95;font-size:.88rem}
.due-card .btn{background:#fff;color:#92400e!important}
.pay-btn{background:var(--green)!important;font-size:1rem;padding:.7rem 1.4rem}.pay-btn:hover{background:#15803d!important}.pay-btn:disabled{opacity:.5;cursor:not-allowed}
button.outline-danger{background:#fff;color:var(--red);border:1.5px solid #fecaca;box-shadow:none}button.outline-danger:hover{background:var(--red);color:#fff;border-color:var(--red)}
.danger-zone{border:1.5px solid #fecaca;background:#fffafa}.danger-zone h2{color:#b91c1c}.danger-zone p{color:#7f1d1d;font-size:.92rem;margin:0 0 .8rem}
details.card summary{cursor:pointer}

/* ======== theme toggle + payment accounts ======== */
.theme-btn{display:grid;place-items:center;width:38px;height:38px;padding:0;border-radius:10px;background:var(--primary-soft);color:var(--text);box-shadow:none;font-size:1.1rem;border:1px solid var(--line)}
.theme-btn:hover{background:var(--line)}
.t-sun{display:none}
.theme-float{position:fixed;top:14px;right:14px;z-index:50}
.acc-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem}
.acc{border:1px solid var(--line);border-radius:12px;padding:1rem 1.1rem;display:flex;flex-direction:column;gap:.35rem;background:var(--primary-soft)}
.acc-type{font-size:.8rem;font-weight:700;color:var(--primary);text-transform:uppercase;letter-spacing:.5px}
.acc-num{display:flex;align-items:center;justify-content:space-between;gap:.6rem}
.acc-num code{font-size:1.15rem;font-weight:700;letter-spacing:.5px}
.acc small{color:var(--muted)}

/* ======== DARK MODE ======== */
html[data-theme=dark]{color-scheme:dark;--bg:#0b1220;--surface:#121b2f;--line:#25324d;--text:#e5e9f2;--muted:#94a3b8;--primary-soft:#1f2550;--shadow:0 1px 2px rgba(0,0,0,.4),0 4px 14px rgba(0,0,0,.35)}
html[data-theme=dark] .t-sun{display:inline}html[data-theme=dark] .t-moon{display:none}
html[data-theme=dark] body:has(.authbox){background:radial-gradient(1000px 500px at 10% -10%,#1e1b4b 0,transparent 60%),radial-gradient(800px 500px at 100% 0,#0c2a44 0,transparent 55%),var(--bg)}
html[data-theme=dark] .topbar{background:rgba(11,18,32,.88)}
html[data-theme=dark] .menu-btn{background:var(--primary-soft);color:#a5b4fc}
html[data-theme=dark] .bell,html[data-theme=dark] .chip em{background:var(--primary-soft);color:#c7d2fe}
html[data-theme=dark] .logout-top{background:transparent;color:#fca5a5!important;border-color:#7f1d1d}
html[data-theme=dark] .logout-top:hover{background:#dc2626;color:#fff!important}
html[data-theme=dark] th{background:#17223a}
html[data-theme=dark] table tr:hover td,html[data-theme=dark] .chat-list a:hover{background:#17223a}
html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea{background:#0e1627;border-color:#2c3b5c;color:var(--text)}
html[data-theme=dark] input::placeholder{color:#64748b}
html[data-theme=dark] input[readonly]{opacity:.7}
html[data-theme=dark] .tabs a,html[data-theme=dark] .rule,html[data-theme=dark] .notif,html[data-theme=dark] .feature,html[data-theme=dark] .room-card,html[data-theme=dark] .chat-box,html[data-theme=dark] .chat-list{background:var(--surface);border-color:var(--line)}
html[data-theme=dark] .tabs a span,html[data-theme=dark] .badge{background:#25324d;color:#cbd5e1}
html[data-theme=dark] .tabs a.on span{background:rgba(255,255,255,.25);color:#fff}
html[data-theme=dark] .badge.active,html[data-theme=dark] .badge.confirmed,html[data-theme=dark] .badge.resolved{background:rgba(34,197,94,.16);color:#4ade80}
html[data-theme=dark] .badge.pending,html[data-theme=dark] .badge.open,html[data-theme=dark] .badge.in_progress{background:rgba(245,158,11,.16);color:#fbbf24}
html[data-theme=dark] .badge.rejected,html[data-theme=dark] .badge.moved_out{background:rgba(239,68,68,.16);color:#f87171}
html[data-theme=dark] .flash.ok{background:rgba(34,197,94,.12);color:#86efac;border-color:rgba(34,197,94,.35)}
html[data-theme=dark] .flash.err{background:rgba(239,68,68,.12);color:#fca5a5;border-color:rgba(239,68,68,.35)}
html[data-theme=dark] .flash.info{background:rgba(59,130,246,.12);color:#93c5fd;border-color:rgba(59,130,246,.35)}
html[data-theme=dark] .alert.danger{background:rgba(239,68,68,.12);color:#fca5a5;border-color:rgba(239,68,68,.35)}
html[data-theme=dark] .alert.warn{background:rgba(245,158,11,.12);color:#fcd34d;border-color:rgba(245,158,11,.35)}
html[data-theme=dark] .notif.unread{background:#16213a}html[data-theme=dark] .notif.overdue.unread{background:#2a1620}html[data-theme=dark] .notif.upcoming.unread{background:#2a2414}
html[data-theme=dark] .chat-head{background:#17223a}html[data-theme=dark] .chat-msgs{background:#0b1220}
html[data-theme=dark] .theirs .bubble{background:#1a253f;border-color:var(--line);color:var(--text)}
html[data-theme=dark] .chat-list a.on{background:var(--primary-soft)}
html[data-theme=dark] .bar{background:#25324d}
html[data-theme=dark] .danger-zone{background:#1d1216;border-color:#7f1d1d}html[data-theme=dark] .danger-zone p{color:#fca5a5}html[data-theme=dark] .danger-zone h2{color:#f87171}
html[data-theme=dark] button.outline-danger{background:transparent;color:#f87171;border-color:#7f1d1d}
html[data-theme=dark] button.outline-danger:hover{background:var(--red);color:#fff}
html[data-theme=dark] .stat-ico{background:var(--primary-soft)}
html[data-theme=dark] .acc{background:#16204a;border-color:#2c3b6b}html[data-theme=dark] .acc-type{color:#a5b4fc}
html[data-theme=dark] a{color:#a5b4fc}html[data-theme=dark] .btn,html[data-theme=dark] button,html[data-theme=dark] .tabs a.on,html[data-theme=dark] .sidebar a{color:inherit}
html[data-theme=dark] button,html[data-theme=dark] .btn{color:#fff}
html[data-theme=dark] .tabs a{color:var(--muted)}html[data-theme=dark] .tabs a.on{color:#fff}
html[data-theme=dark] .tabs a:hover{color:#a5b4fc}
html[data-theme=dark] .due-card .btn{color:#92400e}
html[data-theme=dark] .leaflet-tile{filter:invert(1) hue-rotate(180deg) brightness(.95) contrast(.9)}
html[data-theme=dark] .sidebar{background:linear-gradient(180deg,#060b16,#0e1627)}
html[data-theme=dark] .sidebar nav a{color:#cbd5e1}html[data-theme=dark] .sidebar nav a.active,html[data-theme=dark] .logout-btn,html[data-theme=dark] .logo{color:#fff}
html[data-theme=dark] .land-hero a.btn.big{color:var(--primary)}html[data-theme=dark] .land-hero a.btn.big.ghost{color:#fff}
html[data-theme=dark] .notif,html[data-theme=dark] .chat-list a{color:var(--text)}

/* pay steps + account detail */
.step{display:flex;align-items:center;gap:.6rem;font-weight:600;margin:1.1rem 0 .6rem;font-size:.95rem}
.step span{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--primary);color:#fff;font-size:.78rem}
.step small{color:var(--muted);font-weight:500}
#payform select#from,#payform select#acc{min-width:min(100%,360px)}
.acc-detail{margin-top:.7rem;padding:.9rem 1.1rem;border-radius:12px;background:var(--primary-soft);border:1px dashed #a5b4fc;display:flex;flex-direction:column;gap:.3rem}
.acc code{font-weight:700}
