/* Hydrokleen redesigned web dashboards — Ren Luft Appen (v2).
   Approved mockup v3 design: Poppins throughout, white sidebar with grouped
   nav, KPI cards with icon tiles, Orders Overview line chart + Orders by
   Status donut, role colours — Admin blue #1D70D6, Service Partner green
   #22C55E, Sales Partner orange #EA580C. Custom SVG icons only, zero emojis. */
:root{
  --blue:#1D70D6; --blue-deep:#0B4EA2; --blue-ink:#0A356E; --aqua:#0AA79B;
  --amber:#E8930C; --red:#D64545; --green:#1E8E6E;
  --bg:#EDF1F6; --card:#fff; --line:#DFE6EF; --ink:#0F2233; --muted:#64748B; --faint:#94A3B8;
  --accent:#1D70D6; --accent-soft:#E3EEFC; --accent-ink:#1D70D6;
  --ok-bg:#E4F7EA; --warn-bg:#FEF3C7; --bad-bg:#FDE8E8; --info-bg:#E3EEFC;
  --radius:18px;
}
body[data-role="service"]{--accent:#22C55E;--accent-soft:#E2F7E9;--accent-ink:#15803D}
body[data-role="sales"]{--accent:#EA580C;--accent-soft:#FDEEE3;--accent-ink:#C2410C}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:"Poppins",system-ui,-apple-system,"Segoe UI",sans-serif;
  background:var(--bg); color:var(--ink); font-size:15px; line-height:1.45;
}
h1,h2,h3,h4{font-family:"Poppins",system-ui,sans-serif; font-weight:600; letter-spacing:-.01em; margin:0}
a{color:var(--accent)}
button{font:inherit; cursor:pointer}
input,select,textarea{font:inherit; color:var(--ink)}
.muted{color:var(--muted)} .faint{color:var(--faint)} .small{font-size:13px}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:13px}
.nowrap{white-space:nowrap}

