:root {
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f5f7;
  --bg-gradient: radial-gradient(circle at 12% -8%, rgba(35, 92, 68, 0.32) 0, transparent 34%),
    radial-gradient(circle at 90% 4%, rgba(235, 169, 116, 0.36) 0, transparent 32%),
    radial-gradient(circle at 44% 110%, rgba(165, 197, 149, 0.34) 0, transparent 38%),
    linear-gradient(138deg, #f6f0e8 0%, #eef4ee 46%, #f8faf7 100%);
  --ink: #171717;
  --muted: #6f6f76;
  --line: #e6e6e8;
  --surface: #ffffff;
  --glass-surface: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.54);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --priority-red-bg: rgba(255, 241, 242, 0.72);
  --priority-yellow-bg: rgba(255, 251, 235, 0.72);
  --priority-orange-bg: rgba(255, 247, 237, 0.72);
  --priority-green-bg: rgba(240, 253, 244, 0.72);
  --priority-blue-bg: rgba(239, 246, 255, 0.72);
  --priority-teal-bg: rgba(240, 253, 250, 0.72);
  --priority-red-table: rgba(255, 245, 245, 0.88);
  --priority-yellow-table: rgba(255, 251, 234, 0.88);
  --priority-green-table: rgba(240, 253, 244, 0.88);
  --priority-blue-table: rgba(240, 247, 255, 0.88);
  --brand: #171717;
  --brand-dark: #171717;
  --soft: #f6f6f7;
  --red: #b91c1c;
  --amber: #b45309;
  --green: #15803d;
  --radius-panel: 8px;
  --radius-control: 6px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-soft: 0 1px 1px rgba(17, 24, 39, 0.035);
  --shadow-premium: 0 18px 42px rgba(15, 23, 42, 0.08);
  --shadow-glass: 0 16px 42px rgba(15, 23, 42, 0.1);
  --shadow-liquid: 0 24px 70px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  max-width: 100%;
}

html,
body {
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(13, 63, 45, 0.42), transparent 42%),
    linear-gradient(245deg, rgba(236, 150, 94, 0.36), transparent 50%),
    linear-gradient(20deg, rgba(91, 151, 116, 0.3), transparent 56%);
  filter: blur(42px);
  opacity: 0.95;
  transform: translate3d(0, 0, 0);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(0deg, rgba(17, 24, 39, 0.035) 0 1px, transparent 1px 10px);
  opacity: 0.1;
  mix-blend-mode: soft-light;
}

#app {
  position: relative;
  z-index: 1;
}

.formal-auth-only {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
}

.formal-auth-only .formal-auth-shell {
  width: min(1120px, 100%);
}

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

.crm-workspace {
  min-width: 0;
}

.crm-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  border-right: 1px solid var(--glass-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.42));
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  box-shadow: 16px 0 52px rgba(15, 23, 42, 0.1), inset -1px 0 0 rgba(255, 255, 255, 0.55);
  padding: 18px 12px;
}

.crm-sidebar-brand {
  display: grid;
  gap: 3px;
  padding: 0 8px 10px;
  border-bottom: 1px solid var(--line);
}

.crm-sidebar-brand span {
  font-size: 15px;
  font-weight: 780;
  letter-spacing: 0;
}

.crm-sidebar-brand small,
.crm-sidebar-footer label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.crm-nav {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.crm-nav-item {
  width: 100%;
  display: grid;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 8px 9px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.crm-nav-item span {
  font-size: 13px;
  font-weight: 760;
}

.crm-nav-item small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.crm-nav-item:hover,
.crm-nav-item.active {
  border-color: var(--glass-line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.crm-nav-item.active span {
  color: #0f172a;
}

.crm-nav-item.priority-tomorrow,
.crm-nav-item.priority-soon,
.crm-nav-item.priority-today {
  background: var(--priority-yellow-bg);
  border-color: rgba(248, 223, 168, 0.72);
  box-shadow: var(--glass-highlight);
}

.crm-nav-item.priority-overdue,
.crm-nav-item.priority-repair-review,
.crm-nav-item.priority-manager-review,
.crm-nav-item.priority-unfinished-booking {
  background: var(--priority-red-bg);
  border-color: rgba(244, 199, 199, 0.72);
  box-shadow: var(--glass-highlight);
}

.crm-sidebar-footer {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.crm-sidebar-footer select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.82);
  padding: 6px 8px;
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
  min-width: 0;
}

button {
  border: 0;
}

.top {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34));
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  color: var(--ink);
  padding: 8px clamp(12px, 2.4vw, 22px);
  border-bottom: 1px solid var(--glass-line);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.top-inner {
  max-width: none;
  margin: 0 auto;
  display: grid;
  gap: 0;
}

.top h1 {
  margin: 0;
  font-size: clamp(21px, 3vw, 28px);
  letter-spacing: 0;
  font-weight: 820;
}

.top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.top-title-row {
  position: relative;
  display: flex;
  align-items: start;
  gap: 10px;
}

.top-title-row.compact {
  align-items: center;
}

.top-title-row.compact .identity-rail {
  flex: 1 1 auto;
}

.menu-toggle {
  display: none;
  place-items: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.mailbox-global-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: var(--shadow-soft);
}

.mailbox-global-button.has-mail {
  border-color: rgba(254, 202, 202, 0.72);
  background: var(--priority-red-bg);
  color: var(--red);
  box-shadow: var(--shadow-soft), var(--glass-highlight);
}

.mailbox-envelope {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.mailbox-envelope svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mailbox-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  border: 2px solid #fff;
  font-size: 11px;
  font-weight: 900;
}

.identity {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.8fr);
  gap: 8px;
}

.identity-rail {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}

.identity-chip {
  display: inline-flex;
  min-height: 30px;
  min-width: 0;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  padding: 4px 9px;
  box-shadow: var(--shadow-soft), var(--glass-highlight);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

.identity-chip small,
.identity-chip em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

.identity-chip strong {
  min-width: 0;
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.identity-chip-button {
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.top-install-button {
  margin-left: auto;
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-soft), var(--glass-highlight);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

.top-install-button:hover {
  background: rgba(255, 255, 255, 0.78);
}

.top-install-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  max-width: min(360px, calc(100vw - 24px));
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.4;
  box-shadow: var(--shadow-liquid), var(--glass-highlight);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

.small-link-button {
  margin-top: 6px;
  color: #2563eb;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.formal-login-panel {
  max-width: 620px;
}

.formal-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 480px);
  gap: 14px;
  align-items: start;
}

.formal-auth-shell-compact {
  max-width: 980px;
}

.formal-auth-aside {
  min-width: 0;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-panel);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.22)),
    linear-gradient(135deg, rgba(14, 78, 53, 0.16), rgba(244, 174, 116, 0.18));
  padding: clamp(18px, 3vw, 28px);
  box-shadow: var(--shadow-liquid), var(--glass-highlight);
  backdrop-filter: blur(30px) saturate(1.32);
  -webkit-backdrop-filter: blur(30px) saturate(1.32);
}

