:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --sidebar: #1f2a33;
  --sidebar-2: #172129;
  --text: #26343f;
  --muted: #6b7b88;
  --line: #dbe4ee;
  --blue: #1769c2;
  --blue-2: #0f5aa8;
  --green: #238253;
  --orange: #e97816;
  --red: #c43c3c;
  --purple: #6f4cc3;
  --shadow: 0 10px 28px rgba(31, 42, 51, .08);
  --shadow-sm: 0 3px 12px rgba(31, 42, 51, .06);
  --radius: 10px;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-2); }
input, select, textarea, button { font: inherit; }
textarea { min-height: 104px; resize: vertical; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  color: #d9e3ea;
  background:
    linear-gradient(180deg, rgba(23, 105, 194, .14), transparent 230px),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 8px 0 24px rgba(15, 23, 31, .14);
  overflow: hidden;
}

.brand {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  padding: 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(135deg, #2d8cff, #1769c2);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(23, 105, 194, .28);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: .2px; }
.brand small { margin-top: 3px; color: #9eb1bf; font-size: 12px; }

.side-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  padding: 14px 12px 28px;
  overflow-y: auto;
}
.nav-section {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
}
.side-nav button.nav-group {
  appearance: none;
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #8fa3b2;
  font-size: 11px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  text-transform: uppercase;
}
.side-nav button.nav-group:hover { color: #fff; background: rgba(255,255,255,.05); }
.side-nav button.nav-group b { transition: transform .16s ease; color: #9ed0ff; }
.nav-section.open .side-nav button.nav-group b,
.nav-section.open button.nav-group b { transform: rotate(180deg); }
.nav-items {
  display: none;
  gap: 3px;
  padding: 0 7px 8px;
}
.nav-section.open .nav-items { display: grid; }
.nav-section.alert-section {
  border-color: rgba(196,60,60,.6);
  background: rgba(196,60,60,.16);
}
.nav-section.alert-section .nav-group {
  background: var(--red);
  color: #fff;
}
.nav-section.alert-section .nav-group:hover { background: #aa3030; color: #fff; }
.nav-section.alert-section .nav-group b { color: #fff; }
.nav-alert-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 25px;
  margin-left: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.7);
  color: #fff;
  font-size: 13px;
  line-height: 1;
}
.nav-item-count {
  min-width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0 8px;
  border-radius: 999px;
  background: #c83a3a;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}
.side-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 9px;
  color: #d9e3ea;
}
.side-nav a span {
  min-width: 31px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255,255,255,.06);
  color: #9ed0ff;
  font-size: 10px;
  font-weight: 800;
}
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a.active {
  background: #fff;
  color: #172129;
  box-shadow: var(--shadow-sm);
}
.side-nav a.active span { background: #e9f3ff; color: var(--blue); }

.sidebar-collapse {
  width: calc(100% - 24px);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0 12px 14px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #d9e3ea;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.sidebar-collapse:hover {
  border-color: rgba(158, 208, 255, .35);
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sidebar-collapse span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: #9ed0ff;
  font-size: 22px;
  line-height: 1;
}
.sidebar-collapse strong {
  font-size: 13px;
  font-weight: 700;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}
body.sidebar-collapsed .brand {
  justify-content: center;
  gap: 0;
  padding: 16px 10px;
}
body.sidebar-collapsed .brand > span:not(.brand-mark) {
  display: none;
}
body.sidebar-collapsed .side-nav {
  gap: 9px;
  padding: 12px 8px 18px;
}
body.sidebar-collapsed .nav-section {
  border-color: transparent;
  border-radius: 10px;
  background: transparent;
}
body.sidebar-collapsed .side-nav button.nav-group {
  min-height: 18px;
  justify-content: center;
  padding: 0;
}
body.sidebar-collapsed .side-nav button.nav-group span {
  display: none;
}
body.sidebar-collapsed .side-nav button.nav-group b {
  width: 18px;
  height: 2px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(158, 208, 255, .38);
  color: transparent;
}
body.sidebar-collapsed .nav-section.alert-section {
  border: 1px solid rgba(196,60,60,.6);
  background: rgba(196,60,60,.16);
}
body.sidebar-collapsed .nav-section.alert-section .nav-group {
  min-height: 10px;
  background: var(--red);
}
body.sidebar-collapsed .nav-items {
  padding: 3px 0 8px;
}
body.sidebar-collapsed .side-nav a {
  justify-content: center;
  gap: 0;
  min-height: 42px;
  padding: 8px 0;
  font-size: 0;
}
body.sidebar-collapsed .side-nav a span {
  min-width: 34px;
  height: 30px;
  font-size: 10px;
}
body.sidebar-collapsed .nav-item-count {
  display: none;
}
body.sidebar-collapsed .side-nav a.active {
  box-shadow: none;
}
body.sidebar-collapsed .sidebar-collapse {
  width: auto;
  justify-content: center;
  margin: 0 8px 12px;
  padding: 0;
}
body.sidebar-collapsed .sidebar-collapse strong {
  display: none;
}
body.sidebar-collapsed .sidebar-collapse span {
  background: rgba(255,255,255,.08);
}

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(220px, 560px) 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 26px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(219, 228, 238, .9);
  backdrop-filter: blur(12px);
}
.top-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  background: #f8fafc;
  color: var(--text);
  outline: none;
}
.top-search input:focus { border-color: #88bdf0; box-shadow: 0 0 0 3px rgba(23,105,194,.12); background: #fff; }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head .top-actions { margin-left: auto; flex-wrap: nowrap; }
.client-list-head { align-items: flex-start; }
.client-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.client-title-row h2 { margin-bottom: 0; }
.client-list-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.client-list-search { margin: 0; }
.client-list-search input { width: min(280px, 34vw); }
.client-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}
.client-row-actions form {
  margin: 0;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

.content { padding: 26px; }
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.page-title p { margin: 0 0 5px; color: var(--blue); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.page-title h1 { margin: 0; font-size: 30px; font-weight: 750; color: #1f2a33; }

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 0 13px;
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 1px 0 rgba(31,42,51,.03);
}
.btn:hover { background: #f8fafc; border-color: #c9d6e2; color: var(--text); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 8px 18px rgba(23,105,194,.18); }
.btn.primary:hover { background: var(--blue-2); border-color: var(--blue-2); color: #fff; }
.btn.ghost { background: #fff; }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.small { min-height: 31px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.full { width: 100%; }
.salary-actions-cell { min-width: 320px; }
.salary-actions, .salary-adjust {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.salary-actions form, .salary-adjust { margin: 0; }
.salary-adjust { margin-top: 8px; }
.salary-adjust input { max-width: 150px; }
.salary-days-static {
  display: block;
  margin-bottom: 6px;
}
.salary-days-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.salary-days-form input {
  width: 74px !important;
  min-height: 31px;
  padding: 5px 8px !important;
}
.salary-days-form span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.plan-row-actions {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.plan-row-actions form { margin: 0; }
.salary-pdf-upload {
  display: flex;
  align-items: center;
  gap: 6px;
}
.salary-pdf-upload input[type="file"] {
  max-width: 170px;
  padding: 6px;
  font-size: 12px;
}
.document-stamp {
  display: grid;
  justify-items: end;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}
.document-stamp strong {
  color: var(--text);
  font-size: 18px;
}
.salary-document-page + .salary-document-page { margin-top: 18px; }
.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.panel, .stat {
  background: var(--surface);
  border: 1px solid rgba(219,228,238,.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel { padding: 20px; margin-bottom: 18px; }
.client-hero {
  background:
    linear-gradient(135deg, rgba(23,105,194,.08), rgba(35,130,83,.05)),
    #fff;
  border-color: #cfe0f1;
}
.client-hero .panel-head h2 { font-size: 24px; }
.client-hero .panel-head p { margin: 5px 0 0; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.panel-head h2, .panel h2 { margin: 0 0 10px; font-size: 18px; font-weight: 750; color: #1f2a33; }
.panel-head p, .panel p { color: var(--muted); }
.collapsible-panel { padding: 0; overflow: hidden; }
.collapsible-panel .collapsible-summary {
  cursor: pointer;
  list-style: none;
  margin: 0;
  padding: 18px 20px;
}
.collapsible-panel .collapsible-summary::-webkit-details-marker { display: none; }
.collapsible-panel .collapsible-summary h2 { margin-bottom: 4px; }
.collapsible-panel .collapsible-summary p { margin: 0; }
.collapsible-panel .collapsible-summary .btn::after { content: " +"; }
.collapsible-panel[open] .collapsible-summary .btn::after { content: " -"; }
.collapsible-panel form { padding: 0 20px 20px; }

.cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.list-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; }
.stat { position: relative; overflow: hidden; padding: 17px; }
.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--blue);
  opacity: .85;
}
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; margin-bottom: 9px; }
.stat strong { display: block; font-size: 24px; line-height: 1.15; color: #18242d; }
.profile-cards .stat:nth-child(2)::before { background: var(--green); }
.profile-cards .stat:nth-child(3)::before { background: var(--orange); }
.profile-cards .stat:nth-child(4)::before { background: var(--red); }
.profile-cards .stat:nth-child(5)::before { background: var(--purple); }
.client-credit-note {
  margin: -6px 0 14px;
  padding: 10px 12px;
  border: 1px solid #b7dfc7;
  border-radius: 10px;
  background: #eefaf3;
  color: #146c43;
  font-weight: 800;
}
.alert-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.alert-stat::before,
.danger-stat::before { background: var(--red); }
.alert-hero {
  border-color: #f0c4c4;
  background:
    linear-gradient(135deg, rgba(196,60,60,.07), rgba(255,255,255,0) 320px),
    #fff;
}
.alerts-table td { vertical-align: middle; }
.alert-row-overdue { background: #fff8f8; }
.alert-row-overdue:hover { background: #fff1f1; }
.alert-actions-cell { min-width: 340px; }
.inline-alert-form {
  display: inline-flex;
  margin: 7px 0 0;
}
.alert-resolve-form {
  display: grid;
  grid-template-columns: 90px minmax(130px, 1fr) auto;
  gap: 7px;
  align-items: center;
  margin: 0 0 8px;
}
.alert-resolve-form input { min-height: 31px; padding: 6px 9px; }

.service-plan-highlight {
  padding: 16px;
  border: 1px solid #b8d7ff;
  border-radius: 12px;
  background: #f4f9ff;
}
.service-plan-highlight .panel-head { margin-bottom: 12px; }
.service-plan-highlight .panel-head h2 { color: #115a9f; }
.plan-mini-grid { display: grid; gap: 10px; }
.plan-mini-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) auto auto auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d6e8fb;
  border-radius: 10px;
  background: #fff;
}
.plan-mini-card strong,
.plan-mini-card small { display: block; }
.plan-mini-card small { margin-top: 3px; color: var(--muted); }
.plan-mini-card.empty { grid-template-columns: minmax(220px, 1fr) auto; }

.grid.two { display: grid; grid-template-columns: minmax(340px, 500px) minmax(0, 1fr); gap: 18px; align-items: start; }
.client-detail-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.client-detail-two > .panel {
  min-width: 0;
  overflow: hidden;
}
.client-detail-two .table-wrap {
  max-width: 100%;
}
.access-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.2fr);
  gap: 18px;
  align-items: start;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.permission-group {
  margin: 0;
}
.permission-items {
  display: grid;
  gap: 8px;
}
.permission-admin-note {
  padding: 14px 16px;
  border: 1px solid #b8d7ff;
  border-radius: 10px;
  background: #f4f9ff;
  color: #115a9f;
  font-weight: 800;
}
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-actions form {
  margin: 0;
}
.muted-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.report-toolbar {
  padding: 12px;
  border: 1px solid rgba(219,228,238,.95);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.report-cards { grid-template-columns: repeat(6, minmax(150px, 1fr)); }
.report-cards .stat small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 750;
}
.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.reports-grid .panel {
  min-width: 0;
}
.reports-grid .span-2 {
  grid-column: 1 / -1;
}
.compact-table {
  min-width: 480px;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid h2, .span-2, .form-actions { grid-column: 1 / -1; }
.form-grid label { display: grid; gap: 6px; color: #526371; font-size: 12px; font-weight: 750; }
.form-grid input, .form-grid select, .form-grid textarea, .panel input, .panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .panel input:focus, .panel select:focus {
  border-color: #88bdf0;
  box-shadow: 0 0 0 3px rgba(23,105,194,.12);
}
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fbfdff; }
legend { color: var(--muted); font-weight: 750; }
.check { display: inline-flex !important; grid-template-columns: auto 1fr; align-items: center; margin-right: 12px; gap: 7px !important; }
.check input { width: auto !important; }
.service-day-schedules legend { padding: 0 7px; font-weight: 850; }
.weekday-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 14px;
}
.weekday-tab {
  min-width: 62px;
  min-height: 38px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px solid #b7c4d1;
  border-right: 0;
  background: #fff;
  color: #526371;
  cursor: pointer;
  font-weight: 650;
}
.weekday-tab:first-child { border-radius: 7px 0 0 7px; }
.weekday-tab:last-child { border-right: 1px solid #b7c4d1; border-radius: 0 7px 7px 0; }
.weekday-tab input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-tab.active {
  background: #66737f;
  border-color: #66737f;
  color: #fff;
}
.schedule-frequency-alert {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #f4b4b4;
  border-left: 4px solid #c83b3b;
  border-radius: 8px;
  background: #fff5f5;
  color: #a12626;
  font-weight: 800;
}
.past-sync-warning {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #f4b4b4;
  border-left: 4px solid #c83b3b;
  border-radius: 8px;
  background: #fff5f5;
  color: #a12626;
}
.past-sync-warning[hidden] { display: none; }
.past-sync-warning .check {
  margin: 0;
  color: #1f2a33;
  font-weight: 800;
}
.schedule-table-wrap { overflow-x: auto; }
.schedule-table { min-width: 980px; border: 0; background: transparent; }
.schedule-table th,
.schedule-table td {
  border-bottom: 0;
  padding: 6px 5px;
  vertical-align: middle;
}
.schedule-table th { background: transparent; color: #1f2a33; font-size: 13px; text-transform: none; }
.schedule-day-row { display: none; }
.schedule-day-row.active { display: table-row; }
.schedule-day-row.frequency-override td {
  background: #fff8f8;
}
.schedule-day-row.frequency-override select[data-schedule-frequency] {
  border-color: #c83b3b;
  box-shadow: 0 0 0 3px rgba(200, 59, 59, .1);
}
.schedule-day-row input[readonly] { background: #eef2f6; color: #425466; }
.schedule-day-row select { min-width: 135px; }
.schedule-collaborators {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #526371;
  white-space: nowrap;
}

.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 680px; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 11px; text-align: left; vertical-align: top; }
th {
  color: #617384;
  background: #f7f9fc;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}
tbody tr:hover { background: #fbfdff; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.local-payment-overdue-row { background: #fff3f3; }
tbody tr.local-payment-overdue-row:hover { background: #ffe9e9; }
tbody tr.local-payment-overdue-row td:first-child {
  box-shadow: inset 4px 0 0 var(--red);
}
td strong { color: #1f2a33; }
td small { display: block; color: var(--muted); margin-top: 4px; }
.recon-table {
  min-width: 1600px;
  table-layout: fixed;
}
.recon-table th:nth-child(1), .recon-table td:nth-child(1) { width: 54px; }
.recon-table th:nth-child(2), .recon-table td:nth-child(2) { width: 500px; }
.recon-table th:nth-child(3), .recon-table td:nth-child(3) { width: 110px; }
.recon-table th:nth-child(4), .recon-table td:nth-child(4) { width: 128px; }
.recon-table th:nth-child(5), .recon-table td:nth-child(5) { width: 300px; }
.recon-table th:nth-child(6), .recon-table td:nth-child(6) { width: 330px; }
.recon-table th:nth-child(7), .recon-table td:nth-child(7) { width: 118px; }
.recon-table th:nth-child(8), .recon-table td:nth-child(8) { width: 140px; }
.recon-table th, .recon-table td {
  padding: 9px 10px;
  vertical-align: top;
}
.recon-movement-text,
.recon-line,
.recon-note {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recon-note {
  display: block;
  max-height: 18px;
}
.recon-money,
.recon-date {
  white-space: nowrap;
}
.recon-client-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr);
  gap: 7px;
  align-items: start;
}
.recon-movement-controls {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(150px, 180px);
  gap: 8px 16px;
  margin-top: 12px;
  align-items: end;
}
.recon-client-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}
.recon-client-field span {
  color: #617384;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  text-align: left;
}
.recon-client-grid select,
.recon-movement-controls select,
.recon-client-cell select {
  width: 100%;
  min-height: 32px;
  padding: 4px 9px;
  font-size: 13px;
}
.recon-client-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  white-space: nowrap;
}
.recon-client-meta small,
.recon-status-cell small {
  display: inline-flex;
  margin: 0;
}
.recon-os-list {
  max-height: 132px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow: auto;
}
.recon-os-list .check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #334657;
  font-size: 12px;
  white-space: nowrap;
}
.recon-os-list .check input {
  margin: 0;
}
.recon-os-title {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  width: 100%;
}
.recon-paid-title {
  color: #0f766e;
}
.recon-paid-doc {
  border-color: #99f6e4 !important;
  background: #f0fdfa !important;
}
.recon-selected-total {
  width: 100%;
  display: block;
  margin-top: 4px;
  color: #617384;
  font-weight: 850;
}
.recon-selected-total.is-ok {
  color: var(--green);
}
.recon-selected-total.is-mismatch {
  color: var(--red);
}
.recon-os-list .money-pos,
.recon-os-list .muted {
  align-self: center;
  white-space: nowrap;
}
.recon-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.recon-actions form,
.recon-client-meta form {
  margin: 0;
}
.recon-actions .btn.small {
  min-width: 0;
}
.table-total-row td {
  background: #f8fbff;
  border-top: 2px solid #c8d8e8;
  font-weight: 800;
}
.table-total-row small { font-weight: 650; }
.table-day-total th {
  background: #eef5ff;
  border-top: 2px solid #c8d8e8;
  color: #1f2a33;
  font-size: 12px;
  font-weight: 850;
}
.sort-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed #9fb2c4;
}
.sort-link:hover { color: var(--blue); }

.badge {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  background: #edf2f7;
  color: #455a64;
  font-size: 11px;
  font-weight: 850;
}
.badge.agendada, .badge.confirmada, .badge.pendente, .badge.por_iniciar, .badge.por_fechar, .badge.por_regularizar { background: #fff4e5; color: var(--orange); }
.badge.em_execucao, .badge.reagendada, .badge.parcialmente_pago, .badge.sugerido, .badge.sugestao_local { background: #e7f2ff; color: var(--blue); }
.badge.concluida, .badge.pago, .badge.ativo { background: #e8f6ee; color: var(--green); }
.badge.cancelada, .badge.vencido, .badge.anulado { background: #ffeded; color: var(--red); }
.badge.estimado { background: #fff3d8; color: #8a5a00; }
.forecast-estimated-row td {
  background: #fffaf0;
}
.forecast-estimated-row:hover td {
  background: #fff4dc;
}
.badge.local-payment-overdue {
  margin-top: 6px;
  background: var(--red);
  color: #fff;
}

.color-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: middle; margin-right: 8px; border: 1px solid rgba(0,0,0,.12); }
.money-pos { color: var(--green); font-weight: 800; }
.money-neg { color: var(--red); font-weight: 800; }
.account-toolbar {
  align-items: center;
}
.client-combobox {
  position: relative;
  min-width: 320px;
  flex: 1 1 420px;
  z-index: 20;
}
.account-client-search {
  width: 100%;
  min-width: 240px;
}
.client-combobox-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 35px rgba(15, 23, 42, .16);
}
.client-combobox.open .client-combobox-menu {
  display: grid;
  gap: 4px;
}
.client-combobox-menu button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 750;
  cursor: pointer;
}
.client-combobox-menu button:hover,
.client-combobox-menu button:focus {
  background: #eef6ff;
  color: var(--blue);
  outline: none;
}
.client-combobox-empty {
  margin: 6px 8px;
  color: var(--muted);
  font-size: 13px;
}
.account-summary .stat small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.account-balance-card {
  background: #fbfdff;
}
.account-opening-balance {
  margin: -6px 0 14px;
  color: var(--muted);
  font-weight: 700;
}
.account-statement-table td,
.account-composition-table td {
  vertical-align: top;
}
.account-statement-table small,
.account-composition-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.account-composition-panel {
  border-color: #cfe0f2;
}
.account-composition-table tbody tr.account-credit-row {
  background: #f3fbf7;
}
.badge.credito {
  background: #e4f4eb;
  color: #107e3e;
}
.fuel-price-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}
.payments-stack {
  display: grid;
  gap: 18px;
}
.payment-os-list {
  display: grid;
  gap: 9px;
  margin: 7px 0 10px;
}
.payment-os-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.payment-os-row input { width: auto !important; }
.payment-os-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.payment-os-row.is-theoretical {
  border-color: #f4d2aa;
  background: #fff8f2;
}
.payment-os-row.is-focused {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(198,40,40,.10);
}
.payment-os-row-readonly {
  grid-template-columns: minmax(240px, 1fr) auto;
}
.payment-os-row-credit {
  grid-template-columns: auto minmax(220px, 1fr) auto;
}
.payment-os-open {
  color: var(--orange) !important;
  font-weight: 800;
}
.compact-filter {
  align-self: center;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.availability-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.availability-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}
.availability-chip.free { background: #e8f6ee; color: var(--green); }
.availability-chip.busy { background: #e7f2ff; color: var(--blue); }
.availability-chip.full { background: #ffeded; color: var(--red); }
.availability-range-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #1f2a33;
}
.availability-range-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.availability-range-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.availability-range-nav a {
  display: grid;
  gap: 3px;
  min-height: 68px;
  padding: 9px 10px;
  border: 1px solid #d6e8da;
  border-radius: 9px;
  background: #f4fbf7;
  color: #1f2a33;
}
.availability-range-nav a.is-full {
  border-color: #f0cccc;
  background: #fff6f6;
}
.availability-range-nav strong {
  font-size: 14px;
}
.availability-range-nav span {
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
}
.availability-range-nav a.is-full span {
  color: var(--red);
}
.availability-range-nav small {
  color: var(--muted);
  font-size: 11px;
}
.availability-day {
  scroll-margin-top: 88px;
}
.availability-day .panel-head { margin-bottom: 12px; }
.availability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.availability-team {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.availability-team header {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border-top: 5px solid var(--blue);
  border-bottom: 1px solid var(--line);
}
.availability-team header strong { color: #1f2a33; }
.availability-team header span { color: var(--muted); font-size: 12px; font-weight: 800; }
.availability-team.full header { background: #fff5f5; }
.availability-team.tight header { background: #fffaf0; }
.availability-team.free header { background: #f6fbf8; }
.availability-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.availability-summary b { color: var(--text); }
.availability-slots {
  display: grid;
  gap: 6px;
  padding: 10px;
}
.availability-slot {
  min-height: 42px;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px;
}
.availability-slot > div {
  display: grid;
  line-height: 1.1;
}
.availability-slot > div strong { font-size: 12px; }
.availability-slot > div span { color: var(--muted); font-size: 11px; }
.availability-slot.free { background: #f0fbf5; border-color: #cfeada; }
.availability-slot.busy { background: #f8fafc; }
.availability-slot a {
  color: var(--green);
  font-weight: 850;
}
.availability-slot small {
  display: block;
  margin-top: 3px;
  color: #526371;
  font-size: 11px;
  line-height: 1.25;
}

.route-panel .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.route-inner {
  margin-bottom: 0;
  box-shadow: none;
}
.route-zone-form select {
  min-width: 170px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
}
.route-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.route-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}
.route-list li > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 850;
  font-size: 12px;
}
.route-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}
.route-list.compact { gap: 6px; }
.route-list.compact li { padding: 8px; }
.route-distribution-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.route-distribution-card {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.route-distribution-card header {
  display: grid;
  gap: 3px;
  border-top: 5px solid var(--blue);
  padding-top: 8px;
}
.route-distribution-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.route-distribution-card.over {
  border-color: #f0b8b8;
  background: #fff8f8;
}
.mini-money {
  width: 92px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
}
tfoot th {
  background: #f8fafc;
  font-weight: 850;
}
.audit-hero {
  border-color: #f1c27d;
  background: linear-gradient(135deg, #fff7ea, #fff);
}
.audit-chip {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff4e5;
  color: #8a4b00;
  font-size: 11px;
  font-weight: 850;
}
.audit-close-form {
  display: grid;
  min-width: 260px;
  gap: 7px;
}
.audit-close-form input[name="reason"] {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
}
.monitor-cards .stat::before { background: var(--green); }
.monitor-cards .monitor-warning::before { background: var(--orange); }
.monitor-cards .monitor-danger::before { background: var(--red); }
.monitor-cards .monitor-warning { border-color: #f4cf91; background: #fffaf2; }
.monitor-cards .monitor-danger { border-color: #efb2b2; background: #fff6f6; }
.monitor-cards .monitor-ok { border-color: #b9dec6; background: #f5fbf7; }
.monitor-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.monitor-checklist span {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  font-weight: 750;
}
.monitor-checklist span::before {
  content: "OK";
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 20px;
  margin-right: 8px;
  border-radius: 999px;
  background: #e8f6ee;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}
.regularization-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #f1c27d;
  border-radius: 10px;
  background: #fffaf2;
}
.regularization-box h3 {
  margin: 0 0 12px;
  color: #1f2a33;
}

.tabs-inline { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 2px; }
.tabs-inline a {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--text);
  font-weight: 700;
}
.tabs-inline a:hover { border-color: #9fc7ee; background: #f1f7ff; color: var(--blue); }
.tabs-inline a.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.profile-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.signature { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 8px; color: var(--muted); }
.quote-recipient {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.quote-recipient > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}
.quote-recipient strong { display: block; margin-bottom: 8px; color: #1f2a33; }
.quote-recipient p { margin: 4px 0; color: var(--text); }
.email-html-editor {
  min-height: 360px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}
.email-preview {
  display: grid;
  gap: 8px;
}
.email-preview iframe {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.billing-month-wrap {
  max-height: 72vh;
}
.billing-month-table {
  min-width: 1800px;
  font-size: 12px;
}
.billing-month-table th:first-child,
.billing-month-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  min-width: 210px;
}
.billing-month-table th:first-child {
  background: #f7f9fc;
}
.billing-month-table th {
  text-align: center;
  min-width: 52px;
}
.billing-month-table td {
  min-width: 52px;
  padding: 7px;
  vertical-align: top;
}
.billing-day-entry {
  display: block;
  margin: 0 0 5px;
  padding: 5px 6px;
  border-radius: 7px;
  background: #eef6ff;
  color: #0f5aa8;
  font-weight: 850;
  line-height: 1.2;
}
.billing-day-entry small {
  display: block;
  margin-top: 3px;
  color: #526371;
  font-weight: 700;
}
.task-list { display: grid; gap: 14px; }
.workday-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-color: #cfe5fb;
  background: #f7fbff;
}
.workday-panel h2 { margin-bottom: 5px; }
.workday-panel p { margin: 0 0 6px; }
.workday-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.operator-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(260px, 1.4fr);
  gap: 12px;
  margin-bottom: 18px;
}
.operator-dashboard article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.operator-dashboard span, .operator-dashboard small { display: block; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.operator-dashboard strong { display: block; margin-top: 6px; color: #1f2a33; font-size: 22px; }
.operator-dashboard .wide strong { font-size: 16px; }
.operator-dashboard small { margin-top: 6px; text-transform: none; font-weight: 650; }
  .task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 16px;
    padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }
  .task-card[data-closed="1"] {
    border-color: #9fd8ad;
    background: #eef8f0;
  }
  .task-card[data-closed="1"]::after {
    content: "Servico encerrado";
    display: block;
    grid-column: 1 / -1;
    padding: 9px 10px;
    border-radius: 9px;
    background: #dff1e4;
    color: #20552d;
    font-weight: 850;
  }
  .task-card[data-closed="1"] .task-actions {
    opacity: .72;
  }
  .task-card[data-late-start="1"] {
    border-color: #f5a623;
    box-shadow: 0 0 0 2px rgba(245, 124, 0, .12), var(--shadow-sm);
  }
  .late-start-alert {
    display: block;
    margin: 8px 0 10px;
    padding: 10px 12px;
    border: 1px solid #f8c56a;
    border-radius: 10px;
    background: #fff4df;
    color: #8a4b00;
    font-weight: 850;
    line-height: 1.35;
  }
  .task-card.task-locked {
    opacity: .48;
    filter: grayscale(.2);
  }
.task-card.task-locked::after {
  content: "Indisponível enquanto outro serviço está em execução";
  display: block;
  grid-column: 1 / -1;
  padding: 9px 10px;
  border-radius: 9px;
  background: #fff4e5;
  color: var(--orange);
  font-weight: 800;
}
.btn.disabled, a.disabled {
  pointer-events: none;
  opacity: .5;
}
.task-card strong, .task-card span, .task-card small { display: block; }
.task-card strong { font-size: 16px; margin-bottom: 6px; color: #1f2a33; }
.task-card span { color: var(--muted); margin-top: 3px; }
.task-card small { margin-top: 10px; color: var(--text); }
.task-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 8px;
}
.task-meta span {
  margin: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}
.task-meta b { display: block; margin-top: 3px; color: #1f2a33; font-size: 13px; }
.next-client {
  margin-top: 10px !important;
  padding: 10px;
  border-radius: 10px;
  background: #eef6ff;
  color: #24537a !important;
}
.service-timer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #cfe5fb;
  border-radius: 10px;
  background: #f1f7ff;
}
.service-timer span { margin: 0; color: #24537a; font-weight: 750; }
.service-timer b { display: block; margin-top: 4px; color: #0f5aa8; font-size: 16px; }
.service-timer meter { grid-column: 1 / -1; width: 100%; height: 10px; }
.task-actions { display: grid; align-content: start; gap: 8px; }
.task-actions input[type="number"] { height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; }
.cash-confirm {
  min-height: 92px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid #f2c47c;
  border-radius: 14px;
  background: #fff8e9;
  color: #7a4a00;
  font-weight: 850;
}
.cash-confirm input {
  width: 30px;
  height: 30px;
  accent-color: var(--orange);
}
.cash-confirm span { color: #7a4a00; font-size: 15px; }
.office-note {
  margin-top: 12px;
  padding: 11px;
  border: 1px solid #cfe5fb;
  border-radius: 10px;
  background: #f1f7ff;
}
.office-note strong { display: block; margin-bottom: 6px; color: #0f5aa8; }
.office-note span { color: #24537a; }
.task-checklist {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}
.task-checklist strong { margin-bottom: 2px; }
.task-checklist label {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.task-checklist input {
  width: 24px;
  height: 24px;
  accent-color: var(--green);
}
.operator-notes-label { display: grid; gap: 6px; color: var(--text); font-weight: 750; }
.operator-notes-label textarea { width: 100%; min-height: 88px; border: 1px solid var(--line); border-radius: 10px; padding: 9px; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; background: #e7f2ff; color: #0d4f95; border: 1px solid #cfe5fb; }
.alert.success { background: #e8f6ee; color: var(--green); border-color: #cbead8; }
.alert.error { background: #ffeded; color: var(--red); border-color: #ffd0d0; }
.alert-flash {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #b71c1c;
  border-color: #b71c1c;
  color: #fff;
  box-shadow: 0 10px 28px rgba(183,28,28,.22);
  animation: alertPulse 1.25s ease-in-out infinite alternate;
}
.alert-flash .btn { margin-left: auto; background: #fff; border-color: #fff; color: #b71c1c; }
.alert-flash .btn:hover { background: #ffecec; color: #8f1616; }
.alert-flash.compact { animation: none; box-shadow: none; }
@keyframes alertPulse {
  from { transform: translateY(0); }
  to { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(183,28,28,.32); }
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at top left, rgba(23,105,194,.16), transparent 340px),
    linear-gradient(135deg, #eef4fa, #f8fafc);
}
.login-card {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  box-shadow: 0 24px 70px rgba(31,42,51,.16);
}
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.login-brand strong, .login-brand small { display: block; }
.login-card h1 { margin: 0 0 6px; }
.login-card p, .muted { color: var(--muted); }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #1f2a33;
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .18s ease;
  z-index: 10;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red); }

@media (max-width: 1200px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .profile-cards { grid-template-columns: repeat(2, 1fr); }
  .grid.two { grid-template-columns: 1fr; }
  .access-layout { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .reports-grid { grid-template-columns: 1fr; }
  .report-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid.wide { grid-template-columns: repeat(2, 1fr); }
  .availability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-distribution-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-mini-card { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .18s ease; z-index: 8; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-collapse { display: none; }
  body.sidebar-collapsed .app-shell { display: block; grid-template-columns: none; }
  body.sidebar-collapsed .sidebar { width: 280px; }
  body.sidebar-collapsed .brand { justify-content: flex-start; gap: 12px; padding: 18px; }
  body.sidebar-collapsed .brand > span:not(.brand-mark) { display: block; }
  body.sidebar-collapsed .side-nav { gap: 7px; padding: 14px 12px 28px; }
  body.sidebar-collapsed .nav-section { border: 1px solid rgba(255,255,255,.06); border-radius: 12px; background: rgba(255,255,255,.025); }
  body.sidebar-collapsed .side-nav button.nav-group { min-height: 43px; justify-content: space-between; padding: 0 12px; }
  body.sidebar-collapsed .side-nav button.nav-group span { display: inline-flex; }
  body.sidebar-collapsed .side-nav button.nav-group b { width: auto; height: auto; overflow: visible; background: transparent; color: #9ed0ff; }
  body.sidebar-collapsed .nav-items { padding: 0 7px 8px; }
  body.sidebar-collapsed .side-nav a { justify-content: flex-start; gap: 11px; min-height: 42px; padding: 9px 11px; font-size: 14px; }
  body.sidebar-collapsed .side-nav a span { min-width: 31px; height: 26px; font-size: 10px; }
  .topbar { grid-template-columns: auto 1fr; min-height: auto; padding: 12px; }
  .top-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .panel-head .top-actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .client-list-actions { flex-wrap: wrap; }
  .client-list-search { flex: 1 1 190px; }
  .client-list-search input { width: 100%; }
  .weekday-tab { min-width: 54px; }
  .content { padding: 14px; }
  .page-title h1 { font-size: 24px; }
  .cards, .form-grid, .form-grid.wide, .profile-cards { grid-template-columns: 1fr; }
  .report-cards { grid-template-columns: 1fr; }
  .availability-grid { grid-template-columns: 1fr; }
  .route-distribution-grid { grid-template-columns: 1fr; }
  .plan-mini-card,
  .plan-mini-card.empty { grid-template-columns: 1fr; }
  .task-card { grid-template-columns: 1fr; }
  .task-meta { grid-template-columns: 1fr; }
  .operator-dashboard { grid-template-columns: 1fr; }
  .service-timer { grid-template-columns: 1fr; }
  .panel { padding: 15px; }
  .payment-os-row {
    grid-template-columns: auto 1fr;
    align-items: flex-start;
  }
  .payment-os-row > span:not(:first-of-type) {
    grid-column: 2;
  }

  .operator-mode .topbar {
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 10px;
  }
  .operator-mode .top-search {
    display: none;
  }
  .operator-mode .top-actions {
    grid-column: auto;
    justify-content: flex-end;
    gap: 8px;
  }
  .operator-mode .user-chip {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .operator-mode .content {
    padding: 10px;
    padding-bottom: 90px;
  }
  .operator-mode .page-title {
    margin-bottom: 10px;
  }
  .operator-mode .page-title p {
    display: none;
  }
  .operator-mode .page-title h1 {
    font-size: 22px;
  }
  .operator-mode .calendar-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 10px;
  }
  .operator-mode .calendar-toolbar input,
  .operator-mode .calendar-toolbar button {
    min-height: 48px;
    font-size: 16px;
  }
  .operator-mode .panel {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }
  .operator-mode .panel-head {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }
  .operator-mode .workday-panel {
    display: grid;
    padding: 14px;
    margin-bottom: 12px;
  }
  .operator-mode .workday-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .operator-mode .workday-actions .btn {
    min-height: 56px;
    font-size: 16px;
  }
  .operator-mode .panel-head p {
    font-size: 13px;
  }
  .operator-mode .operator-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .operator-mode .operator-dashboard .wide {
    grid-column: 1 / -1;
  }
  .operator-mode .operator-dashboard article {
    padding: 12px;
    border-radius: 10px;
  }
  .operator-mode .task-list {
    gap: 12px;
  }
  .operator-mode .task-card {
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
  }
  .operator-mode .task-card strong {
    font-size: 18px;
    line-height: 1.25;
  }
  .operator-mode .task-card span,
  .operator-mode .task-card small {
    font-size: 14px;
    line-height: 1.35;
  }
  .operator-mode .task-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .operator-mode .task-meta span {
    padding: 10px;
  }
  .operator-mode .task-actions {
    gap: 10px;
  }
  .operator-mode .task-actions .btn,
  .operator-mode .task-actions a.btn {
    min-height: 54px;
    width: 100%;
    justify-content: center;
    font-size: 16px;
  }
  .operator-mode .cash-confirm {
    min-height: 112px;
    grid-template-columns: 46px 1fr;
    padding: 16px;
  }
  .operator-mode .cash-confirm input {
    width: 38px;
    height: 38px;
  }
  .operator-mode .cash-confirm span {
    font-size: 16px;
  }
  .operator-mode .task-actions input[type="number"] {
    min-height: 50px;
    font-size: 16px;
  }
  .operator-mode .task-checklist {
    padding: 14px;
  }
  .operator-mode .task-checklist label {
    grid-template-columns: 42px 1fr;
    gap: 12px;
    font-size: 15px;
  }
  .operator-mode .task-checklist input {
    width: 34px;
    height: 34px;
  }
  .operator-mode .operator-notes-label textarea {
    min-height: 120px;
    font-size: 16px;
  }
  .operator-mode .service-timer {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  .operator-mode .task-meta {
    grid-template-columns: 1fr;
  }
  .operator-mode .top-actions .user-chip {
    display: none;
  }
}

@media print {
  .sidebar, .topbar, .calendar-toolbar, .calendar-filters, .page-title, .btn, .card-actions, .print-hide, .form-actions { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .quote-print { border: 0; box-shadow: none; }
  .salary-document-page { page-break-after: always; break-after: page; }
  .salary-document-page:last-of-type { page-break-after: auto; break-after: auto; }
  .billing-month-wrap { overflow: visible; max-height: none; border: 0; }
  .billing-month-table { min-width: 0; font-size: 9px; }
  .billing-month-table th:first-child,
  .billing-month-table td:first-child { position: static; min-width: 120px; }
  .billing-month-table th, .billing-month-table td { min-width: 28px; padding: 3px; }
  .billing-day-entry { padding: 2px; font-size: 8px; }
}
