/* Qlean Platform Admin: desktop shell, controls and list surfaces. */
@font-face {
  font-family: Inter;
  src: url('/assets/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f8f9fa;
  --card: #fff;
  --ink: #212529;
  --mute: #69737e;
  --line: #e3e7ed;
  --line2: #ced4da;
  --link: #1971c2;
  --blue: #228be6;
  --side: #2e333b;
  --ok: #237536;
  --warn: #985400;
  --bad: #c92a2a;
  --soft-bad: #fff5f5;
  --soft-warn: #fff9db;
  --r: 8px;
  font: 14px/1.55 Inter, system-ui, sans-serif;
  font-optical-sizing: auto;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
body, dialog { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden], .hidden { display: none !important; }

.app { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100dvh; }
#sidebar { position: sticky; top: 0; align-self: start; height: 100dvh; background: var(--side); color: white; }
.logo { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 18px; }
.brand-mark { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; background: #27b86b; color: white; font-size: 21px; font-weight: 700; line-height: 1; }
.brand-name { flex: 1; font-size: 21px; font-weight: 500; white-space: nowrap; }
.nav-toggle { flex: 0 0 28px; height: 28px; border: 0; border-radius: 4px; background: transparent url('/assets/nav-close.svg') center no-repeat; font-size: 0; }
.nav-toggle:hover { background-color: #43474f; }
#sidebar nav { display: grid; gap: 6px; padding: 16px 10px; }
#sidebar .nav { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 11px; border-radius: 8px; color: #d7dbe1; font-size: 15px; font-weight: 500; }
#sidebar .nav:hover { background-color: #393e46; text-decoration: none; }
#sidebar .nav.on { background-color: #2d4e45; color: white; }
.nav-icon { flex: 0 0 28px; height: 28px; border-radius: 7px; background-color: #43474f; background-repeat: no-repeat; background-position: center; }
.nav.on .nav-icon { background-color: #27b86b; }
.nav[data-page='cleaners'] .nav-icon { background-image: url('/assets/nav-cleaner.svg'); }
.nav[data-page='orders'] .nav-icon { background-image: url('/assets/nav-order.svg'); }
.app > main { min-width: 0; background: var(--bg); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; padding: 0 34px; background: #fff; }
.top b { color: #2f343b; font-size: 18px; font-weight: 500; }
.top .u { display: flex; align-items: center; gap: 14px; color: var(--mute); }
#live { font-size: 12px; }
.page { max-width: 2000px; padding: 26px 30px 40px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.t { font-size: clamp(28px, 2.4vw, 34px); line-height: 1.3; letter-spacing: -.04em; font-weight: 700; }
.sub { margin-top: 4px; color: var(--mute); font-size: 14px; }
.tabs { display: flex; overflow-x: auto; gap: 0; margin: 20px 0 16px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; white-space: nowrap; font-weight: 500; }
.tab:hover { background: #eef1f4; }
.tab.on { border-color: var(--blue); color: var(--link); }
.tab em { border-radius: 10px; padding: 0 6px; color: #495057; background: #e9ecef; font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; }
.tab.on em { background: #d0ebff; color: #1864ab; }
.tabs :focus-visible { outline-offset: -3px; }

.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line2); border-radius: 3px; padding: 0 16px; min-height: 36px; color: var(--ink); background: white; font-size: 14px; font-weight: 600; line-height: 1.2; }
.btn:hover { background-color: #f1f3f5; text-decoration: none; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn.dark, .btn.primary { border-color: var(--blue); background: var(--blue); color: white; }
.btn.dark:hover, .btn.primary:hover { background: #1c7ed6; border-color: #1c7ed6; }
.btn:disabled, button:disabled { color: #868e96; background: #e9ecef; cursor: not-allowed; }
#filter-toggle { flex-shrink: 0; }
.alerts { display: grid; gap: 8px; }
.alerts:not(:empty) { margin-bottom: 14px; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid; border-radius: 8px; }
.alert.bad { border-color: #ffc9c9; background: var(--soft-bad); color: #a61e1e; }
.alert.warn { border-color: #ffec99; background: var(--soft-warn); color: #845300; }
.alert .btn { flex-shrink: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi, .results, .oc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.kpi { text-align: left; min-width: 0; padding: 12px 16px; }
.kpi:hover, .kpi.selected { border-color: #74c0fc; }
.kpi.selected { background: #e7f5ff; }
.kpi .h { color: #495057; font-size: 13px; font-weight: 500; line-height: 1.35; }
.kpi .v { margin-top: 4px; color: var(--ink); font-size: 27px; font-weight: 700; line-height: 1.2; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

.results, .filters { min-width: 0; }
.count, .leg, .meta, .m, .mut { color: var(--mute); }
.count { font-size: 14px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(148px,1fr)); align-items: end; gap: 12px; padding: 0 16px 16px; }
.filters h2 { font-size: 18px; line-height: 1.35; }
.fil, .f { display: grid; gap: 4px; font-size: 14px; line-height: 1.4; font-weight: 500; }
.fil input, .fil select, .f input { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line2); border-radius: 3px; background-color: white; color: var(--ink); font-weight: 400; font-size: 14px; }
.fil input::placeholder, .f input::placeholder { color: #78828c; }
.fil input:focus, .fil select:focus, .f input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px #228be620; }
.fil select { appearance: none; padding-right: 30px; background: white url('/assets/select-chevron.svg') right 9px center no-repeat; }
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 5px; background: #f1f3f5; }
.seg button { flex: 1; border: 0; border-radius: 3px; min-height: 30px; background: transparent; color: #495057; }
.seg .on { background: white; color: var(--ink); box-shadow: 0 1px 3px #21252922; }
.tw { width: 100%; overflow: auto; scrollbar-color: #b5bdc6 transparent; max-height: max(56vh, 340px); }
.g { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.45; }
.g th, .g td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.g th { position: sticky; z-index: 2; top: 0; min-height: 52px; background: white; font-weight: 600; }
.g td { background: white; height: 54px; }
.g td.wr { min-width: 115px; max-width: 265px; white-space: normal; overflow-wrap: anywhere; }
.g td.wr:first-child { min-width: 147px; }
.g td:first-child, .g th:first-child { position: sticky; left: 0; z-index: 1; border-right: 1px solid #edf0f3; }
.g th:first-child { z-index: 3; }
.g tr:hover td { background-color: #f8f9fa; }
.g tr:last-child td { border-bottom: 0; }
.st { display: inline-flex; align-items: center; min-height: 20px; padding: 1px 8px; border-radius: 20px; background: #d3f9d8; color: #237536; font-size: 12px; font-weight: 600; }
.st.zero { color: #495057; background: #f1f3f5; }
.st.off { color: #59616b; background: #edf0f2; }
.st.rs { color: var(--warn); background: #fff0ce; }
.st.rs.ft { color: var(--bad); background: #ffe3e3; }
.uc { border: 0; padding: 0; background: none; font-size: inherit; font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px; }
.u-g, .chk .ok { color: var(--ok); }
.u-o, .wnr { color: var(--warn); }
.u-r, .u-x, .bad, .low { color: var(--bad); }
.u-x, .rt.low { font-weight: 750; }

#login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.lcard { width: min(360px, 100%); display: grid; gap: 20px; }
.lcard h1 { font-weight: 700; font-size: 26px; letter-spacing: -.035em; }
.lcard .f { font-weight: 600; }
.login-actions { justify-content: space-between; }
.login-actions .btn { flex: 0 0 92px; }
.hint { font-size: 12px; color: var(--mute); }
.err { color: var(--bad); font-size: 13px; }
.err:empty { display: none; }
#see { font-size: 0; }
#see::before { content: ''; display: block; width: 20px; height: 20px; margin: auto; background: url('/assets/eye.svg') center no-repeat; }

.modal { padding: 24px; }
.mh { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.mh h2 { font-size: 22px; line-height: 1.35; letter-spacing: -.025em; }
.mh .meta { margin-top: 4px; }
.x { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border: 0; border-radius: 4px; background: transparent url('/assets/close.svg') center no-repeat; font-size: 0; }
.x:hover { background-color: #f1f3f5; }
.sec { margin: 22px 0 10px; font-weight: 600; font-size: 18px; }
.leg { font-size: 13px; }
.ol { display: grid; gap: 10px; }
.oc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 16px; }
.oc h4 { font-size: 16px; font-weight: 600; }
.oc .m { margin-top: 3px; }
.cmp { display: grid; gap: 3px; margin-top: 10px; }
.cmp b { font-weight: 600; }
.chk { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 13px; }
.empty, .g td.empty { color: var(--mute); text-align: center; padding: 30px 14px; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 6px; color: white; background: var(--side); box-shadow: 0 4px 16px #21252929; }

@media (min-width: 901px) {
  .app.collapsed { grid-template-columns: 72px minmax(0, 1fr); }
  .collapsed .brand-name, .collapsed .nav-label { display: none; }
  .collapsed .logo, .collapsed .nav { justify-content: center; }
  .collapsed .logo { position: relative; }
  .collapsed .nav-toggle { position: absolute; width: 38px; height: 38px; border-radius: 50%; background: transparent; }
  .collapsed .nav-toggle:hover { outline: 2px solid #ffffff60; }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .kpis { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 7px; }
  .kpi { padding: 12px; }
  .filters { padding: 15px; }
}
@media (max-width: 900px) {
  .app { display: block; }
  #sidebar { display: none; position: fixed; z-index: 20; inset: 0 auto 0 0; width: min(280px, 85vw); box-shadow: 4px 0 24px #21252933; }
  .nav-open #sidebar { display: block; }
  .top { padding: 0 16px; }
  .page { padding: 22px 16px 32px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .filters h2 { grid-column: 1 / -1; }
  .filters .btn { justify-self: start; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 8px; }
}
@media (max-width: 540px) {
  .page { padding: 16px 12px 26px; }
  .top { padding: 0 12px; }
  .top .u { gap: 7px; }
  .top b { font-size: 15px; }
  .top #who { font-size: 12px; }
  .page-head { align-items: start; }
  .page-head .btn { min-height: 32px; max-width: 110px; padding: 4px 9px; font-size: 12px; }
  .sub { font-size: 14px; }
  .tabs { margin: 15px 0 12px; }
  .tab { padding: 8px 11px; }
  .alert { align-items: start; }
  .alert .btn { font-size: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 10px 12px; }
  .kpi .v { font-size: 23px; }
  .filters { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }
  .g th, .g td { padding: 10px; }
  .g td.wr:first-child { min-width: 120px; max-width: 145px; }
}