.section-kicker {
  display: inline-flex;
  border: 1px solid rgba(147, 197, 253, 0.62);
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.78);
  color: #1d4ed8;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.formal-auth-aside h2,
.formal-auth-card h2 {
  margin: 12px 0 0;
  font-size: clamp(24px, 3.5vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 860;
}

.formal-auth-card h2 {
  font-size: 22px;
}

.formal-auth-aside p,
.formal-auth-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.formal-auth-points {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.formal-auth-points span {
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.46);
  padding: 9px 10px;
  color: #374151;
  font-size: 13px;
  font-weight: 820;
}

.formal-auth-card {
  display: grid;
  align-content: start;
  max-width: none;
  gap: 12px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-panel);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.42));
  padding: clamp(14px, 2.4vw, 20px);
  box-shadow: var(--shadow-liquid), var(--glass-highlight);
  backdrop-filter: blur(30px) saturate(1.32);
  -webkit-backdrop-filter: blur(30px) saturate(1.32);
}

.formal-auth-card-head h2 {
  margin-top: 0;
}

.formal-auth-card .compact-form,
.formal-reset-form {
  margin-top: 0;
}

.formal-auth-notes {
  display: grid;
  gap: 8px;
}

.formal-auth-notes .soft-note {
  margin-top: 0;
}

.soft-note {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-panel);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.soft-note strong {
  color: var(--ink);
}

.danger-text {
  color: var(--red);
  font-weight: 800;
}

.subtle-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.inline-action {
  margin-left: 8px;
  border-radius: 6px;
  padding: 3px 7px;
  background: var(--priority-green-bg);
  color: #166534;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--glass-highlight);
}

.desk-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.desk-tab {
  min-height: 34px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-control);
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.48);
  color: #374151;
  cursor: pointer;
  font-weight: 850;
}

.desk-tab.active {
  background: linear-gradient(135deg, #0d1b16 0%, #17251f 48%, #30372f 100%);
  border-color: rgba(13, 27, 22, 0.88);
  color: #fff;
  box-shadow: 0 16px 36px rgba(13, 27, 22, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.desk-tab.priority-tomorrow,
.desk-tab.priority-tomorrow.active {
  background: var(--priority-orange-bg);
  color: #9a3412;
  border-color: rgba(253, 186, 116, 0.74);
  box-shadow: var(--glass-highlight);
}

.desk-tab.priority-overdue,
.desk-tab.priority-repair-review,
.desk-tab.priority-manager-review,
.desk-tab.priority-unfinished-booking,
.desk-tab.priority-overdue.active,
.desk-tab.priority-repair-review.active,
.desk-tab.priority-manager-review.active,
.desk-tab.priority-unfinished-booking.active {
  background: var(--priority-red-bg);
  color: #9f1239;
  border-color: rgba(254, 202, 202, 0.78);
  box-shadow: var(--glass-highlight);
}

.desk-tab.priority-soon,
.desk-tab.priority-soon.active,
.desk-tab.priority-today,
.desk-tab.priority-today.active {
  background: var(--priority-yellow-bg);
  color: #92400e;
  border-color: rgba(253, 230, 138, 0.78);
  box-shadow: var(--glass-highlight);
}

.desk-tab.active {
  outline: 2px solid rgba(17, 24, 39, 0.12);
  outline-offset: 2px;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.34);
}

.side-menu {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 21;
  width: min(340px, calc(100vw - 28px));
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.46));
  backdrop-filter: blur(30px) saturate(1.32);
  -webkit-backdrop-filter: blur(30px) saturate(1.32);
  color: var(--ink);
  box-shadow: 18px 0 48px rgba(17, 24, 39, 0.16);
  padding: 14px 14px max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.side-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.side-menu-head strong {
  font-size: 18px;
}

.language-control {
  display: grid;
  gap: 6px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.46);
  padding: 10px;
}

.language-control label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.menu-list {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2px 8px 0;
  -webkit-overflow-scrolling: touch;
}

.menu-item {
  width: 100%;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink);
  cursor: pointer;
  padding: 11px 12px;
  text-align: left;
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  box-shadow: var(--glass-highlight);
}

.menu-item span,
.menu-item small {
  display: block;
}

.menu-item span {
  font-weight: 900;
}

.menu-item small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.menu-item.active {
  border-color: rgba(153, 246, 228, 0.72);
  background: var(--priority-teal-bg);
}

.menu-item.priority-tomorrow {
  border-color: rgba(253, 186, 116, 0.74);
  background: var(--priority-orange-bg);
}

.menu-item.priority-overdue,
.menu-item.priority-repair-review,
.menu-item.priority-manager-review,
.menu-item.priority-unfinished-booking {
  border-color: rgba(254, 202, 202, 0.78);
  background: var(--priority-red-bg);
}

