:root {
  --app-font-scale: 1;
  --bg: #eef6ff;
  --surface: rgba(255, 255, 255, 0.95);
  --surface-strong: #ffffff;
  --surface-soft: rgba(245, 250, 255, 0.96);
  --panel: var(--surface-strong);
  --panel-soft: var(--surface-soft);
  --line: rgba(86, 132, 176, 0.16);
  --text: #15324d;
  --muted: #5d7993;
  --accent: #3b82f6;
  --accent-dark: #2059b0;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --good: #21895f;
  --warn: #b37a18;
  --bad: #cf4c4c;
  --shadow: 0 20px 44px rgba(71, 123, 185, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: calc(15px * var(--app-font-scale));
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(197, 225, 255, 0.95), transparent 30%),
    radial-gradient(circle at right center, rgba(214, 236, 255, 0.8), transparent 24%),
    linear-gradient(180deg, #f6fbff 0%, #ecf5ff 55%, #e6f0fb 100%);
}

body[data-theme="dark"] {
  --bg: #0f172a;
  --surface: rgba(17, 28, 48, 0.96);
  --surface-strong: #111827;
  --surface-soft: rgba(22, 39, 65, 0.98);
  --line: rgba(148, 163, 184, 0.24);
  --text: #eaf2ff;
  --muted: #a9bad0;
  --accent: #60a5fa;
  --accent-dark: #bfdbfe;
  --accent-soft: rgba(96, 165, 250, 0.18);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.28), transparent 30%),
    radial-gradient(circle at right center, rgba(14, 165, 233, 0.18), transparent 24%),
    linear-gradient(180deg, #0b1220 0%, #111827 55%, #0f172a 100%);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #0b1220;
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.28);
}

body[data-theme="dark"] input[type="date"],
body[data-theme="dark"] input[type="month"],
body[data-theme="dark"] input[type="time"] {
  color-scheme: dark;
}

body[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
body[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
body[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  border-radius: 4px;
  background-color: rgba(96, 165, 250, 0.26);
  filter: invert(1) brightness(1.9) drop-shadow(0 0 2px rgba(96, 165, 250, 0.8));
}

body[data-theme="dark"] .ghost-btn,
body[data-theme="dark"] .chip-btn,
body[data-theme="dark"] .icon-btn,
body[data-theme="dark"] .flat-btn {
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.28);
}

body[data-theme="dark"] .client-card,
body[data-theme="dark"] .calendar-cell,
body[data-theme="dark"] .chat-message.self {
  background: rgba(22, 39, 65, 0.92);
}

body[data-theme="dark"] .menu-btn {
  background: #16345c;
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.28);
}

body[data-theme="dark"] .menu-btn.active,
body[data-theme="dark"] .primary-btn,
body[data-theme="dark"] .chip-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

body[data-theme="dark"],
body[data-theme="dark"] *,
body[data-theme="dark"] .meta,
body[data-theme="dark"] .eyebrow,
body[data-theme="dark"] label span,
body[data-theme="dark"] .calendar-cell strong,
body[data-theme="dark"] .calendar-cell span,
body[data-theme="dark"] .calendar-head,
body[data-theme="dark"] .client-link {
  color: #f8fbff;
}

#resetDataBtn,
#resetDemoBtn {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

.font-size-controls {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.font-size-controls .theme-toggle {
  min-width: 34px;
  padding: 7px 9px;
  font-weight: 800;
}

.street-lighting-tabs {
  margin: 12px auto 16px;
  justify-content: center;
  width: auto;
}

.street-lighting-tabs .chip-btn {
  min-width: 170px;
  width: auto;
  flex: 0 0 auto;
  justify-content: center;
  text-align: center;
}

.street-lighting-report-date {
  min-width: 170px;
}

.street-lighting-email-panel textarea {
  min-height: 96px;
}

.street-lighting-report-status {
  min-height: 20px;
}

.street-lighting-confirm-panel {
  margin: 12px 0;
  align-items: center;
}

.street-lighting-report .fonarka-report-table th,
.street-lighting-report .fonarka-report-table td,
.street-lighting-print-table th,
.street-lighting-print-table td {
  border: 1px solid #9fb4ca;
  padding: 8px;
}

body[data-theme="dark"] .street-lighting-print-table th,
body[data-theme="dark"] .street-lighting-print-table td {
  border-color: rgba(226, 232, 240, 0.38);
}

.scroll-top-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 95;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

#app {
  min-height: 100vh;
}

.login-shell,
.app-shell {
  padding: 24px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card,
.sidebar,
.hero,
.panel,
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.login-card {
  width: min(980px, 100%);
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(380px, 1.05fr);
}

.login-aside {
  padding: 36px;
  background: linear-gradient(160deg, #61a8ff 0%, #3480ea 100%);
  color: white;
}

.login-aside h1,
.brand h1,
.hero h2,
.section-head h2,
.login-form h2,
.client-card h3,
.task-card h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-aside .eyebrow {
  color: rgba(255, 255, 255, 0.8);
}

.login-aside p,
.hero-copy,
.muted,
.meta {
  line-height: 1.6;
}

.credential-list,
.permission-list,
.pill-list,
menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.demo-box,
.metric-card,
.panel-card,
.notification-item,
.vehicle-card,
.task-card,
.timeline-entry,
.directory-card,
.user-card,
.empty-card,
.summary-note,
.log-item,
.chat-message {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.demo-box {
  margin-top: 22px;
  padding: 18px;
}

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

.credential-list li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
}

.login-form {
  padding: 36px;
  display: grid;
  align-content: center;
  gap: 16px;
  background: var(--surface-strong);
}

label {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 13px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 96px;
}

.field-grid,
.checkbox-grid {
  display: grid;
  gap: 12px;
}

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

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

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: auto;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.checkbox input {
  width: auto;
  min-height: auto;
  padding: 0;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn,
.chip-btn,
.flat-btn {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.icon-btn:hover,
.chip-btn:hover,
.flat-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.ghost-btn,
.chip-btn,
.icon-btn,
.flat-btn {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  color: var(--text);
}

.danger-btn {
  background: rgba(207, 76, 76, 0.12);
  border-color: rgba(207, 76, 76, 0.2);
  color: var(--bad);
}

.icon-btn {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.chip-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.flat-btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.error-box {
  min-height: 22px;
  color: var(--bad);
  font-size: 14px;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar {
  border-radius: 24px;
  padding: 22px;
  display: grid;
  gap: 18px;
  align-content: start;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.brand,
.section-head,
.item-head,
.toolbar,
.compact,
.client-head,
.task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  align-items: flex-start;
}

.brand-account-role {
  margin-top: 3px;
  color: var(--muted);
  font-size: calc(10px * var(--app-font-scale));
  line-height: 1.25;
}

.brand-mark {
  width: 48px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #80bbff, #3b82f6);
  color: white;
  font-size: 24px;
  font-weight: 800;
}

.profile-card,
.access-card,
.notice-card {
  display: grid;
  gap: 12px;
}

.permission-list,
.notification-list,
.metrics-grid,
.task-list,
.directory-grid,
.user-grid,
.timeline-list,
.log-list,
.chat-list {
  display: grid;
  gap: 10px;
}

.permission-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.permission-dot {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--accent);
}

.badge,
.status-pill,
.currency-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-pill {
  background: rgba(33, 137, 95, 0.12);
  color: var(--good);
}

.task-status-inline {
  margin-left: 4px;
  vertical-align: middle;
}

body[data-display-mode="phone"] #taskDetailsDialog .modal-card,
body[data-display-mode="phone"] #taskDetailsContent,
body[data-display-mode="phone"] #taskDetailsContent .task-card {
  width: 100%;
  max-width: calc(100vw - 16px);
  min-width: 0;
  overflow-x: hidden;
}

body[data-display-mode="phone"] #taskDetailsContent .task-head {
  display: block;
}

body[data-display-mode="phone"] #taskDetailsContent .task-head > div,
body[data-display-mode="phone"] #taskDetailsContent .task-head h3,
body[data-display-mode="phone"] #taskDetailsContent .task-head .meta,
body[data-display-mode="phone"] #taskDetailsContent .task-card > .meta {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-display-mode="phone"] #taskDetailsContent .task-head > div > .meta:nth-of-type(2),
body[data-display-mode="phone"] #taskDetailsContent .task-head > div > .meta:nth-of-type(3) {
  font-size: calc(11px * var(--app-font-scale));
  line-height: 1.45;
}

body[data-display-mode="phone"] #taskDetailsContent .task-status-inline {
  margin-left: 2px;
  padding: 2px 6px;
  min-width: 0;
  font-size: calc(10px * var(--app-font-scale));
}

body[data-display-mode="phone"] #taskDetailsContent .timeline-list,
body[data-display-mode="phone"] #taskDetailsContent .timeline-entry,
body[data-display-mode="phone"] #taskDetailsContent .timeline-entry *,
body[data-display-mode="phone"] #taskDetailsContent .task-file-list,
body[data-display-mode="phone"] #taskDetailsContent .photo-grid {
  max-width: 100%;
  min-width: 0;
}

body[data-display-mode="phone"] #taskDetailsContent .timeline-entry {
  overflow-x: hidden;
}

body[data-display-mode="phone"] #taskDetailsContent .timeline-entry .item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: start;
  align-items: start;
  gap: 4px;
}

body[data-display-mode="phone"] #taskDetailsContent .timeline-entry .item-head strong,
body[data-display-mode="phone"] #taskDetailsContent .timeline-entry .badge,
body[data-display-mode="phone"] #taskDetailsContent .timeline-status-inline,
body[data-display-mode="phone"] #taskDetailsContent .timeline-entry > div:not(.item-head):not(.photo-grid):not(.task-file-list),
body[data-display-mode="phone"] #taskDetailsContent .file-open-btn {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-display-mode="phone"] #taskDetailsContent .timeline-entry .badge,
body[data-display-mode="phone"] #taskDetailsContent .timeline-status-inline {
  justify-self: start;
  margin-left: 0;
  font-size: calc(10px * var(--app-font-scale));
}

body[data-display-mode="phone"] #taskDetailsContent .photo-grid img {
  width: min(120px, 42vw);
  height: auto;
  aspect-ratio: 4 / 3;
}

.status-pill.in_progress {
  background: rgba(179, 122, 24, 0.16);
  color: var(--warn);
}

.status-pill.open {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-dark);
}

.status-pill.done {
  background: rgba(179, 122, 24, 0.16);
  color: var(--warn);
}

.status-pill.confirmed {
  background: rgba(33, 137, 95, 0.14);
  color: var(--good);
}

.currency-pill.eur {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-dark);
}

.currency-pill.mdl {
  background: rgba(179, 122, 24, 0.14);
  color: var(--warn);
}

.main-panel {
  display: grid;
  gap: 24px;
}

.hero {
  border-radius: 24px;
  padding: 28px;
  display: grid;
  gap: 22px;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
  gap: 18px;
}

.hero-copy {
  max-width: 72ch;
  color: var(--muted);
}

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

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-card strong {
  font-size: 28px;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(480px, 1.15fr);
  align-items: start;
  gap: 24px;
}