/* ---------- shell ---------- */
#app{display:flex; min-height:100vh}
.sidebar{
  width:264px; flex:0 0 264px; background:#fff; border-right:1px solid var(--line);
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh; overflow-y:auto;
  padding:18px 14px 16px;
}
.brand{padding:2px 0 14px; border-bottom:1px solid var(--line); margin-bottom:12px; text-align:left}
.brand .logo{
  width:38px; height:38px; border-radius:10px; background:var(--accent);
  display:inline-flex; align-items:center; justify-content:center;
  color:#fff; vertical-align:middle; margin-right:10px;
}
.brand b{font-size:17px}
.brand span{display:block; color:var(--muted); font-size:12.5px; margin-top:2px}
.brand .rolechip{display:inline-block; margin-top:8px; background:var(--accent-soft); color:var(--accent-ink); font-weight:700; font-size:12px; border-radius:999px; padding:3px 10px}
.nav{flex:1}
.nav-group{font-size:10.5px; letter-spacing:.14em; color:var(--faint); font-weight:600; margin:14px 8px 6px; text-transform:uppercase}
.nav-item{
  display:flex; align-items:center; gap:11px; width:100%; text-align:left;
  padding:9px 10px; margin:1px 0; border:0; border-radius:12px;
  background:transparent; color:#3E4C5E; font-size:14.5px; font-weight:600; min-height:44px;
}
.nav-item:hover{background:#F3F6FA}
.nav-item.active{background:var(--accent); color:#fff; font-weight:700}
.nav-item .tile{width:34px; height:34px; flex:0 0 34px; border-radius:10px; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent-ink)}
.nav-item.active .tile{background:rgba(255,255,255,.94); color:var(--accent)}
.nav-item .badge{margin-left:auto; background:var(--accent); color:#fff; border-radius:999px; min-width:20px; height:20px; font-size:12px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; padding:0 6px}
.nav-item.active .badge{background:#fff; color:var(--accent)}
.side-foot{padding-top:14px; border-top:1px solid var(--line); font-size:13px; color:var(--muted)}
.side-foot b{color:var(--ink)}
.side-foot .avatar{width:38px; height:38px}
.langrow{display:flex; align-items:center; gap:9px; padding:12px 4px 8px; font-weight:700; color:#3E4C5E}
.langrow .gic{color:var(--accent-ink); display:inline-flex}
.langrow select{margin-left:auto; border:1px solid var(--line); border-radius:9px; font:inherit; font-weight:700; padding:4px 6px; background:#fff}
.logout{width:100%; border:1.5px solid var(--accent); color:var(--accent-ink); background:#fff; border-radius:12px; font:inherit; font-weight:600; padding:10px; cursor:pointer; min-height:44px; display:flex; align-items:center; justify-content:center; gap:8px; margin-top:8px}
.logout:hover{background:var(--accent-soft)}
.side-foot a{color:var(--accent-ink)}
.main{flex:1; min-width:0; display:flex; flex-direction:column}
.topbar{
  display:flex; align-items:center; gap:14px; padding:14px 22px;
  background:#fff; border-bottom:1px solid var(--line); flex-wrap:wrap;
}
.topbar h1{font-size:23px; font-weight:700}
.topbar .sub{color:var(--muted); font-size:13px; margin-top:2px}
.topbar .spacer{flex:1}
.search{
  display:flex; align-items:center; gap:8px; background:#fff; border:1px solid var(--line);
  border-radius:999px; padding:0 16px; min-width:280px;
}
.search .sic{display:inline-flex; color:var(--faint)}
.search input{border:0; outline:0; flex:1; background:transparent; padding:10px 0}
.userchip{display:flex; align-items:center; gap:9px; font-weight:600}
.userchip .ini{font-size:13px; font-weight:600; color:var(--muted)}
.avatar{
  width:40px; height:40px; border-radius:50%; background:var(--accent-soft); color:var(--accent-ink);
  display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:13px;
}
.bellwrap{position:relative}
.bell{position:relative; width:42px; height:42px; border-radius:50%; border:1px solid var(--line); background:#fff; display:grid; place-items:center; color:#3E4C5E; cursor:pointer}
.bell:hover{background:#F3F6FA; color:var(--accent-ink)}
.bell i{position:absolute; top:6px; right:8px; width:9px; height:9px; border-radius:50%; background:#EF4444; border:2px solid #fff}
.notif-drop{
  position:absolute; right:0; top:50px; width:360px; max-width:90vw; max-height:70vh; overflow-y:auto;
  background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:0 18px 40px rgba(15,34,51,.18);
  padding:16px; z-index:60;
}
.notif-item{padding:10px 0; border-bottom:1px solid #EDF1F6}
.notif-item:last-child{border-bottom:0}
.content{padding:20px 22px 40px; max-width:1240px; width:100%; margin:0 auto; display:flex; flex-direction:column; gap:18px}

/* ---------- cards / grids ---------- */
.grid{display:grid; gap:14px}
.g4{grid-template-columns:repeat(4,1fr)} .g3{grid-template-columns:repeat(3,1fr)}
.g2{grid-template-columns:repeat(2,1fr)} .g2wide{grid-template-columns:1.9fr 1fr}
.grid2{display:grid; grid-template-columns:1.9fr 1fr; gap:18px}
.grid2b{display:grid; grid-template-columns:1fr 1fr; gap:18px}
.grid3{display:grid; grid-template-columns:repeat(3,1fr); gap:18px}
@media(max-width:1100px){ .g4{grid-template-columns:repeat(2,1fr)} .g3,.g2,.g2wide,.grid2,.grid2b,.grid3{grid-template-columns:1fr} }
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:18px; box-shadow:0 1px 2px rgba(15,34,51,.04)}
.card h2{font-size:16.5px; font-weight:600} .card h3{font-size:15px}
.card .lede{color:var(--muted); font-size:13px; margin-top:4px}
.kpi .top{display:flex; justify-content:space-between; align-items:flex-start}
.kpi .icon{width:38px; height:38px; border-radius:11px; background:var(--accent-soft); color:var(--accent-ink); display:grid; place-items:center}
.kpi .num{font-family:"Poppins",sans-serif; font-size:27px; font-weight:800; margin:10px 0 2px}
.kpi .label{color:var(--muted); font-size:13px; font-weight:500}
.kpi .delta{font-size:11.5px; font-weight:500; border-radius:999px; padding:3px 8px; display:inline-flex; align-items:center; gap:4px}
.kpi .delta.up{background:#E4F7EA; color:#15803D}
.kpi .delta.down{background:#FDE8E8; color:#B91C1C}
.kpi .note{font-size:13px; color:var(--muted); margin-top:4px}
.section{margin-top:2px}
.row{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.row.end{justify-content:flex-end} .row.between{justify-content:space-between}
.mt{margin-top:16px} .mb{margin-bottom:16px}
.legend{display:flex; flex-direction:column; gap:9px; margin-top:12px}
.legend .row{display:flex; align-items:center; gap:8px; font-size:13.5px; font-weight:600}
.legend .row b{margin-left:auto; font-weight:700; color:var(--muted)}
.dot{width:10px; height:10px; border-radius:50%; flex:0 0 10px}
.chartlegend{display:flex; gap:18px; justify-content:center; font-size:12.5px; font-weight:500; color:var(--muted); flex-wrap:wrap}

/* ---------- tables ---------- */
table.tbl{width:100%; border-collapse:collapse; font-size:14px}
.tbl th{
  text-align:left; font-size:12.5px; color:var(--muted);
  padding:10px 8px; border-bottom:1px solid var(--line); font-weight:700; white-space:nowrap;
}
.tbl td{padding:12px 8px; border-bottom:1px solid #EDF1F6; vertical-align:middle}
.tbl tr:last-child td{border-bottom:0}
.tbl tr.clickable{cursor:pointer}
.tbl tr.clickable:hover td{background:#F7FAFD}
.tblwrap{overflow-x:auto}
.person{display:flex; align-items:center; gap:10px}
.person .avatar{width:34px; height:34px; font-size:12.5px}
.person b{display:block; font-size:14px}
.person span{font-size:12.5px; color:var(--muted)}

/* ---------- pills / buttons ---------- */
.pill{
  display:inline-block; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600;
  background:var(--info-bg); color:#1D4ED8; white-space:nowrap;
}
.pill.ok{background:var(--ok-bg); color:#15803D}
.pill.warn{background:var(--warn-bg); color:#92400E}
.pill.bad{background:var(--bad-bg); color:#B91C1C}
.pill.grey{background:#EEF2F7; color:#475569}
.btn{
  display:inline-flex; align-items:center; gap:7px; padding:10px 18px; border-radius:12px;
  border:1.5px solid var(--accent); background:#fff; color:var(--accent-ink); font-weight:600; font-size:14px; min-height:44px;
}
.btn:hover{background:var(--accent-soft)}
.btn.primary{background:var(--accent); border-color:var(--accent); color:#fff}
.btn.primary:hover{opacity:.92; background:var(--accent)}
.btn.danger{color:var(--red); border-color:#F0C4C4}
.btn.danger:hover{border-color:var(--red); color:var(--red); background:#FDE8E8}
.btn.small{padding:6px 13px; min-height:38px; border-radius:10px; font-size:13.5px}
.btn:disabled{opacity:.55; cursor:not-allowed}
.btn.quiet{border-color:transparent; background:transparent; color:var(--accent)}
.linklike{background:none; border:0; color:var(--accent); font-weight:700; padding:0}
.linklike:hover{text-decoration:underline}

/* ---------- forms ---------- */
.field{margin-bottom:14px}
.field label{display:block; font-weight:600; font-size:13.5px; margin-bottom:5px}
.field .hint{font-weight:400; color:var(--faint); font-size:12.5px}
.input,select.input,textarea.input{
  width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#fff;
}
.input:focus{outline:2px solid var(--accent); border-color:var(--accent)}
textarea.input{min-height:110px; resize:vertical}
.formgrid{display:grid; grid-template-columns:1fr 1fr; gap:0 16px}
.addrgrid{display:grid; grid-template-columns:1fr 1fr; gap:0 14px}
.addrgrid .full{grid-column:1 / -1}
@media(max-width:700px){ .formgrid,.addrgrid{grid-template-columns:1fr} }
.check{display:flex; gap:10px; align-items:flex-start; font-size:14px; margin:8px 0}
.check input{margin-top:3px}
.switch{position:relative; display:inline-flex; align-items:center; gap:10px; cursor:pointer}
.switch input{width:18px; height:18px; accent-color:var(--accent)}
.switchrow{display:flex; justify-content:space-between; align-items:center; gap:14px; padding:12px 0; border-bottom:1px solid #EDF1F6}
.switchrow:last-child{border-bottom:0}
.switchrow p{margin:2px 0 0; color:var(--muted); font-size:13px}

/* ---------- banners / states ---------- */
.notice{
  border-radius:12px; padding:14px 16px; font-size:14px; margin:0 0 16px;
  background:var(--info-bg); border:1px solid #BFD9F5; color:var(--blue-ink);
}
.notice.warn{background:var(--warn-bg); border-color:#F0D9A8; color:#6B4400}
.notice.bad{background:var(--bad-bg); border-color:#F0C4C4; color:#8F1D1D}
.notice b{font-weight:700}
.empty{padding:36px 20px; text-align:center; color:var(--muted)}
.empty b{display:block; color:var(--ink); font-size:16px; margin-bottom:6px}
.loading{padding:40px; text-align:center; color:var(--muted)}
.skel{height:16px; border-radius:6px; background:linear-gradient(90deg,#EAF2FA,#F4F8FC,#EAF2FA); margin:8px 0}

/* ---------- login ---------- */
.login-wrap{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px}
.login-card{width:100%; max-width:460px; background:#fff; border:1px solid var(--line); border-radius:18px; padding:32px; box-shadow:0 30px 60px -18px rgba(10,53,110,.35)}
.login-card .brandline{display:flex; align-items:center; gap:12px; margin-bottom:8px}
.login-card .brandline .logo{width:44px; height:44px; border-radius:12px; background:var(--accent); color:#fff; display:inline-flex; align-items:center; justify-content:center}
.rolepick{display:flex; gap:8px; margin:16px 0}
.rolepick button{flex:1; padding:10px 6px; border-radius:10px; border:1px solid var(--line); background:#F4F8FC; font-weight:700; font-size:13.5px}
.rolepick button[aria-pressed="true"]{background:var(--accent); border-color:var(--accent); color:#fff}
.otp-row{display:flex; gap:8px}
.otp-row input{width:48px; height:52px; text-align:center; font-size:22px; font-weight:800; border:1px solid var(--line); border-radius:10px}

/* ---------- workflow steps ---------- */
.steps{list-style:none; margin:0; padding:0}
.steps li{display:flex; gap:12px; padding:12px 0; border-bottom:1px solid #EAF2FA}
.steps li:last-child{border-bottom:0}
.stepnum{
  width:28px; height:28px; flex:0 0 28px; border-radius:50%; background:var(--accent-soft); color:var(--accent-ink);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px;
}
.steps li.done .stepnum{background:#16A34A; color:#fff}
.steps li.current .stepnum{background:var(--accent); color:#fff}
.steps b{display:block; font-size:14.5px}
.steps span{font-size:13px; color:var(--muted)}
.timeline{list-style:none; margin:0; padding:0}
.timeline li{padding:10px 0 10px 18px; border-left:2px solid var(--line); position:relative}
.timeline li::before{content:""; position:absolute; left:-6px; top:16px; width:10px; height:10px; border-radius:50%; background:var(--accent)}
.timeline b{display:block; font-size:14.5px}
.timeline span{font-size:13px; color:var(--muted)}

/* ---------- modal / toast ---------- */
.modal-back{position:fixed; inset:0; background:rgba(10,31,58,.5); display:flex; align-items:center; justify-content:center; padding:20px; z-index:50}
.modal{background:#fff; border-radius:16px; max-width:640px; width:100%; max-height:88vh; overflow-y:auto; padding:24px}
.modal h2{font-size:19px; margin-bottom:4px}
#toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%); z-index:99;
  background:var(--ink); color:#fff; padding:12px 20px; border-radius:999px; font-weight:600; font-size:14px;
  box-shadow:0 12px 30px rgba(0,0,0,.3); display:none; max-width:90vw;
}
#toast.err{background:var(--red)}
.tabs{display:flex; gap:8px; flex-wrap:wrap; margin:0 0 16px}
.tabs button{padding:8px 14px; border-radius:999px; border:1px solid var(--line); background:#fff; font-weight:700; font-size:13.5px}
.tabs button[aria-pressed="true"]{background:var(--accent); border-color:var(--accent); color:#fff}
.chiprow{display:flex; gap:8px; flex-wrap:wrap}
.chip{padding:6px 12px; border-radius:999px; border:1px solid var(--line); background:#fff; font-size:13px; font-weight:700}
.chip[aria-pressed="true"]{background:var(--accent); border-color:var(--accent); color:#fff}
.bar{height:10px; background:var(--accent-soft); border-radius:99px; overflow:hidden}
.bar > i{display:block; height:100%; background:var(--accent); border-radius:99px}
.weekgrid{display:grid; grid-template-columns:90px repeat(7,1fr); gap:6px; align-items:center; font-size:13px}
.weekgrid .cell{border:1px solid var(--line); border-radius:8px; padding:8px 4px; text-align:center; background:#fff; cursor:pointer; min-height:44px}
.weekgrid .cell.open{background:var(--ok-bg); border-color:#9AD8CB}
.weekgrid .cell.full{background:var(--warn-bg); border-color:#EBCB8B}
.weekgrid .cell.off{background:#EDF2F7; color:var(--faint)}
.weekgrid .cell b{display:block; font-size:13px}
.weekgrid .cell span{font-size:11px; color:var(--muted)}
.week{display:grid; grid-template-columns:repeat(7,1fr); gap:10px}
.day{border:1px solid var(--line); border-radius:14px; padding:12px; background:#fff}
.day h4{margin:0 0 2px; font-size:14px; font-weight:600}
.day .hrs{font-weight:600; color:var(--accent-ink); font-size:13px}
.day .slots{color:var(--muted); font-size:12px; margin-top:6px; line-height:1.7}
.day.closed{background:#F8FAFC; color:var(--faint)}
.day.closed .hrs{color:var(--faint)}
@media(max-width:1100px){ .week{grid-template-columns:repeat(2,1fr)} }
.kv{display:grid; grid-template-columns:170px 1fr; gap:6px 14px; font-size:14px}
.kv dt{color:var(--faint); font-size:12px; letter-spacing:.06em; text-transform:uppercase; font-weight:700; padding-top:2px}
.kv dd{margin:0}
.dispatchcols{display:grid; grid-template-columns:1fr 1fr; gap:18px}
@media(max-width:1100px){ .dispatchcols{grid-template-columns:1fr} }
.techrow{display:flex; gap:11px; align-items:flex-start; padding:12px 0; border-bottom:1px solid #EDF1F6}
.techrow:last-child{border-bottom:0}
.comm-card{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px; border:1px solid var(--line); border-radius:12px; margin-bottom:8px; background:#F7FAFD}
.footer-note{color:var(--faint); font-size:12.5px; padding:24px 0 8px; text-align:center}
@media(max-width:860px){
  .sidebar{position:fixed; z-index:40; transform:translateX(-100%); transition:transform .2s; height:100dvh}
  .sidebar.open{transform:none}
  .topbar{padding:14px 16px} .content{padding:16px 16px 40px}
  .search{display:none}
  #menuBtn{display:inline-flex !important}
}
#menuBtn{display:none}
