/*
 * AsiatiK ERP - stylesheet
 *
 *  1. Tokens and base
 *  2. Buttons and form controls
 *  3. Logo, boot screen and sign-in
 *  4. Application shell: sidebar, navigation, top bar
 *  5. Dashboard, panels, tables, status
 *  6. Enquiries board
 *  7. Dialogs and workflow forms
 *  8. (Customer Portal moved to the website)
 *  9. Responsive: tablet, phone
 * 10. Accessibility
 */

/* ---------- 1. Tokens and base ---------- */
:root {
  /* AsiatiK 2026 look: light ground, white cards, near-black rail, AsiatiK red for action */
  --bg: #eef0f3;
  --panel: #ffffff;
  --panel-2: #f4f6f8;
  --line: #e1e6ea;
  --line-soft: #eef1f4;
  --text: #1b2630;
  --muted: #56616b;
  --ink: #16181d;
  --red: #c8102e;
  --red-dark: #9e0c24;
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --zoom: 1;               /* computers show the ERP at 90% (set below) */
  --cyan: #0f9d8c;
  --green: #12a150;
  --yellow: #b7791f;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --sidebar-w: 84px;
  color-scheme: light;
}


html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body { overflow-x: hidden; }
body.modal-open { overflow: hidden; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.full { grid-column: 1 / -1; }

.eyebrow {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 800;
}

.svg { display: block; flex: 0 0 auto; }

/* ---------- 2. Buttons and form controls ---------- */
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: #44545f;
  font-weight: 700;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(15, 157, 140, .14);
}
textarea { min-height: 100px; resize: vertical; }

.primary, .ghost, .danger, .icon {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  color: var(--text);
  background: #ffffff;
  font-weight: 600;
  transition: transform .15s var(--ease), background .15s, box-shadow .15s, filter .15s;
}
.primary:active, .ghost:active, .danger:active, .icon:active { transform: scale(.97); }
.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(200, 16, 46, .22);
}
.danger { background: #fdecee; border-color: #f0b4bb; }
.primary:hover { filter: brightness(1.08); }
button:disabled { opacity: .55; cursor: progress; }
.wide { width: 100%; }

.icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: #f3f6f9;
}

.check { display: flex; align-items: center; gap: 7px; }
.check input { width: auto; }

.msg { min-height: 18px; color: #c0182a; font-size: 12px; }
.back-link, .login-row a { color: var(--cyan); text-decoration: none; font-size: 12px; }
.back-link { display: block; margin-top: 16px; }

/* ---------- 3. Logo, boot screen and sign-in ---------- */
.boot {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
}
.boot picture { display: contents; }
.boot img { width: min(640px, 88vw); height: auto; }
.boot p { margin: 0; color: var(--muted); font-size: 13px; min-height: 18px; }
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #d7dee4;
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 520px;
  align-items: center;
  padding: 7vw;
  gap: 8vw;
}
.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.login-brand img { width: min(560px, 80vw); height: auto; }
.login-brand small { display: block; color: var(--muted); margin-top: 5px; }
.login-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid #d3dae0;
  border-radius: 24px;
  padding: 38px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.login-card h1 { font-size: 34px; margin: 8px 0; }
.login-card form { display: grid; gap: 16px; margin-top: 24px; }
.login-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ---------- 4. Application shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh / var(--zoom));
  transition: grid-template-columns .26s var(--ease);
}
/* On computers the whole ERP is drawn at 90%; the rail widens and the page moves aside instead of being covered */
@media (min-width: 701px) {
  :root { --zoom: .9; }
  html { zoom: .9; }
  .app:has(#sidebar:hover), .app:has(#sidebar :focus-visible) { grid-template-columns: 252px minmax(0, 1fr); }
}

/* The menu: a near-black icon rail that opens with labels when pointed at */
#sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: calc(100vh / var(--zoom));
  width: auto;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--ink);
  color: #c3c9cf;
  transition: width .22s var(--ease), box-shadow .22s;
}
#sidebar::-webkit-scrollbar { display: none; }
.sidebar-logo { height: 104px; flex: 0 0 auto; display: flex; align-items: center; padding: 0 20px; }
.sidebar-logo .logo-mark { width: 44px; height: 44px; border-radius: 12px; background: #ffffff; padding: 4px; box-sizing: border-box; flex: 0 0 44px; }
.sidebar-logo .logo-full { display: none; width: 100%; height: 84px; object-fit: contain; background: #ffffff; border-radius: 14px; padding: 8px 12px; box-sizing: border-box; }
#sidebar:hover .logo-mark, #sidebar:has(:focus-visible) .logo-mark { display: none; }
#sidebar:hover .logo-full, #sidebar:has(:focus-visible) .logo-full { display: block; }

#nav { padding: 6px 19px; }
#nav .nav-section {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 4px;
  color: #8b949d;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity .15s, max-height .2s;
}
#sidebar:hover #nav .nav-section, #sidebar:has(:focus-visible) #nav .nav-section { max-height: 30px; opacity: 1; padding: 12px 4px 4px; }
#nav button {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2px 0;
  padding: 0 13px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #c3c9cf;
  text-align: left;
  font-weight: 600;
  transition: background .15s, color .15s;
}
#nav button span { opacity: 0; white-space: nowrap; transition: opacity .15s; }
#sidebar:hover #nav button span, #sidebar:has(:focus-visible) #nav button span { opacity: 1; }
#nav button:hover { background: rgba(255, 255, 255, .08); color: #ffffff; }
#nav button.active { background: var(--red); color: #ffffff; box-shadow: 0 8px 18px rgba(200, 16, 46, .35); }
#nav .ico { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: 0 0 20px; color: inherit; }

.side-footer { margin-top: auto; padding: 12px 19px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(255, 255, 255, .08); }
#sessionBadge { font-size: 11px; color: #8b949d; padding: 4px 2px 10px; white-space: nowrap; opacity: 0; max-height: 0; overflow: hidden; transition: opacity .15s; }
#sidebar:hover #sessionBadge, #sidebar:has(:focus-visible) #sessionBadge { opacity: 1; max-height: 60px; }
#logout { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 13px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .06); color: #c3c9cf; font-weight: 600; }
#logout span { opacity: 0; white-space: nowrap; transition: opacity .15s; }
#sidebar:hover #logout span, #sidebar:has(:focus-visible) #logout span { opacity: 1; }
#logout:hover { background: rgba(255, 255, 255, .12); color: #ffffff; }