.dashboard-work-panel {
  grid-column: 1;
}

.dashboard-calendar-panel {
  grid-column: 2;
  position: relative;
}

.dashboard-calendar-panel > .inline-control {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 150px;
  margin: 0;
}

.dashboard-calendar-panel > .inline-control span {
  display: none;
}

.dashboard-calendar-panel > .inline-control input {
  height: 34px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.dashboard-calendar-panel > .calendar-grid {
  margin-top: 46px;
}

.client-title-status {
  margin-top: 4px;
}

.client-status-text.active {
  color: #15803d;
}

.client-status-text.paused {
  color: #b91c1c;
}

.panel {
  padding: 22px;
  border-radius: 22px;
}

.panel-wide {
  grid-column: span 2;
}

.panel-card,
.vehicle-card,
.task-card,
.timeline-entry,
.directory-card,
.user-card,
.empty-card,
.summary-note,
.log-item,
.notification-item,
.chat-message {
  padding: 14px;
}

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

.client-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 12px;
}

.client-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  text-align: left;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 24px;
}

.pill-list,
.kv-row,
.photo-grid,
.action-list,
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.kv {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
}

.pill button {
  border: 0;
  background: transparent;
  color: var(--bad);
  padding: 0;
  min-height: auto;
}

.timeline-entry {
  display: grid;
  gap: 10px;
}