.menu-item.priority-soon,
.menu-item.priority-today {
  border-color: rgba(253, 230, 138, 0.78);
  background: var(--priority-yellow-bg);
}

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field label {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.top .field label {
  color: #6b7280;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  padding: 9px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.field textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.45;
}

.assignment-note {
  border: 1px solid #bee0da;
  border-radius: var(--radius-panel);
  background: var(--priority-teal-bg);
  color: #134e4a;
  padding: 10px 12px;
  font-weight: 800;
  box-shadow: var(--glass-highlight);
}

.top .field input,
.top .field select {
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
  border-color: var(--glass-line);
  box-shadow: var(--shadow-soft);
}

.top .field option {
  color: var(--ink);
}

.wrap {
  min-width: 0;
  max-width: none;
  margin: 0 auto;
  padding: 14px clamp(12px, 3vw, 28px) 36px;
}

.workspace-notices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}

.workspace-hero {
  margin-bottom: 0;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  padding: 14px 16px;
  display: grid;
  gap: 12px;
  align-content: center;
  box-shadow: var(--shadow-soft), var(--glass-highlight);
  backdrop-filter: blur(20px) saturate(1.16);
  -webkit-backdrop-filter: blur(20px) saturate(1.16);
}

.workspace-hero h1 {
  margin: 2px 0 0;
  font-size: clamp(26px, 4.2vw, 48px);
  line-height: 1.02;
  font-weight: 860;
  letter-spacing: 0;
}

.workspace-hero p {
  margin: 6px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 720;
  line-height: 1.35;
}

.workspace-hero-tabs {
  margin-top: 2px;
}

.install-button {
  background: linear-gradient(135deg, #0d1b16 0%, #17251f 48%, #30372f 100%);
  color: #fff;
}

.install-help {
  grid-column: 1 / -1;
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
  padding: 9px 10px;
  font-weight: 750;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.stats + .daily-social-section {
  margin-top: 12px;
}

.stats + .mailbox-shell {
  margin-top: 14px;
}

.stats + .panel {
  margin-top: 14px;
}

.stats + .module-home {
  margin-top: 14px;
}

.stat,
.panel,
.case-card {
  min-width: 0;
  background: var(--glass-surface);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-liquid), var(--glass-highlight);
  backdrop-filter: blur(26px) saturate(1.25);
  -webkit-backdrop-filter: blur(26px) saturate(1.25);
}

.stat {
  padding: 10px 12px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  letter-spacing: 0;
}

.main-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 12px;
  margin-top: 12px;
}

.main-grid.single-column {
  grid-template-columns: 1fr;
}

.panel {
  padding: 14px;
}

.panel h2,
.task-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel p,
.task-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 12px;
  margin-top: 14px;
}