/* Top bar: page title, the section's pages as pill tabs, alerts and account */
.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 78px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 14px 28px;
  background: var(--bg);
}
.topbar > div:not(.top-actions) { min-width: 0; }
.topbar h2 { margin: 2px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-tabs { display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: #ffffff; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.group-tabs:empty { display: none; }
.group-tabs::-webkit-scrollbar { display: none; }
.group-tabs button { flex: 0 0 auto; border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; color: #4a5560; font-weight: 600; white-space: nowrap; transition: background .18s var(--ease), color .18s; }
.group-tabs button:hover { background: var(--panel-2); color: var(--text); }
.group-tabs button.on { background: var(--ink); color: #ffffff; }
.top-actions .icon { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; box-shadow: var(--shadow); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #ffffff; font-weight: 800; }
@media (min-width: 701px) { #menu { display: none; } }
.main > section { padding: 24px; min-width: 0; }

/* ---------- 5. Dashboard, panels, tables, status ---------- */
.cards { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: #ffffff;
  border: 0;
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.kpi small { color: var(--muted); }
.kpi .value { font-size: 27px; font-weight: 900; margin-top: 8px; overflow-wrap: anywhere; }
.kpi.link, .stage.link { cursor: pointer; transition: border-color .15s, transform .15s; }
.kpi.link:hover, .stage.link:hover { border-color: var(--red); transform: translateY(-2px); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 16px; margin-top: 16px; }

.panel {
  min-width: 0;
  background: #ffffff;
  border: 0;
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 15px; }
.toolbar input { flex: 1 1 220px; max-width: 320px; }
.seg { display: inline-flex; border: 1px solid #cfd7de; border-radius: 10px; overflow: hidden; margin-left: auto; }
.seg button { border: 0; border-radius: 0; background: #f3f6f9; color: var(--muted); padding: 10px 16px; }
.seg button.on { background: var(--ink); color: #fff; font-weight: 700; }

.table { width: 100%; border-collapse: collapse; }
.table.compact { min-width: 0; }
.table th, .table td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 12.5px; vertical-align: top; overflow-wrap: break-word; }
.table.compact td { white-space: normal; }
.table tr:hover td { background: #f3f6f9; }
.table td.actions { width: 1%; min-width: 150px; }
.table td.actions .ghost { margin: 0 4px 4px 0; padding: 7px 10px; font-size: 12px; }

.status { display: inline-flex; border: 1px solid #d3dae0; border-radius: 99px; padding: 4px 8px; font-size: 10px; }
.status.green { color: var(--green); }
.status.red { color: #c0182a; }
.status.yellow { color: var(--yellow); }

.stagebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.stage {
  min-width: 0;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f1f4f7;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.stage b { display: block; font-size: 16px; color: var(--text); margin-bottom: 3px; }

.empty { padding: 30px; text-align: center; color: var(--muted); }

.note { margin: 10px 2px 0; font-size: 12px; }
.hint { align-self: center; color: var(--muted); font-size: 11px; }
.customer-360 { grid-column: 1 / -1; display: grid; gap: 14px; min-width: 0; }
.customer-360 .cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.customer-360 .kpi .value { font-size: 18px; }

/* ---------- 6. Enquiries board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.bcol { background: #f7f9fb; border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 140px; }
.bcol header { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #44545f; }
.bcol header em { font-style: normal; background: #eef2f5; border: 1px solid #d3dae0; border-radius: 99px; padding: 2px 9px; font-size: 11px; color: #fff; }
.bcard { background: #ffffff; border: 1px solid #dbe2e8; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.bcard:hover { border-color: #b8c4cd; }
.bhead { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-bottom: 6px; }
.bhead small { color: var(--muted); }
.bname { font-weight: 800; font-size: 13px; }
.bsub { color: var(--muted); font-size: 12px; margin: 2px 0 6px; }
.bpest { display: inline-block; font-size: 10px; color: var(--cyan); border: 1px solid #9bd6cf; border-radius: 99px; padding: 2px 8px; margin-bottom: 8px; }
.bactions { display: flex; flex-wrap: wrap; gap: 6px; }
.bactions button { padding: 6px 9px; font-size: 11px; }
.bempty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 6px; }

/* ---------- 7. Dialogs and workflow forms ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 34, 43, .5);
  overscroll-behavior: contain;
  animation: fade-in .2s ease both;
}
.modal-card {
  width: 100%;
  max-width: 850px;
  max-height: calc(92vh / var(--zoom));
  max-height: 92dvh;
  overflow: auto;
  overscroll-behavior: contain;
  background: #ffffff;
  border: 1px solid #d3dae0;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(20, 35, 50, .2);
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}
.modal-head h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.modal form { padding: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 8px; }

.payment-allocation-form { grid-column: 1 / -1; min-width: 0; width: 100%; }
.payment-allocation-form .payment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.payment-allocation-form .payment-grid .full { grid-column: 1 / -1; }
.payment-allocation-input { width: 130px; min-width: 100px; }
.payment-allocation-form .table th, .payment-allocation-form .table td { vertical-align: middle; }

.combined-pest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.combined-check { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.combined-check input { width: auto; }
.field-label { font-size: 12px; font-weight: 600; }
.combined-form-note { padding: 10px 12px; background: #eef4f8; border: 1px solid #d3e0e8; border-radius: 8px; color: #4a5d69; font-size: 12px; line-height: 1.5; }
.combined-section { border-bottom: 1px solid var(--line); padding: 8px 0 2px; margin-top: 8px; }
.combined-section h4 { margin: 0; font-size: 13px; }
.combined-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.combined-grid label { min-width: 0; }

#toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; max-width: calc(100vw - 40px); }
.toast { color: #fff; background: #17222b; border: 1px solid #17222b; padding: 12px 15px; border-radius: 10px; box-shadow: var(--shadow); font-size: 12px; overflow-wrap: anywhere; }
.toast.error { border-color: #9b2532; }

/* ---------- 9. Responsive ---------- */
@media (max-width: 1100px) {
  .login-screen { grid-template-columns: 1fr; padding: 35px; }
  .login-brand { align-items: center; text-align: center; }
  .login-brand img { width: min(420px, 80vw); }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .payment-allocation-form .payment-grid { grid-template-columns: 1fr; }
  .payment-allocation-form .payment-grid .full { grid-column: auto; }
  .payment-allocation-input { width: 100%; }
}

@media (max-width: 700px) {
  .login-screen { padding: 20px; }
  #sidebar { position: fixed; z-index: 40; left: -250px; top: 0; bottom: 0; height: auto; max-height: 100dvh; width: 232px; overscroll-behavior: contain; touch-action: pan-y; transition: left .24s var(--ease); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); background: var(--ink); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #sidebar.open { left: 0; }
  .main > section { padding: 14px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 22px; }
  .toolbar input { flex-basis: 100%; max-width: none; }
  .seg { margin-left: 0; }

  /* Lists become cards: no sideways scrolling to reach the buttons */
  .stack-wrap { border: 0; overflow: visible; }
  .table.stack { min-width: 0; }
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { margin: 0 0 12px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff; }
  .table.stack td { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border: 0; white-space: normal; text-align: right; overflow-wrap: anywhere; }
  .table.stack td::before { content: attr(data-label); flex: 0 0 38%; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; text-align: left; }
  .table.stack td.actions { justify-content: flex-start; flex-wrap: wrap; gap: 6px; min-width: 0; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
  .table.stack td.actions::before { display: none; }

  .board { grid-auto-columns: minmax(82%, 1fr); }

  .modal form { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .form-actions button { flex: 1 1 140px; }
  #toast { left: 14px; right: 14px; bottom: 14px; max-width: none; }
}

@media (max-width: 640px) {
  .combined-grid, .combined-pest-grid { grid-template-columns: minmax(0, 1fr); }
}


/* ---------- Menu button (the icon logo) and hidden menu ---------- */
.logo-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 5px; border: 1px solid #d5dbe0; border-radius: 11px; background: #fff; cursor: pointer; }
.logo-btn:hover { background: #eef2f5; }
.logo-btn img { height: 30px; width: 30px; object-fit: contain; display: block; }
.readonly-note { padding: 9px 12px; border: 1px dashed #b9c4cc; border-radius: 8px; color: var(--muted); font-size: 12px; }

/* ---------- Locked fields ---------- */
label.locked { color: var(--muted); }
label.locked select, label.locked input { background: #f1f4f7; color: #6b7c88; border-style: dashed; cursor: not-allowed; opacity: .9; }
label.locked::after { content: "Locked after creation"; font-size: 10px; font-weight: 600; letter-spacing: .04em; color: #7b8a95; }

/* ---------- Schedules calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-title { flex: 1; text-align: center; font-size: 18px; font-weight: 800; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; font-size: 11px; color: var(--muted); }
.cal-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--cyan); vertical-align: middle; }
.cal-legend .st-service_in_progress::before { background: var(--yellow); }
.cal-legend .st-service_completed::before { background: var(--green); }
.cal-legend .st-cancelled::before { background: #7b8a93; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-dow { padding: 9px 6px; text-align: center; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #6b7c88; background: #ffffff; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 112px; padding: 6px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: #f7f9fb; cursor: pointer; min-width: 0; }
.cal-day:nth-child(7n+1) { border-right: 0; }
.cal-day:hover { background: #f3f6f9; }
.cal-day.other { opacity: .45; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--red); }
.cal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.cal-num { font-size: 12px; font-weight: 800; }
.cal-dots { display: none; align-items: center; gap: 2px; }
.cal-dots b { font-size: 9.5px; color: var(--muted); margin-left: 1px; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); display: inline-block; }
.cal-dot.st-service_in_progress { background: var(--yellow); }
.cal-dot.st-service_completed { background: var(--green); }
.cal-dot.st-cancelled { background: #7b8a93; }
.cal-chips { display: grid; gap: 3px; }
.cal-chip { display: block; width: 100%; padding: 3px 6px; border: 0; border-left: 3px solid var(--cyan); border-radius: 5px; background: #e1f4f1; color: #17323a; font-size: 10.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.st-service_in_progress { border-left-color: var(--yellow); background: #fcf1d8; }
.cal-chip.st-service_completed { border-left-color: var(--green); background: #dcf4e7; }
.cal-chip.st-cancelled { border-left-color: #7b8a93; background: #eceff1; color: #6b7c88; text-decoration: line-through; }
.cal-more { border: 0; background: none; color: var(--cyan); font-size: 10.5px; text-align: left; padding: 2px 4px; }
.sch-day { grid-column: 1 / -1; display: grid; gap: 10px; }
.sch-card { padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 12px; background: #ffffff; }
.sch-card.st-service_in_progress { border-left-color: var(--yellow); }
.sch-card.st-service_completed { border-left-color: var(--green); }
.sch-card.st-cancelled { border-left-color: #7b8a93; }
.sch-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.sch-name { font-weight: 800; }
.sch-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Calendar on a phone: a count per day; tap a day for its list */
@media (max-width: 700px) {
  .cal-day { min-height: 56px; padding: 4px; }
  .cal-chips { display: none; }
  .cal-dots { display: inline-flex; }
  .cal-dow { padding: 7px 2px; letter-spacing: 0; }
}

/* ---------- Phone sign-in: the stacked colour logo sits behind the credentials ---------- */
@media (max-width: 700px) {
  .boot img { width: min(360px, 84vw); }
  .login-brand { display: none; }
  .login-card { padding: 24px; position: relative; overflow: hidden; }
  .login-card::before { content: ""; position: absolute; inset: 0; background: url("logo-stacked-watermark.png") center 60% / 88% auto no-repeat; opacity: .34; pointer-events: none; }
  .login-card > * { position: relative; }
}

/* ---------- Quotation Studio, Invoice Studio and Settings ---------- */
.studio-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.studio-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px; }
.studio-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.studio-tabs { display: none; gap: 8px; margin-bottom: 12px; }
.studio-tabs button { flex: 1; padding: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 10px; cursor: pointer; }
.studio-tabs button.on { background: var(--red); color: #fff; border-color: var(--red); }
.studio-grid { display: grid; grid-template-columns: minmax(400px, 470px) minmax(0, 1fr); gap: 18px; align-items: start; }
.studio-form, .settings-form { display: grid; gap: 14px; }
.studio-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.studio-card h4 { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.studio-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.studio-readonly { background: var(--panel-2); border: 1px dashed #cfd7de; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.55; }
.studio-preview { position: sticky; top: 12px; display: grid; gap: 14px; max-height: calc(100vh / var(--zoom) - 24px); overflow: auto; padding: 2px; }
.paper svg { display: block; width: 100%; height: 100%; }
.sl { display: grid; gap: 8px; align-items: end; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.sl label { display: grid; gap: 3px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; min-width: 0; }
.sl input, .sl select { padding: 7px 8px; font-size: 12.5px; min-width: 0; width: 100%; text-transform: none; letter-spacing: 0; color: var(--text); }
.sl-quote { grid-template-columns: repeat(4, minmax(0, 1fr)) 34px; }
.sl-invoice { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sl-invoice label:not(.c-all):not(.span3) { grid-column: span 2; }
.sl .span3 { grid-column: span 3; }
.sl .c-all { grid-column: 1 / -1; }
.sl-text { overflow-wrap: anywhere; font-size: 13px; }
.sl-static { color: var(--muted); font-size: 12px; }
.sl-del { padding: 6px 0; }
#studioLines { display: grid; gap: 10px; }
.sv { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.small { padding: 5px 9px; font-size: 12px; }
.settings-test { display: flex; align-items: end; }
@media (max-width: 1100px) {
  .studio-grid { grid-template-columns: 1fr; }
  .studio-tabs { display: flex; }
  .studio-grid[data-tab="form"] .studio-preview { display: none; }
  .studio-grid[data-tab="preview"] .studio-form { display: none; }
  .studio-preview { position: static; max-height: none; }
}

/* ---------- Scroll bars: thin and quiet ---------- */
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #c3ccd4 transparent; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3ccd4; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #9aa8b3; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- Billing plan ---------- */
.billing-plan-summary .kpi{min-height:80px}.billing-plan-table{width:100%;border-collapse:collapse;min-width:1050px}.billing-plan-table th,.billing-plan-table td{padding:9px;border-bottom:1px solid #e3e8ed;text-align:left;font-size:11px;vertical-align:middle}.billing-plan-table th{font-size:9px;color:#6b7c88;text-transform:uppercase;letter-spacing:.06em}.billing-plan-table input,.billing-plan-table select{width:100%;min-width:90px;padding:7px 8px;border-radius:7px}.billing-plan-table .bp-name{min-width:190px}.bp-readonly{background:#eef2f4}.bp-actions{display:flex;gap:6px;flex-wrap:wrap}.billing-plan-note{font-size:11px;color:#6d7d86;line-height:1.5}.billing-plan-progress{height:8px;background:#e7ecef;border-radius:99px;overflow:hidden}.billing-plan-progress i{display:block;height:100%;background:#d71920}.billing-plan-total{font-weight:800}.billing-plan-badge{display:inline-block;padding:4px 8px;border-radius:99px;background:#edf2f4;font-size:10px}.billing-plan-badge.done{background:#e6f4ea;color:#176b36}.billing-plan-badge.warn{background:#fff3d9;color:#8a5a00}@media(max-width:900px){.billing-plan-summary{grid-template-columns:1fr 1fr}.billing-plan-table{min-width:1050px}}
.billing-plan-shell { display: grid; gap: 14px; grid-column: 1 / -1; }
.billing-plan-summary { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.billing-plan-summary .kpi .value { font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.billing-plan-shell .form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.billing-plan-shell .form-grid .full { grid-column: 1 / -1; }
.billing-plan-table span:empty { display: none; }
@media (max-width: 800px) { .billing-plan-shell .form-grid { grid-template-columns: 1fr; } }

/* ---------- Wide dialogs, signature pad ---------- */
.modal-card.wide { max-width: 1180px; }
.sig-pad { width: 100%; height: 150px; border: 1px dashed #b9c4cc; border-radius: 10px; background: #f4f7f9; touch-action: none; cursor: crosshair; display: block; }
.sig-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
.occf-head { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.with-button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.same-as { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.same-as input { width: auto; }

/* ---------- Light theme details ---------- */
.customer-note { background: #fff8e1; border: 1px solid #f0d58a; border-left: 4px solid #e0a100; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; color: #4b3b00; line-height: 1.5; }
.customer-note b { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; color: #8a6200; }
.customer-notes textarea { width: 100%; }
.paper { background: #fff; border-radius: 6px; aspect-ratio: 595.28 / 841.89; width: 100%; max-width: 820px; margin: 0 auto; box-shadow: 0 8px 30px rgba(20, 35, 50, .16); border: 1px solid var(--line); }
.studio-actions .sm { display: none; }

/* ---------- Tables squeezed to fit (wide screens) ---------- */
.table td.actions .ghost, .table td.actions button { padding: 5px 9px; font-size: 12px; margin: 0 4px 4px 0; }

/* ---------- Phone: one fixed screen, sheets for dialogs ---------- */
@media (max-width: 700px) {
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body { position: fixed; inset: 0; width: 100%; }
  .app { display: block; height: 100dvh; min-height: 0; }
  .main { height: 100dvh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }
  .login-screen, .boot { min-height: 100dvh; height: 100dvh; overflow-y: auto; overflow-x: hidden; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  input, select, textarea, button { max-width: 100%; }
  input, select, textarea { min-width: 0; font-size: 16px; }
  input[type=date], input[type=datetime-local], input[type=time], input[type=month] { width: 100%; min-width: 0; max-width: 100%; min-height: 42px; -webkit-appearance: none; appearance: none; }
  button, .ghost, .primary { padding: 8px 12px; font-size: 13px; min-height: 36px; border-radius: 10px; }
  .panel { padding: 12px; border-radius: 14px; }
  .panel-head { gap: 8px; }
  .modal { padding: 0; place-items: stretch; background: var(--panel); }
  .modal-card { max-width: none; width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; overflow: hidden; }
  .modal-head { flex: 0 0 auto; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
  .modal-head h3 { font-size: 16px; }
  #recordForm { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; grid-template-columns: minmax(0, 1fr); padding: 14px 14px 0; align-content: start; -webkit-overflow-scrolling: touch; }
  #recordForm > * { min-width: 0; }
  #recordForm label { min-width: 0; }
  #recordForm .form-actions { position: sticky; bottom: 0; z-index: 3; margin: 6px -14px 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); justify-content: stretch; flex-wrap: nowrap; }
  #recordForm .form-actions button { flex: 1 1 0; min-width: 0; }
  .studio-bar { gap: 8px; }
  .studio-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .studio-actions button { flex: 1; padding: 7px 4px; font-size: 12px; min-height: 34px; white-space: nowrap; }
  .studio-actions .lg { display: none; }
  .studio-actions .sm { display: inline; }
  .studio-card { padding: 12px; }
  .studio-row { grid-template-columns: minmax(0, 1fr); }
  .toast { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
  .cal-grid { font-size: 11px; }
}

/* ---------- Today, reports, audit ---------- */
#today { margin-bottom: 16px; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.today-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.today-head h4 { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.today-count { min-width: 24px; padding: 2px 8px; border-radius: 99px; background: var(--line-soft); color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
.today-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.today-item b { margin-right: 6px; }
.today-item small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.today-empty { font-size: 13px; padding: 6px 2px; }
.ageing { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ageing-cell { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ageing-cell small { display: block; color: var(--muted); font-size: 11.5px; }
.ageing-cell b { font-size: 18px; }
.ageing-cell.late { border-color: #f0b4bb; background: #fdecee; }
.report-sub { margin: 6px 0 8px; font-size: 13px; color: var(--muted); }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 190px; padding: 10px 4px 0; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.bar-month { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 4px; text-align: center; }
.bar-month small { font-size: 10.5px; color: var(--muted); }
.bar-pair { display: flex; gap: 2px; align-items: flex-end; justify-content: center; height: 100%; }
.bar { width: 42%; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.sales, .key.sales { background: #9fb3c2; }
.bar.collected, .key.collected { background: var(--green); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
.funnel { display: grid; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 50px; gap: 10px; align-items: center; font-size: 13px; }
.funnel-track { height: 14px; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.audit-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; margin-bottom: 12px; }
.audit-detail { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--muted); }
.audit-pages { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
@media (max-width: 700px) {
  .audit-filters { grid-template-columns: minmax(0, 1fr); }
  .bars { height: 150px; gap: 3px; }
  .funnel-row { grid-template-columns: 90px minmax(0, 1fr) 40px; }
  .table th, .table td { padding: 8px 6px; }
  .table td.actions { min-width: 0; width: auto; }
}

/* ---------- Customer finder, duplicate warning ---------- */
.finder-source { display: none !important; }
.finder { position: relative; }
.finder-input { width: 100%; }
.finder-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; padding: 4px; }
.finder-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 13px; }
.finder-item:hover, .finder-item:focus { background: var(--panel-2); }
.finder-item small { display: block; color: var(--muted); font-size: 11.5px; }
.finder-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.dup-warning { background: #fff4e5; border: 1px solid #f3c27a; border-left: 4px solid #e08a00; border-radius: 10px; padding: 9px 12px; font-size: 13px; color: #5b3b00; }
.dup-warning button { margin-left: 6px; }

/* ---------- Chemicals check-list, import ---------- */
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.checklist .check { display: flex; gap: 8px; align-items: baseline; font-weight: 600; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text); }
.checklist .check small { color: var(--muted); font-weight: 400; margin-left: 2px; }
.import-actions { display: flex; gap: 8px; margin: 8px 0; }
a.button-link { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- Customer 360 ---------- */
.c360-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.c360-id { min-width: 0; flex: 1 1 320px; }
.c360-id h2 { margin: 0 0 6px; font-size: 22px; }
.c360-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--head, #1f2933); color: #fff; font-size: 12px; font-weight: 700; }
.chip.soft { background: var(--line-soft); color: var(--text); font-weight: 600; }
.c360-contact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 700; }
.c360-address { margin-top: 6px; color: var(--muted); overflow-wrap: anywhere; }
.c360-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.c360-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.c360-kpis .value { font-size: 20px; font-weight: 800; }
.c360-kpis .value.due { color: var(--red); }
.c360-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.c360-tabs button { border: 0; background: none; padding: 9px 12px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.c360-tabs button.on { color: var(--text); border-bottom-color: var(--red); }
.c360-tab h4 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.c360-empty { padding: 12px; }
#modal.wide-360 .modal-card { width: min(1180px, 96vw); max-width: 96vw; }
.import-sub { margin: 16px 0 4px; }

/* ---------- 10. Accessibility ---------- */
button:focus-visible, [role="link"]:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tech-picker { display: grid; gap: 6px; }
.tech-picker .picker-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chip.points { background: #e7f6ec; color: #1d7a3a; }

/* ---------- Password field, list pager, job contact bar ---------- */
.pass-wrap { display: flex; gap: 6px; align-items: stretch; }
.pass-wrap input { flex: 1 1 auto; min-width: 0; }
.show-pass { flex: 0 0 auto; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 0 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pager-buttons { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pager select { width: auto; }
.contact-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.contact-actions .button-link { padding: 10px 16px; border-radius: 10px; }

/* ==================== AsiatiK look: rail, page tabs, cards, motion ==================== */
#content { padding: 6px 28px 36px; }
.table-wrap { overflow: auto; overflow-x: auto; border: 0; border-radius: 16px; background: #ffffff; }
.table th { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; background: var(--panel-2); color: #5b6670; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8f9fb; }
input, select, textarea { width: 100%; background: #ffffff; color: var(--text); border: 1px solid #cfd7de; padding: 12px 13px; outline: none; border-radius: 12px; }
.badge { border-radius: 999px; }

/* Phone: the drawer shows labels, and a dark quick bar sits at the bottom */
@media (max-width: 700px) {
  #content { padding: 10px 12px 104px; }
  .topbar { height: auto; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; min-height: 60px; }
  .topbar h2 { font-size: 20px; }
  .group-tabs { order: 5; width: 100%; box-shadow: none; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
  #nav { padding: 4px 12px; }
  #nav button { height: 40px; font-size: 14px; gap: 12px; }
  .sidebar-logo { height: 66px; padding: 0 12px; }
  .side-footer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  #sidebar .logo-mark { display: none; }
  #sidebar .logo-full { display: block; }
  #sidebar #nav .nav-section { max-height: 30px; opacity: 1; padding: 12px 4px 4px; }
  #sidebar #nav button span, #sidebar #logout span, #sidebar #sessionBadge { opacity: 1; max-height: none; }
  #bottomBar.bottom-bar { display: flex; }
}
.bottom-bar { display: none; position: fixed; z-index: 35; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); height: 64px; padding: 0 8px; border-radius: 22px; background: var(--ink); align-items: center; justify-content: space-around; box-shadow: 0 14px 34px rgba(0, 0, 0, .3); }
.bottom-bar button { width: 48px; height: 48px; border: 0; border-radius: 15px; background: transparent; color: #aeb6be; display: grid; place-items: center; transition: background .15s, color .15s, transform .15s var(--ease); }
.bottom-bar button.on { background: var(--red); color: #ffffff; }
.bottom-bar button.plus { background: #ffffff; color: var(--ink); border-radius: 50%; }
.bottom-bar button:active { transform: scale(.92); }
body.modal-open .bottom-bar { display: none; }

/* Dashboard */
.dash-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; }
.dash-hello p { margin: 0 0 4px; color: var(--muted); font-weight: 600; font-size: 14px; }
.dash-hello h1 { margin: 0; font-size: 38px; line-height: 1.05; letter-spacing: -.025em; font-weight: 800; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.dash-kpis .kpi { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.dash-kpis .kpi small { font-weight: 600; font-size: 13px; }
.dash-kpis .kpi .value { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.dash-kpis .kpi .hint { font-size: 13px; color: var(--muted); }
.dash-kpis .kpi.dark { background: var(--ink); color: #ffffff; }
.dash-kpis .kpi.dark small, .dash-kpis .kpi.dark .hint { color: #c3c9cf; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; margin-top: 16px; }
.dash-grid3 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.pipe { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; }
.pipe-stage { border: 0; border-radius: 18px; padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s; }
.pipe-stage:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(16, 24, 40, .10); }
.pipe-stage span { font-size: 13px; font-weight: 700; }
.pipe-stage b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.pipe-stage.s0 { background: #dbe7ff; color: #10203f; }
.pipe-stage.s1 { background: #fff0bf; color: #33280a; }
.pipe-stage.s2 { background: #ffd9cc; color: #3d1406; }
.pipe-stage.s3 { background: #d8f2e0; color: #0d2a16; }
.pipe-stage.s4 { background: #e6e1fb; color: #241650; }
.pipe-stage.s5 { background: #e3e7eb; color: #1b2630; }
.chart-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; height: 170px; padding-top: 8px; }
.chart-col { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 6px; text-align: center; }
.chart-pair { display: flex; gap: 4px; align-items: flex-end; justify-content: center; height: 100%; }
.chart-pair i { display: block; width: 42%; min-height: 3px; border-radius: 7px 7px 3px 3px; transform-origin: bottom; animation: grow .7s var(--ease) both; }
.chart-pair i.inv { background: #c9ced4; }
.chart-pair i.col { background: var(--red); animation-delay: .08s; }
.chart-col small { font-size: 11px; color: var(--muted); }
.chart-key { display: flex; gap: 16px; font-size: 13px; color: #3c4650; margin-top: 10px; }
.chart-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.meter { display: flex; flex-direction: column; gap: 12px; }
.meter-row div:first-child { display: flex; justify-content: space-between; font-size: 13px; }
.meter-track { height: 10px; border-radius: 999px; background: var(--line-soft); margin-top: 6px; overflow: hidden; }
.meter-track i { display: block; height: 10px; border-radius: 999px; transform-origin: left; animation: growx .8s var(--ease) both; }
.leader { display: flex; flex-direction: column; gap: 12px; }
.leader-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.leader-row .av { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: var(--ink); color: #ffffff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.leader-row .bar { flex: 1; min-width: 0; }
.leader-row .bar .meter-track { height: 7px; }
.leader-row .bar .meter-track i { height: 7px; background: var(--red); }

/* Today lists in the new style */
.today-card { background: var(--panel); min-width: 0; border: 0; border-radius: 20px; box-shadow: var(--shadow); padding: 16px 18px; }
.today-item { width: 100%; text-align: left; border: 0; background: var(--panel-2); cursor: pointer; font-size: 13px; color: var(--text); border-radius: 14px; padding: 10px 12px; transition: background .15s, transform .15s var(--ease); }
.today-item:hover { background: #e9eff4; transform: translateX(2px); }
.today-count.on { color: #fff; background: var(--red); }

/* Movement: short, smooth, and off when the phone asks for reduced motion */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sheet { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
/* Every page is a stack of sections with the same space between them */
#content > * + * { margin-top: 18px; }
#content > * { animation: rise .28s var(--ease) both; }
#content > *:nth-child(2) { animation-delay: .03s; }
#content > *:nth-child(3) { animation-delay: .06s; }
#content > *:nth-child(4) { animation-delay: .09s; }
#content > *:nth-child(5) { animation-delay: .12s; }
.kpi, .today-card { transition: transform .18s var(--ease), box-shadow .18s; }
.kpi.link:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16, 24, 40, .10); }
.modal .modal-card { animation: pop-in .22s var(--ease) both; }
.modal.closing { animation: fade-out .18s ease both; pointer-events: none; }
.modal.closing .modal-card { animation: pop-out .18s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px) scale(.98); } }
@media (max-width: 700px) { .modal .modal-card { animation-name: sheet; } }

/* Phone menu: a backdrop behind it; tapping it closes the menu */
.nav-backdrop { display: none; }
@media (max-width: 700px) {
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(16, 18, 22, .45); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  #sidebar.open + .nav-backdrop { opacity: 1; pointer-events: auto; }
}

/* Smooth hover everywhere: soft colour changes and a small lift on things you can open */
.ghost:hover, .icon:hover { background: var(--panel-2); }
.today-item, .pipe-stage, .kpi.link, .finder-item, .group-tabs button, #nav button { will-change: transform; }
.panel:hover { box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 12px 30px rgba(16, 24, 40, .08); }

/* Donut chart: the parts sweep in from 0, the total counts up */
.donut { position: relative; width: 150px; height: 150px; margin: 0 auto 12px; }
.donut svg { width: 150px; height: 150px; display: block; }
.donut .seg { animation: sweep .9s var(--ease) both; }
@keyframes sweep { from { stroke-dasharray: 0 400; } }
.donut-mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-mid small { color: var(--muted); font-size: 11px; font-weight: 600; }
.donut-mid b { font-size: 17px; font-weight: 800; }
.empty.loading { color: transparent; border-radius: 16px; min-height: 90px; background: linear-gradient(90deg, #eef1f4 0, #f7f8fa 50%, #eef1f4 100%) 0 0 / 800px 100%; animation: shimmer 1.2s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 1100px) { .dash-grid, .dash-grid3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .dash-hello h1 { font-size: 28px; }
  .dash-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-kpis .kpi { padding: 14px; border-radius: 18px; }
  .dash-kpis .kpi .value { font-size: 21px; }
  .pipe { grid-auto-flow: column; grid-auto-columns: 46%; grid-template-columns: none; overflow-x: auto; }
}

/* ======================================================================================
 * Team, field, growth, chat and notification pages
 * ====================================================================================== */

/* Rail: the logout icon keeps its size when the rail is closed */
#logout svg { flex: 0 0 18px; width: 18px; height: 18px; }

/* Reports: bars and conversion lines grow from 0 */
.bar-pair .bar { transform-origin: bottom; animation: grow .8s var(--ease) both; min-height: 2px; }
.funnel-fill { height: 100%; background: linear-gradient(90deg, var(--red), var(--red-dark)); border-radius: 99px; transform-origin: left; animation: growx .9s var(--ease) both; }
.meter-track i, .target-bar i { transform-origin: left; animation: growx .9s var(--ease) both; }
.donut.clear .donut-mid small { color: var(--green); }
.donut.clear .donut-total { color: var(--green); }

/* Customer 360 on a phone: nothing wider than the screen; tables scroll inside their box */
.c360 { display: grid; gap: 14px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.c360 > * { min-width: 0; }
.c360-tab .table-wrap { max-width: 100%; }
@media (max-width: 700px) {
  #modal.wide-360 .modal-card { width: 100%; max-width: none; }
  .c360-head { padding: 12px; }
  .c360-id h2 { font-size: 19px; }
  .c360-actions { width: 100%; }
  .c360-actions > * { flex: 1 1 auto; text-align: center; }
  .c360-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .c360-kpis .kpi { padding: 10px 12px; border-radius: 14px; }
  .c360-kpis .kpi small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .c360-kpis .value { font-size: 17px; }
  .customer-notes .panel-head { display: block; }
  .customer-notes .form-actions { position: static; margin: 8px 0 0; padding: 0; border: 0; }
  .c360-tab .table { font-size: 12.5px; }
  .c360-tab .table th, .c360-tab .table td { white-space: nowrap; }
}

/* Quotation Studio: the numbers of a service line on one row, delete button included */
.sl-nums { display: flex; gap: 6px; align-items: flex-end; min-width: 0; }
.sl-nums > label { flex: 1 1 0; min-width: 0; }
.sl-nums > .w-bill { flex: 1.5 1 0; }
.sl-nums > .w-gst { flex: .7 1 0; }
.sl-nums > .w-sac { flex: .9 1 0; }
.sl-nums > .w-area { flex: 1.2 1 0; }
.sl-nums .sl-del { flex: 0 0 30px; height: 31px; padding: 0; }
.sl-nums input, .sl-nums select { padding: 6px 6px; }
.sl-tools { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { .sl-nums { gap: 4px; } .sl-nums label { font-size: 9.5px; } .sl-nums input, .sl-nums select { font-size: 12px; padding: 6px 4px; } }

/* Notifications: bell count, panel, alerts on this device */
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
#notif { position: relative; }
.count-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.notif-panel { position: absolute; right: 0; top: 54px; z-index: 60; width: min(380px, calc(100vw - 24px)); max-height: min(560px, 75vh); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 40px rgba(16, 24, 40, .18); overflow: hidden; animation: pop-in .18s var(--ease) both; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-push { padding: 10px 14px; font-size: 12.5px; background: var(--panel-2); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.notif-list { overflow-y: auto; }
.notif-item { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; color: var(--text); cursor: pointer; }
.notif-item:hover { background: var(--panel-2); }
.notif-item span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.notif-item small { font-size: 11px; color: var(--muted); }
.notif-item.unread { background: #fff5f6; }
.notif-item.unread b::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--red); vertical-align: middle; }
#nav button.has-badge { position: relative; }
#nav button.has-badge::after { content: attr(data-badge); position: absolute; left: 30px; top: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.primary.small, .ghost.small { padding: 5px 10px; font-size: 12px; }

/* Team chat */
.chat-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); padding: 0; overflow: hidden; height: calc((100vh - 150px) / var(--zoom)); min-height: 420px; }
.chat-rooms { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; display: grid; align-content: start; gap: 2px; }
.chat-rooms button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 12px; background: none; color: var(--text); cursor: pointer; }
.chat-rooms button:hover { background: var(--panel-2); }
.chat-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 4px; }
.chat-none { font-size: 12px; padding: 4px 10px; }
.chat-rooms button.on { background: var(--ink); color: #fff; }
.chat-rooms b { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-rooms b small { display: block; font-weight: 500; opacity: .7; font-size: 11px; }
.chat-rooms em { font-style: normal; background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 7px; }
.chat-avatar { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--text); font-weight: 800; }
.chat-avatar.team { background: var(--red); color: #fff; }
.chat-rooms button.on .chat-avatar { background: rgba(255, 255, 255, .15); color: #fff; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head small { display: block; color: var(--muted); font-size: 11.5px; }
.chat-back { display: none; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); }
.msg-line { max-width: 78%; align-self: flex-start; }
.msg-line.mine { align-self: flex-end; text-align: right; }
.msg-line p { margin: 0; padding: 9px 12px; border-radius: 16px 16px 16px 4px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .05); white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }
.msg-line.mine p { background: var(--ink); color: #fff; border-radius: 16px 16px 4px 16px; }
.msg-line small, .msg-line time { display: block; font-size: 10.5px; color: var(--muted); margin: 2px 4px; }
.chat-send { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-send textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; }
@media (max-width: 700px) {
  .chat-wrap { grid-template-columns: 1fr; height: calc(100dvh - 190px); }
  .chat-wrap .chat-main { display: none; }
  .chat-wrap.room-open .chat-rooms { display: none; }
  .chat-wrap.room-open .chat-main { display: flex; }
  .chat-back { display: inline-grid; }
}

/* Attendance, leave, salary */
.hr-today-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hr-stat { display: grid; gap: 2px; min-width: 130px; padding: 12px 16px; border-radius: 16px; background: var(--panel-2); }
.hr-stat small { color: var(--muted); font-size: 11.5px; }
.hr-stat b { font-size: 24px; }
.hr-actions { display: grid; gap: 6px; flex: 1 1 260px; justify-items: start; }
.warn-text { color: #b45309; font-weight: 600; }
.month-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-grid.compact { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.form-grid.compact .full { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.inline-form input, .inline-form select { flex: 1 1 150px; min-width: 0; }
.att-wrap { overflow-x: auto; }
.att-table { border-collapse: separate; border-spacing: 2px; font-size: 11.5px; }
.att-table th { font-weight: 700; color: var(--muted); padding: 2px; }
.att-table tbody th { text-align: left; white-space: nowrap; padding-right: 10px; color: var(--text); position: sticky; left: 0; background: var(--panel); z-index: 1; }
.att-table tbody th small { display: block; color: var(--muted); font-weight: 500; }
.att { width: 26px; height: 26px; text-align: center; border-radius: 6px; font-weight: 800; cursor: default; }
.att[data-call] { cursor: pointer; }
.a-present { background: #dcf5e4; color: #146c34; }
.a-half { background: #fff1d6; color: #8a5a00; }
.a-leave { background: #e3ecff; color: #2449a8; }
.a-absent { background: #fde2e5; color: #a1122b; }
.a-off { background: #eef0f3; color: #8b949d; }
.a-none { background: #f7f8fa; }
.att-legend { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.att-legend span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-weight: 800; }
tfoot th { text-align: left; }

/* Performance and targets */
.perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.perf-card { border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 12px; background: #fff; }
.perf-card header { display: flex; align-items: center; gap: 10px; }
.perf-card header div { flex: 1; min-width: 0; }
.perf-card header small { display: block; color: var(--muted); }
.perf-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.perf-fig { padding: 9px 10px; border-radius: 12px; background: var(--panel-2); display: grid; gap: 3px; }
.perf-fig small { color: var(--muted); font-size: 11px; }
.perf-fig b { font-size: 18px; }
.target-bar { height: 6px; border-radius: 99px; background: #e3e7eb; overflow: hidden; }
.target-bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--red), #ff6b6b); border-radius: 99px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-award { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: #fff7e0; color: #7a5600; border: 1px solid #f3dc9a; }

/* To-do */
.todo-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.todo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.todo label span { overflow-wrap: anywhere; }
.todo small { color: var(--muted); white-space: nowrap; }
.todo.done label span { text-decoration: line-through; color: var(--muted); }
.todo.late { border-color: #f3b4bd; background: #fff6f7; }
.today-card.my-day .today-item[data-go] { margin-bottom: 6px; }

/* Marketing and referrals */
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.campaign-card { border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 10px; background: #fff; }
.campaign-card header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.campaign-figs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.campaign-figs div { background: var(--panel-2); border-radius: 10px; padding: 6px 8px; display: grid; }
.campaign-figs small { font-size: 10.5px; color: var(--muted); }
.campaign-card footer { display: flex; gap: 6px; justify-content: flex-end; }
.ref-list { display: grid; gap: 8px; }
.ref-item { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.ref-item summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; flex-wrap: wrap; list-style: none; }
.ref-item summary small { color: var(--muted); }
.ref-item .rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; font-size: 12px; }
.ref-figs { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.ref-figs em { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--panel-2); }
.ref-figs em.pts { background: #e7f6ec; color: #1d7a3a; }
.ref-item ul { margin: 0; padding: 4px 14px 12px 52px; display: grid; gap: 6px; }
.linkish { border: 0; background: none; padding: 0; color: var(--red); font-weight: 700; cursor: pointer; }
.chip.green { background: #e7f6ec; color: #1d7a3a; }
.chip.amber { background: #fff1d6; color: #8a5a00; }
.chip.red { background: #fde2e5; color: #a1122b; }

/* Customer map */
.map-panel { padding-bottom: 14px; }
.map-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.map-tools input { min-width: 200px; }
.erp-map { height: calc((100vh - 270px) / var(--zoom)); min-height: 380px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); z-index: 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.map-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--c); vertical-align: -1px; }
.map-legend span.office::before { background: #fbbf24; border: 2px solid #111827; }
.map-pop { display: grid; gap: 3px; font: 12.5px Inter, system-ui, sans-serif; min-width: 180px; }
.map-pop small { color: var(--muted); }
.map-pop-actions { display: flex; gap: 8px; margin-top: 6px; }
.map-pop-actions a, .map-pop-actions button { font-weight: 700; color: var(--red); background: none; border: 0; padding: 0; cursor: pointer; font-size: 12.5px; }
@media (max-width: 700px) { .erp-map { height: calc(100dvh - 330px); } .map-tools input { min-width: 0; flex: 1 1 100%; } }

/* Chemical stock */
.low-stock td { background: #fff6f7; }
td.neg { color: var(--red); font-weight: 700; }
td.pos { color: var(--green); font-weight: 700; }

/* OCCF and service report: photos, chemicals, part-done work, rating, job card */
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.photo { position: relative; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.photo.pending { outline: 2px dashed var(--cyan); }
.photo-add { display: inline-flex; align-items: center; cursor: pointer; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.chem-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 34px 32px; gap: 6px; align-items: center; margin-bottom: 6px; }
.chem-unit { font-size: 12px; color: var(--muted); }
.work-status { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.progress-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.progress-table th, .progress-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.progress-table input { width: 80px; }
.stars { display: flex; gap: 4px; }
.stars button { border: 0; background: none; font-size: 26px; line-height: 1; color: #d6dbe0; cursor: pointer; padding: 0 2px; }
.stars button.on { color: #f59e0b; }
.rec-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 10px; max-height: 220px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.rec-services small { color: var(--muted); margin-left: 4px; }
.rec-custom { margin-top: 8px; display: grid; }
.job-note { flex-basis: 100%; font-size: 12.5px; }
.job-note b { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.job-note .chip { background: var(--ink); margin: 0 4px 4px 0; }
.finder-title { padding: 6px 10px 2px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.finder-item.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--red); }
input[type="checkbox"], input[type="radio"] { width: auto; flex: 0 0 auto; }
.todo label { flex: 1; align-items: center; gap: 10px; cursor: pointer; min-width: 0; display: flex; font-size: 14px; font-weight: 600; color: var(--text); }
.todo input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--red); }