.photo-grid img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.file-link {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.summary-cell {
  display: grid;
  gap: 8px;
}

.summary-note {
  font-size: 12px;
  color: var(--muted);
}

.summary-note-danger {
  color: #dc2626;
  font-weight: 600;
}

.theme-toggle {
  margin-left: auto;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.brand-controls {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand-controls .theme-toggle {
  margin-left: 0;
  min-height: 26px;
  padding: 4px 7px;
  border-radius: 8px;
  font-size: calc(10px * var(--app-font-scale));
  line-height: 1.1;
}

.display-mode-toggle {
  min-width: 68px;
}

.summary-toolbar {
  justify-content: flex-end;
  align-items: end;
  gap: 8px;
}

.summary-toolbar .primary-btn,
.summary-toolbar .ghost-btn {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.summary-toolbar .inline-control {
  min-width: 160px;
}

.summary-toolbar select {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.compact-client-list {
  gap: 8px;
}

.compact-client-card {
  padding: 12px 14px;
}

.client-info-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
}

.client-row-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.client-info-inline .meta {
  line-height: 1.35;
  white-space: nowrap;
}

.client-active-count strong {
  font-weight: 900;
  letter-spacing: 0;
}

.client-active-count {
  font-weight: 700;
}

.client-active-count-highlight {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid rgba(22, 163, 74, .42);
  border-radius: 999px;
  background: rgba(22, 163, 74, .14);
  color: #166534;
}

.client-active-count-highlight strong {
  font-size: 1.08em;
  color: #15803d;
}

body[data-theme="dark"] .client-active-count-highlight {
  background: rgba(34, 197, 94, .18);
  border-color: rgba(74, 222, 128, .55);
  color: #dcfce7 !important;
}

body[data-theme="dark"] .client-active-count-highlight strong {
  color: #86efac !important;
}

.task-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-inline-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.task-client-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-head-inline,
.summary-amount-line {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.summary-rate-input {
  width: 86px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
}

.summary-amount-line {
  justify-content: space-between;
}

.mini-icon-btn {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  height: 28px;
  font-size: 12px;
}

.icon-small-btn {
  min-width: 34px;
  width: 34px;
  padding: 0;
}

.vehicle-status-select {
  min-width: 116px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 7px 10px;
  font-weight: 700;
}

.vehicle-status-select.active {
  background: rgba(33, 137, 95, 0.12);
  color: var(--good);
}

.vehicle-status-select.paused {
  background: rgba(179, 122, 24, 0.16);
  color: var(--warn);
}

.vehicle-status-select.deleted {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.vehicle-status-select.sold {
  background: rgba(100, 116, 139, 0.14);
  color: #64748b;
}

.compact-actions {
  flex-wrap: nowrap;
}

.muted-field {
  opacity: 0.68;
}

.task-urgent {
  border-color: rgba(220, 38, 38, 0.32);
}

.task-due-soon {
  background: #fff1f2;
  border-color: rgba(220, 38, 38, 0.38);
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.priority-badge.urgent,
.priority-badge.danger {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.calendar-task-list {
  display: grid;
  gap: 4px;
  margin-top: 5px;
}

.calendar-task-chip,
.calendar-more {
  display: block;
  width: 100%;
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.08);
  padding: 3px 5px;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-task-chip.task-urgent,
.calendar-task-chip.task-due-soon {
  background: #fff1f2;
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}

.calendar-task-chip.task-done-calendar {
  background: rgba(136, 136, 136, 0.12);
  border-color: rgba(136, 136, 136, 0.36);
  color: #888888;
  text-decoration: line-through;
}

.calendar-task-chip.task-done-calendar .calendar-kind {
  opacity: 0.55;
}

.day-task-table tr.task-done-calendar,
.day-task-table tr.task-done-calendar td {
  color: #888888;
  text-decoration: line-through;
}

.day-task-table tr.task-done-calendar .flat-btn {
  color: #888888;
  text-decoration: none;
}

.calendar-more {
  background: var(--surface);
  color: var(--accent-dark);
  font-weight: 800;
}

.chat-box {
  display: grid;
  gap: 14px;
}

.chat-list {
  max-height: 360px;
  overflow: auto;
}

.chat-list-bottom {
  display: flex;
  flex-direction: column;
}

.clickable-chat-message {
  cursor: pointer;
}

.clickable-chat-message:hover {
  border-color: var(--accent);
}

.chat-message.self {
  background: rgba(224, 239, 255, 0.92);
}

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

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

.table-wrap {
  overflow-x: auto;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 120, 210, 0.55) rgba(148, 163, 184, 0.16);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.14);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(52, 152, 219, 0.85), rgba(37, 99, 235, 0.72));
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.86));
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.vehicle-table th,
.vehicle-table td,
.summary-table th,
.summary-table td {
  min-width: 140px;
}

.log-list,
.notification-list {
  max-height: 320px;
  overflow: auto;
}

.empty-card {
  display: grid;
  gap: 6px;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(27, 68, 110, 0.24);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(560px, calc(100vw - 24px));
  padding: 22px;
  border-radius: 22px;
  display: grid;
  gap: 14px;
}

.modal-wide {
  width: min(760px, calc(100vw - 24px));
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1200px) {
  .app-shell,
  .panel-grid,
  .dashboard-grid,
  .hero-top,
  .detail-layout,
  .login-card,
  .notify-grid {
    grid-template-columns: 1fr;
  }

  .panel-wide {
    grid-column: span 1;
  }

  .dashboard-work-panel,
  .dashboard-calendar-panel {
    grid-column: auto;
  }

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

@media (max-width: 760px) {
  .dashboard-calendar-panel > .inline-control {
    position: static;
    width: 100%;
    margin: 0 0 12px;
  }

  .dashboard-calendar-panel > .inline-control span {
    display: block;
  }

  .login-shell,
  .app-shell {
    padding: 14px;
  }

  .metrics-grid,
  .field-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .sidebar,
  .panel,
  .login-card {
    border-radius: 20px;
  }
}

.nav-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.chat-drawer {
  position: fixed;
  top: 12px;
  right: 18px;
  width: 380px;
  max-width: calc(100vw - 28px);
  z-index: 80;
  pointer-events: none;
}

.chat-toggle {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 14px;
  min-height: 46px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
}

.chat-drawer-panel {
  pointer-events: auto;
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: none;
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.chat-drawer.open .chat-drawer-panel {
  display: grid;
  gap: 14px;
}

@media (max-width: 1200px) {
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .chat-drawer {
    position: static;
    width: auto;
    max-width: none;
    pointer-events: auto;
  }

  .chat-toggle {
    margin-left: 0;
  }
}

.menu-card {
  flex: 1;
}

.menu-card .permission-list {
  width: calc(100% - 38px);
}

.menu-btn {
  width: 100%;
  justify-content: flex-start;
  background: #e0efff;
  color: #1d4ed8;
  border-color: #bfdbfe;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.menu-btn.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

.legacy-vehicle-device-field,
.legacy-vehicle-device-grid {
  display: none !important;
}

.vehicle-attachments-field {
  display: grid;
  gap: 8px;
}

.vehicle-attachment-list {
  align-items: center;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.sidebar-version {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 12px;
  width: calc(100% - 38px);
  box-sizing: border-box;
  justify-self: start;
}

.sidebar-build-version {
  width: calc(100% - 38px);
  justify-self: start;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  padding: 0 2px;
}

.task-contact-line {
  color: var(--text);
  font-weight: 700;
}

.sidebar-footer #logoutBtn {
  width: calc(100% - 38px);
  justify-self: start;
}

.admin-tab-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.admin-tab-row .nav-btn,
.admin-tab-row .chip-btn {
  width: auto;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.admin-tabs-screen,
.vehicles-registry-screen {
  align-items: stretch;
  grid-template-columns: 1fr;
}

.admin-tab-content {
  display: grid;
  gap: 16px;
  width: 100%;
}

.admin-tab-content > .panel-grid {
  padding: 0;
  grid-template-columns: 1fr;
  width: 100%;
}

.admin-tab-content .panel,
.admin-tab-content .panel-wide,
.documents-admin-grid .panel {
  width: 100%;
  box-sizing: border-box;
}

.admin-tabs-header {
  width: 100%;
  box-sizing: border-box;
}

.vehicles-registry-wrap {
  height: calc(100vh - 150px);
  max-height: none;
  overflow: auto;
}

.vehicles-registry-screen {
  min-height: calc(100vh - 118px);
}

.vehicles-registry-screen .panel-wide {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.vehicles-registry-table th,
.vehicles-registry-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.vehicle-registry-head {
  display: grid;
  gap: 6px;
  min-width: 132px;
}

.vehicle-registry-title {
  font-weight: 700;
}

.sort-arrow-row {
  display: flex;
  gap: 4px;
}

.sort-arrow-row button {
  width: 26px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.sort-arrow-row button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.vehicle-filter-select {
  width: 100%;
  min-width: 120px;
  min-height: 30px;
  padding: 5px 8px;
}

.compact-admin-btn {
  min-width: 0;
  padding-inline: 12px;
}

.font-size-controls {
  gap: 4px;
}

.font-size-btn {
  min-width: 34px;
}

.chat-drawer {
  top: var(--chat-top, 78px) !important;
  right: var(--chat-right, 18px) !important;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat-toggle {
  margin-left: auto;
  margin-right: 0;
}

.chat-drawer-panel {
  transform-origin: top right;
  width: 100%;
}

.sidebar-version span {
  color: var(--muted);
}

.sidebar-version strong {
  line-height: 1.35;
}

.hero-slim {
  padding-bottom: 20px;
}

.compact-card {
  padding: 14px;
}

.summary-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-head-cell {
  display: grid;
  gap: 8px;
}

.summary-head-cell label,
.inline-control {
  display: grid;
  gap: 6px;
}

.field-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-head {
  align-items: start;
}

.client-title-col {
  min-width: 220px;
}

.client-info-col {
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
}

.client-section-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}

.client-section-tabs-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
}

.client-section-tabs-row .client-section-tabs {
  margin: 0;
}

.client-section-tabs-row .client-document-picker {
  margin: 0;
  justify-self: end;
}

.client-tab-btn {
  width: auto;
  min-width: 132px;
  justify-content: center;
  text-align: center;
}

.tasks-screen,
.journal-screen {
  min-height: calc(100vh - 48px);
  align-items: stretch;
}

.tasks-screen .panel,
.journal-screen .panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.tasks-screen .panel {
  min-height: 340px;
}

.journal-screen .panel {
  min-height: calc(100vh - 48px);
}

.full-height-list {
  max-height: none;
  min-height: 0;
  overflow: auto;
  align-content: start;
}

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

.calendar-head {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding-bottom: 4px;
}

.calendar-cell {
  min-height: 88px;
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 8px;
  padding: 8px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 4px;
}

.calendar-cell span {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .field-grid.two-col {
    grid-template-columns: 1fr;
  }

  .client-row-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-info-inline {
    justify-content: flex-start;
  }
}

body[data-theme="dark"] *,
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #f8fbff !important;
}

body[data-theme="dark"] .calendar-cell {
  background: rgba(22, 39, 65, 0.92);
  border-color: rgba(148, 163, 184, 0.24);
}

body[data-theme="dark"] .task-card.task-urgent,
body[data-theme="dark"] .task-card.task-due-soon,
body[data-theme="dark"] .log-item.task-urgent,
body[data-theme="dark"] .log-item.task-due-soon,
body[data-theme="dark"] .calendar-task-chip.task-urgent,
body[data-theme="dark"] .calendar-task-chip.task-due-soon,
body[data-theme="dark"] .day-task-table tr.task-urgent,
body[data-theme="dark"] .day-task-table tr.task-due-soon,
body[data-theme="dark"] .day-task-table tr.task-urgent td,
body[data-theme="dark"] .day-task-table tr.task-due-soon td {
  background: rgba(127, 29, 29, 0.32);
  border-color: rgba(248, 113, 113, 0.48);
  color: #f8fbff;
}

body[data-theme="dark"] .day-task-table tr.task-urgent .flat-btn,
body[data-theme="dark"] .day-task-table tr.task-due-soon .flat-btn {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fbff;
}

body[data-theme="dark"] .calendar-task-chip.task-done-calendar,
body[data-theme="dark"] .day-task-table tr.task-done-calendar,
body[data-theme="dark"] .day-task-table tr.task-done-calendar td {
  background: rgba(136, 136, 136, 0.16);
  border-color: rgba(136, 136, 136, 0.42);
  color: #888888;
}

body[data-theme="dark"] .day-task-table tr.task-done-calendar .flat-btn {
  background: rgba(15, 23, 42, 0.92);
  color: #888888;
}

body[data-theme="dark"] .priority-badge.urgent,
body[data-theme="dark"] .priority-badge.danger {
  background: rgba(248, 113, 113, 0.22);
}

.photo-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.photo-button img {
  display: block;
}

.file-open-btn {
  cursor: pointer;
}

.photo-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  border: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
}

.photo-viewer-overlay:not([open]) {
  display: none;
}

.photo-viewer-overlay::backdrop {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
}

.photo-viewer-dialog {
  position: relative;
  width: min(980px, 96vw);
  height: min(760px, 92vh);
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.36);
}

.photo-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.photo-viewer-frame {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
  text-align: center;
}

.photo-viewer-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #0f172a;
}

.photo-viewer-frame figcaption {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.photo-viewer-arrow {
  width: 44px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 34px;
  font-weight: 800;
  cursor: pointer;
}

body[data-theme="dark"] .photo-viewer-dialog {
  background: #111827;
}

body[data-theme="dark"] .photo-viewer-arrow {
  background: rgba(96, 165, 250, 0.18);
  color: #f8fbff;
}

.chat-drawer {
  position: fixed !important;
  top: var(--chat-top, 12px) !important;
  right: var(--chat-right, 18px) !important;
  left: auto !important;
  width: 380px;
  max-width: calc(100vw - 28px);
  pointer-events: none;
  z-index: 120;
}

.chat-toggle,
.chat-drawer-panel {
  pointer-events: auto;
}

.draggable-chat-toggle {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.draggable-chat-toggle:active {
  cursor: grabbing;
}

.chat-drawer.open .chat-toggle {
  display: flex;
  margin-left: auto;
  margin-right: 0;
}

.chat-drawer.open .chat-drawer-panel {
  clear: both;
}

.login-aside-with-form {
  gap: 18px;
}

.login-form-in-aside {
  width: min(100%, 420px);
  color: var(--text);
}

.login-form-in-aside .eyebrow,
.login-form-in-aside h2,
.login-form-in-aside label span {
  color: var(--text);
}

.login-request-right .public-request-form {
  align-self: center;
}

.summary-toolbar {
  align-items: end;
}

.summary-inline-control {
  min-width: 120px;
}

.summary-table-bordered {
  border-collapse: separate;
  border-spacing: 0;
}

.summary-table-bordered th,
.summary-table-bordered td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.summary-table-bordered th:first-child,
.summary-table-bordered td:first-child {
  border-left: 1px solid var(--line);
}

.summary-table-bordered thead th {
  border-top: 1px solid var(--line);
}

.summary-comment-btn.has-comment {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff !important;
}

.summary-comment-btn.has-comment:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

body[data-theme="dark"] .summary-comment-btn.has-comment {
  background: #facc15;
  border-color: #fde68a;
  color: #111827 !important;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.22);
}

body[data-theme="dark"] .summary-comment-btn.has-comment:hover {
  background: #ffffff;
  border-color: #facc15;
  color: #111827 !important;
}

.summary-total-groups {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(280px, 0.8fr);
  gap: 12px;
  margin: 14px 0;
}

.summary-total-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.summary-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.summary-mini-total {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 8px;
  display: grid;
  gap: 3px;
}

.summary-mini-total span {
  color: var(--muted);
  font-size: 12px;
}

.summary-mini-total strong {
  font-size: 14px;
}

body[data-theme="dark"] #calendarMonthInput {
  background: #0b1220;
  color: #f8fbff !important;
  border-color: rgba(96, 165, 250, 0.75);
  color-scheme: dark;
}

body[data-theme="dark"] #calendarMonthInput::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  border-radius: 4px;
  background-color: rgba(96, 165, 250, 0.26);
  filter: invert(1) brightness(1.9) drop-shadow(0 0 2px rgba(96, 165, 250, 0.8));
}

body[data-theme="dark"] .pill,
body[data-theme="dark"] .kv,
body[data-theme="dark"] .directory-card,
body[data-theme="dark"] .user-card,
body[data-theme="dark"] .access-card,
body[data-theme="dark"] .notice-card,
body[data-theme="dark"] .profile-card,
body[data-theme="dark"] .panel-card,
body[data-theme="dark"] .summary-mini-total,
body[data-theme="dark"] .summary-total-block,
body[data-theme="dark"] .file-open-btn,
body[data-theme="dark"] .task-file-list .pill,
body[data-theme="dark"] .permission-list li,
body[data-theme="dark"] .checkbox,
body[data-theme="dark"] .client-card,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] a.pill {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #f8fbff !important;
}

.tool-link-card {
  display: block;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

.tool-link-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(29, 114, 201, 0.14);
}

.table-scroll-shell {
  position: relative;
}

.horizontal-scroll-btn {
  position: sticky;
  bottom: 12px;
  z-index: 40;
  width: 34px;
  height: 52px;
  transform: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.horizontal-scroll-btn.left {
  left: 8px;
  float: left;
  margin-right: -34px;
}

.horizontal-scroll-btn.left[data-scroll-table="vehicles"],
.horizontal-scroll-btn.left[data-scroll-table="vehicleRegistry"] {
  left: 44px;
}

.horizontal-scroll-btn.right {
  left: calc(100% - 42px);
  float: right;
  margin-left: -34px;
}

.inline-vehicle-savebar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.inline-vehicle-input {
  min-width: 120px;
  width: 100%;
  max-width: 220px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.vehicle-table-inline td,
.vehicle-table-inline th {
  vertical-align: middle;
  border-right: 1px solid var(--line);
}

.task-created-inline {
  white-space: nowrap;
}

.task-created-phone-row {
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
}

.task-phone-created-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  max-width: 100%;
  min-width: 0;
}

.task-phone-created-actions .task-row-actions {
  width: auto;
  margin-left: 0;
  flex: 0 0 auto;
}

body[data-theme="dark"] .horizontal-scroll-btn,
body[data-theme="dark"] .inline-vehicle-input {
  background: rgba(15, 23, 42, 0.96);
  color: #f8fbff;
  border-color: rgba(148, 163, 184, 0.35);
}

body[data-theme="dark"] .pill button {
  color: #f8fbff !important;
}

#openDirectoryValueDialogBtn {
  display: none !important;
}

.summary-current-rate {
  align-self: end;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: calc(12px * var(--app-font-scale));
  white-space: nowrap;
}

.summary-table {
  font-size: calc(13px * var(--app-font-scale));
}

.report-filter-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 14px 0;
}

.report-filter-form .report-email-field {
  grid-column: span 2;
}

.report-filter-form button {
  min-height: 42px;
}

.report-status {
  margin: 8px 0 10px;
}

.reports-table th,
.reports-table td {
  vertical-align: top;
}

.reports-table th:nth-child(1),
.reports-table td:nth-child(1) {
  width: 44px;
  text-align: center;
}

.reports-table th:nth-child(5),
.reports-table td:nth-child(5),
.reports-table th:nth-child(8),
.reports-table td:nth-child(8) {
  min-width: 220px;
}

@media (max-width: 1100px) {
  .report-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-filter-form .report-email-field {
    grid-column: span 2;
  }
}

.summary-table th,
.summary-table td {
  padding: 4px 5px;
}

.summary-cell {
  min-width: 72px;
  gap: 3px;
}

.summary-amount-line {
  justify-content: flex-start;
  gap: 2px;
}

.summary-amount-line strong {
  margin-right: 2px;
  font-size: calc(13px * var(--app-font-scale));
}

.summary-table .mini-icon-btn,
.summary-cell .mini-icon-btn {
  width: calc(20px * var(--app-font-scale));
  height: calc(20px * var(--app-font-scale));
  min-width: calc(20px * var(--app-font-scale));
  min-height: calc(20px * var(--app-font-scale));
  aspect-ratio: 1 / 1;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: calc(10px * var(--app-font-scale));
  border-radius: 999px;
  line-height: 1;
}

.summary-table th:nth-child(2),
.summary-table td:nth-child(2) {
  min-width: 58px;
  width: 58px;
  max-width: 68px;
}

.reports-table th:nth-child(2),
.reports-table td:nth-child(2) {
  min-width: 96px;
  width: auto;
  max-width: none;
}

.summary-total-groups {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 8px;
}

.summary-total-block {
  padding: 8px;
  font-size: calc(12px * var(--app-font-scale));
}

.summary-mini-grid {
  grid-template-columns: repeat(12, minmax(74px, 1fr));
  gap: 5px;
}

.summary-mini-total {
  padding: 5px;
  border-radius: 6px;
}

.summary-mini-total span {
  font-size: calc(10px * var(--app-font-scale));
}

.summary-mini-total strong {
  font-size: calc(12px * var(--app-font-scale));
}

.summary-company-total-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.summary-company-year-total .summary-mini-total {
  padding: 8px;
}

.summary-company-year-total .summary-mini-total strong {
  font-size: calc(13px * var(--app-font-scale));
}

.horizontal-scroll-btn.right[data-scroll-table="summary"] {
  bottom: 112px;
}

.horizontal-scroll-btn.right[data-scroll-table="vehicles"],
.horizontal-scroll-btn.right[data-scroll-table="vehicleRegistry"] {
  bottom: 112px;
}

.vehicle-registry-toolbar {
  align-items: center;
}

.vehicle-global-search {
  width: 220px;
  max-width: 32vw;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}

.vehicle-column-settings {
  margin: 0 0 10px;
  font-size: 12px;
}

.vehicle-column-settings summary {
  cursor: pointer;
  width: max-content;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.vehicle-column-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.vehicle-column-settings-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.compact-column-check {
  min-height: 0;
  padding: 5px 6px;
  gap: 5px;
}

.vehicles-registry-table,
.vehicle-table-inline {
  font-size: 12px;
}

.vehicles-registry-table th,
.vehicles-registry-table td,
.vehicle-table-inline th,
.vehicle-table-inline td {
  padding: 1px 5px;
  line-height: 1.05;
}

.vehicles-registry-table .inline-vehicle-input,
.vehicle-table-inline .inline-vehicle-input {
  min-height: 22px;
  padding: 2px 4px;
  font-size: 11px;
}

.row-number-col {
  min-width: 34px !important;
  width: 34px;
  max-width: 42px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.vehicle-table-inline .vehicle-sticky-row-number,
.vehicle-table-inline .vehicle-sticky-plate {
  position: sticky;
  background: var(--surface-strong);
  background-clip: padding-box;
  box-shadow: 1px 0 0 var(--line);
}

.vehicle-table-inline th.vehicle-sticky-row-number,
.vehicle-table-inline th.vehicle-sticky-plate {
  z-index: 7;
}

.vehicle-table-inline td.vehicle-sticky-row-number,
.vehicle-table-inline td.vehicle-sticky-plate {
  z-index: 5;
}

.vehicle-table-inline .vehicle-sticky-row-number {
  left: 0;
}

.vehicle-table-inline .vehicle-sticky-plate {
  left: var(--vehicle-sticky-plate-left, 0px);
  min-width: 128px;
}

body[data-theme="dark"] .vehicle-table-inline .vehicle-sticky-row-number,
body[data-theme="dark"] .vehicle-table-inline .vehicle-sticky-plate {
  background: var(--surface-strong);
}

.summary-client-search-head {
  min-width: 180px !important;
}

.summary-client-search-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.summary-client-search-input {
  width: 100%;
  min-width: 150px;
  padding: 4px 6px;
  font-size: calc(11px * var(--app-font-scale));
}

.summary-client-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  color: var(--primary);
  text-align: left;
  cursor: pointer;
}

.summary-client-vehicles-table th,
.summary-client-vehicles-table td {
  padding: 6px 8px;
  border: 1px solid var(--line);
}

.vehicle-registry-title,
.column-head {
  white-space: nowrap;
  font-size: 11px;
}

.vehicle-filter-select {
  min-height: 24px;
  padding: 4px 6px;
  font-size: 11px;
}

.muted-entity-row,
.muted-entity-row td,
.muted-entity-row .meta,
.muted-entity-text {
  color: #888888 !important;
}

.sold-vehicle-row td {
  color: #888888 !important;
}

.sold-vehicle-row td:not(:has(.action-list)),
.sold-vehicle-row .row-number-col {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #888888;
}

.sold-vehicle-btn {
  color: #475569;
  border-color: rgba(71, 85, 105, 0.24);
}

.template-editor-card {
  width: min(1180px, calc(100vw - 24px));
}

.template-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  align-items: start;
}

.template-editor-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.template-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.template-visual-editor {
  min-height: 520px;
  max-height: min(66vh, 720px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.template-visual-editor:focus {
  outline: 2px solid rgba(14, 116, 144, 0.28);
  outline-offset: 2px;
}

.template-source-panel textarea {
  width: 100%;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.template-variable-panel {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 10px;
  max-height: 70vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.template-token-pill {
  justify-content: flex-start;
  width: 100%;
  border: 1px solid var(--line);
  cursor: grab;
  text-align: left;
}

.template-token-pill span {
  display: block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.client-document-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.client-document-picker select {
  min-width: min(320px, 100%);
}

.client-document-picker-compact {
  margin: 8px 0;
  justify-content: flex-start;
}

.client-document-picker-compact .primary-btn {
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
}

.client-document-vehicle-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.client-document-vehicle-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, max-content));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.client-document-vehicle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  width: max-content;
  max-width: 100%;
}

.client-document-vehicle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  padding: 0;
  margin: 0;
}

.client-document-vehicle-row span {
  white-space: nowrap;
}

.company-requisites-form,
.bonus-layout,
.bonus-sale-form,
.bonus-equipment-lines {
  display: grid;
  gap: 12px;
}

.company-requisites-card h3 {
  margin: 0 0 10px;
}

.bonus-equipment-line {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px 150px auto;
  gap: 8px;
  align-items: center;
}

.bonus-equipment-delete-btn {
  align-self: center;
}

.vehicle-billing-period-fields {
  display: grid;
  gap: 10px;
}

.vehicle-billing-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vehicle-billing-event {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: var(--panel-soft);
}

.bonus-table-wrap {
  max-height: calc(100vh - 360px);
}

.compact-table-wrap {
  max-height: 260px;
}

.bonus-month-summary-card {
  margin-bottom: 12px;
}

.bonus-balance-card {
  margin-bottom: 12px;
}

.bonus-debt-form {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.bonus-money-form {
  margin-bottom: 12px;
}

.bonus-main-tabs,
.bonus-month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin: 8px 0 12px;
}

.bonus-month-tabs {
  gap: 6px;
}

.bonus-main-tabs .chip-btn,
.bonus-month-tabs .chip-btn {
  width: auto;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
}

.bonus-month-tabs .chip-btn {
  font-size: 12px;
}

.bonus-small-card {
  padding: 14px;
}

.bonus-small-card h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.bonus-balance-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 13px;
}

.bonus-balance-line strong {
  font-size: 14px;
}

.bonus-debt-compact {
  grid-template-columns: 220px auto;
  max-width: 390px;
  margin-top: 10px;
  margin-bottom: 0;
}

.bonus-compact-table th,
.bonus-compact-table td {
  padding: 6px 7px;
  font-size: 12px;
  line-height: 1.25;
}

.bonus-total-row td,
.bonus-compact-table tfoot td {
  background: #123f6d;
  color: #ffffff;
  font-weight: 700;
}

.bonus-total-row td strong,
.bonus-compact-table tfoot td strong {
  color: inherit;
}

body[data-theme="dark"] .bonus-total-row td,
body[data-theme="dark"] .bonus-compact-table tfoot td {
  background: #0b1220;
  color: #f8fbff;
}

.field-grid.four-col {
  grid-template-columns: 150px minmax(180px, 1fr) 140px minmax(220px, 1fr) auto;
  align-items: end;
}

.bonus-sale-compact-form {
  margin-bottom: 12px;
}

.bonus-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}

.bonus-report-total {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 13px;
}

.bonus-table {
  width: 100% !important;
  min-width: 0;
  table-layout: fixed !important;
}

.bonus-table th {
  position: relative;
  padding-right: 14px;
  white-space: normal;
  word-break: break-word;
}

.bonus-table td {
  white-space: normal;
  word-break: break-word;
}

.bonus-screen .bonus-table-wrap {
  overflow-x: hidden;
}

.bonus-no-scroll-table {
  font-size: 11px;
}

.bonus-no-scroll-table th,
.bonus-no-scroll-table td {
  padding: 5px 5px;
  line-height: 1.18;
}

.bonus-no-scroll-table .bonus-narrow-col,
.bonus-summary-accrual-table th:nth-child(3),
.bonus-summary-accrual-table td:nth-child(3) {
  width: 58px;
}

.bonus-action-col {
  width: 54px;
}

.bonus-accrual-table th:nth-child(1),
.bonus-accrual-table td:nth-child(1) {
  width: 18%;
}

.bonus-accrual-table th:nth-child(2),
.bonus-accrual-table td:nth-child(2) {
  width: 24%;
}

.bonus-accrual-table th:nth-child(4),
.bonus-accrual-table td:nth-child(4),
.bonus-report-table th:nth-child(5),
.bonus-report-table td:nth-child(5) {
  width: 72px;
}

.bonus-column-resizer {
  display: none;
}

.bonus-column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
}

.bonus-column-resizer::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 1px;
  background: rgba(31, 120, 210, 0.45);
}

