/* Cleanumi app styles — mobile first */
:root {
  --g900: #063d1c; --g800: #0a5528; --g700: #0b6b2e; --g600: #11823a; --g500: #22a447; --g400: #4cc35f; --lime: #8dc63f;
  --g100: #e3f4e6; --g50: #f2faf3;
  --ink: #15241a; --muted: #5d6b62; --line: #e1e8e3; --bg: #f6f8f6; --card: #fff;
  --red: #c62828; --red-bg: #fdecec; --amber: #b26a00; --amber-bg: #fff4e0; --blue: #1c5fb8; --blue-bg: #e8f0fc;
  --r: 16px; --shadow: 0 1px 2px rgba(10, 40, 20, .06), 0 4px 16px rgba(10, 40, 20, .06);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 66px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--g700); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--g700); color: #fff; }
.topbar h1 { font-size: 17px; font-weight: 600; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .5px; font-size: 18px; flex: 1; }
.topbar .brand svg { width: 30px; height: 30px; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; text-decoration: none; }
.iconbtn:hover { background: rgba(255,255,255,.22); }
.dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--lime); color: var(--g900); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.demo-bar { background: var(--amber-bg); color: #6b4100; font-size: 12.5px; padding: 6px 16px; text-align: center; }
.demo-bar button { border: 0; background: none; text-decoration: underline; color: inherit; cursor: pointer; font-size: 12.5px; }
main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
main.no-nav { padding-bottom: 32px; }

.bottomnav { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: #fff; border-top: 1px solid var(--line); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; color: var(--muted); text-decoration: none; position: relative; }
.bottomnav a.on { color: var(--g700); font-weight: 600; }
.bottomnav a.on::before { content: ""; position: absolute; top: 0; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--g600); }
.bottomnav .dot { top: 6px; right: calc(50% - 22px); }

/* Desktop: side navigation (mostly for the admin dashboard) */
@media (min-width: 980px) {
  body.has-nav #app { padding-left: 232px; }
  .bottomnav { top: 0; right: auto; width: 232px; height: 100%; flex-direction: column; justify-content: flex-start; padding: 84px 12px 12px; border-top: 0; border-right: 1px solid var(--line); gap: 2px; overflow-y: auto; }
  .bottomnav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: 14.5px; }
  .bottomnav a.on { background: var(--g50); }
  .bottomnav a.on::before { display: none; }
  .bottomnav a.mobile-only { display: none; }
  .bottomnav a.desk-only { display: flex; }
  .bottomnav .dot { position: static; margin-left: auto; }
  main { max-width: 1080px; padding: 28px 32px 40px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
}
.bottomnav a.desk-only { display: none; }
@media (min-width: 980px) { .bottomnav a.desk-only { display: flex; } }

/* ---------- building blocks ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2, .card h3 { margin: 0 0 8px; }
h2 { font-size: 19px; margin: 6px 0 12px; }
h3 { font-size: 16px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.right { text-align: right; }
.center { text-align: center; }
.hide { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: 1.5px solid transparent;
  background: var(--g600); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; min-height: 46px; }
.btn:hover { background: var(--g700); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--g700); border-color: var(--line); }
.btn.ghost:hover { background: var(--g50); }
.btn.danger { background: #fff; color: var(--red); border-color: #f3c7c7; }
.btn.danger:hover { background: var(--red-bg); }
.btn.lime { background: var(--lime); color: var(--g900); }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: 13.5px; border-radius: 10px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btns > .btn { flex: 1; }

label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #2c3d32; }
input.in, select.in, textarea.in { width: 100%; padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; outline: none; min-height: 46px; }
textarea.in { min-height: 90px; resize: vertical; }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--g500); box-shadow: 0 0 0 3px rgba(34, 164, 71, .15); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.err { background: var(--red-bg); color: var(--red); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }

.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { width: 46px; height: 44px; border: 0; background: var(--g50); color: var(--g700); font-size: 20px; cursor: pointer; }
.stepper output { flex: 1; text-align: center; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 13.5px; user-select: none; }
.chip input { display: none; }
.chip.on, .chip:has(input:checked) { border-color: var(--g500); background: var(--g50); color: var(--g800); font-weight: 600; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; scrollbar-width: none; }
.tabs a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); color: var(--muted); text-decoration: none; font-size: 13.5px; }
.tabs a.on { background: var(--g700); border-color: var(--g700); color: #fff; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-green { background: var(--g100); color: var(--g800); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-red { background: var(--red-bg); color: var(--red); }
.b-blue { background: var(--blue-bg); color: var(--blue); }
.b-grey { background: #eef1ef; color: var(--muted); }

.list { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.item:last-child { border-bottom: 0; }
a.item:hover { background: var(--g50); }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; }
.item .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--g100); color: var(--g700); flex: none; }
.ico.lg { width: 52px; height: 52px; }
.ico svg.i { width: 24px; height: 24px; }

.hero { background: linear-gradient(135deg, var(--g700), var(--g500)); color: #fff; border-radius: 20px; padding: 20px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(141, 198, 63, .35); }
.hero h2 { margin: 0 0 4px; font-size: 21px; }
.hero p { margin: 0 0 14px; opacity: .92; position: relative; z-index: 1; }
.hero .btn { position: relative; z-index: 1; }

.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.svc { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; border: 1.5px solid transparent; }
.svc:hover { border-color: var(--g400); }
.svc .n { font-weight: 600; font-size: 14px; line-height: 1.25; }
.svc .p { color: var(--g700); font-weight: 700; font-size: 14px; }

.stat { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat.hl { background: var(--g700); color: #fff; }
.stat.hl .k { color: rgba(255,255,255,.8); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.price-box { background: var(--g50); border: 1.5px dashed var(--g400); border-radius: 14px; padding: 14px; }
.price-box .total { font-size: 24px; font-weight: 700; color: var(--g800); }

.timeline { display: flex; gap: 4px; margin: 6px 0 4px; }
.timeline .st { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.timeline .st::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--line); margin-bottom: 6px; }
.timeline .st.done { color: var(--g700); font-weight: 600; }
.timeline .st.done::before { background: var(--g500); }

.stars { display: inline-flex; gap: 2px; color: #f0a500; }
.stars svg.i { width: 16px; height: 16px; fill: currentColor; }
.star-pick { display: flex; gap: 6px; justify-content: center; margin: 8px 0 12px; }
.star-pick button { border: 0; background: none; cursor: pointer; color: #d4d8d5; padding: 2px; }
.star-pick button.on { color: #f0a500; }
.star-pick svg.i { width: 36px; height: 36px; fill: currentColor; }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ico { margin: 0 auto 10px; width: 60px; height: 60px; border-radius: 18px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--g100); border-top-color: var(--g600); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 100; transition: .25s; max-width: calc(100% - 32px); font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--red); }

dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(460px, calc(100% - 24px)); max-height: calc(100% - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(6, 30, 14, .45); }
dialog.modal .mh { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
dialog.modal .mh h3 { margin: 0; }
dialog.modal .mb { padding: 18px; }
dialog.modal .x { border: 0; background: none; cursor: pointer; color: var(--muted); }

/* auth */
.auth { min-height: 100%; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--g700) 0, var(--g600) 260px, var(--bg) 260px); }
.auth-head { color: #fff; text-align: center; padding: calc(34px + env(safe-area-inset-top)) 20px 26px; }
.auth-head svg.logo { width: 76px; height: 76px; }
.auth-head .name { font-size: 30px; font-weight: 800; letter-spacing: 1px; margin-top: 4px; }
.auth-head .tag { opacity: .9; font-style: italic; }
.auth .card { max-width: 440px; width: calc(100% - 32px); margin: 0 auto 18px; padding: 22px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.role-pick label { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; text-align: center; font-size: 13.5px; }
.role-pick label b { display: block; font-size: 14.5px; }
.role-pick input { display: none; }
.role-pick label:has(input:checked) { border-color: var(--g500); background: var(--g50); }
.demo-pick { display: grid; gap: 8px; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.t th, table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.t th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; background: #fafcfa; }
.table-wrap { overflow-x: auto; border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 14px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd8d2; border-radius: 15px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--g500); }
.switch input:checked + span::before { transform: translateX(20px); }
.file-drop { display: flex; align-items: center; gap: 12px; border: 1.5px dashed var(--g400); border-radius: 14px; padding: 12px; background: var(--g50); cursor: pointer; }
.file-drop input { display: none; }