.payment-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.payment-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.66);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.payment-choice input[type="radio"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.payment-choice label span {
  min-width: 0;
}

.btn {
  min-height: 38px;
  border-radius: var(--radius-control);
  padding: 8px 12px;
  background: linear-gradient(135deg, #0d1b16 0%, #17251f 48%, #30372f 100%);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  box-shadow: 0 16px 36px rgba(13, 27, 22, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.54);
  color: #1f2937;
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-soft), var(--glass-highlight);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-head {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 10px;
}

.compact-create-panel {
  align-self: start;
}

.compact-create-panel .compact-task-head {
  margin-bottom: 0;
}

.case-list {
  display: grid;
  gap: 12px;
}

.case-card {
  padding: 14px;
}

.case-top {
  display: flex;
  min-width: 0;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.case-card h3 {
  margin: 0;
  font-size: 17px;
}

.meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.chip {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.chip.open {
  background: var(--priority-yellow-bg);
  color: var(--amber);
}

.chip.done {
  background: var(--priority-green-bg);
  color: var(--green);
}

.chip.overdue {
  background: var(--priority-red-bg);
  color: var(--red);
}

.chip.remove {
  background: rgba(254, 202, 202, 0.72);
  color: #991b1b;
}

.follow-card {
  padding: 0;
}

.case-card.priority-tomorrow {
  border-color: rgba(253, 186, 116, 0.74);
  background: var(--priority-orange-bg);
}

.case-card.priority-soon,
.case-card.priority-today {
  border-color: rgba(253, 230, 138, 0.78);
  background: var(--priority-yellow-bg);
}

.case-card.priority-overdue,
.case-card.priority-unfinished-booking {
  border-color: rgba(254, 202, 202, 0.78);
  background: var(--priority-red-bg);
}

.case-card.priority-repair-review {
  border-color: #fca5a5;
  background: var(--priority-red-bg);
}

.case-card.priority-manager-review {
  border-color: #fca5a5;
  background: var(--priority-red-bg);
}

.case-card.priority-repair-ready {
  border-color: #fca5a5;
  background: var(--priority-red-bg);
}

.case-card.priority-tomorrow .follow-summary {
  background: transparent;
}

.case-card.priority-soon .follow-summary,
.case-card.priority-today .follow-summary {
  background: transparent;
}

.case-card.priority-overdue .follow-summary,
.case-card.priority-unfinished-booking .follow-summary {
  background: transparent;
}

.case-card.priority-repair-review .follow-summary,
.case-card.priority-manager-review .follow-summary {
  background: transparent;
}

.case-card.priority-repair-ready .follow-summary {
  background: transparent;
}

.follow-summary {
  display: flex;
  min-width: 0;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.summary-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mailbox-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.mailbox-inbox-panel {
  min-width: 0;
}

.mailbox-list {
  display: grid;
  gap: 10px;
}

.mailbox-message-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: var(--glass-strong);
  box-shadow: var(--glass-highlight);
}

.mailbox-message-card.priority-overdue {
  border-color: rgba(254, 202, 202, 0.78);
  background: var(--priority-red-bg);
}

.mailbox-message-card.priority-soon {
  border-color: rgba(253, 230, 138, 0.78);
  background: var(--priority-yellow-bg);
}

.mailbox-message-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mailbox-message-icon.red {
  background: var(--priority-red-bg);
  color: var(--red);
}

.mailbox-message-icon.yellow {
  background: var(--priority-yellow-bg);
  color: var(--amber);
}

.mailbox-message-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.mailbox-message-top {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mailbox-message-top > * {
  min-width: 0;
}

.mailbox-message-card h3 {
  margin: 0;
  font-size: 16px;
}

.mailbox-message-card p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.mailbox-message-details {
  display: grid;
  gap: 10px;
}

.mailbox-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-log-panel {
  grid-column: 1 / -1;
}

.queue-panel,
.deployment-panel {
  grid-column: 1 / -1;
}

.app-log-table td:last-child {
  min-width: 220px;
}

.queue-table td:nth-child(2),
.deployment-table td:first-child {
  min-width: 210px;
}

.queue-table small,
.deployment-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.task-head > *,
.case-top > *,
.follow-summary > *,
.workspace-notices > *,
.formal-auth-shell > *,
.stocklist-stats > *,
.stocklist-filters > *,
.manager-console-grid > *,
.loan-grid > *,
.quotation-grid > *,
.office-hub-grid > * {
  min-width: 0;
}

.summary-link {
  min-height: 30px;
  border: 0;
  border-radius: 10px;
  padding: 6px 9px;
  background: #e0f2fe;
  color: #075985;
  cursor: pointer;
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
}

.whatsapp-logo {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  text-decoration: none;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.whatsapp-logo:hover {
  background: #15803d;
}

.compact-logo {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.manager-reminder-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: 100%;
  border: 1px solid #86efac;
  border-radius: 10px;
  background: #fff;
  color: #166534;
  padding: 5px 8px;
  text-decoration: none;
  text-align: left;
}

.manager-reminder-link .whatsapp-logo {
  background: #25d366;
  color: #fff;
}

.manager-reminder-link strong,
.manager-reminder-link small {
  display: block;
  line-height: 1.15;
}

.manager-reminder-link strong {
  font-size: 12px;
  font-weight: 950;
}

.manager-reminder-link small {
  margin-top: 2px;
  color: #3f6f55;
  font-size: 11px;
  font-weight: 750;
}

.manager-reminder-link:hover {
  border-color: #16a34a;
  background: var(--priority-green-bg);
}

.icon-danger {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--priority-red-bg);
  color: #991b1b;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.details-toggle {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 8px;
}

.follow-card > :not(.follow-summary) {
  margin-left: 14px;
  margin-right: 14px;
}

.follow-card > :last-child {
  margin-bottom: 14px;
}

.progress {
  margin: 12px 0;
}

.damage-section {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.repair-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.repair-card {
  border-color: rgba(254, 202, 202, 0.78);
}

.record-section {
  margin-top: 18px;
}

.record-card {
  border-color: #bbf7d0;
}

.record-card .follow-summary {
  background: #f8fafc;
}

.damage-type-field {
  max-width: 520px;
}

.damage-type-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.damage-map {
  position: relative;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
  cursor: crosshair;
}

.damage-map:not([data-damage-map]) {
  cursor: default;
}

.damage-front {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.car-shape {
  position: absolute;
  border: 2px solid #334155;
  background: rgba(255, 255, 255, 0.72);
}

.body-main {
  left: 28%;
  top: 28%;
  width: 48%;
  height: 44%;
  border-radius: 28px;
}

.cabin {
  left: 43%;
  top: 34%;
  width: 18%;
  height: 32%;
  border-radius: 10px;
}

.hood {
  left: 24%;
  top: 38%;
  width: 12%;
  height: 24%;
  border-radius: 18px 4px 4px 18px;
}

.trunk {
  right: 18%;
  top: 38%;
  width: 10%;
  height: 24%;
  border-radius: 4px 18px 18px 4px;
}

.wheel {
  width: 10%;
  height: 15%;
  border-radius: 999px;
  background: #e2e8f0;
}

.wheel-fl {
  left: 29%;
  top: 16%;
}

.wheel-fr {
  left: 29%;
  bottom: 16%;
}

.wheel-rl {
  right: 23%;
  top: 16%;
}

.wheel-rr {
  right: 23%;
  bottom: 16%;
}

.damage-marker {
  position: absolute;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border: 3px solid var(--damage-color, #dc2626);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--damage-bg, rgba(254, 226, 226, 0.72));
  color: var(--damage-color, #991b1b);
  font-size: 12px;
  font-weight: 950;
}

.damage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.damage-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--damage-color, var(--line));
  border-radius: 999px;
  background: var(--damage-bg, #fff);
  color: var(--damage-color, var(--ink));
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
}

.damage-summary-chip strong {
  min-width: 20px;
  border-radius: 999px;
  background: #fff;
  padding: 2px 6px;
  text-align: center;
}

.damage-summary-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.subtle-empty {
  padding: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.follow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.btn.whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #128c7e;
}

.btn.success {
  background: #15803d;
}

.btn.danger {
  background: #dc2626;
}

.btn.subtle-danger {
  min-height: 34px;
  background: var(--priority-red-bg);
  border: 1px solid rgba(254, 202, 202, 0.78);
  color: #991b1b;
  padding: 7px 10px;
  box-shadow: var(--glass-highlight);
}

.mini-select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 800;
}

.muted-block {
  opacity: 0.62;
}

.remove-panel,
.book-panel,
.manager-panel,
.invoice-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  background: #fff;
}

.remove-panel {
  border-color: rgba(254, 202, 202, 0.78);
  background: var(--priority-red-bg);
}

.book-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-color: #bbf7d0;
  background: var(--priority-green-bg);
}

.book-panel span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
}

.book-panel strong {
  display: block;
  margin-top: 3px;
}

.book-panel.pending-book {
  display: grid;
  align-items: stretch;
}

.booking-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.booking-detail-grid .booking-stock-box,
.booking-detail-grid .full-field {
  grid-column: 1 / -1;
}

.manager-panel {
  display: grid;
  gap: 8px;
  border-color: #bfdbfe;
  background: var(--priority-blue-bg);
}

.manager-panel span,
.invoice-panel span {
  display: block;
  font-size: 12px;
  font-weight: 850;
}

.manager-panel span {
  color: #1d4ed8;
}

.manager-panel strong,
.invoice-panel strong {
  display: block;
}

.invoice-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-color: #bbf7d0;
  background: var(--priority-green-bg);
}

.invoice-panel span {
  color: var(--green);
}

.invoice-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.invoice-controls input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.role-note {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 750;
}

.todo-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 14px;
  margin-top: 14px;
}

.compact-select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.todo-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 14px;
}

.todo-day {
  aspect-ratio: 1 / 1;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  overflow: hidden;
}

.todo-month-day.has-events {
  border-color: #fca5a5;
  background: var(--priority-red-bg);
}

.todo-day strong,
.todo-event {
  display: block;
}

.todo-event {
  margin-top: 3px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-event.todo,
.todo-event.followup,
.todo-event.arrival,
.todo-event.repair {
  background: var(--priority-red-bg);
  color: #991b1b;
}

.todo-event.birthday,
.todo-event.insurance {
  background: var(--priority-yellow-bg);
  color: #92400e;
}

.boss-dashboard {
  display: grid;
  gap: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-panel {
  display: grid;
  gap: 10px;
}

.dashboard-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dashboard-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  font-size: 12px;
}

.dashboard-table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 900;
}

.dashboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.user-admin-panel {
  grid-column: 1 / -1;
}

.developer-mode-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-panel);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.24));
  padding: 18px;
  box-shadow: var(--shadow-liquid), var(--glass-highlight);
  backdrop-filter: blur(24px) saturate(1.24);
  -webkit-backdrop-filter: blur(24px) saturate(1.24);
}