@media (max-width: 700px) {
  .bonus-debt-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .field-grid.four-col,
  .bonus-debt-compact {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .bonus-summary-grid {
    grid-template-columns: 1fr;
  }

  .client-section-tabs-row {
    grid-template-columns: 1fr;
  }

  .client-section-tabs-row .client-document-picker {
    justify-self: center;
  }
}

.bonus-table th,
.bonus-table td {
  border: 1px solid var(--line);
}

.centered-tabs {
  justify-content: center;
}

@media (max-width: 700px) {
  .bonus-equipment-line {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .template-editor-layout {
    grid-template-columns: 1fr;
  }

  .template-variable-panel {
    position: static;
    max-height: 260px;
  }
}

.vehicle-client-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}

.login-card-with-request {
  grid-template-columns: minmax(360px, 0.92fr) minmax(360px, 1fr);
}

.login-forms-stack {
  display: grid;
  gap: 0;
}

.public-request-form {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.login-aside .public-request-in-aside {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: none;
}

.login-aside .public-request-in-aside .eyebrow,
.login-aside .public-request-in-aside h2,
.login-aside .public-request-in-aside label span,
.login-aside .public-request-in-aside .meta {
  color: #ffffff;
}

.login-aside .public-request-in-aside input,
.login-aside .public-request-in-aside textarea {
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  border-color: rgba(255, 255, 255, 0.4);
}

.login-aside .public-request-in-aside input::placeholder,
.login-aside .public-request-in-aside textarea::placeholder {
  color: #64748b;
}

.login-aside .public-request-in-aside .ghost-btn {
  background: #ffffff;
  color: #1d4ed8;
  border-color: #ffffff;
}

.role-management-panel {
  display: grid;
  gap: 16px;
}

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

.role-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.sidebar-toggle-btn {
  position: sticky;
  top: 12px;
  z-index: 40;
  align-self: start;
  justify-self: start;
  border: 1px solid var(--line);
  background: var(--accent);
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  overflow-x: clip;
  padding-left: clamp(6px, 2.5vw, 14px);
  padding-right: clamp(6px, 2.5vw, 14px);
}

.app-shell.sidebar-collapsed .sidebar {
  display: none;
}

.app-shell.sidebar-collapsed .main-panel {
  grid-column: 1;
}

.app-shell.sidebar-collapsed .main-panel,
.app-shell.sidebar-collapsed .panel-grid,
.app-shell.sidebar-collapsed .dashboard-grid,
.app-shell.sidebar-collapsed .dashboard-grid-final,
.app-shell.sidebar-collapsed .communications-grid-final,
.app-shell.sidebar-collapsed .detail-layout,
.app-shell.sidebar-collapsed .panel,
.app-shell.sidebar-collapsed .panel-wide,
.app-shell.sidebar-collapsed .log-list,
.app-shell.sidebar-collapsed .tasks-page-list,
.app-shell.sidebar-collapsed .dashboard-full-height-list,
.app-shell.sidebar-collapsed .client-task-list-full {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.app-shell.sidebar-collapsed .panel-grid,
.app-shell.sidebar-collapsed .dashboard-grid,
.app-shell.sidebar-collapsed .dashboard-grid-final,
.app-shell.sidebar-collapsed .communications-grid-final,
.app-shell.sidebar-collapsed .detail-layout {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .panel-wide,
.app-shell.sidebar-collapsed .dashboard-work-panel,
.app-shell.sidebar-collapsed .dashboard-calendar-panel {
  grid-column: auto;
}

.app-shell.sidebar-collapsed .panel,
.app-shell.sidebar-collapsed .log-item {
  padding-left: clamp(8px, 2.8vw, 14px);
  padding-right: clamp(8px, 2.8vw, 14px);
}

.app-shell.sidebar-collapsed .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.app-shell.sidebar-collapsed .task-row-card,
.app-shell.sidebar-collapsed .task-row-card *,
.app-shell.sidebar-collapsed .task-row-line,
.app-shell.sidebar-collapsed .task-row-main,
.app-shell.sidebar-collapsed .task-row-main .item-head,
.app-shell.sidebar-collapsed .task-row-main .item-head strong,
.app-shell.sidebar-collapsed .task-row-main .client-link,
.app-shell.sidebar-collapsed .task-row-main > .meta {
  max-width: 100%;
  min-width: 0;
}

.app-shell.sidebar-collapsed .task-row-card {
  overflow-x: hidden;
}

.app-shell.sidebar-collapsed .task-row-line {
  flex-direction: column;
}

.app-shell.sidebar-collapsed .task-row-main .item-head {
  display: block;
}

.app-shell.sidebar-collapsed .task-row-main .client-link,
.app-shell.sidebar-collapsed .task-row-main > .meta {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.app-shell.sidebar-collapsed .task-created-phone-row {
  flex: 1 1 auto;
  white-space: normal;
  overflow-wrap: anywhere;
}

.app-shell.sidebar-collapsed .task-phone-created-actions .task-row-actions {
  width: auto;
  max-width: 100%;
  justify-content: flex-end;
}

.app-shell.sidebar-collapsed .task-icon-actions,
.app-shell.sidebar-collapsed .task-phone-created-actions {
  flex-wrap: wrap;
}

.app-shell.sidebar-collapsed .mini-icon-btn {
  flex: 0 0 auto;
}

.column-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.column-move-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.calendar-kind {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  background: var(--accent);
  vertical-align: middle;
}

.calendar-kind.reminder {
  border-radius: 2px;
  background: var(--warn);
}

.calendar-kind.ticket {
  border-radius: 0;
  transform: rotate(45deg);
  background: var(--bad);
}

@media (max-width: 900px) {
  .login-card-with-request {
    grid-template-columns: 1fr;
  }
}

.communications-grid-final {
  grid-template-columns: minmax(420px, 1.25fr) minmax(300px, 0.75fr);
}

.communications-status-panel,
.dashboard-full-height-panel,
.client-detail-panel {
  min-height: calc(100vh - 48px);
}

.communications-status-list {
  max-height: none;
  height: calc(100vh - 170px);
  min-height: 520px;
  align-content: start;
}

.dashboard-grid-final {
  align-items: stretch;
}

.dashboard-full-height-list {
  max-height: none;
  height: calc(100vh - 170px);
  min-height: 520px;
  align-content: start;
}

.tasks-page-list,
.client-task-list-full {
  max-height: none;
  height: calc(100vh - 260px);
  min-height: 440px;
  align-content: start;
}

.task-row-card {
  width: 100%;
}

.task-row-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.task-row-main {
  min-width: 0;
  flex: 1;
}

.task-row-main .client-link {
  text-align: left;
}

.task-row-actions {
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.task-icon-actions,
.fonarka-ticket-inline-actions {
  flex-wrap: nowrap;
  margin-left: auto;
}

.fonarka-ticket-head {
  gap: 10px;
}

.fonarka-ticket-head .badge {
  white-space: nowrap;
}

.fonarka-urgent-ticket {
  background: #fee2e2;
  border-color: rgba(220, 38, 38, 0.55);
}

.fonarka-urgent-ticket .client-link,
.fonarka-urgent-ticket .meta {
  color: #7f1d1d;
}

.meta-inline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

body[data-theme="dark"] .fonarka-urgent-ticket {
  background: rgba(127, 29, 29, 0.45);
  border-color: rgba(248, 113, 113, 0.58);
}

body[data-theme="dark"] .fonarka-urgent-ticket .client-link,
body[data-theme="dark"] .fonarka-urgent-ticket .meta {
  color: #f8fbff;
}

.right-actions {
  justify-content: flex-end;
}

.task-search-control {
  min-width: min(360px, 46vw);
}

.bonus-report-table th:nth-child(1),
.bonus-report-table td:nth-child(1) {
  width: 12%;
  min-width: 74px;
}

.bonus-report-table th:nth-child(2),
.bonus-report-table td:nth-child(2) {
  width: 28%;
}

.bonus-report-table th:nth-child(3),
.bonus-report-table td:nth-child(3) {
  width: 24%;
}

.status-pill.review {
  background: rgba(124, 58, 237, 0.14);
  color: #6d28d9;
}

body[data-theme="dark"] .status-pill.review {
  background: rgba(167, 139, 250, 0.22);
  color: #ede9fe !important;
}

.task-review {
  border-color: rgba(124, 58, 237, 0.34);
  background: rgba(124, 58, 237, 0.08);
}

body[data-theme="dark"] .task-review {
  border-color: rgba(167, 139, 250, 0.42);
  background: rgba(88, 28, 135, 0.32);
}

.compact-section-head {
  gap: 10px;
}

.dashboard-mini-task-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.dashboard-mini-task-card {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px;
  color: var(--text);
}

@keyframes dashboardReviewPulseMay29 {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    background: var(--surface-soft);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.24);
    background: rgba(254, 243, 199, 0.9);
  }
}

.dashboard-mini-task-card.task-review {
  animation: dashboardReviewPulseMay29 1.9s ease-in-out infinite;
  border-color: rgba(245, 158, 11, 0.62);
}

body[data-theme="dark"] .dashboard-mini-task-card.task-review {
  animation-name: dashboardReviewPulseDarkMay29;
  border-color: rgba(251, 191, 36, 0.72);
}

@keyframes dashboardReviewPulseDarkMay29 {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    background: rgba(22, 39, 65, 0.92);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.28);
    background: rgba(120, 83, 18, 0.5);
  }
}

.dashboard-mini-task-card .calendar-kind {
  margin-top: 5px;
  margin-right: 0;
}

.dashboard-mini-task-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-mini-task-body strong,
.dashboard-mini-task-body span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-mini-task-body strong {
  font-size: calc(13px * var(--app-font-scale));
  line-height: 1.15;
}

.dashboard-mini-task-body span {
  color: var(--muted);
  font-size: calc(11px * var(--app-font-scale));
}

.dashboard-mini-task-card .status-pill {
  align-self: start;
  white-space: nowrap;
  font-size: calc(10px * var(--app-font-scale));
  padding: 3px 6px;
}

body[data-theme="dark"] .dashboard-mini-task-card {
  background: rgba(22, 39, 65, 0.92);
  border-color: rgba(148, 163, 184, 0.24);
}

.client-account-panel {
  margin-top: 14px;
}

.client-account-panel #clientAccountForm,
.client-account-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(180px, 260px) auto;
  align-items: end;
  gap: 10px;
}

.client-account-panel #clientAccountForm .meta,
.client-account-form .meta {
  grid-column: 1 / -1;
}

.client-account-panel #clientAccountForm .primary-btn,
.client-account-form .primary-btn {
  min-height: 42px;
  width: auto;
  justify-self: start;
}

.password-input-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 38px;
  gap: 6px;
  align-items: center;
}

