/* =========================================================
   MONITORING BBM PRO — STYLE
   Design tokens: Navy premium, SaaS-card layout, mobile-first
   ========================================================= */

:root{
  --navy: #1E3A5F;
  --navy-dark: #152A47;
  --navy-soft: #E7EDF4;
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --text: #14213D;
  --text-muted: #5B6B79;
  --border: #E6EAEE;

  --green: #1B8A5A;
  --green-soft: #E5F5EC;
  --amber: #B4740E;
  --amber-soft: #FCF1DC;
  --blue: #1D63B8;
  --blue-soft: #E5EFFB;
  --red: #C0362C;
  --red-soft: #FBEAE8;
  --whatsapp: #1EA457;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 10px 30px rgba(20, 33, 61, .07);
  --shadow-modal: 0 24px 60px rgba(20, 33, 61, .22);

  --font-head: 'Poppins', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  font-size:15px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  padding-bottom:calc(72px + var(--safe-bottom));
}
h1,h2,h3{font-family:var(--font-head); margin:0; color:var(--navy-dark); font-weight:600;}
p{margin:0;}
a{color:var(--blue); text-decoration:none;}
button{font-family:inherit;}
::selection{background:var(--navy-soft);}

img{max-width:100%; display:block;}

/* ---------- TOP BAR ---------- */
.topbar{
  position:sticky; top:0; z-index:30;
  display:flex; align-items:center; justify-content:space-between;
  padding:calc(14px + var(--safe-top)) 18px 14px;
  background:var(--navy);
  color:#fff;
}
.topbar__brand{display:flex; align-items:center; gap:9px;}
.topbar__logo{
  width:32px; height:32px; border-radius:10px;
  background:rgba(255,255,255,.14);
  display:flex; align-items:center; justify-content:center;
  color:#fff;
}
.topbar__title{font-family:var(--font-head); font-weight:600; font-size:16px; letter-spacing:.1px;}
.topbar__icon-btn{
  width:36px; height:36px; border-radius:10px; border:none;
  background:rgba(255,255,255,.12); color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.topbar__icon-btn:hover{background:rgba(255,255,255,.2);}

/* ---------- SHELL / SIDENAV (desktop) ---------- */
.app-shell{display:flex; align-items:flex-start;}
.sidenav{display:none;}

.content{
  flex:1; min-width:0;
  max-width:920px;
  margin:0 auto;
  padding:20px 16px 40px;
}

/* ---------- BOTTOM NAV (mobile) ---------- */
.bottomnav{
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  display:flex;
  background:var(--surface);
  border-top:1px solid var(--border);
  padding:8px 6px calc(8px + var(--safe-bottom));
  box-shadow:0 -8px 24px rgba(20,33,61,.06);
}
.bottomnav__link{
  flex:1;
  display:flex; flex-direction:column; align-items:center; gap:3px;
  color:var(--text-muted);
  font-size:11px;
  padding:6px 2px;
  border-radius:12px;
}
.bottomnav__link.is-active{color:var(--navy);}
.bottomnav__link.is-active svg path,
.bottomnav__link.is-active svg circle{ }
.bottomnav__link.is-active{background:var(--navy-soft);}

/* ---------- PAGES ---------- */
.page{display:none; animation:fadeIn .25s ease;}
.page.is-active{display:block;}
@keyframes fadeIn{from{opacity:0; transform:translateY(4px);} to{opacity:1; transform:translateY(0);}}

.page-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  margin-bottom:18px; flex-wrap:wrap;
}
.page-head h1{font-size:21px;}
.page-head__desc{color:var(--text-muted); font-size:13.5px; margin-top:4px;}