.developer-mode-panel h2,
.developer-mode-panel p {
  margin: 0;
}

.developer-mode-grid {
  display: grid;
  align-items: stretch;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(180px, 0.8fr));
}

.developer-mode-card {
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.36);
  padding: 14px;
  box-shadow: var(--glass-highlight);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.developer-mode-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.user-admin-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.details-toggle.danger-mini {
  border-color: rgba(254, 202, 202, 0.78);
  background: var(--priority-red-bg);
  color: #991b1b;
}

.permission-template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.permission-template-grid h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
}

.permission-template-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  padding: 10px;
}

.permission-template-card span,
.permission-template-card small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-list {
  display: grid;
  gap: 8px;
}

.risk-row {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  padding: 10px;
}

.risk-row.high-risk {
  border-color: #fca5a5;
  background: var(--priority-red-bg);
}

.risk-row.opportunity-green {
  border-color: #86efac;
  background: var(--priority-green-bg);
}

.risk-row.opportunity-yellow {
  border-color: #fde68a;
  background: var(--priority-yellow-bg);
}

.risk-row strong,
.risk-row span {
  display: block;
}

.risk-row strong {
  font-size: 14px;
}

.risk-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.storage-boundary-panel {
  border-color: #fdba74;
  background: var(--priority-orange-bg);
}

.wide-flow {
  margin-top: 14px;
}

.module-home {
  min-width: 0;
  margin-top: 14px;
}

.office-hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.module-tile {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.module-tile h3 {
  margin: 0;
  font-size: 17px;
}

.module-tile span {
  display: inline-block;
  margin-top: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.compact-module-home {
  margin-top: 12px;
}

.compact-module-home .module-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quotation-drafts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 12px;
  margin-top: 14px;
}

.quotation-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.compact-head {
  margin-bottom: 8px;
}

.quotation-card .follow-summary {
  border-bottom: 1px solid var(--line);
}

.quotation-file-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 14px 14px;
}

.quotation-file-row > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 10px;
}

.quotation-file-row span,
.quotation-file-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quotation-file-row strong {
  display: block;
  margin: 3px 0;
  overflow-wrap: anywhere;
}

.loan-calculator {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 12px;
  margin-top: 14px;
}

.loan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.loan-input-panel,
.loan-output-panel {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 14px;
}

.loan-output-panel {
  overflow: visible;
}

.loan-output-panel > * {
  min-width: 0;
  max-width: 100%;
}

.loan-output-panel p,
.summary-item {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
}

.loan-form {
  display: grid;
  gap: 12px;
}