.password-input-row input {
  min-width: 0;
}

.password-eye-btn {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
}

.client-gps-access-fields {
  max-width: 560px;
}

.compact-client-gps-grid {
  grid-template-columns: repeat(2, minmax(150px, 220px));
}

.client-gps-note-detail strong {
  letter-spacing: 0;
}

#clientDocumentPrintDialog .modal-card,
#clientDocumentPrintForm {
  background: var(--panel);
  color: var(--text);
}

#clientDocumentVehicleList,
#clientDocumentPrintDialog .client-document-vehicle-box,
#clientDocumentPrintDialog .client-document-vehicle-row {
  background: var(--panel-soft);
  color: var(--text);
}

body[data-theme="dark"] #clientDocumentPrintDialog .modal-card,
body[data-theme="dark"] #clientDocumentPrintForm,
body[data-theme="dark"] #clientDocumentVehicleList,
body[data-theme="dark"] #clientDocumentPrintDialog .client-document-vehicle-box,
body[data-theme="dark"] #clientDocumentPrintDialog .client-document-vehicle-row {
  background: rgba(15, 23, 42, 0.96) !important;
  border-color: rgba(148, 163, 184, 0.32) !important;
  color: #f8fbff !important;
}

.comment-attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -6px;
}

.comment-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(280px, 100%);
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.comment-attachment-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-attachment-chip .mini-icon-btn {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  flex: 0 0 22px;
}

body[data-theme="dark"] .comment-attachment-chip {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(148, 163, 184, 0.28);
  color: #f8fbff;
}

.attachment-summary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: -2px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.attachment-summary-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

body[data-theme="dark"] .attachment-summary-toggle {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(148, 163, 184, 0.28);
  color: #f8fbff;
}

.task-edit-attachments {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.task-edit-attachment-list {
  display: grid;
  gap: 6px;
}

.task-edit-attachment-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.task-edit-attachment-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-edit-attachment-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.82rem;
}