/* ---------- HERO (Dashboard) ---------- */
.hero{
  background:linear-gradient(135deg, var(--navy) 0%, #274B78 100%);
  color:#fff;
  border-radius:var(--radius-lg);
  padding:26px 22px 24px;
  margin-bottom:18px;
}
.hero__eyebrow{font-size:12.5px; color:rgba(255,255,255,.72); margin-bottom:6px;}
.hero__title{font-size:22px; line-height:1.3; color:#fff;}
.hero__desc{margin-top:8px; font-size:13.5px; color:rgba(255,255,255,.82); max-width:52ch;}
.hero__cta{display:flex; gap:10px; margin-top:18px; flex-wrap:wrap;}

/* ---------- BUTTONS ---------- */
.btn{
  appearance:none; border:none; cursor:pointer;
  font-family:var(--font-body); font-weight:600; font-size:14px;
  padding:12px 18px; border-radius:13px;
  transition:transform .08s ease, background .15s ease, box-shadow .15s ease;
  white-space:nowrap;
}
.btn:active{transform:scale(.97);}
.btn--primary{background:#fff; color:var(--navy);}
.hero .btn--primary{background:#fff; color:var(--navy);}
.page .btn--primary, .modal .btn--primary, .cta-banner .btn--primary{background:var(--navy); color:#fff;}
.page .btn--primary:hover, .modal .btn--primary:hover{background:var(--navy-dark);}
.btn--outline{background:transparent; color:#fff; border:1.5px solid rgba(255,255,255,.55);}
.btn--outline:hover{background:rgba(255,255,255,.12);}
.btn--ghost{background:var(--bg); color:var(--text);}
.btn--ghost:hover{background:var(--navy-soft);}
.btn--danger{background:var(--red); color:#fff;}
.btn--danger:hover{background:#A22C24;}
.btn--sm{padding:8px 12px; font-size:12.5px; border-radius:10px;}
.btn--wa{
  background:var(--whatsapp); color:#fff;
  display:inline-flex; align-items:center; gap:6px;
}
.btn--wa:hover{background:#188C4A;}
.btn--block{width:100%;}
.btn:disabled{opacity:.5; cursor:not-allowed;}

/* ---------- STAT CARDS ---------- */
.stat-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:12px;
  margin-bottom:22px;
}
.stat-card{
  background:var(--surface); border-radius:var(--radius-md);
  padding:16px 14px; box-shadow:var(--shadow-card);
}
.stat-card__icon{
  width:34px; height:34px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  margin-bottom:10px;
}
.stat-card__icon--navy{background:var(--navy-soft); color:var(--navy);}
.stat-card__icon--green{background:var(--green-soft); color:var(--green);}
.stat-card__icon--blue{background:var(--blue-soft); color:var(--blue);}
.stat-card__value{font-family:var(--font-head); font-size:24px; font-weight:700; color:var(--navy-dark);}
.stat-card__label{font-size:12px; color:var(--text-muted); margin-top:2px;}

/* ---------- SECTION BLOCK ---------- */
.section-block{margin-bottom:20px;}
.section-block__head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;}
.section-block__head h2{font-size:16px;}
.link-more{font-size:13px; font-weight:600;}

.activity-list{
  background:var(--surface); border-radius:var(--radius-md);
  box-shadow:var(--shadow-card); overflow:hidden;
}
.activity-item{
  display:flex; align-items:flex-start; gap:10px;
  padding:13px 15px; border-bottom:1px solid var(--border);
  font-size:13.5px;
}
.activity-item:last-child{border-bottom:none;}
.activity-item__dot{
  width:8px; height:8px; border-radius:50%; margin-top:6px; flex-shrink:0;
  background:var(--navy);
}
.activity-item__text{color:var(--text);}
.activity-item__time{display:block; color:var(--text-muted); font-size:11.5px; margin-top:2px;}

/* ---------- TRUST STRIP ---------- */
.trust-strip{
  display:grid; gap:10px; margin-bottom:18px;
}
.trust-strip__item{
  display:flex; align-items:center; gap:10px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:12px 14px;
  font-size:13px; color:var(--text-muted);
}
.trust-strip__dot{width:8px; height:8px; border-radius:50%; background:var(--green); flex-shrink:0;}

/* ---------- CTA BANNER ---------- */
.cta-banner{
  background:var(--navy-soft); border-radius:var(--radius-lg);
  padding:20px; display:flex; flex-direction:column; gap:14px;
  margin-bottom:8px;
}
.cta-banner h3{font-size:16px;}
.cta-banner p{font-size:13px; color:var(--text-muted); margin-top:4px;}

/* ---------- TOOLBAR / SEARCH / CHIPS ---------- */
.toolbar{display:flex; flex-direction:column; gap:12px; margin-bottom:16px;}
.search-box{
  display:flex; align-items:center; gap:8px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:12px; padding:11px 14px;
  color:var(--text-muted);
}
.search-box input{
  border:none; outline:none; flex:1; font-size:14px; color:var(--text); background:transparent;
}
.chip-group{display:flex; gap:8px; overflow-x:auto; padding-bottom:2px;}
.chip{
  flex-shrink:0; border:1px solid var(--border); background:var(--surface);
  color:var(--text-muted); font-size:12.5px; font-weight:600;
  padding:8px 14px; border-radius:999px; cursor:pointer;
}
.chip.is-active{background:var(--navy); color:#fff; border-color:var(--navy);}

/* ---------- CARD LIST (unit / booking / customer) ---------- */
.card-list{display:flex; flex-direction:column; gap:12px;}
.item-card{
  background:var(--surface); border-radius:var(--radius-md);
  box-shadow:var(--shadow-card); padding:16px;
}
.item-card__top{display:flex; align-items:flex-start; justify-content:space-between; gap:10px;}
.item-card__title{font-family:var(--font-head); font-weight:600; font-size:15px; color:var(--navy-dark);}
.item-card__subtitle{font-size:12.5px; color:var(--text-muted); margin-top:2px;}
.item-card__meta{font-size:12.5px; color:var(--text-muted); margin-top:8px; line-height:1.6;}
.item-card__note{
  font-size:12.5px; color:var(--text-muted); margin-top:8px;
  background:var(--bg); border-radius:9px; padding:8px 10px;
}
.item-card__actions{display:flex; gap:8px; margin-top:14px; flex-wrap:wrap;}
.icon-btn{
  width:34px; height:34px; border-radius:10px; border:1px solid var(--border);
  background:var(--surface); color:var(--text-muted); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.icon-btn:hover{background:var(--bg);}
.icon-btn--danger:hover{color:var(--red); border-color:var(--red-soft); background:var(--red-soft);}

.badge{
  display:inline-flex; align-items:center; gap:5px;
  font-size:11.5px; font-weight:700; padding:5px 10px; border-radius:999px;
}
.badge--tersedia, .badge--selesai{background:var(--green-soft); color:var(--green);}
.badge--servis, .badge--menunggu{background:var(--amber-soft); color:var(--amber);}
.badge--dibooking, .badge--berjalan{background:var(--blue-soft); color:var(--blue);}

.status-switch{display:flex; gap:6px; flex-wrap:wrap; margin-top:12px;}
.status-switch button{
  font-size:11.5px; font-weight:600; padding:7px 11px; border-radius:9px;
  border:1px solid var(--border); background:var(--surface); color:var(--text-muted); cursor:pointer;
}
.status-switch button.is-current{border-color:transparent;}
.status-switch button.status-tersedia.is-current{background:var(--green-soft); color:var(--green);}
.status-switch button.status-servis.is-current{background:var(--amber-soft); color:var(--amber);}
.status-switch button.status-dibooking.is-current{background:var(--blue-soft); color:var(--blue);}

/* ---------- EMPTY STATE ---------- */
.empty-state{
  text-align:center; padding:44px 20px;
  background:var(--surface); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-card);
}
.empty-state__icon{font-size:38px; margin-bottom:10px;}
.empty-state h3{font-size:16px; margin-bottom:6px;}
.empty-state p{color:var(--text-muted); font-size:13.5px; max-width:36ch; margin:0 auto 18px;}

/* ---------- TIMELINE (riwayat) ---------- */
.timeline{display:flex; flex-direction:column; gap:0; background:var(--surface); border-radius:var(--radius-md); box-shadow:var(--shadow-card); overflow:hidden;}
.timeline-item{display:flex; gap:12px; padding:14px 16px; border-bottom:1px solid var(--border);}
.timeline-item:last-child{border-bottom:none;}
.timeline-item__marker{width:9px; height:9px; border-radius:50%; background:var(--navy); margin-top:6px; flex-shrink:0;}
.timeline-item__body{font-size:13.5px;}
.timeline-item__time{display:block; font-size:11.5px; color:var(--text-muted); margin-top:2px;}

/* ---------- FORMS ---------- */
.form-card{
  background:var(--surface); border-radius:var(--radius-lg);
  padding:20px; box-shadow:var(--shadow-card);
  display:flex; flex-direction:column; gap:16px;
  max-width:520px;
}
.form-card--modal{box-shadow:none; padding:20px 22px 22px; max-width:none;}
.form-row{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
.form-field{display:flex; flex-direction:column; gap:6px;}
.form-field label{font-size:13px; font-weight:600; color:var(--text);}
.form-field input, .form-field select, .form-field textarea{
  border:1.5px solid var(--border); border-radius:11px;
  padding:11px 13px; font-size:14px; font-family:inherit; color:var(--text);
  background:var(--surface); outline:none; width:100%;
}
.form-field textarea{resize:vertical; min-height:64px;}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus{
  border-color:var(--navy); box-shadow:0 0 0 3px var(--navy-soft);
}
.form-field input.is-invalid, .form-field select.is-invalid, .form-field textarea.is-invalid{
  border-color:var(--red);
}
.form-hint{font-size:11.5px; color:var(--text-muted);}
.form-error{font-size:11.5px; color:var(--red); min-height:14px; display:block;}
.form-actions{display:flex; justify-content:flex-end; gap:10px; margin-top:4px; flex-wrap:wrap;}

.danger-card{
  margin-top:20px; max-width:520px;
  background:var(--red-soft); border:1px solid #F3D2CE;
  border-radius:var(--radius-lg); padding:18px;
  display:flex; flex-direction:column; gap:12px;
}
.danger-card h3{font-size:14.5px; color:#8C271F;}
.danger-card p{font-size:12.5px; color:#8C271F; opacity:.85;}

/* ---------- MODAL ---------- */
.modal-overlay{
  position:fixed; inset:0; z-index:100;
  background:rgba(20,33,61,.45);
  display:flex; align-items:flex-end; justify-content:center;
  padding:0;
}
.modal-overlay[hidden]{display:none;}
.modal{
  background:var(--surface); width:100%; max-width:520px;
  border-radius:22px 22px 0 0;
  max-height:92vh; overflow-y:auto;
  box-shadow:var(--shadow-modal);
  animation:slideUp .22s ease;
  padding-bottom:calc(4px + var(--safe-bottom));
}
.modal--sm{padding:20px 22px 22px;}
@keyframes slideUp{from{transform:translateY(24px); opacity:.6;} to{transform:translateY(0); opacity:1;}}
.modal__head{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 20px 6px;
}
.modal__head h2{font-size:17px;}
.modal__close{
  width:32px; height:32px; border-radius:9px; border:none;
  background:var(--bg); color:var(--text-muted); cursor:pointer; font-size:14px;
}
.modal__text{padding:0 0 16px; font-size:13.5px; color:var(--text-muted);}
.modal--sm .modal__head{padding:0 0 10px;}

/* ---------- TOAST ---------- */
.toast-stack{
  position:fixed; top:calc(14px + var(--safe-top)); left:50%; transform:translateX(-50%);
  z-index:200; display:flex; flex-direction:column; gap:8px; width:min(92vw, 380px);
}
.toast{
  background:var(--navy-dark); color:#fff; border-radius:12px;
  padding:12px 16px; font-size:13.5px; box-shadow:var(--shadow-modal);
  display:flex; align-items:center; gap:10px;
  animation:toastIn .2s ease;
}
.toast--success{background:#1E6B44;}
.toast--error{background:#8C271F;}
@keyframes toastIn{from{opacity:0; transform:translateY(-8px);} to{opacity:1; transform:translateY(0);}}

/* ---------- FOOTER ---------- */
.app-footer{
  text-align:center; padding:18px 16px calc(90px + var(--safe-bottom));
  color:var(--text-muted); font-size:12px;
}

/* =========================================================
   TABLET / DESKTOP
   ========================================================= */
@media (min-width: 900px){
  body{padding-bottom:0;}
  .topbar{display:none;}
  .bottomnav{display:none;}
  .app-footer{padding-bottom:24px;}

  .app-shell{min-height:100vh;}
  .sidenav{
    display:flex; flex-direction:column;
    width:250px; flex-shrink:0;
    background:var(--navy); color:#fff;
    min-height:100vh; padding:22px 16px;
    position:sticky; top:0;
  }
  .sidenav__brand{display:flex; align-items:center; gap:10px; padding:0 6px 24px;}
  .sidenav__title{font-family:var(--font-head); font-weight:600; font-size:14.5px;}
  .sidenav__subtitle{font-size:11px; color:rgba(255,255,255,.6);}
  .sidenav__list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; flex:1;}
  .sidenav__link{
    display:flex; align-items:center; gap:11px;
    color:rgba(255,255,255,.78); font-size:13.5px; font-weight:500;
    padding:11px 12px; border-radius:11px;
  }
  .sidenav__link:hover{background:rgba(255,255,255,.08); color:#fff;}
  .sidenav__link.is-active{background:rgba(255,255,255,.14); color:#fff;}
  .sidenav__footer{font-size:11px; color:rgba(255,255,255,.45); padding:10px 6px 0;}

  .content{padding:32px 40px 48px; max-width:1000px;}
  .hero{padding:34px 36px;}
  .hero__title{font-size:26px;}
  .stat-grid{grid-template-columns:repeat(3,1fr); gap:16px;}
  .cta-banner{flex-direction:row; align-items:center; justify-content:space-between;}
  .toolbar{flex-direction:row; align-items:center; justify-content:space-between;}
  .search-box{max-width:320px;}
  .trust-strip{grid-template-columns:repeat(3,1fr);}
  .modal-overlay{align-items:center;}
  .modal{border-radius:22px; margin:20px;}
}

@media (min-width: 1180px){
  .content{max-width:1080px;}
}