.loan-field-grid,
.loan-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.full-loan-field {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.language-segment {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.language-button,
.year-toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.language-button.active,
.year-toggle.active,
.ncd-options button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.ncd-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ncd-options button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.loan-percent-tool {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  padding: 10px 12px 12px;
}

.loan-percent-tool.active {
  border-color: #99f6e4;
  background: var(--priority-teal-bg);
}

.loan-percent-tool input {
  min-height: 26px;
  padding: 0;
  accent-color: var(--brand);
}

.loan-percent-row,
.year-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.loan-percent-row span,
.year-head strong,
.quote-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.loan-percent-row strong {
  color: var(--brand-dark);
}

.year-block {
  display: grid;
  gap: 9px;
}

.year-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.year-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
  color: #1f2937;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(34px, 1fr));
  gap: 6px;
}

.quote-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quote-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.quote-option input {
  flex: 0 0 auto;
  accent-color: var(--brand);
}

.summary-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfcff;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.summary-item strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.summary-item span,
.summary-item strong {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.validation-messages {
  display: grid;
  gap: 7px;
  border: 1px solid #fdba74;
  border-radius: 8px;
  background: var(--priority-orange-bg);
  color: #9a3412;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.loan-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.loan-table-wrap table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.loan-table-wrap th,
.loan-table-wrap td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  white-space: nowrap;
}

.loan-table-wrap th {
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.loan-table-wrap td {
  font-size: 14px;
  font-weight: 800;
}

.loan-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.quote-preview textarea {
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.stocklist-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 12px;
  margin-top: 18px;
}

.stocklist-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stocklist-filters {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(180px, 0.9fr);
  gap: 10px;
  align-items: end;
}

.stocklist-filters .field,
.stocklist-filters .compact-stat {
  align-self: stretch;
}

.stocklist-filters .field {
  display: grid;
  align-content: end;
}

.stocklist-filters .field label {
  min-height: 18px;
}

.stocklist-filters .field select,
.stocklist-filters .field input {
  width: 100%;
  min-height: 42px;
}

.stocklist-filters .compact-stat {
  display: grid;
  align-content: center;
  min-height: 72px;
  padding: 9px 12px;
}

.stock-scroll-controls {
  position: sticky;
  top: 8px;
  z-index: 8;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

.stock-scroll-controls span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.stock-scroll-range {
  width: 100%;
  min-width: 0;
  background: transparent;
  accent-color: #111827;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
}

.stock-scroll-range::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #111827 0 var(--stock-scroll-progress, 0%), #e5e7eb var(--stock-scroll-progress, 0%) 100%);
}

.stock-scroll-range::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  margin-top: -8px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #111827;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.24);
  -webkit-appearance: none;
}

.stock-scroll-range::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
}

.stock-scroll-range::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: #111827;
}

.stock-scroll-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #111827;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.24);
}

.manager-stock-console,
.stock-opportunity-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 10px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.58);
  padding: 14px;
  box-shadow: var(--shadow-liquid), var(--glass-highlight);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

.manager-console-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stock-event-price-box {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}

.stock-event-price-box span,
.stock-event-price-box small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-form {
  align-content: start;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--glass-highlight);
}

.compact-form h3 {
  grid-column: 1 / -1;
  margin: 0;
}

.rule-list {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 6px;
}

.rule-list span {
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 850;
}

.compact-stat {
  min-height: 0;
}

.compact-stat strong {
  font-size: 18px;
  line-height: 1.25;
}

.stocklist-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.76);
  overflow-x: auto;
  box-shadow: var(--shadow-liquid), var(--glass-highlight);
  backdrop-filter: blur(22px) saturate(1.14);
  -webkit-backdrop-filter: blur(22px) saturate(1.14);
}

.stocklist-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  table-layout: fixed;
}

.stocklist-table th,
.stocklist-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: normal;
}

.stocklist-table th {
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.stocklist-table tbody tr:hover td {
  background: rgba(249, 250, 251, 0.96);
}

.stocklist-table th:nth-child(1),
.stocklist-table td:nth-child(1) {
  width: 38px;
}

.stocklist-table th:nth-child(2),
.stocklist-table td:nth-child(2) {
  width: 82px;
}

.stocklist-table th:nth-child(3),
.stocklist-table td:nth-child(3) {
  width: 170px;
}

.stocklist-table th:nth-child(4),
.stocklist-table td:nth-child(4) {
  width: 54px;
}

.stocklist-table th:nth-child(5),
.stocklist-table td:nth-child(5) {
  width: 76px;
}

.stocklist-table th:nth-child(6),
.stocklist-table td:nth-child(6) {
  width: 84px;
}

.stocklist-table th:nth-child(7),
.stocklist-table td:nth-child(7) {
  width: 126px;
}

.stocklist-table th:nth-child(8),
.stocklist-table td:nth-child(8) {
  width: 104px;
}

.stocklist-table th:nth-child(9),
.stocklist-table td:nth-child(9) {
  width: 70px;
}

.stocklist-table th:nth-child(10),
.stocklist-table td:nth-child(10) {
  width: 76px;
}

.stocklist-table th:nth-child(11),
.stocklist-table td:nth-child(11) {
  width: 74px;
}

.stocklist-table th:nth-child(12),
.stocklist-table td:nth-child(12) {
  width: 86px;
}

.stocklist-table th:nth-child(13),
.stocklist-table td:nth-child(13) {
  width: 280px;
}

.stocklist-table th:nth-child(14),
.stocklist-table td:nth-child(14) {
  width: 64px;
}

.stocklist-table th:last-child,
.stocklist-table td:last-child {
  width: 78px;
  white-space: nowrap;
}

.stocklist-table th:nth-child(1),
.stocklist-table td:nth-child(1),
.stocklist-table th:nth-child(4),
.stocklist-table td:nth-child(4),
.stocklist-table th:nth-child(5),
.stocklist-table td:nth-child(5),
.stocklist-table th:nth-child(9),
.stocklist-table td:nth-child(9),
.stocklist-table th:nth-child(10),
.stocklist-table td:nth-child(10),
.stocklist-table th:nth-child(11),
.stocklist-table td:nth-child(11),
.stocklist-table th:nth-child(12),
.stocklist-table td:nth-child(12),
.stocklist-table th:nth-child(14),
.stocklist-table td:nth-child(14) {
  white-space: nowrap;
}

.stocklist-table .stock-actions-col {
  position: sticky;
  right: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: -10px 0 16px rgba(17, 24, 39, 0.06);
}

.stocklist-table th.stock-actions-col {
  z-index: 3;
  background: rgba(255, 255, 255, 0.9);
}

.stocklist-table tbody tr:hover td.stock-actions-col {
  background: rgba(249, 250, 251, 0.96);
}

.stocklist-table tr.stock-row-booked td {
  background: var(--priority-red-table);
}

.stocklist-table tr.stock-highlight-green td {
  background: var(--priority-green-table);
}

.stocklist-table tr.stock-highlight-yellow td {
  background: var(--priority-yellow-table);
}

.stocklist-table tr.stock-highlight-blue td {
  background: var(--priority-blue-table);
}

.stocklist-table tr.stock-highlight-red td {
  background: var(--priority-red-table);
}

.stocklist-table tr.stock-row-booked td.stock-actions-col,
.stocklist-table tr.stock-highlight-red td.stock-actions-col {
  background: var(--priority-red-table);
}

.stocklist-table tr.stock-highlight-green td.stock-actions-col {
  background: var(--priority-green-table);
}

.stocklist-table tr.stock-highlight-yellow td.stock-actions-col {
  background: var(--priority-yellow-table);
}

.stocklist-table tr.stock-highlight-blue td.stock-actions-col {
  background: var(--priority-blue-table);
}

.stock-highlight-label {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
}

.stock-price-project,
.stock-price-delta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 900;
}