body[data-theme="dark"] .task-edit-attachments,
body[data-theme="dark"] .task-edit-attachment-row {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(148, 163, 184, 0.28);
  color: #f8fbff;
}

.client-portal-shell {
  display: block;
  min-height: 100vh;
}

.client-portal-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.client-portal-history-head {
  margin-top: 18px;
}

.client-portal-head {
  padding-bottom: 16px;
}

.client-portal-tabs,
.admin-access-tabs {
  margin-top: 10px;
}

.client-portal-section-panel {
  margin-top: 12px;
}

.client-portal-hidden-field {
  display: none !important;
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.calendar-add-day {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(59, 130, 246, 0.34);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-dark) !important;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.calendar-add-day:hover,
.calendar-add-day:focus {
  background: var(--accent);
  color: #ffffff !important;
  outline: none;
}

.calendar-day-task-link {
  font-size: calc(13px * var(--app-font-scale));
  color: var(--text);
}

.task-log-comment-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.task-log-actions-jun05 {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.task-log-actions-jun05 .mini-icon-btn {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
}

.task-file-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.task-photo-item {
  position: relative;
}

.task-file-delete-btn {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  color: #dc2626;
}

.editable-photo-grid .task-file-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255, 255, 255, 0.92);
}

body[data-theme="dark"] .calendar-add-day {
  border-color: rgba(125, 211, 252, 0.46);
  background: rgba(14, 116, 144, 0.24);
  color: #f8fbff !important;
}

body[data-theme="dark"] .task-log-comment-box {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(148, 163, 184, 0.28);
  color: #f8fbff;
}

.clients-toolbar-actions {
  align-items: end;
}

.compact-inline-control {
  width: auto;
  min-width: 150px;
}

.compact-inline-control select {
  min-width: 150px;
}

.disabled-client-card,
.disabled-client-card *,
.disabled-client-card .client-link,
.disabled-client-card .dense-client-name,
.client-card.disabled-client-card .client-link,
.muted-entity-row,
.muted-entity-row *,
.muted-entity-row td,
.muted-entity-row .meta,
.muted-entity-row .client-link,
.muted-entity-text,
body[data-theme="dark"] .disabled-client-card .client-link,
body[data-theme="dark"] .muted-entity-row .client-link,
body[data-theme="dark"] .muted-entity-text {
  color: #888888 !important;
}

body[data-theme="dark"] .role-card,
body[data-theme="dark"] .role-management-panel,
body[data-theme="dark"] .permission-group {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #f8fbff !important;
}

body[data-theme="dark"] .role-card .pill,
body[data-theme="dark"] .permission-group .checkbox {
  background: rgba(30, 41, 59, 0.92) !important;
  color: #f8fbff !important;
}

@media (max-width: 760px) {
  .client-account-panel #clientAccountForm,
  .client-account-form {
    grid-template-columns: 1fr;
  }
}

.task-search-control input {
  width: 100%;
}

.file-dropzone {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  background: rgba(14, 116, 144, 0.08);
  color: var(--text);
  cursor: pointer;
}

.file-dropzone.active {
  background: rgba(14, 116, 144, 0.16);
  border-color: var(--accent-strong);
}

body[data-theme="dark"] .file-dropzone {
  background: rgba(56, 189, 248, 0.12);
  color: #f8fbff;
}

.vehicle-custom-pair > label:only-child {
  grid-column: 1 / -1;
}

.vehicle-table th,
.vehicle-table td,
.summary-table-bordered th,
.summary-table-bordered td {
  border: 1px solid var(--line);
}

.vehicle-table {
  border-collapse: collapse;
}

.permission-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.fonarka-screen .full-height-list {
  max-height: none;
  min-height: 380px;
}

.fonarka-location-list {
  max-height: 320px;
}

.fonarka-materials-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

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

.fonarka-material-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.fonarka-material-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.fonarka-material-form {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.fonarka-report-materials {
  margin-top: 18px;
}

.fonarka-report-materials ul {
  margin: 0;
  padding-left: 18px;
}

.fonarka-material-report-group {
  display: grid;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.fonarka-material-report-group:last-child {
  border-bottom: 0;
}

.task-card > .meta,
.task-row-main > .meta,
.timeline-entry > div:not(.item-head):not(.meta),
.fonarka-ticket-row .task-row-main > .meta,
#fonarkaDetailsContent > p,
.summary-note,
.chat-message {
  font-size: calc(12px * var(--app-font-scale));
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-soft);
}

.timeline-entry > .meta,
.task-row-main > .meta:first-of-type {
  font-weight: 600;
}

.timeline-status-inline {
  margin-left: auto;
  color: var(--muted);
  font-size: calc(12px * var(--app-font-scale));
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

body[data-theme="dark"] .task-card > .meta,
body[data-theme="dark"] .task-row-main > .meta,
body[data-theme="dark"] .timeline-entry > div:not(.item-head):not(.meta),
body[data-theme="dark"] #fonarkaDetailsContent > p,
body[data-theme="dark"] .summary-note,
body[data-theme="dark"] .chat-message {
  background: #0f172a;
  color: #f8fbff;
  border-color: rgba(148, 163, 184, 0.35);
}

body[data-theme="dark"] .timeline-status-inline {
  color: #cbd5e1;
}

.client-task-search {
  margin: 10px 0;
}

.directory-card-head {
  align-items: flex-start;
  gap: 12px;
}

.directory-card-title {
  min-width: 0;
}

.directory-card-title strong {
  display: inline-block;
  margin-right: 8px;
}

.directory-card-actions {
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.directory-action-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.directory-plus-btn {
  width: 42px;
  height: 38px;
  min-width: 42px;
  padding: 0;
  border-radius: 9px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.directory-value-list {
  margin-top: 10px;
}

.directory-value-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dense-client-card {
  padding: 8px 12px;
}

.dense-client-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.dense-client-name {
  flex: 0 0 min(300px, 34%);
  min-width: 180px;
  text-align: left;
}

.dense-client-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.dense-client-info .meta {
  line-height: 1.25;
  white-space: nowrap;
}

.dense-client-info .flat-btn,
.dense-client-info .danger-btn {
  min-height: 30px;
  padding: 6px 10px;
}

.directory-value-pill button {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.danger-icon-btn {
  color: #dc2626;
}

body[data-theme="dark"] .directory-value-pill button,
body[data-theme="dark"] .directory-action-btn {
  background: #0f172a;
  color: #f8fbff;
  border-color: rgba(148, 163, 184, 0.35);
}

body[data-theme="dark"] .danger-icon-btn {
  color: #fecaca;
}

@media (max-width: 900px) {
  .communications-grid-final {
    grid-template-columns: 1fr;
  }

  .summary-total-groups {
    grid-template-columns: 1fr;
  }

  .communications-status-list,
  .dashboard-full-height-list,
  .tasks-page-list,
  .client-task-list-full {
    height: auto;
    min-height: 320px;
  }

  .task-row-line {
    flex-direction: column;
  }

  .task-row-actions {
    width: 100%;
  }

  .task-row-card,
  .task-row-card *,
  .task-row-line,
  .task-row-main,
  .task-row-main .item-head,
  .task-row-main .item-head strong,
  .task-row-main .client-link,
  .task-row-main > .meta {
    max-width: 100%;
    min-width: 0;
  }

  .task-row-card {
    overflow-x: hidden;
  }

  .task-row-main .item-head {
    align-items: flex-start;
  }

  .task-row-main .item-head strong {
    display: block;
  }

  .task-row-main .client-link,
  .task-row-main > .meta {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .task-created-phone-row {
    flex: 1 1 auto;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .task-phone-created-actions .task-row-actions {
    width: auto;
    max-width: 100%;
    justify-content: flex-end;
  }

  .fonarka-materials-grid {
    grid-template-columns: 1fr;
  }

  .dense-client-row {
    flex-wrap: wrap;
  }

  .dense-client-name {
    flex-basis: 100%;
  }

  .dense-client-info {
    justify-content: flex-start;
  }
}

.app-shell,
.login-shell,
.sidebar,
.panel,
.modal-card,
.chat-drawer,
.client-card,
.log-item,
.calendar-cell {
  font-size: calc(1rem * var(--app-font-scale));
}

.primary-btn,
.ghost-btn,
.flat-btn,
.chip-btn,
.theme-toggle,
.menu-btn,
.icon-btn,
input,
select,
textarea {
  font-size: calc(14px * var(--app-font-scale));
}

.eyebrow,
.meta,
.badge,
.pill,
.summary-note {
  font-size: calc(12px * var(--app-font-scale));
}

h1 {
  font-size: calc(24px * var(--app-font-scale));
}

h2 {
  font-size: calc(20px * var(--app-font-scale));
}

h3,
.client-link {
  font-size: calc(17px * var(--app-font-scale));
}

.sidebar-menu-group {
  display: grid;
  gap: 6px;
  width: 100%;
}

.sidebar-submenu {
  display: grid;
  gap: 5px;
  padding-left: 12px;
  border-left: 2px solid rgba(14, 116, 144, 0.24);
}

.submenu-btn {
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: calc(13px * var(--app-font-scale));
}

.inventory-screen .panel-wide {
  display: grid;
  align-content: start;
  gap: 8px;
}

.inventory-tabs {
  justify-content: flex-start;
  gap: 8px;
}

.inventory-card {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.inventory-list-card {
  min-height: 0;
}

.inventory-form {
  display: grid;
  gap: 10px;
}

.inventory-dialog-card {
  width: min(980px, calc(100vw - 32px));
}

.compact-inventory-form {
  gap: 8px;
}

.compact-field-grid {
  align-items: end;
}

.compact-field-grid label {
  min-width: 0;
}

.compact-field-grid input,
.compact-field-grid select,
.compact-field-grid textarea,
.inventory-dialog-card input,
.inventory-dialog-card select,
.inventory-dialog-card textarea {
  min-height: 34px;
  padding: 7px 9px;
}

.compact-action-list {
  gap: 6px;
  flex-wrap: wrap;
}

.inventory-product-grid-final {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) 140px 112px minmax(130px, 0.75fr);
  gap: 8px;
  align-items: end;
}

.inventory-product-grid-final label {
  min-width: 0;
}

.inventory-product-grid-final .inventory-name-field {
  grid-column: span 2;
}

.inventory-product-grid-final .inventory-small-price-field {
  max-width: 126px;
}

.inventory-product-grid-final input[readonly] {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: default;
}

.inventory-section-head {
  margin-bottom: 0;
}

.inventory-screen {
  align-items: start;
  font-size: calc(13px * var(--app-font-scale));
}

.inventory-screen .item-head {
  min-height: 0;
  margin: 0;
}

.inventory-screen .compact-admin-btn {
  min-height: 30px;
  padding: 6px 10px;
  font-size: calc(12px * var(--app-font-scale));
}

.inventory-doc-lines {
  display: grid;
  gap: 8px;
}

.inventory-doc-line {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) 84px 110px 100px minmax(180px, 1fr) 34px;
  gap: 8px;
  align-items: stretch;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.inventory-doc-line:not(.inventory-request-line) {
  grid-template-columns: minmax(190px, 1.4fr) 90px 130px minmax(220px, 1fr) 34px;
}

.inventory-doc-line input,
.inventory-doc-line textarea {
  min-width: 0;
}

.inventory-doc-line textarea {
  resize: vertical;
}

.inventory-card .compact-table th,
.inventory-card .compact-table td {
  padding: 5px 7px;
  font-size: calc(12px * var(--app-font-scale));
  vertical-align: top;
}

.inventory-table-final .client-link,
.inventory-product-link {
  font-size: calc(13px * var(--app-font-scale));
}

.inventory-row-actions {
  gap: 4px;
  flex-wrap: nowrap;
}

.inventory-row-actions .mini-icon-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  font-size: calc(12px * var(--app-font-scale));
}

.inventory-list-card .table-wrap {
  min-height: 0;
  max-height: calc(100vh - 230px);
}

body[data-theme="dark"] .inventory-doc-line,
body[data-theme="dark"] .inventory-card {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.28);
}

body[data-theme="dark"] .sidebar-submenu {
  border-left-color: rgba(125, 211, 252, 0.32);
}

@media (max-width: 1000px) {
  .inventory-product-grid-final,
  .inventory-doc-line,
  .inventory-doc-line:not(.inventory-request-line) {
    grid-template-columns: 1fr;
  }

  .inventory-product-grid-final .inventory-name-field {
    grid-column: auto;
  }

  .inventory-product-grid-final .inventory-small-price-field {
    max-width: none;
  }
}

.inventory-document-head-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(31, 120, 210, 0.06);
}

.inventory-lines-head {
  margin-top: 10px;
}

.inventory-stock-tabs {
  justify-content: center;
  margin-bottom: 8px;
}

.inventory-stock-search {
  max-width: 320px;
}

.inventory-stock-dialog-card .table-wrap {
  min-height: 320px;
}

.inventory-attachment-list {
  margin-top: 6px;
}

.inventory-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inventory-attachment-chip input {
  width: auto;
  min-height: 0;
}

.vehicle-attachment-button {
  width: 30px;
  height: 30px;
}

.vehicle-attachment-modal-list {
  min-height: 220px;
}

.client-documents-panel {
  margin-top: 10px;
}

.client-documents-list {
  min-height: 360px;
}

.client-info-groups-panel {
  display: grid;
  gap: 8px;
}

.client-info-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-soft);
}

.client-info-group summary {
  cursor: pointer;
  font-weight: 700;
}

.client-info-group .client-main-details {
  margin-top: 8px;
}

body[data-theme="dark"] .client-info-group {
  background: #111827;
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.32);
}

body[data-theme="dark"] .template-editor-card,
body[data-theme="dark"] .template-editor-main,
body[data-theme="dark"] .template-variable-panel,
body[data-theme="dark"] .template-source-panel textarea,
body[data-theme="dark"] .template-visual-editor {
  background: #0f172a;
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.32);
}

body[data-theme="dark"] .template-visual-editor *,
body[data-theme="dark"] .template-source-panel textarea {
  color: #f8fafc;
}

body[data-theme="dark"] .template-token-pill,
body[data-theme="dark"] .inventory-document-head-block,
body[data-theme="dark"] .inventory-attachment-chip,
body[data-theme="dark"] .vehicle-attachment-modal-list,
body[data-theme="dark"] .client-documents-panel {
  background: #111827;
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.32);
}

body[data-theme="dark"] .inventory-stock-dialog-card table,
body[data-theme="dark"] .inventory-stock-dialog-card th,
body[data-theme="dark"] .inventory-stock-dialog-card td {
  background: #0f172a;
  color: #f8fafc;
}
/* NetSistem Jun 05: stable vehicle attachments, drag-drop fields and inventory invoice states. */
.vehicle-attachment-modal-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.vehicle-attachment-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  max-height: 68vh;
  overflow: auto;
}

.vehicle-attachment-thumb {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border-color, rgba(148, 163, 184, .35));
  border-radius: 8px;
  background: var(--panel-soft, rgba(255, 255, 255, .72));
  color: inherit;
  padding: 6px;
  cursor: pointer;
  text-align: left;
}

.vehicle-attachment-thumb.active {
  outline: 2px solid #38bdf8;
  border-color: #38bdf8;
}

.vehicle-attachment-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(15, 23, 42, .08);
}

.vehicle-attachment-thumb span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .78rem;
}

.vehicle-attachment-large-preview {
  min-height: 220px;
  border: 1px solid var(--border-color, rgba(148, 163, 184, .35));
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft, rgba(255, 255, 255, .72));
  display: grid;
  place-items: center;
  gap: 8px;
}

.vehicle-attachment-large-preview img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 6px;
}

.generic-file-dropzone {
  border: 1px dashed rgba(14, 165, 233, .55);
  border-radius: 8px;
  padding: 8px;
  transition: border-color .15s ease, background .15s ease;
}

.generic-file-dropzone.drag-over {
  border-color: #0284c7;
  background: rgba(14, 165, 233, .12);
}

.generic-file-dropzone-hint {
  margin-top: 4px;
  font-size: .76rem;
  color: var(--muted-color, #64748b);
}

.inventory-request-head {
  align-items: center;
}

.inventory-request-list-block + .inventory-request-list-block {
  margin-top: 14px;
}

.inventory-status-inline {
  min-width: 150px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .45);
  padding: 4px 22px 4px 9px;
  font-size: .8rem;
}

.inventory-status-draft {
  background: #fff;
  color: #0f172a;
}

.inventory-status-signing {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.inventory-status-project {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.inventory-status-closed {
  background: #e5e7eb;
  color: #475569;
  border-color: #cbd5e1;
}

.inventory-cash-checkbox {
  align-self: end;
  min-height: 38px;
}

.cash-badge {
  display: inline-flex;
  margin-top: 4px;
}

body[data-theme="dark"] .vehicle-attachment-thumb,
body[data-theme="dark"] .vehicle-attachment-large-preview {
  background: #111827;
  border-color: rgba(148, 163, 184, .34);
}

body[data-theme="dark"] .inventory-status-draft {
  background: #1f2937;
  color: #f8fafc;
}

body[data-theme="dark"] .inventory-status-signing {
  background: #064e3b;
  color: #ecfdf5;
}

body[data-theme="dark"] .inventory-status-project {
  background: #1e3a8a;
  color: #eff6ff;
}

body[data-theme="dark"] .inventory-status-closed {
  background: #334155;
  color: #e2e8f0;
}

@media (max-width: 760px) {
  .vehicle-attachment-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* NetSistem Jun 05: explicit IMEI accounting and compact stock documents. */
.inventory-product-grid-v2 {
  grid-template-columns: minmax(300px, 2fr) 110px 104px 104px 72px 112px minmax(130px, .8fr);
}

.inventory-product-grid-v2 .inventory-name-field {
  grid-column: span 2;
}

.inventory-product-grid-v2 .inventory-small-price-field {
  max-width: 112px;
}

.inventory-product-grid-v2 .inventory-qty-field {
  max-width: 72px;
}

.inventory-product-grid-v2 .inventory-type-field {
  max-width: 120px;
}

.inventory-product-grid-v2 .inventory-imei-checkbox {
  min-height: 38px;
  padding: 7px 8px;
}

.inventory-product-grid-v2 .inventory-image-field {
  grid-column: span 2;
}

.inventory-product-image-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.inventory-product-image-preview img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.inventory-doc-line.no-imei.inventory-request-line {
  grid-template-columns: minmax(210px, 1.8fr) 76px 96px 86px 34px;
}

.inventory-doc-line.no-imei.inventory-purchase-line,
.inventory-doc-line.no-imei:not(.inventory-request-line) {
  grid-template-columns: minmax(230px, 1.8fr) 76px 112px 34px;
}

.inventory-imei-field {
  display: grid;
  gap: 4px;
  margin: 0;
}

.inventory-imei-field[hidden] {
  display: none !important;
}

.inventory-imei-field span {
  font-size: .72rem;
  color: var(--muted);
}

.inventory-cash-na-checkbox {
  width: 58px;
  min-height: 34px;
  padding: 6px 7px;
  justify-content: center;
  align-self: end;
}

.inventory-cash-na-checkbox span {
  font-weight: 700;
  letter-spacing: .02em;
}

.inventory-request-head-grid .inventory-cash-na-checkbox {
  max-width: 58px;
}

.inventory-request-table-final .inventory-invoice-number {
  width: 118px;
  white-space: nowrap;
}

.inventory-request-table-final .inventory-company-col {
  min-width: 230px;
  width: 35%;
}

.inventory-request-table-final .inventory-sum-col {
  width: 92px;
  white-space: nowrap;
}

.inventory-request-table-final td.inventory-sum-col {
  font-size: calc(11px * var(--app-font-scale));
}

.inventory-request-table-final .inventory-status-inline {
  min-width: 132px;
}

.cash-badge {
  width: fit-content;
  padding: 2px 6px;
  font-size: .72rem;
}

body[data-theme="dark"] .inventory-product-image-preview img {
  border-color: rgba(148, 163, 184, .35);
}

body[data-theme="dark"] .vehicle-billing-period-fields input,
body[data-theme="dark"] .vehicle-billing-period-fields select,
body[data-theme="dark"] .vehicle-billing-period-fields textarea {
  background: var(--input-bg, #0b1220);
  border-color: var(--line);
  color: var(--text);
  color-scheme: dark;
}

body[data-theme="dark"] .vehicle-billing-event {
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--text);
}

.task-customer-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 7px 9px;
  font-size: calc(.86rem * var(--app-font-scale));
}

.task-customer-line strong {
  color: var(--text);
}

.task-customer-line .meta {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
}

body[data-theme="dark"] .task-customer-line {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.35);
  color: #f8fbff;
}

body[data-theme="dark"] .task-customer-line .meta,
body[data-theme="dark"] .task-customer-client-link {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.35);
  color: #f8fbff !important;
}

.inventory-product-grid-v3 {
  grid-template-columns: minmax(260px, 2fr) 130px 120px 120px 110px 120px;
}

.inventory-product-grid-v3 .inventory-name-field {
  grid-column: span 2;
}

.inventory-imei-under-name {
  align-self: end;
  min-height: 34px;
  max-width: 130px;
}

.inventory-product-grid-v3 .inventory-image-field-small {
  max-width: 190px;
}

.inventory-product-grid-v3 .inventory-image-field-small input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: calc(11px * var(--app-font-scale));
}

.inventory-product-grid-v3 .inventory-small-price-field,
.inventory-product-grid-v3 .inventory-qty-field,
.inventory-product-grid-v3 .inventory-unit-field {
  max-width: 135px;
}

.inventory-purchase-line-eur {
  grid-template-columns: minmax(220px, 1.4fr) 72px 105px 105px 112px minmax(160px, .9fr) 34px;
}

.inventory-mdl-price,
.inventory-mdl-total {
  background: var(--surface-soft);
  font-weight: 700;
}

.inventory-purchase-row-clickable {
  cursor: pointer;
}