.stock-price-project {
  color: #1d4ed8;
}

.stock-price-delta {
  color: #b91c1c;
}

.stock-copy-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 3px;
  align-items: center;
  white-space: nowrap;
}

.compact-copy,
.compact-photo-copy {
  display: inline-grid;
  place-items: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  border-radius: 8px;
}

.compact-photo-copy {
  border-color: #22c55e;
  color: #15803d;
}

.missing-roadtax-list {
  display: grid;
  gap: 6px;
  border: 1px dashed #f59e0b;
  border-radius: 8px;
  background: var(--priority-yellow-bg);
  padding: 8px;
}

.missing-roadtax-list strong {
  font-size: 12px;
}

.missing-roadtax-list span {
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
}

.stock-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
}

.stock-status.arrived {
  background: var(--priority-green-bg);
  color: #166534;
}

.stock-status.booked {
  background: var(--priority-red-bg);
  color: #991b1b;
}

.stock-status.tbc {
  background: var(--priority-yellow-bg);
  color: #92400e;
}

.booking-stock-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.booking-stock-box .full-field,
.stock-autofill {
  grid-column: 1 / -1;
}

.stock-autofill {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.stock-autofill span,
.stock-autofill small {
  color: var(--muted);
  font-weight: 800;
}

.booking-rco-detail {
  margin-bottom: 12px;
}

.book-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.follow-log {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(150px, 0.7fr);
  gap: 8px;
  margin: 10px 0;
}

.last-outcome {
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 9px 10px;
  background: #eef2ff;
  color: #1e1b4b;
}

.remove-reason {
  border: 1px solid rgba(254, 202, 202, 0.78);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--priority-red-bg);
  color: #7f1d1d;
  margin-top: 10px;
}

.remove-reason span,
.remove-reason small {
  display: block;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
}

.remove-reason strong {
  display: block;
  margin: 3px 0;
}

.last-outcome span,
.last-outcome small {
  display: block;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 800;
}

.last-outcome strong {
  display: block;
  margin: 3px 0;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fafc;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--brand);
}

.progress-text {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tasks {
  display: grid;
  gap: 8px;
}

.booking-task-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.booking-task-block:not(.done) {
  border-color: rgba(254, 202, 202, 0.78);
  background: var(--priority-red-bg);
}

.booking-task-block .task {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.booking-task-block.done {
  border-color: #bbf7d0;
  background: var(--priority-green-bg);
}

.booking-task-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
  padding: 0 10px 10px 40px;
}

.booking-task-details .full-field,
.payment-records {
  grid-column: 1 / -1;
}

.payment-records {
  display: grid;
  gap: 6px;
}

.payment-records div {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.payment-records .payment-record-row {
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) minmax(120px, 2fr) auto;
  align-items: center;
  min-width: 0;
}

.payment-records span,
.payment-records small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tiny-danger {
  border: 1px solid rgba(254, 202, 202, 0.78);
  background: var(--priority-red-bg);
  color: #991b1b;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.reminder-check,
.warranty-toggle {
  min-height: 42px;
}

.arrival-task-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.arrival-task-block.has-issue {
  border-color: #fca5a5;
  background: #fef2f2;
}

.arrival-task-block .task {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.arrival-task-block .task.done {
  background: transparent;
}

.arrival-task-note {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px 40px;
}

.arrival-task-note label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.arrival-task-note-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.arrival-stock-sync {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.arrival-task-block.has-issue .arrival-task-note input {
  border-color: #fca5a5;
  background: #fffafa;
}

.repair-cost-field {
  max-width: 520px;
  margin: 10px 0;
}

.repair-cost-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.repair-action-panel {
  border-color: rgba(254, 202, 202, 0.78);
  background: var(--priority-red-bg);
}

.repair-cost-list,
.repair-cost-add {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.repair-checklist {
  display: grid;
  gap: 8px;
  margin: 10px 14px;
}

.repair-checklist > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.repair-check-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(254, 202, 202, 0.78);
  border-radius: 8px;
  background: var(--priority-red-bg);
  padding: 9px 10px;
}

.repair-check-row.done {
  border-color: #86efac;
  background: var(--priority-green-bg);
}

.repair-check-row strong,
.repair-check-row small {
  display: block;
}

.repair-check-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.repair-cost-list > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.repair-cost-item {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.repair-cost-item strong {
  color: var(--green);
}

.repair-cost-add {
  grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1fr) auto;
  align-items: end;
}

.repaired-note {
  margin: 0;
}

.daily-social-section {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid rgba(254, 202, 202, 0.78);
  border-radius: 8px;
  background: var(--priority-red-bg);
  padding: 12px;
}

.daily-social-section.social-all-done {
  border-color: #bbf7d0;
  background: var(--priority-green-bg);
}

.compact-month-field {
  min-width: 180px;
}

.daily-social-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow);
}

.daily-social-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.daily-social-head h3 {
  margin: 0 0 4px;
}

.daily-social-form {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.platform-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}

.platform-checks label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 42px;
  min-width: 0;
  padding: 7px 8px;
  font-weight: 900;
  line-height: 1.1;
  white-space: normal;
}

.platform-checks input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.platform-checks span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.social-calendar {
  display: grid;
  grid-template-columns: repeat(15, minmax(34px, 1fr));
  gap: 6px;
  overflow-x: auto;
}

.compact-calendar {
  gap: 4px;
}

.social-day {
  min-height: 0;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px;
  overflow: hidden;
}

.compact-calendar .social-day {
  min-height: 0;
  padding: 4px;
  border-radius: 6px;
}

.social-day.done {
  border-color: #86efac;
  background: var(--priority-green-bg);
}

.social-day.missed,
.social-day.today-open {
  border-color: rgba(254, 202, 202, 0.78);
  background: var(--priority-red-bg);
}

.social-day.has-followup {
  box-shadow: inset 0 0 0 2px #fde68a;
}

.social-day-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 1000;
}