.inventory-purchase-details-row td {
  background: var(--panel-soft);
  padding: 8px;
}

.inventory-purchase-details-table {
  margin: 0;
  font-size: calc(11px * var(--app-font-scale));
}

.inventory-product-table-final th:nth-child(4),
.inventory-product-table-final td:nth-child(4) {
  width: 120px;
}

.login-language-field select,
.user-language-field select {
  min-width: 90px;
}

@media (max-width: 900px) {
  .inventory-product-grid-v2,
  .inventory-product-grid-v3,
  .inventory-doc-line.no-imei.inventory-request-line,
  .inventory-doc-line.no-imei.inventory-purchase-line,
  .inventory-purchase-line-eur,
  .inventory-doc-line.no-imei:not(.inventory-request-line) {
    grid-template-columns: 1fr;
  }
}

.brand-settings-trigger {
  border: 0;
  cursor: pointer;
}

.brand-settings-panel {
  position: fixed;
  top: 88px;
  left: 28px;
  z-index: 360;
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  width: 280px;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
}

.brand-settings-panel[hidden] {
  display: none !important;
}

.brand-settings-panel .theme-toggle,
.brand-settings-panel select {
  width: 100%;
  min-height: 36px;
  margin: 0;
  border-radius: 8px;
  font-size: calc(13px * var(--app-font-scale));
}

.brand-settings-font {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.brand-settings-language {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: calc(12px * var(--app-font-scale));
}

.brand-settings-language span {
  font-weight: 700;
}

@media (max-width: 700px) {
  .brand-settings-panel {
    top: 76px;
    left: 12px;
    width: min(320px, calc(100vw - 24px));
  }
}

.brand > .brand-controls {
  display: none !important;
}

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

.task-comment-actions-jun06 .primary-btn,
.task-comment-actions-jun06 .ghost-btn {
  width: auto;
  min-width: 110px;
  flex: 0 0 auto;
}

.task-customer-client-link {
  font-weight: 800;
}

.task-vehicle-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 9px;
}

.vehicle-plate-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vehicle-plate-link:hover,
.vehicle-plate-link:focus-visible {
  color: var(--accent-strong);
}

.task-vehicle-contact-line,
.task-vehicle-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.task-customer-line .task-vehicle-chip {
  margin-left: 0;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.task-report-vehicle-select {
  min-width: 220px;
}

.reports-table td .task-report-vehicle-link,
.vehicle-table td .vehicle-table-plate-link {
  max-width: 180px;
  overflow-wrap: anywhere;
}

body[data-theme="dark"] .task-vehicle-field,
body[data-theme="dark"] .task-customer-line .task-vehicle-chip {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.35);
  color: #f8fbff;
}

body[data-theme="dark"] .vehicle-plate-link {
  color: #93c5fd;
}

body[data-theme="dark"] .vehicle-plate-link:hover,
body[data-theme="dark"] .vehicle-plate-link:focus-visible {
  color: #bfdbfe;
}

.direct-vehicle-status-select {
  min-width: 116px;
  min-height: 30px;
  padding: 4px 26px 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: calc(11px * var(--app-font-scale));
  font-weight: 800;
  cursor: pointer;
}

.direct-vehicle-status-select.status-active {
  border-color: rgba(22, 163, 74, .35);
  background: rgba(34, 197, 94, .12);
  color: #166534;
}

.direct-vehicle-status-select.status-paused {
  border-color: rgba(202, 138, 4, .38);
  background: rgba(234, 179, 8, .14);
  color: #854d0e;
}

.direct-vehicle-status-select.status-deleted,
.direct-vehicle-status-select.status-sold {
  border-color: rgba(148, 163, 184, .45);
  background: rgba(148, 163, 184, .14);
  color: #64748b;
}

body[data-theme="dark"] .direct-vehicle-status-select {
  background: #111827;
  color: #f8fbff;
  border-color: rgba(148, 163, 184, .35);
  color-scheme: dark;
}

body[data-theme="dark"] .direct-vehicle-status-select.status-active {
  background: rgba(34, 197, 94, .18);
  color: #bbf7d0;
}

body[data-theme="dark"] .direct-vehicle-status-select.status-paused {
  background: rgba(234, 179, 8, .18);
  color: #fde68a;
}

body[data-theme="dark"] .direct-vehicle-status-select.status-deleted,
body[data-theme="dark"] .direct-vehicle-status-select.status-sold {
  background: rgba(148, 163, 184, .18);
  color: #cbd5e1;
}

body[data-theme="dark"] .direct-vehicle-status-select option {
  background: #111827;
  color: #f8fbff;
}

.entity-journal-dialog .entity-journal-list {
  display: grid;
  gap: 8px;
  max-height: min(64vh, 620px);
  overflow: auto;
}

.entity-journal-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--panel-soft);
}

.client-related-attachments-panel {
  margin-top: 12px;
}

.client-related-attachments-list {
  display: grid;
  gap: 7px;
}

.client-related-attachment {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, .8fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 5px 8px;
  text-align: left;
  cursor: pointer;
  font-size: calc(11px * var(--app-font-scale));
}

.client-related-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.client-related-file-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  text-align: right;
}

.client-attachment-mouse-preview {
  position: fixed;
  z-index: 10050;
  display: none;
  width: 260px;
  max-height: 240px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .22);
  pointer-events: none;
}

.client-attachment-mouse-preview.visible {
  display: block;
}

.client-attachment-mouse-preview img {
  display: block;
  width: 100%;
  max-height: 226px;
  object-fit: contain;
  border-radius: 6px;
}

body[data-theme="dark"] .entity-journal-item,
body[data-theme="dark"] .client-related-attachment,
body[data-theme="dark"] .client-attachment-mouse-preview {
  background: #111827;
  color: #f8fbff;
  border-color: rgba(148, 163, 184, .35);
}

.login-2fa-field.required-2fa input {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.security-panel .security-2fa-secret-box {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.security-secret {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 800;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
}

.security-2fa-secret-box textarea {
  min-height: 74px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: calc(11px * var(--app-font-scale));
}

.compact-security-form {
  max-width: 460px;
}

.security-note-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: calc(13px * var(--app-font-scale));
}

body[data-theme="dark"] .security-secret {
  background: #111827;
  border-color: rgba(148, 163, 184, .35);
  color: #f8fbff;
}

.two-factor-login-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.two-factor-login-card {
  width: min(420px, calc(100vw - 28px));
  display: grid;
  gap: 12px;
}

.two-factor-login-card label {
  display: grid;
  gap: 6px;
}

.two-factor-login-card input {
  text-align: center;
  font-size: calc(22px * var(--app-font-scale));
  font-weight: 800;
  letter-spacing: .12em;
}

.two-factor-login-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.two-factor-login-actions button {
  width: auto;
  min-width: 120px;
}

body[data-theme="dark"] .two-factor-login-card {
  background: #111827;
  color: #f8fbff;
  border-color: rgba(148, 163, 184, .35);
}

.dashboard-task-split-panel {
  min-height: calc(100vh - 128px);
}

.dashboard-task-split,
.tasks-split-inner {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.dashboard-task-split {
  grid-template-rows: minmax(0, 1fr) minmax(180px, .8fr);
  height: calc(100% - 54px);
}

.dashboard-task-split-section,
.task-column-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.dashboard-task-split-section.review-section,
.task-column-section.done-section {
  border-top-style: dashed;
}

.task-split-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: calc(12px * var(--app-font-scale));
  font-weight: 800;
  text-transform: uppercase;
}

.task-split-title strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-size: calc(12px * var(--app-font-scale));
}

.task-split-title.review strong {
  background: #fff7cc;
  border-color: #facc15;
  color: #78350f;
}

.task-split-title.muted {
  color: var(--muted);
}

.task-split-list {
  min-height: 0;
  overflow: auto;
}

.tasks-split-screen {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .75fr);
  align-items: stretch;
}

.tasks-split-screen .panel {
  min-height: calc(100vh - 126px);
}

.tasks-split-left,
.tasks-split-right {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.tasks-split-right {
  border-left: 3px solid #facc15;
}

.review-task-list .task-row,
.review-task-list .dashboard-mini-task-card {
  border-color: #facc15;
}

body[data-theme="dark"] .task-split-title.review strong {
  background: #facc15;
  color: #111827;
  border-color: #fde68a;
}

body[data-theme="dark"] .task-split-title strong {
  background: #111827;
  color: #f8fbff;
  border-color: rgba(148, 163, 184, .35);
}

body[data-theme="dark"] .task-split-title.review strong {
  background: #facc15;
  color: #111827;
  border-color: rgba(250, 204, 21, .75);
}

.inventory-count-table input,
.inventory-count-table textarea {
  width: 100%;
  min-width: 0;
  font-size: calc(12px * var(--app-font-scale));
}

.inventory-count-table textarea {
  min-height: 44px;
  resize: vertical;
}

.inventory-replacement-grid {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}

.inventory-replacement-row {
  display: grid;
  grid-template-columns: 110px minmax(180px, 1fr) minmax(140px, .7fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.vehicle-attachment-thumb-wrap {
  position: relative;
  display: grid;
  min-width: 0;
}

.vehicle-attachment-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
}

.vehicle-attachment-file-icon {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 62px;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: calc(10px * var(--app-font-scale));
  font-weight: 800;
}

body[data-theme="dark"] .inventory-replacement-row,
body[data-theme="dark"] .vehicle-attachment-file-icon {
  background: #111827;
  color: #f8fbff;
  border-color: rgba(148, 163, 184, .35);
}

body[data-theme="dark"] .tasks-split-right {
  border-left-color: #facc15;
}

@media (max-width: 980px) {
  .tasks-split-screen {
    grid-template-columns: 1fr;
  }

  .tasks-split-screen .panel {
    min-height: auto;
  }

  .tasks-split-right {
    border-left: 0;
    border-top: 3px solid #facc15;
  }

  .dashboard-task-split {
    height: auto;
    grid-template-rows: auto auto;
  }
}

.dashboard-task-split .dashboard-mini-task-list {
  align-content: start;
  grid-auto-rows: minmax(68px, max-content);
}

.dashboard-task-split .dashboard-mini-task-card {
  min-height: 68px;
  height: auto;
  align-self: start;
}

.tasks-split-stacked-screen {
  grid-template-columns: 1fr;
}

.tasks-split-stacked-screen .panel {
  min-height: auto;
}

.tasks-split-top {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(64vh - 92px);
}

.tasks-review-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.tasks-review-top-grid .task-column-section {
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.task-review-column {
  border-color: rgba(250, 204, 21, .72) !important;
}

.tasks-split-done {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(36vh - 60px);
}

body[data-theme="dark"] .tasks-review-top-grid .task-column-section {
  background: #111827;
  border-color: rgba(148, 163, 184, .35);
}

body[data-theme="dark"] .task-review-column {
  border-color: rgba(250, 204, 21, .72) !important;
}

@media (max-width: 980px) {
  .tasks-review-top-grid {
    grid-template-columns: 1fr;
  }

  .tasks-split-top,
  .tasks-split-done {
    min-height: auto;
  }
}