.social-day-top strong {
  color: var(--green);
}

.social-day small,
.social-day em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.2;
}

.compact-calendar .social-day small {
  display: none;
}

.calendar-followups em {
  color: #92400e;
}

.social-today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.social-today-item {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(254, 202, 202, 0.78);
  border-radius: 8px;
  background: var(--priority-red-bg);
  padding: 10px;
}

.social-today-item.done {
  border-color: #86efac;
  background: #ecfdf5;
}

.social-today-item strong,
.social-today-item span {
  font-weight: 1000;
}

.social-today-item.done span {
  color: var(--green);
}

.social-today-item.missed span {
  color: #b91c1c;
}

.final-rco-panel {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.final-rco-grid,
.rco-total-grid {
  margin-top: 10px;
}

.task {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  cursor: pointer;
}

.task input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.task.done {
  background: var(--soft);
  color: var(--muted);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 10px 14px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
}

.photo-share-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.24);
}

.photo-share-card {
  position: relative;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.photo-share-card h3 {
  margin: 0 36px 8px 0;
  font-size: 22px;
}

.photo-share-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.photo-share-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.photo-share-actions {
  display: grid;
  gap: 10px;
}

.photo-share-now {
  width: 100%;
}

.photo-share-actions .secondary-btn {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.ai-assistant {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  justify-items: end;
  gap: 10px;
  pointer-events: none;
}

.ai-assistant > * {
  pointer-events: auto;
}

.ai-launcher {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.22));
  color: rgba(15, 23, 42, 0.78);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px) saturate(1.28);
  -webkit-backdrop-filter: blur(24px) saturate(1.28);
  cursor: pointer;
}

.ai-launcher::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.78), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(15, 23, 42, 0.06));
  pointer-events: none;
}

.ai-panel {
  width: min(720px, calc(100vw - 28px));
  max-height: min(760px, calc(100dvh - 36px));
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.18);
}

.ai-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.ai-panel-head strong {
  display: block;
  font-size: 15px;
}

.ai-panel-head small,
.ai-rules {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.ai-panel-head button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.ai-messages {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  min-height: 260px;
  padding: 14px;
  background: #fafafa;
}

.ai-message {
  display: grid;
  gap: 4px;
  max-width: 92%;
}

.ai-message span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ai-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  font-size: 13px;
}

.ai-message.user {
  justify-self: end;
}

.ai-message.user p {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.ai-prompts,
.ai-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-prompts {
  max-height: 54px;
  overflow-y: auto;
  padding: 10px 12px 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

.ai-prompts button,
.ai-message-actions button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  padding: 7px 9px;
  cursor: pointer;
}

.ai-prompts button:hover,
.ai-message-actions button:hover {
  border-color: #111827;
}

.ai-prompts button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ai-message-actions {
  max-width: 100%;
}

.ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.ai-form textarea {
  resize: vertical;
  min-height: 44px;
  max-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
}

.ai-form button {
  min-width: 64px;
  border-radius: 8px;
  padding: 0 12px;
  background: #111827;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.ai-form button:disabled,
.ai-form textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ai-rules {
  padding: 0 12px 12px;
}

@media (max-width: 980px) {
  .crm-shell {
    display: block;
  }

  .crm-sidebar {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .top {
    padding: 14px 12px;
  }

  .wrap {
    padding: 14px 10px 32px;
  }
}

@media (max-width: 860px) {
  .workspace-notices,
  .formal-auth-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .identity,
  .workspace-notices,
  .formal-auth-shell,
  .stats,
  .main-grid,
  .todo-layout,
  .detail-grid,
  .follow-log,
  .payment-choice,
  .module-grid,
  .loan-grid,
  .loan-field-grid,
  .loan-summary-grid,
  .quote-options,
  .quotation-grid,
  .office-hub-grid,
  .quotation-file-row,
  .stocklist-stats,
  .stocklist-filters,
  .manager-console-grid,
  .arrival-stock-sync,
  .dashboard-grid,
  .developer-mode-grid,
  .user-admin-form,
  .permission-template-grid,
  .booking-detail-grid,
  .booking-stock-box,
  .compact-module-home .module-grid {
    grid-template-columns: 1fr;
  }

  .todo-calendar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .year-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .arrival-task-note {
    padding-left: 10px;
  }

  .arrival-task-note-row {
    grid-template-columns: 1fr;
  }

  .repair-cost-row {
    grid-template-columns: 1fr;
  }

  .repair-cost-add {
    grid-template-columns: 1fr;
  }

  .booking-task-details {
    grid-template-columns: 1fr;
    padding-left: 10px;
  }

  .payment-records .payment-record-row {
    grid-template-columns: 1fr;
  }

  .daily-social-head {
    display: grid;
  }

  .social-calendar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .compact-calendar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .book-panel,
  .invoice-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .task-head,
  .case-top,
  .follow-summary {
    display: grid;
  }

  .mailbox-message-top {
    display: grid;
  }

  .summary-actions {
    justify-content: flex-start;
  }

  .manager-reminder-link {
    width: 100%;
  }

  .ai-assistant {
    right: 12px;
    bottom: 12px;
  }

  .ai-panel {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .ai-form {
    grid-template-columns: 1fr;
  }
}
