@font-face {
  font-family: "Bahnschrift";
  src: url("../fonts/bahnschrift.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --primary: #ed1c24;
  --primary-dark: #c9151c;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: rgba(0, 0, 0, 0.87);
  --muted: rgba(0, 0, 0, 0.6);
  --border: #e0e0e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Bahnschrift", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  background: var(--primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100000;
}

.large-interventions-page .topbar {
  position: static;
  z-index: auto;
}

.topbar-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar-logo {
  height: 44px;
  width: auto;
  display: block;
}

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

.container {
  max-width: 100%;
  margin: 24px auto;
  padding: 0;
}

.panel,
.hero-card,
.stat-card,
.detail-card,
.subpanel,
.module-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.page-grid {
  display: grid;
  gap: 16px;
}

.page-grid > * {
  min-width: 0;
}

.module-grid,
.stats-grid,
.details-grid,
.preset-grid {
  display: grid;
  gap: 16px;
}

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

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

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

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

.stats-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.details-grid,
.page-grid.two-columns,
.form-grid,
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.button,
.primary-button,
.secondary-button,
.table-action,
.invoice-tab,
.invoice-row-remove,
.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.button:hover,
.primary-button:hover,
.secondary-button:hover,
.table-action:hover,
.invoice-tab:hover,
.invoice-row-remove:hover,
.login-submit:hover {
  opacity: 0.96;
}

.button-primary,
.primary-button {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.button-primary:hover,
.primary-button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.spin-report-button {
  background: #c1121f;
  border-color: #c1121f;
  color: #fff;
}

.spin-report-button:hover {
  background: #990d18;
  border-color: #990d18;
}

.spin-report-button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary-button {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.secondary-button.is-small,
.primary-button.is-small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.is-active-positive {
  background: #e8f6ea;
  border-color: #7bc58a;
  color: #1f7a1f;
}

.is-active-negative {
  background: #fdecec;
  border-color: #e5a4a4;
  color: #b12222;
}

.hero-card,
.panel,
.subpanel,
.detail-card,
.stat-card {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.lead,
.stat-label,
.detail-label,
.module-card p,
.muted {
  color: var(--muted);
}

.settings-upload-preview {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.settings-upload-thumb-link {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
}

.settings-upload-thumb {
  max-width: min(100%, 320px);
  max-height: 140px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  object-fit: contain;
}

/* Road-closure positioning and review. */
.vehicle-road-closures-panel {
  display: grid;
  gap: 16px;
}

.vehicle-road-closures-panel .panel-header {
  align-items: end;
}

.vehicle-road-closures-panel .panel-header > .muted {
  max-width: 620px;
  margin: 0;
  text-align: right;
}

.vehicle-road-closure-editor {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 1fr);
  gap: 16px 22px;
  padding: 18px;
  border: 1px solid #fecaca;
  border-left: 5px solid #ed1c24;
  border-radius: 18px;
  background: #fff7f7;
}

.vehicle-road-closure-editor[hidden] {
  display: none;
}

.vehicle-road-closure-editor h3,
.vehicle-road-closure-editor p {
  margin: 0;
}

.vehicle-road-closure-editor > div:first-child > p:last-child {
  margin-top: 7px;
  color: #6b7280;
}

.vehicle-road-closure-editor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.vehicle-road-closure-editor-fields label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.vehicle-road-closure-editor .actions,
.vehicle-road-closure-editor .form-status {
  grid-column: 1 / -1;
}

.vehicle-road-closure-editor .form-status {
  min-height: 20px;
  margin: 0;
  color: #17693a;
  font-weight: 800;
}

.vehicle-road-closure-editor .form-status.is-error,
.road-closure-missing {
  color: #b5121b;
}

.vehicle-tracking-map.is-road-closure-editing,
.vehicle-tracking-map.is-road-closure-editing .leaflet-interactive {
  cursor: crosshair !important;
}

.vehicle-road-closures-table {
  min-width: 980px;
}

.vehicle-road-closures-table td {
  vertical-align: middle;
}

.vehicle-road-closures-table tr.road-closure-needs-review td:not(.functions-cell) {
  background: #fff7ed;
}

.road-closure-confidence {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

.road-closure-confidence.is-high {
  background: #dcfce7;
  color: #166534;
}

.road-closure-confidence.is-medium {
  background: #fef3c7;
  color: #92400e;
}

.road-closure-confidence.is-low {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 820px) {
  .vehicle-road-closures-panel .panel-header {
    align-items: start;
  }

  .vehicle-road-closures-panel .panel-header > .muted {
    text-align: left;
  }

  .vehicle-road-closure-editor {
    grid-template-columns: 1fr;
  }

  .vehicle-road-closure-editor-fields {
    grid-template-columns: 1fr;
  }

  .vehicle-road-closure-editor .actions .primary-button,
  .vehicle-road-closure-editor .actions .secondary-button,
  .vehicle-road-closures-table .secondary-button {
    width: auto !important;
  }
}

.settings-form label {
  align-content: start;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.module-card {
  min-height: 180px;
  padding: 48px 30px 34px;
  display: grid;
  gap: 14px;
}

.module-card strong {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.module-card p {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.35;
}

.module-card-label {
  display: none;
}

.stat-card {
  display: grid;
  gap: 10px;
}

.stat-card strong {
  font-size: 32px;
  line-height: 1;
}

.stat-card-alert strong {
  color: var(--primary);
}

.button-row,
.form-actions,
.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.load-more-actions {
  margin-top: 18px;
}

.segmented-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stack-form,
.invoice-form,
.login-form {
  display: grid;
  gap: 16px;
}

.form-group {
  display: grid;
  gap: 8px;
  width: 100%;
}

label {
  display: grid;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.input,
.select,
.textarea,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  font-family: inherit;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  display: block !important;
  height: 48px !important;
  min-height: 48px !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  background-color: #fff !important;
  color: var(--text) !important;
  font-family: "Bahnschrift", Arial, Helvetica, sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  box-shadow: none;
}

textarea,
.textarea {
  min-height: 140px;
  resize: vertical;
  padding-top: 14px;
}

select[multiple] {
  min-height: 180px;
  padding-top: 10px;
}

.floating-select {
  position: relative;
  width: 100%;
}

.floating-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.floating-select-button {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 40px 12px 14px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  position: relative;
  box-sizing: border-box;
}

.floating-select-button::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  opacity: 0.65;
}

.floating-select.is-open .floating-select-button {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12);
}

.floating-select-button:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12);
}

.floating-select.is-invalid .floating-select-button {
  border-color: var(--primary);
}

.floating-select-menu {
  display: none;
  position: fixed;
  max-height: calc(var(--floating-select-visible-options, 6) * 46px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  z-index: 2000000;
  padding: 6px;
  box-sizing: border-box;
}

.floating-select.is-open .floating-select-menu {
  display: block;
}

.floating-select-option {
  display: block;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
}

.floating-select-option:hover,
.floating-select-option[aria-selected="true"] {
  background: rgba(237, 28, 36, 0.09);
  color: var(--primary);
}

.event-search-select {
  position: relative;
  display: block;
  width: 100%;
}

.event-search-select input {
  width: 100%;
  padding-right: 40px;
}

.event-search-select::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  color: var(--text);
  opacity: 0.65;
  pointer-events: none;
}

.event-search-select.is-open input {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12);
}

.event-search-select-menu {
  display: none;
  position: fixed;
  max-height: calc(6 * 46px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  z-index: 2000000;
  padding: 6px;
  box-sizing: border-box;
}

.event-search-select.is-open .event-search-select-menu {
  display: block;
}

.event-search-select-option {
  display: block;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.event-search-select-option:hover,
.event-search-select-option[aria-selected="true"] {
  background: rgba(237, 28, 36, 0.09);
  color: var(--primary);
}

.native-select-proxy {
  display: none !important;
}

.inline-status-form .floating-select-button {
  min-height: 36px;
  padding: 6px 30px 6px 10px;
  color: inherit;
  font-size: 14px;
}

.input:focus,
.select:focus,
.textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12);
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
  color: rgba(0, 0, 0, 0.45);
  font-weight: 500;
}

.span-two {
  grid-column: 1 / -1;
}

.profile-permissions-page {
  gap: 22px;
}

.profile-permissions-hero .panel-header {
  align-items: flex-start;
}

.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.profile-summary-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fafc;
}

.profile-summary-card span,
.profile-summary-card small {
  display: block;
  color: var(--muted);
}

.profile-summary-card span {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-summary-card strong {
  display: block;
  color: var(--text);
  font-size: 28px;
  line-height: 1.1;
}

.profile-summary-card small {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.profile-permissions-table td:first-child {
    font-weight: 800;
}

.profile-task-center {
  min-width: 0;
}

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

.profile-summary-card.needs-attention {
  border-color: #f7c8ca;
  background: #fff7f7;
}

.profile-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  min-width: 0;
}

.profile-task-panel,
.profile-task-panel .panel-header,
.profile-task-list {
  min-width: 0;
}

.profile-events-panel {
  grid-column: 1 / -1;
}

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

.profile-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 15px 16px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  text-decoration: none;
}

.profile-task-item + .profile-task-item {
  margin-top: 10px;
}

.profile-task-item > div {
  min-width: 0;
}

.profile-task-item strong,
.profile-task-item span {
  display: block;
}

.profile-task-item > div > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-task-item > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.profile-task-link:hover {
  border-color: #f3a9ac;
  background: #fff7f7;
}

.profile-status-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: #475569;
  background: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.profile-status-badge.is-valid {
  color: #166534;
  background: #dcfce7;
}

.profile-status-badge.is-warning {
  color: #92400e;
  background: #fef3c7;
}

.profile-status-badge.is-expired {
  color: #991b1b;
  background: #fee2e2;
}

.profile-status-badge.is-missing {
  color: #475569;
  background: #e2e8f0;
}

.profile-empty-state {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}

.profile-empty-state strong,
.profile-empty-state p {
  display: block;
  margin: 0;
}

.profile-empty-state p {
  margin-top: 5px;
  color: var(--muted);
}

.profile-empty-state.is-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

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

@media (max-width: 760px) {
  .profile-task-grid,
  .profile-task-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-events-panel {
    grid-column: auto;
  }

  .profile-task-panel .panel-header {
    align-items: flex-start;
  }

  .profile-task-panel .panel-header .secondary-button {
    width: auto;
  }

  .profile-task-item {
    align-items: flex-start;
  }

  .profile-task-item > div > strong {
    white-space: normal;
  }
}

.sms-page {
    display: grid;
    gap: 24px;
    min-width: 0;
}

.sms-hero-panel .panel-header {
    align-items: flex-start;
}

.sms-page .panel,
.sms-page .form-grid,
.sms-page label,
.sms-page .table-wrap {
    min-width: 0;
}

.sms-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.sms-stat-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    color: #111827;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.sms-stat-card span,
.sms-detail-card span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sms-stat-card strong {
    font-size: 24px;
}

.sms-alert-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 800;
}

.sms-setup-warning {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #fbbf24;
    border-radius: 14px;
    background: #fffbeb;
    color: #92400e;
    font-weight: 700;
}

.sms-setup-warning code {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(146, 64, 14, 0.08);
    color: inherit;
}

.sms-compose-grid {
    align-items: start;
}

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

.sms-compose-form select[multiple] {
    min-height: 168px;
}

.sms-groups-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.sms-group-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.sms-group-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sms-group-card-header > div:first-child {
    min-width: 0;
    text-align: left;
}

.sms-page [data-sms-group-create-panel][hidden],
.sms-page [data-sms-group-panel][hidden] {
    display: none !important;
}

.sms-group-form,
.sms-group-edit-form {
    margin-top: 14px;
}

.sms-group-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}

.sms-group-card-header h3 {
    margin: 0 0 2px;
    font-size: 18px;
}

.sms-group-card-header p {
    margin: 0 0 2px;
    color: var(--muted);
}

.sms-group-members {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f9fafb;
}

.sms-group-member {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.sms-group-member small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.sms-selected-recipients {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
}

.sms-selected-recipient-list {
    min-height: 36px;
}

.sms-selected-chip {
    cursor: pointer;
}

.sms-page input,
.sms-page select,
.sms-page textarea {
    max-width: 100%;
}

.sms-message-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
}

.sms-unicode-warning {
    color: #b45309;
    font-weight: 800;
}

.sms-inline-checkbox {
    width: auto;
    margin-left: auto;
    margin-right: 6px;
    padding-inline: 14px;
    border-radius: 12px;
    flex-shrink: 0;
}

.sms-recipient-preview {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
}

.sms-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sms-recipient-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sms-recipient-list span {
    display: inline-flex;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 800;
    font-size: 13px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.sms-recipient-list span.is-invalid {
    background: #fee2e2;
    color: #991b1b;
}

.sms-config-state,
.sms-detail-card {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f9fafb;
    margin-bottom: 16px;
}

.sms-config-state span {
    color: #6b7280;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 12px;
}

.sms-detail-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.sms-message-preview {
    margin-top: 18px;
    padding: 18px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    white-space: pre-wrap;
    font-weight: 700;
}

.sms-test-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.sms-page .form-actions {
    gap: 10px;
    flex-wrap: wrap;
}

.sms-page .form-actions > .primary-button,
.sms-page .form-actions > .secondary-button {
    width: auto;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.15;
}

.sms-page .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sms-page .data-table {
    min-width: 760px;
}

.sms-page .action-cell {
    white-space: nowrap;
}

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

@media (max-width: 700px) {
    .sms-stat-grid,
    .sms-detail-grid {
        grid-template-columns: 1fr;
    }

    .sms-page {
        gap: 16px;
    }

    .sms-page .panel {
        padding: 18px;
        border-radius: 18px;
    }

    .sms-page .panel-header {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .sms-page .form-grid,
    .sms-page .page-grid.two-columns,
    .sms-page .sms-compose-grid {
        grid-template-columns: 1fr;
    }

    .sms-page .span-two {
        grid-column: auto;
    }

    .sms-message-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .sms-inline-checkbox {
        margin-left: 0;
        width: 100%;
    }

    .sms-preview-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .sms-recipient-list {
        display: grid;
        grid-template-columns: 1fr;
    }

    .sms-recipient-list span {
        border-radius: 12px;
    }

    .sms-group-card-header {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        text-align: left;
    }

    .sms-group-card-header > div:first-child {
        flex: 1 1 190px;
    }

    .sms-group-actions {
        display: grid;
        flex: 0 0 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        justify-content: stretch;
        margin-left: 0;
    }

    .sms-group-actions form,
    .sms-group-actions .secondary-button {
        width: 100%;
    }

    .sms-group-members {
        grid-template-columns: 1fr;
        max-height: 300px;
    }

    .sms-page .form-actions {
        align-items: center;
        flex-direction: row;
        width: auto;
    }

    .sms-page .form-actions > * {
        width: auto;
    }

    .sms-page .form-actions > .primary-button,
    .sms-page .form-actions > .secondary-button {
        width: auto;
        align-self: flex-start;
    }

    .sms-page .secondary-button.is-small,
    .sms-page .primary-button.is-small {
        width: auto;
        min-height: 38px;
    }

    .sms-page .action-cell {
        white-space: normal;
    }

    .sms-page .action-cell form,
    .sms-page .action-cell button {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .sms-stat-card {
        padding: 15px;
    }

    .sms-stat-card strong {
        font-size: 21px;
        overflow-wrap: anywhere;
    }
}

.permission-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.permission-pill.is-enabled {
  background: #dcfce7;
  color: #166534;
}

.permission-pill.is-disabled {
  background: #f1f5f9;
  color: #64748b;
}

.pwa-permissions-panel .notice {
  margin-top: 18px;
}

.pwa-permissions-panel .form-actions {
  margin-top: 18px;
}

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

.r1r2-date-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.r1r2-page,
.r1r2-page .panel,
.r1r2-page .form-grid,
.r1r2-page label {
  min-width: 0;
}

.r1r2-page select,
.r1r2-page input {
  width: 100%;
  min-width: 0;
}

.r1r2-page input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.r1r2-page .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.r1r2-page .data-table {
  min-width: 760px;
}

.r1r2-events-table th:first-child,
.r1r2-events-table td:first-child {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
  vertical-align: middle;
}

.r1r2-events-table td:first-child input[type="checkbox"] {
  display: inline-block !important;
  float: none !important;
  margin: 0 auto !important;
  vertical-align: middle !important;
}

.r1r2-events-table th:nth-child(2),
.r1r2-events-table td:nth-child(2) {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.r1r2-events-table th:nth-child(4),
.r1r2-events-table td:nth-child(4),
.r1r2-events-table th:nth-child(5),
.r1r2-events-table td:nth-child(5) {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
}

.r1r2-submit-actions {
  margin-top: 18px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-row input[type="checkbox"] {
  transform: scale(1);
  margin: 0;
  min-height: 18px;
  width: 18px;
  height: 18px;
}

.pocsag-manual-review-filter {
  min-height: 56px;
  padding: 0 16px;
  align-self: end;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.notice.error,
.login-error {
  background: rgba(237, 28, 36, 0.08);
  color: #b00020;
}

.notice.success {
  background: rgba(46, 125, 50, 0.1);
  color: #2e7d32;
}

.notice.warning {
  background: rgba(255, 193, 7, 0.12);
  color: #8a6500;
}

.is-hidden {
  display: none !important;
}

.invoice-create-panel,
.invoice-create-form {
  display: grid;
  gap: 24px;
}

.invoice-quick-add,
.invoice-items-panel {
  display: grid;
  gap: 18px;
}

.invoice-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.invoice-tab {
  padding: 0 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.invoice-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.invoice-calculator-total {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.invoice-add-item-button {
  justify-self: start;
  width: auto;
  padding-inline: 18px;
}

.invoice-items-table input {
  min-height: 38px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.invoice-items-table {
  table-layout: auto;
}

.invoice-items-table th:first-child,
.invoice-items-table td:first-child {
  width: 52%;
}

.invoice-items-table th:nth-child(2),
.invoice-items-table td:nth-child(2),
.invoice-items-table th:nth-child(3),
.invoice-items-table td:nth-child(3) {
  width: 1%;
  white-space: nowrap;
}

.invoice-items-table th:last-child,
.invoice-items-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.invoice-row-remove {
  min-height: 44px;
  padding-inline: 12px;
}

.invoice-view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  gap: 16px;
  align-items: start;
}

.invoice-view-main,
.invoice-summary-panel {
  display: grid;
  gap: 16px;
}

.invoice-status-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.invoice-summary-box {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.invoice-summary-box p,
.invoice-print-summary p {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
}

.invoice-summary-total,
.invoice-print-total {
  font-size: 18px;
  font-weight: 900;
}

.invoice-status-row td,
.invoice-status-row a {
  color: inherit;
}

.invoice-status-prejeto_placilo {
  color: #1b7f3a;
}

.invoice-status-izstavljen {
  color: #d31924;
}

.invoice-status-storno {
  color: #8a5a21;
}

.inline-status-form {
  margin: 0;
}

.inline-status-form select {
  min-height: 36px;
  padding: 6px 10px;
  color: inherit;
  font-size: 14px;
}

.invoice-print-body {
  background: #fff;
  color: #111;
  margin: 0;
}

.invoice-print-page {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 0 16mm 28mm;
  box-sizing: border-box;
  font-family: "Bahnschrift", Arial, Helvetica, sans-serif;
  background: #fff;
}

.invoice-letterhead {
  margin: 0 -16mm 12mm;
}

.invoice-letterhead img,
.invoice-letterfoot img {
  display: block;
  width: 100%;
  height: auto;
}

.invoice-letterfoot {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
}

.invoice-print-title-row {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 4mm;
}

.invoice-print-title-row h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.invoice-print-intro-row {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 320px);
  gap: 24mm;
  align-items: start;
  margin-bottom: 5mm;
  font-size: 16px;
}

.invoice-print-recipient {
  line-height: 1.3;
}

.invoice-print-dates {
  text-align: right;
}

.invoice-print-due {
  font-weight: 900;
}

.invoice-print-dates p,
.invoice-print-parties p,
.invoice-print-recipient p,
.invoice-print-footer p {
  margin: 0 0 4px;
}

.invoice-print-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24mm;
  margin-bottom: 12mm;
}

.invoice-print-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
  font-size: 13px;
}

.invoice-print-table th,
.invoice-print-table td {
  padding: 8px 7px;
  border-bottom: 1px solid #cfcfcf;
  text-align: left;
}

.invoice-print-table th {
  border-top: 1px solid #111;
  border-bottom: 2px solid #111;
}

.invoice-print-table th:last-child,
.invoice-print-table td:last-child {
  text-align: right;
}

.invoice-print-summary {
  display: grid;
  gap: 7px;
  max-width: 340px;
  margin: 10mm 0 0 auto;
  font-size: 13px;
}

.invoice-print-note {
  margin-top: 10mm;
  padding: 10px;
  border: 1px solid #cfcfcf;
  font-size: 13px;
}

.invoice-print-footer {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-top: 16mm;
  align-items: flex-end;
  font-size: 13px;
}

.invoice-print-footer-party {
  flex: 1 1 0;
}

.invoice-print-footer-party-right {
  text-align: right;
}

.invoice-print-footer-stamp {
  flex: 0 0 140px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.invoice-print-stamp {
  max-width: 110px;
  max-height: 110px;
  display: block;
}

.login-page {
  background: #f3f4f6;
  min-height: 100vh;
  color: #111827;
}

.login-page .container {
  max-width: none;
  margin: 0;
  padding: 0;
}

.login-shell {
  min-height: 100vh;
}

.login-topbar {
  display: block;
  min-height: 72px;
  background: linear-gradient(135deg, #ed1c24 0%, #b5121b 100%);
  width: 100%;
  box-shadow: 0 12px 30px rgba(181, 18, 27, 0.18);
}

.login-topbar-inner {
  max-width: 1120px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-layout {
  max-width: 1120px;
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 44px 28px;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 520px);
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.login-brand-side {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-brand-card {
  width: min(100%, 360px);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.login-brand-logo {
  display: block;
  width: 72%;
  max-width: 260px;
  height: auto;
}

.login-panel {
  width: 100%;
}

.login-layout > .login-panel:only-child {
  grid-column: 1 / -1;
  max-width: 520px;
  margin: 0 auto;
}

.login-panel-inner {
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 18px 45px rgba(17, 24, 39, 0.08);
  border: 1px solid #e5e7eb;
  padding: 34px 34px 30px;
  display: grid;
  justify-items: stretch;
}

.login-heading {
  margin-bottom: 28px;
  text-align: left;
}

.login-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 950;
  color: #111827;
}

.login-heading p {
  margin: 10px 0 0 0;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.45;
}

.login-page .login-form {
  gap: 14px;
  width: 100%;
  margin: 0;
}

.login-page .login-form .input {
  min-height: 52px;
  padding: 14px 16px;
  border-color: rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: #ffffff;
  color: #111827;
}

.login-page .login-form .input:focus {
  border-color: #ed1c24;
  box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.12);
}

.login-remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 11px;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.login-remember-row input {
  width: 16px;
  height: 16px;
  accent-color: #ed1c24;
  flex: 0 0 auto;
}

.login-actions {
  margin-top: 26px;
}

.login-submit {
  width: min(100%, 225px);
  min-height: 52px;
  border-radius: 14px;
  border-color: #ed1c24;
  background: #ed1c24;
  color: #fff;
  font-weight: 900;
}

.login-submit:hover {
  background: #b5121b;
  border-color: #b5121b;
}

.login-panel-inner .muted {
  width: 100%;
  color: #6b7280;
  text-align: left;
  margin-top: 18px;
}

.login-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.audit-scan-grid {
  display: grid;
  gap: 16px;
}

.audit-item-row textarea {
  min-height: 86px;
}

.inventory-audit-table th,
.inventory-audit-table td {
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}

.inventory-audit-table {
  width: 100%;
  table-layout: auto;
}

.inventory-audit-table th,
.inventory-audit-table td {
  position: static !important;
  left: auto !important;
  right: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  box-shadow: none !important;
  background-clip: padding-box;
}

.inventory-audit-table th:nth-child(2),
.inventory-audit-table td:nth-child(2) {
  max-width: 19ch !important;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.inventory-audits-list-table {
  width: max-content;
  min-width: 720px;
}

.inventory-audits-wrap {
  max-width: 100%;
  min-width: 0;
}

.inventory-audit-table tr.audit-status-ok td {
  background: #eef9ef !important;
}

.inventory-audit-table tr.audit-status-not_ok td {
  background: #fff1f1 !important;
}

.inventory-audit-divider-row td {
  padding: 0 !important;
  background: #fff !important;
  border-bottom: 0;
}

.inventory-audit-divider-label {
  display: block;
  margin: 8px 0 0;
  padding: 10px 12px 8px;
  border-top: 3px solid var(--primary);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.audit-item-highlight td {
  background: #fff4cc !important;
  transition: background 0.2s ease;
}

.label-print-grid {
  display: grid;
  gap: 16px;
}

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

.label-page {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0;
  width: 51mm;
}

.label-sheet {
  width: 51mm;
  min-height: 25mm;
  padding: 0;
}

.inventory-label {
  width: 51mm;
  height: 25mm;
  border: 0;
  padding: 1.5mm 2mm 1.2mm;
  overflow: hidden;
  page-break-inside: avoid;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 0.3mm;
}

.inventory-label-name,
.inventory-label-location,
.inventory-label-owner,
.inventory-label-code {
  line-height: 1.05;
  word-break: break-word;
}

.inventory-label-name {
  font-size: 9pt;
  font-weight: 800;
  text-transform: uppercase;
}

.inventory-label-location {
  font-size: 8pt;
  font-weight: 700;
  text-transform: uppercase;
}

.inventory-label-owner {
  font-size: 7pt;
  font-weight: 700;
}

.inventory-label-code {
  font-size: 8pt;
  font-weight: 800;
}

.data-table,
.print-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.data-table th,
.data-table td,
.print-table th,
.print-table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.data-table th,
.print-table th {
  font-weight: 700;
  background: #fff;
}

.data-table th:last-child,
.data-table td:last-child,
.print-table th:last-child,
.print-table td:last-child {
  border-right: none;
}

.data-table tr:last-child td,
.print-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:nth-child(even) td {
  background: #f7f7f7;
}

.data-table .action-cell {
  background: #eeeeee !important;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.data-table .action-cell a {
  color: var(--text);
  text-decoration: none;
}

.data-table .action-cell a:hover {
  color: var(--primary);
}

.members-data-table td.table-cell-link,
.vehicles-data-table td.table-cell-link,
.equipment-data-table td.table-cell-link {
  padding: 0 !important;
}

.members-data-table td.table-cell-link > .table-cell-link-target,
.vehicles-data-table td.table-cell-link > .table-cell-link-target,
.equipment-data-table td.table-cell-link > .table-cell-link-target {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 48px;
  align-items: center;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
}

.members-data-table td.table-cell-link > .table-cell-link-target:hover,
.vehicles-data-table td.table-cell-link > .table-cell-link-target:hover,
.equipment-data-table td.table-cell-link > .table-cell-link-target:hover {
  color: var(--primary);
}

.wide-table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  contain: inline-size;
}

.equipment-table-wrap {
  max-height: 70vh;
  overflow: auto;
}

.equipment-table-wrap .equipment-data-table th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.equipment-table-wrap .equipment-data-table th:nth-child(1),
.equipment-table-wrap .equipment-data-table th:nth-child(2),
.equipment-table-wrap .equipment-data-table th:last-child {
  z-index: 7;
}

.wide-data-table {
  width: max-content;
}

.equipment-data-table {
  min-width: 2700px;
}

.vehicles-data-table {
  min-width: 3600px;
}

.equipment-data-table th:nth-child(2),
.equipment-data-table td:nth-child(2) {
  min-width: 420px;
  max-width: none;
  white-space: normal;
  word-break: break-word;
}

.wide-data-table th,
.wide-data-table td {
  white-space: nowrap;
}

.wide-data-table th:nth-child(1),
.wide-data-table td:nth-child(1),
.wide-data-table th:nth-child(2),
.wide-data-table td:nth-child(2),
.wide-data-table th:last-child,
.wide-data-table td:last-child {
  position: sticky;
  z-index: 3;
  background: #fff;
}

.wide-data-table tbody tr:nth-child(even) td:nth-child(1),
.wide-data-table tbody tr:nth-child(even) td:nth-child(2),
.wide-data-table tbody tr:nth-child(even) td:last-child {
  background: #f7f7f7;
}

.wide-data-table th:nth-child(1),
.wide-data-table td:nth-child(1) {
  left: 0;
  min-width: 110px;
  max-width: 110px;
}

.wide-data-table th:nth-child(2),
.wide-data-table td:nth-child(2) {
  left: 110px;
  min-width: 240px;
  max-width: 240px;
  box-shadow: 8px 0 14px rgba(17, 24, 39, 0.08);
}

.wide-data-table th:nth-child(1),
.wide-data-table th:nth-child(2),
.wide-data-table th:last-child {
  z-index: 4;
}

.vehicle-tracking-page {
  gap: 18px;
}

.vehicle-tracking-map-panel {
  overflow: hidden;
}

.public-tracking-topbar {
  min-height: 72px;
  padding: 12px 26px;
  border: 0;
  background: linear-gradient(135deg, #ed1c24 0%, #b5121b 100%);
  box-shadow: 0 12px 30px rgba(181, 18, 27, 0.18);
}

.public-tracking-topbar .topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.public-tracking-topbar-title {
  display: grid;
  gap: 2px;
  color: #fff;
}

.public-tracking-topbar-title strong {
  font-size: 16px;
  line-height: 1.1;
}

.public-tracking-topbar-title span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.vehicle-tracking-public-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 14px 38px rgba(15, 23, 42, 0.06);
}

.vehicle-tracking-public-hero h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.vehicle-tracking-public-hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 17px;
  line-height: 1.4;
}

.vehicle-tracking-public-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff1f2;
  color: #b5121b;
  font-size: 13px;
  font-weight: 950;
}

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

.meratch-table {
  min-width: 1120px;
}

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

.json-details summary {
  cursor: pointer;
  font-weight: 800;
}

.json-preview {
  max-width: 520px;
  max-height: 320px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7f7f7;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.vehicle-tracking-live-layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.vehicle-tracking-interventions {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 4px;
}

.vehicle-tracking-public-unit,
.vehicle-tracking-panel-section {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.vehicle-tracking-public-unit {
  padding: 20px;
}

.vehicle-tracking-public-unit h2,
.vehicle-tracking-map-card-header h2,
.vehicle-tracking-section-heading h3 {
  margin: 0;
  color: #111827;
}

.vehicle-tracking-public-unit h2 {
  font-size: 24px;
}

.vehicle-tracking-public-unit p:not(.eyebrow) {
  margin: 9px 0 0;
  color: #6b7280;
  line-height: 1.42;
}

.vehicle-tracking-panel-section {
  padding: 16px;
}

.vehicle-tracking-section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.vehicle-tracking-section-heading h3 {
  font-size: 16px;
  font-weight: 950;
}

.vehicle-tracking-section-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.vehicle-tracking-section-dot.is-danger {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.vehicle-tracking-section-dot.is-info {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.vehicle-tracking-section-dot.is-success {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.pocsag-intervention-list {
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.pocsag-intervention-list > p.muted {
  display: grid;
  gap: 6px;
  min-height: 132px;
  align-content: center;
  margin: 0;
  padding: 18px;
  border: 1px dashed #d1d5db;
  border-radius: 16px;
  background: #f9fafb;
  color: #6b7280;
  text-align: center;
}

.pocsag-intervention-list > p.muted::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0 auto 4px;
  border-radius: 50%;
  background: #eef2ff;
  color: #2563eb;
  font-weight: 950;
}

.pocsag-intervention-list > p.muted::after {
  content: "Ko bo dogodek objavljen, bo prikazan tukaj.";
  color: #6b7280;
  font-size: 13px;
  font-weight: 650;
}

.pocsag-intervention-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pocsag-intervention-card p {
  display: grid;
  gap: 2px;
  margin: 0;
  line-height: 1.25;
}

.pocsag-intervention-card span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.pocsag-intervention-card strong {
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pocsag-intervention-card a {
  color: #b5121b;
  text-decoration: underline;
}

.pocsag-audio-button {
  justify-self: start;
  margin-top: 2px;
}

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

.vehicle-public-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
}

.vehicle-public-card strong,
.vehicle-public-card span {
  display: block;
}

.vehicle-public-card strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.2;
}

.vehicle-public-card span {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.3;
}

.vehicle-public-card .vehicle-status {
  flex: 0 0 auto;
  font-size: 12px;
  font-style: normal;
}

.vehicle-tracking-empty-state {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 18px;
  border: 1px dashed #d1d5db;
  border-radius: 16px;
  background: #f9fafb;
  color: #6b7280;
  text-align: center;
}

.vehicle-tracking-empty-state > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef2ff;
  color: #2563eb;
  font-size: 24px;
  line-height: 1;
}

.vehicle-tracking-empty-state strong {
  color: #111827;
}

.vehicle-tracking-empty-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.vehicle-tracking-legend {
  display: grid;
  gap: 10px;
}

.vehicle-tracking-legend span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #374151;
  font-size: 14px;
  font-weight: 750;
}

.legend-marker {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: #ed1c24;
  box-shadow: inset 0 0 0 3px #ffffff, 0 0 0 1px #e5e7eb;
}

.legend-intervention {
  border-radius: 50%;
  background: #111827;
}

.legend-road-closure {
  border-radius: 4px;
  background: #111827;
  box-shadow: inset 0 0 0 3px #f97316, 0 0 0 1px #e5e7eb;
}

.legend-last {
  background: #16a34a;
}

.legend-empty {
  background: #d1d5db;
}

.vehicle-tracking-map-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 14px 38px rgba(15, 23, 42, 0.06);
}

.vehicle-tracking-map-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.vehicle-tracking-map-card-header h2 {
  font-size: 22px;
}

.vehicle-tracking-map-shell {
  min-height: 650px;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
}

.vehicle-tracking-map {
  min-height: 650px;
  width: 100%;
  z-index: 1;
}

.leaflet-container svg {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  flex: initial;
}

.vehicle-tracking-embed-page {
  background: #e5e7eb;
}

.vehicle-tracking-embed-page .app-shell,
.vehicle-tracking-embed-page .container,
.vehicle-tracking-embed,
.vehicle-tracking-embed .vehicle-tracking-map-shell,
.vehicle-tracking-embed .vehicle-tracking-map {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
}

.vehicle-tracking-embed-page .container {
  max-width: none;
  margin: 0;
  padding: 0;
}

.vehicle-tracking-embed-page.has-app-sidebar .app-sidebar,
.vehicle-tracking-embed-page .app-topbar,
.vehicle-tracking-embed-page .topbar {
  display: none !important;
}

.vehicle-tracking-embed-page.has-app-sidebar .app-shell {
  display: block !important;
  grid-template-columns: none !important;
}

.vehicle-tracking-embed .vehicle-tracking-map-shell {
  overflow: hidden;
}

.vehicle-tracking-map-status {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 500;
  width: fit-content;
  max-width: calc(100% - 32px);
  padding: 8px 11px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  pointer-events: none;
}

.vehicle-tracking-map-status:empty {
  display: none;
}

.vehicle-tracking-marker {
  border: 0;
  background: transparent !important;
}

.pocsag-intervention-marker {
  border: 0;
  background: transparent !important;
}

.pocsag-intervention-marker span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: #111827;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.36);
}

.vehicle-road-closure-marker {
  border: 0;
  background: transparent !important;
}

.vehicle-road-closure-marker span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: #111827;
  border: 3px solid #f97316;
  border-radius: 8px;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.36);
}

.vehicle-road-warning {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(249, 115, 22, 0.4);
  border-radius: 10px;
  background: rgba(249, 115, 22, 0.12);
  color: #7c2d12;
  font-size: 13px;
  font-weight: 800;
}

.vehicle-road-warning strong,
.vehicle-road-warning span {
  color: inherit;
}

.vehicle-marker-symbol {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
}

.vehicle-marker-direction {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 3px;
  height: 14px;
  background: #ed1c24;
  border: 1px solid #fff;
  border-radius: 999px;
  transform-origin: 50% 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
}

.vehicle-marker-direction::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -4px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid #ed1c24;
  transform: translateX(-50%);
}

.vehicle-marker-box,
.vehicle-tracking-marker .vehicle-marker-box {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: #ed1c24;
  border: 3px solid #fff;
  border-radius: 3px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.36);
}

.vehicle-marker-status-online .vehicle-marker-box {
  border-color: #1f8f4d;
}

.vehicle-marker-status-zakasnitev .vehicle-marker-box {
  border-color: #d6a400;
}

.vehicle-marker-status-offline .vehicle-marker-box {
  border-color: #6b7280;
}

.vehicle-marker-followed .vehicle-marker-box {
  outline: 3px solid rgba(237, 28, 36, 0.34);
  outline-offset: 3px;
}

.vehicle-marker-speed,
.vehicle-tracking-marker .vehicle-marker-speed {
  display: block;
  min-width: 52px;
  margin-top: 2px;
  padding: 2px 4px;
  background: #ed1c24;
  border: 2px solid #fff;
  border-radius: 3px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.3);
}

.vehicle-tracking-popup p {
  margin: 0 0 6px;
}

.vehicle-tracking-popup a,
.vehicle-tracking-table a {
  color: var(--primary-dark);
  text-decoration: underline;
}

.vehicle-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.vehicle-status-online {
  background: rgba(31, 143, 77, 0.12);
  color: #17693a;
}

.vehicle-status-zakasnitev {
  background: rgba(214, 164, 0, 0.14);
  color: #755a00;
}

.vehicle-status-offline {
  background: rgba(107, 114, 128, 0.14);
  color: #4b5563;
}

@media (max-width: 1050px) {
  .vehicle-tracking-live-layout {
    grid-template-columns: 1fr;
  }

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

  .vehicle-tracking-public-unit {
    grid-column: 1 / -1;
  }

  .vehicle-tracking-map-shell,
  .vehicle-tracking-map {
    min-height: 560px;
  }
}

/* Large intervention diary final visual pass. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page {
  margin-top: 0;
  padding: 16px 22px !important;
  border: 0 !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  background: #ed1c24 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page .panel-header {
  min-height: 0;
  margin: 0;
  gap: 8px;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page .eyebrow {
  display: none !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page h1 {
  margin: 0 0 4px;
  color: #ffffff !important;
  font-size: 26px;
  line-height: 1.08;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92) !important;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed !important;
  background: transparent;
  color: #111827;
  font-size: 13px;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table thead th {
  height: 20px;
  padding: 2px 4px !important;
  border: 1px solid #cbd5e1 !important;
  border-right: 0 !important;
  background: #e5e7eb !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
  letter-spacing: 0;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table thead th:last-child {
  border-right: 1px solid #cbd5e1 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td {
  height: 66px;
  padding: 4px 3px !important;
  border: 1px solid rgba(255, 255, 255, 0.62) !important;
  color: #111827;
  text-align: center;
  vertical-align: middle;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table tr.large-row-not-started td {
  background-color: #ff514b !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table tr.large-row-waiting td {
  background-color: #a855f7 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table tr.large-row-in-progress td {
  background-color: #ffd84f !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table tr.large-row-closed td {
  background-color: #57d786 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table textarea,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table select,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker summary {
  min-height: 38px !important;
  height: auto;
  padding: 6px 7px !important;
  border: 1px solid #d8dee6 !important;
  border-radius: 5px !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.18;
  text-align: center;
  box-shadow: none !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table textarea {
  display: block;
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .time-field,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td:nth-child(10) input {
  min-height: 38px !important;
  padding-right: 2px !important;
  padding-left: 2px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-number-cell {
  width: 24px !important;
  padding: 0 2px !important;
  font-size: 13px;
  font-weight: 950;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-map-button {
  width: 28px !important;
  min-width: 28px !important;
  height: 38px;
  min-height: 38px;
  margin: 0 auto;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  background: #ffffff;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-map-button svg {
  width: 18px;
  height: 18px;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-waiting-checkbox {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px;
  border-radius: 4px;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-delete-button,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-open-button,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-database-badge {
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-open-button {
  border: 1px solid #15803d;
  background: #dcfce7;
  color: #166534;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-delete-button {
  border: 1px solid #dc2626;
  background: #ffffff;
  color: #dc2626;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-database-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #9ca3af;
  background: #e5e7eb;
  color: #374151;
}

/* Large intervention diary sticky and compact interaction fixes. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-change-notices {
  position: sticky !important;
  top: 0 !important;
  z-index: 2000002 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap {
  scroll-padding-top: 44px;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap .large-intervention-main-diary-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2000001 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-map-cell {
  text-align: center !important;
  vertical-align: middle !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-map-cell .diary-map-button,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-map-cell .diary-map-indicator {
  margin-right: auto !important;
  margin-left: auto !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td {
  font-weight: 400 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table textarea,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table select,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker summary {
  font-weight: 400 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu,
.unit-picker-menu.is-unit-picker-portal {
  gap: 1px !important;
  width: min(250px, calc(100vw - 28px)) !important;
  max-height: 300px;
  padding: 5px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu label,
.unit-picker-menu.is-unit-picker-portal label {
  min-height: 0 !important;
  gap: 5px !important;
  padding: 3px 4px !important;
  border-radius: 4px;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu input[type="checkbox"],
.unit-picker-menu.is-unit-picker-portal input[type="checkbox"] {
  width: 13px !important;
  min-width: 13px !important;
  height: 13px !important;
  flex: 0 0 13px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu [data-unit-manual],
.unit-picker-menu.is-unit-picker-portal [data-unit-manual] {
  min-height: 30px !important;
  margin-top: 3px !important;
  padding: 5px 7px !important;
  font-size: 12px !important;
  text-align: left !important;
}

/* Extra compact diary rows and unit menu. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td {
  font-size: 11px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table textarea,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table select,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker summary {
  font-size: 12px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table col.col-actions {
  width: 42px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table th:nth-child(17),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td:nth-child(17) {
  width: 42px !important;
  min-width: 42px !important;
  padding-right: 1px !important;
  padding-left: 1px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-delete-button,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-open-button,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-database-badge {
  min-height: 24px !important;
  padding: 4px 5px !important;
  border-radius: 4px !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu,
.unit-picker-menu.is-unit-picker-portal {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  width: 220px !important;
  padding: 3px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu label,
.unit-picker-menu.is-unit-picker-portal label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  min-height: 20px !important;
  margin: 0 !important;
  padding: 1px 3px !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.1 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu label span,
.unit-picker-menu.is-unit-picker-portal label span {
  display: inline !important;
  margin: 0 !important;
  line-height: 1.1 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu input[type="checkbox"],
.unit-picker-menu.is-unit-picker-portal input[type="checkbox"] {
  width: 11px !important;
  min-width: 11px !important;
  height: 11px !important;
  min-height: 11px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 11px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu [data-unit-manual],
.unit-picker-menu.is-unit-picker-portal [data-unit-manual] {
  min-height: 24px !important;
  margin-top: 2px !important;
  padding: 3px 5px !important;
  font-size: 11px !important;
}

/* Fixed fallback for diary header when native table sticky is unreliable. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table.has-fixed-diary-header thead {
  position: fixed !important;
  top: var(--large-intervention-sticky-header-top, 0px) !important;
  left: var(--large-intervention-sticky-header-left, 0px) !important;
  z-index: 2000001 !important;
  display: table !important;
  width: var(--large-intervention-sticky-header-width, 100%) !important;
  table-layout: fixed !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table.has-fixed-diary-header tbody {
  position: relative;
}

/* Diary table sticky header and balanced text columns. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap .large-intervention-main-diary-table thead {
  position: sticky !important;
  top: 0 !important;
  z-index: 2000001 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap .large-intervention-main-diary-table thead th {
  position: sticky !important;
  top: 0 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table col.col-info,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table col.col-notes,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table col.col-equipment {
  width: 10.5% !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table th:nth-child(6),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td:nth-child(6),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table th:nth-child(13),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td:nth-child(13),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table th:nth-child(14),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td:nth-child(14) {
  width: 10.5% !important;
  white-space: normal !important;
}

/* Fixed fallback for diary header when native table sticky is unreliable. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table.has-fixed-diary-header thead {
  position: fixed !important;
  top: var(--large-intervention-sticky-header-top, 0px) !important;
  left: var(--large-intervention-sticky-header-left, 0px) !important;
  z-index: 2000001 !important;
  display: table !important;
  width: var(--large-intervention-sticky-header-width, 100%) !important;
  table-layout: fixed !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table.has-fixed-diary-header tbody {
  position: relative;
}

/* Vehicles list: keep frozen columns above the horizontally scrolling table body/header. */
.has-app-sidebar .app-main .vehicles-data-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  background: #f8fafc !important;
}

.has-app-sidebar .app-main .vehicles-data-table thead th:nth-child(1),
.has-app-sidebar .app-main .vehicles-data-table thead th:nth-child(2) {
  z-index: 24 !important;
  background: #f8fafc !important;
}

.has-app-sidebar .app-main .vehicles-data-table thead th:nth-child(1),
.has-app-sidebar .app-main .vehicles-data-table tbody td:nth-child(1) {
  left: 0 !important;
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
}

.has-app-sidebar .app-main .vehicles-data-table thead th:nth-child(2),
.has-app-sidebar .app-main .vehicles-data-table tbody td:nth-child(2) {
  left: 64px !important;
}

.has-app-sidebar .app-main .vehicles-data-table tbody td:nth-child(1),
.has-app-sidebar .app-main .vehicles-data-table tbody td:nth-child(2) {
  z-index: 12 !important;
}

.has-app-sidebar .app-main .vehicles-data-table thead th:nth-child(2),
.has-app-sidebar .app-main .vehicles-data-table tbody td:nth-child(2) {
  box-shadow: 8px 0 14px rgba(17, 24, 39, 0.08);
}

.pwa-status-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2500000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  font-size: 14px;
  font-weight: 800;
}

.pwa-status-panel[hidden] {
  display: none;
}

.pwa-status-panel.is-warning {
  border-color: #f4b942;
  background: #fffaf0;
}

.pwa-status-panel.is-success {
  border-color: #86d5a5;
  background: #f0fdf4;
}

.audit-item-row.audit-sync-pending td {
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.45);
}

.audit-item-row.audit-sync-pending td:first-child::after {
  content: "Čaka na sinhronizacijo";
  display: block;
  margin-top: 5px;
  color: #9a5b00;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
}

.pwa-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .pwa-status-panel {
    right: 10px;
    bottom: 10px;
    left: 10px;
    align-items: stretch;
    flex-direction: column;
    max-width: none;
    overflow: hidden;
  }

  .pwa-status-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .pwa-status-actions button {
    min-width: 0;
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    white-space: normal;
  }
}

@media (max-width: 380px) {
  .pwa-status-actions {
    grid-template-columns: 1fr;
  }
}

/* Large intervention diary sticky and compact interaction fixes. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-change-notices {
  position: sticky !important;
  top: 0 !important;
  z-index: 2000002 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap .large-intervention-main-diary-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2000001 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td {
  font-weight: 400 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table textarea,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table select,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker summary {
  font-weight: 400 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu,
.unit-picker-menu.is-unit-picker-portal {
  gap: 1px !important;
  width: min(250px, calc(100vw - 28px)) !important;
  max-height: 300px;
  padding: 5px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu label,
.unit-picker-menu.is-unit-picker-portal label {
  min-height: 0 !important;
  gap: 5px !important;
  padding: 3px 4px !important;
  border-radius: 4px;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu input[type="checkbox"],
.unit-picker-menu.is-unit-picker-portal input[type="checkbox"] {
  width: 13px !important;
  min-width: 13px !important;
  height: 13px !important;
  flex: 0 0 13px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu [data-unit-manual],
.unit-picker-menu.is-unit-picker-portal [data-unit-manual] {
  min-height: 30px !important;
  margin-top: 3px !important;
  padding: 5px 7px !important;
  font-size: 12px !important;
  text-align: left !important;
}

@media (max-width: 720px) {
  .public-tracking-topbar {
    min-height: 62px;
    padding: 9px 14px;
  }

  .public-tracking-topbar-title strong {
    font-size: 14px;
  }

  .public-tracking-topbar-title span {
    font-size: 11px;
  }

  .vehicle-tracking-public-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
    border-radius: 20px;
  }

  .vehicle-tracking-public-hero h1 {
    font-size: 28px;
  }

  .vehicle-tracking-public-badge {
    width: 100%;
    justify-content: center;
  }

  .vehicle-tracking-interventions {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .vehicle-tracking-page,
  .vehicle-tracking-map-panel,
  .vehicle-tracking-live-layout,
  .vehicle-tracking-interventions {
    display: contents;
  }

  .vehicle-tracking-public-hero {
    order: -1;
  }

  .vehicle-tracking-active-section {
    order: 0;
  }

  .vehicle-tracking-map-card {
    order: 1;
  }

  .vehicle-tracking-legend-section {
    order: 2;
  }

  .vehicle-tracking-vehicles-section {
    order: 3;
  }

  .vehicle-road-closures-panel {
    order: 4;
  }

  .vehicle-tracking-latest-section {
    order: 5;
  }

  .vehicle-tracking-active-section[hidden] {
    display: none !important;
  }

  .pocsag-intervention-list {
    max-height: none;
  }

  .vehicle-tracking-map-panel {
    padding: 14px;
    border-radius: 20px;
  }

  .vehicle-tracking-map-card,
  .vehicle-tracking-map-shell {
    border-radius: 20px;
  }

  .vehicle-tracking-map-card-header {
    padding: 15px 16px;
  }

  .vehicle-tracking-map-shell,
  .vehicle-tracking-map {
    min-height: 420px;
  }
}

.pgd-admin-branding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.pgd-admin-branding-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f9fafb;
}

.pgd-admin-branding-card h3,
.pgd-admin-branding-card p {
  margin: 0;
}

.pgd-admin-branding-card > *,
.pgd-admin-branding-card label {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pgd-admin-branding-card > img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 120px;
  object-fit: contain;
  object-position: left center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.pgd-admin-branding-card .pgd-admin-file-name {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pgd-admin-branding-card input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
  white-space: nowrap;
}

.pgd-admin-branding-card input[type="file"]::file-selector-button {
  max-width: 55%;
  margin-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .pgd-admin-branding-grid {
    grid-template-columns: 1fr;
  }
}

.wide-data-table th:last-child,
.wide-data-table td:last-child {
  right: 0;
  box-shadow: -8px 0 14px rgba(17, 24, 39, 0.08);
}

.vehicles-data-table th:nth-child(1),
.vehicles-data-table td:nth-child(1) {
  left: 0;
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  text-align: center;
}

.vehicles-data-table th:nth-child(2),
.vehicles-data-table td:nth-child(2) {
  left: 64px;
  width: 1%;
  min-width: max-content;
  max-width: none;
}

.members-table-wrap {
  position: relative;
  max-width: 100%;
  max-height: 70vh;
  overflow: auto;
  contain: inline-size;
}

.members-data-table {
  width: max-content;
  min-width: 2500px;
}

.members-data-table th,
.members-data-table td {
  white-space: nowrap;
}

.members-data-table th:nth-child(1),
.members-data-table td:nth-child(1),
.members-data-table th:nth-child(2),
.members-data-table td:nth-child(2),
.members-data-table th:last-child,
.members-data-table td:last-child {
  position: sticky;
  z-index: 3;
}

.members-data-table th:nth-child(1),
.members-data-table td:nth-child(1) {
  left: 0;
  min-width: 140px;
  max-width: 140px;
  background: #fff;
}

.members-data-table th:nth-child(2),
.members-data-table td:nth-child(2) {
  left: 140px;
  min-width: 170px;
  max-width: 170px;
  background: #fff;
  box-shadow: 8px 0 14px rgba(17, 24, 39, 0.08);
}

.members-data-table th:last-child,
.members-data-table td:last-child {
  right: 0;
  min-width: 145px;
  max-width: 145px;
  box-shadow: -8px 0 14px rgba(17, 24, 39, 0.08);
}

.members-data-table th:nth-child(1),
.members-data-table th:nth-child(2),
.members-data-table th:last-child {
  z-index: 4;
}

.members-table-wrap .members-data-table th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
}

.members-table-wrap .members-data-table th:nth-child(1),
.members-table-wrap .members-data-table th:nth-child(2),
.members-table-wrap .members-data-table th:last-child {
  z-index: 7;
}

.members-data-table tbody tr:nth-child(even) td:nth-child(1),
.members-data-table tbody tr:nth-child(even) td:nth-child(2),
.members-data-table tbody tr:nth-child(even) td:last-child {
  background: #f7f7f7;
}

.activity-log-actions {
  align-items: end;
}

.activity-log-table-wrap {
  max-height: 70vh;
  overflow: auto;
}

.activity-log-table {
  width: max-content;
  min-width: 1650px;
}

.activity-log-table th,
.activity-log-table td {
  white-space: normal;
  vertical-align: top;
}

.activity-log-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
}

.activity-log-table th:nth-child(1),
.activity-log-table td:nth-child(1) {
  min-width: 170px;
}

.activity-log-table th:nth-child(2),
.activity-log-table td:nth-child(2) {
  min-width: 190px;
}

.activity-log-table th:nth-child(7),
.activity-log-table td:nth-child(7) {
  min-width: 680px;
  max-width: 820px;
}

.activity-log-details-cell details {
  display: grid;
  gap: 10px;
}

.activity-log-details-cell summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 800;
}

.activity-change-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.activity-change-row {
  display: grid;
  grid-template-columns: 170px 1fr 1fr;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.activity-change-row span {
  overflow-wrap: anywhere;
}

.activity-change-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.event-row-red td {
  color: #d71920;
}

.event-row-red-soft td {
  color: #ffffff;
  background: #ed1c24 !important;
}

.event-row-blue td {
  color: #0057b8;
}

.event-row-green td {
  color: #20803a;
}

.event-row-purple td {
  color: #7b2cbf;
}

.event-row-brown td {
  color: #8a5a2b;
}

.event-row-red .action-cell,
.event-row-red .action-cell a {
  color: #d71920;
}

.event-row-red-soft .action-cell,
.event-row-red-soft .action-cell a {
  color: #ffffff;
}

.event-row-red-soft .action-cell {
  background: #ed1c24 !important;
}

.event-row-blue .action-cell,
.event-row-blue .action-cell a {
  color: #0057b8;
}

.event-row-green .action-cell,
.event-row-green .action-cell a {
  color: #20803a;
}

.event-row-purple .action-cell,
.event-row-purple .action-cell a {
  color: #7b2cbf;
}

.event-row-brown .action-cell,
.event-row-brown .action-cell a {
  color: #8a5a2b;
}

.preset-card {
  width: 100%;
  text-align: left;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow);
}

.preset-card strong,
.preset-card span {
  display: block;
}

.preset-card span {
  margin-top: 8px;
}

.preset-calculator {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.calculator-summary {
  margin-top: 14px;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 800;
}

.preset-group-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.permissions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.event-section {
  display: grid;
  gap: 16px;
}

.compact-subpanel {
  padding: 18px;
}

.member-checklist,
.assignment-members,
.vehicle-assignment-grid {
  display: grid;
  gap: 12px;
}

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

.selected-member-box {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.selected-member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.selected-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  background: #f1f1f1;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.selected-member-chip span {
  color: var(--primary);
  font-size: 12px;
}

.event-builder .event-section {
  display: grid;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

.event-builder .event-section[hidden],
.event-builder [data-intervention-section][hidden] {
  display: none;
}

.event-section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 18px;
  align-items: start;
}

.event-duration-card {
  padding: 18px;
}

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

.vehicle-card-grid {
  align-items: start;
}

.event-check-card {
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.event-check-card small {
  color: var(--muted);
}

.pocsag-suggestion-button {
  display: block;
  justify-content: start;
  min-height: 58px;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 800;
}

.pocsag-suggestion-button.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12);
}

.event-finalize-modal {
  position: fixed;
  inset: 0;
  z-index: 3000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 25, 35, 0.58);
  backdrop-filter: blur(3px);
}

.event-finalize-dialog {
  width: min(760px, 100%);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 28px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.has-open-modal {
  overflow: hidden;
}

.event-finalize-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.event-finalize-step {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.event-finalize-close {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
  place-items: center;
  cursor: pointer;
}

.event-finalize-dialog h2 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 28px;
}

.event-finalize-intro {
  flex: 0 0 auto;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.event-finalize-summary {
  flex: 0 0 auto;
  margin-top: 20px;
  padding: 13px 16px;
  border: 1px solid;
  border-radius: 12px;
  font-weight: 900;
}

.event-finalize-summary.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.event-finalize-summary.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.event-finalize-summary.is-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.event-finalize-dialog label {
  margin-top: 16px;
}

.event-finalize-dialog .form-actions {
  margin-top: 24px;
}

.event-finalize-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  margin: 16px -8px 0 0;
  padding: 0 8px 8px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.event-finalize-check {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.event-finalize-check.is-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.event-finalize-check.is-warning {
  border-color: #fde68a;
  background: #fffdf5;
}

.event-finalize-check.is-ready {
  border-color: #d1fae5;
  background: #f8fffb;
}

.event-finalize-check-marker {
  display: grid;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  place-items: center;
}

.is-error .event-finalize-check-marker {
  background: var(--danger);
}

.is-warning .event-finalize-check-marker {
  background: var(--warning);
}

.is-ready .event-finalize-check-marker {
  background: var(--success);
}

.event-finalize-check-body h3,
.event-finalize-check-body p {
  margin: 0;
}

.event-finalize-check-body h3 {
  font-size: 16px;
}

.event-finalize-check-body p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.event-finalize-edit {
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 900;
  cursor: pointer;
}

.event-finalize-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-top: 18px !important;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.event-finalize-actions .primary-button:disabled {
  border-color: #d1d5db;
  background: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 1;
}

.vehicle-assignment-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.vehicle-assignment-card[hidden],
.event-check-card[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .event-section-header,
  .event-check-grid,
  .vehicle-card-grid {
    grid-template-columns: 1fr;
  }
}

.vehicle-assignment-grid {
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vehicle-assignment-card h3 {
  margin-bottom: 12px;
}

.events-hero {
  min-height: 180px;
  margin-bottom: 22px;
}

.events-hero p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.events-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.events-filter-panel .panel-header {
  margin-bottom: 0;
}

.events-filter-panel {
  margin-bottom: 22px;
}

.events-filter-panel form {
  margin-top: 24px;
}

.large-interventions-hero {
  min-height: 180px;
  margin-bottom: 16px;
}

.large-interventions-hero p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.large-interventions-stats,
.large-interventions-filter-panel {
  margin-bottom: 18px;
}

.large-intervention-menu-grid {
  margin: 16px 0;
}

.large-interventions-hero + .large-intervention-menu-grid,
.large-intervention-menu-grid + .panel,
.panel + .large-intervention-menu-grid {
  margin-top: 16px;
}

.large-interventions-action-panel {
  margin: 0 0 18px;
}

.large-interventions-action-panel .panel-header {
  align-items: center;
  margin-bottom: 0;
}

.large-interventions-action-panel h1 {
  margin: 2px 0 0;
}

.large-interventions-action-panel .panel-header p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
}

.large-interventions-filter-panel .panel-header {
  margin-bottom: 0;
}

.large-interventions-date-form {
  margin-top: 24px;
  align-items: end;
}

.large-intervention-form {
  align-items: start;
}

.large-intervention-crew-panel {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.large-intervention-diary-panel {
  display: grid;
  gap: 14px;
}

.vehicle-leader-title-strip {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  background: #d92d20;
  color: #fff;
}

.vehicle-leader-title-strip .eyebrow,
.vehicle-leader-title-strip h1,
.vehicle-leader-title-strip p {
  color: #fff !important;
}

.vehicle-leader-title-strip h1 {
  margin-top: 2px;
}

.large-intervention-excel-table input,
.large-intervention-excel-table select,
.large-intervention-excel-table textarea {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.large-intervention-excel-table textarea {
  min-height: 30px;
  height: auto;
  resize: none;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.large-intervention-diary-wrap {
  overflow-x: visible;
}

.large-interventions-page.has-app-sidebar .large-intervention-diary-table-section {
  width: calc(100% + 48px);
  margin-right: -24px;
  margin-left: -24px;
}

.large-interventions-page.has-app-sidebar .large-intervention-diary-table-section .large-intervention-change-notices {
  margin-right: 24px;
  margin-left: 24px;
}

.large-interventions-page.has-app-sidebar .large-intervention-diary-table-section .large-intervention-diary-wrap {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 760px) {
  .large-interventions-page.has-app-sidebar .large-intervention-diary-table-section {
    width: calc(100% + 32px);
    margin-right: -16px;
    margin-left: -16px;
  }

  .large-interventions-page.has-app-sidebar .large-intervention-diary-table-section .large-intervention-change-notices {
    margin-right: 16px;
    margin-left: 16px;
  }
}

.pocsag-suggestion-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pocsag-suggestion-card .pocsag-suggestion-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}

.ppo-guidance-card,
.ppo-guidance-compact {
  border: 1px solid rgba(237, 28, 36, 0.18);
  border-radius: 16px;
  background: #fff7f7;
  color: var(--text, #111827);
}

.ppo-guidance-card {
  padding: 16px;
}

.ppo-guidance-card p,
.ppo-guidance-card li {
  font-size: 14px;
  line-height: 1.5;
}

.ppo-guidance-card ol {
  margin: 10px 0 10px 20px;
  padding: 0;
}

.ppo-guidance-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ppo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(237, 28, 36, 0.12);
  color: #b5121b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ppo-warning-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.ppo-warning-list p {
  margin: 0;
}

.ppo-guidance-compact {
  display: grid;
  gap: 6px;
  min-width: 260px;
  padding: 10px;
}

.ppo-guidance-compact strong,
.ppo-guidance-compact small {
  display: block;
}

.large-intervention-diary-wrap .large-intervention-main-diary-table thead th {
  position: sticky;
  top: 0;
  z-index: 2000001;
  background: #f3f4f6;
  box-shadow: 0 1px 0 var(--border);
}

.large-intervention-change-notices {
  position: sticky;
  top: 0;
  z-index: 2000002;
  display: grid;
  gap: 5px;
  margin: 10px 0 14px;
  padding: 9px 12px;
  border: 1px solid #f5b7b1;
  border-radius: 6px;
  background: #fff7f6;
  color: #7a271a;
  font-size: 13px;
  font-weight: 700;
}

.large-intervention-change-notices p {
  margin: 0;
}

.large-intervention-excel-table {
  width: 100%;
  table-layout: auto;
  font-size: 10px;
}

.large-intervention-excel-table .col-number {
  width: 1%;
}

.large-intervention-excel-table .col-time {
  width: 1%;
}

.large-intervention-excel-table .col-map {
  width: 1%;
}

.large-intervention-excel-table .col-count {
  width: 1%;
}

.large-intervention-excel-table .col-actions {
  width: 1%;
}

.large-intervention-excel-table th,
.large-intervention-excel-table td {
  padding: 3px;
  white-space: normal;
  text-align: center;
  vertical-align: middle;
}

.large-intervention-excel-table th {
  text-align: center;
  vertical-align: middle;
  line-height: 1.05;
}

.large-intervention-excel-table th:nth-child(1),
.large-intervention-excel-table td:nth-child(1) {
  width: 1%;
  padding-left: 1px;
  padding-right: 1px;
  text-align: center;
  white-space: nowrap;
}

.large-intervention-excel-table th:nth-child(2),
.large-intervention-excel-table td:nth-child(2),
.large-intervention-excel-table th:nth-child(5),
.large-intervention-excel-table td:nth-child(5),
.large-intervention-excel-table th:nth-child(6),
.large-intervention-excel-table td:nth-child(6),
.large-intervention-excel-table th:nth-child(13),
.large-intervention-excel-table td:nth-child(13) {
  width: 1%;
  padding-left: 2px;
  padding-right: 2px;
  white-space: nowrap;
}

.large-intervention-excel-table .time-field {
  width: 54px;
  max-width: 54px;
  padding-left: 2px;
  padding-right: 2px;
  text-align: center;
}

.large-intervention-excel-table th:nth-child(8),
.large-intervention-excel-table td:nth-child(8) {
  width: 1%;
  padding-left: 2px;
  padding-right: 2px;
  white-space: nowrap;
}

.large-intervention-excel-table td:nth-child(8) input {
  width: 74px;
  max-width: 74px;
}

.large-intervention-excel-table th:nth-child(3),
.large-intervention-excel-table th:nth-child(4),
.large-intervention-excel-table th:nth-child(7),
.large-intervention-excel-table th:nth-child(9),
.large-intervention-excel-table th:nth-child(10),
.large-intervention-excel-table th:nth-child(11),
.large-intervention-excel-table th:nth-child(12) {
  width: auto;
}

.large-intervention-excel-table th:nth-child(14),
.large-intervention-excel-table td:nth-child(14) {
  width: 1%;
  padding-left: 1px;
  padding-right: 1px;
  white-space: nowrap;
}

.large-intervention-main-diary-table th:nth-child(3),
.large-intervention-main-diary-table td:nth-child(3),
.large-intervention-main-diary-table th:nth-child(5),
.large-intervention-main-diary-table td:nth-child(5),
.large-intervention-main-diary-table th:nth-child(8),
.large-intervention-main-diary-table td:nth-child(8),
.large-intervention-main-diary-table th:nth-child(10),
.large-intervention-main-diary-table td:nth-child(10),
.large-intervention-main-diary-table th:nth-child(11),
.large-intervention-main-diary-table td:nth-child(11),
.large-intervention-main-diary-table th:nth-child(12),
.large-intervention-main-diary-table td:nth-child(12),
.large-intervention-main-diary-table th:nth-child(13),
.large-intervention-main-diary-table td:nth-child(13) {
  width: auto;
  white-space: normal;
}

.large-intervention-main-diary-table th:nth-child(2),
.large-intervention-main-diary-table td:nth-child(2),
.large-intervention-main-diary-table th:nth-child(4),
.large-intervention-main-diary-table td:nth-child(4),
.large-intervention-main-diary-table th:nth-child(6),
.large-intervention-main-diary-table td:nth-child(6),
.large-intervention-main-diary-table th:nth-child(7),
.large-intervention-main-diary-table td:nth-child(7),
.large-intervention-main-diary-table th:nth-child(9),
.large-intervention-main-diary-table td:nth-child(9),
.large-intervention-main-diary-table th:nth-child(14),
.large-intervention-main-diary-table td:nth-child(14),
.large-intervention-main-diary-table th:nth-child(15),
.large-intervention-main-diary-table td:nth-child(15) {
  width: 1%;
  white-space: nowrap;
}

.large-intervention-main-diary-table td:nth-child(9) input {
  width: 74px;
  max-width: 74px;
}

.diary-map-cell {
  text-align: center;
}

.diary-map-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.diary-map-button span {
  display: block;
  width: 13px;
  height: 13px;
  border: 2px solid #d92d20;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.location-map-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(15 23 42 / 0.42);
}

.location-map-modal[hidden] {
  display: none;
}

.location-map-dialog {
  width: min(920px, 96vw);
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgb(15 23 42 / 0.28);
}

.location-map-header,
.location-map-search,
.location-map-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.location-map-search input {
  flex: 1;
}

.location-map-canvas {
  height: min(62vh, 560px);
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.location-map-pin-icon {
  position: relative;
  width: 30px !important;
  height: 42px !important;
  background: transparent;
  z-index: 1000 !important;
}

.location-map-pin-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 20px;
  height: 20px;
  background: #ed1c24;
  border: 3px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.28);
  transform: rotate(-45deg);
}

.location-map-pin-icon span {
  position: absolute;
  left: 12px;
  top: 9px;
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 999px;
  z-index: 1;
}

.navigation-field {
  display: flex;
  align-items: end;
}

.navigation-field .secondary-button {
  width: 100%;
  min-height: 42px;
  border-color: #b42318;
  background: #d92d20;
  color: #fff;
  justify-content: center;
}

.navigation-field .secondary-button:hover {
  background: #b42318;
}

/* Stable main diary widths. Keep these after older nth-child rules. */
.large-intervention-main-diary-table {
  table-layout: fixed;
}

.large-intervention-main-diary-table th:nth-child(1),
.large-intervention-main-diary-table td:nth-child(1) {
  width: 22px !important;
}

.large-intervention-main-diary-table th:nth-child(2),
.large-intervention-main-diary-table td:nth-child(2),
.large-intervention-main-diary-table th:nth-child(6),
.large-intervention-main-diary-table td:nth-child(6),
.large-intervention-main-diary-table th:nth-child(8),
.large-intervention-main-diary-table td:nth-child(8),
.large-intervention-main-diary-table th:nth-child(15),
.large-intervention-main-diary-table td:nth-child(15) {
  width: 58px !important;
}

.large-intervention-main-diary-table th:nth-child(4),
.large-intervention-main-diary-table td:nth-child(4) {
  width: 34px !important;
}

.large-intervention-main-diary-table th:nth-child(10),
.large-intervention-main-diary-table td:nth-child(10) {
  width: 60px !important;
}

.large-intervention-main-diary-table th:nth-child(16),
.large-intervention-main-diary-table td:nth-child(16) {
  width: 54px !important;
}

.large-intervention-main-diary-table th:nth-child(3),
.large-intervention-main-diary-table td:nth-child(3),
.large-intervention-main-diary-table th:nth-child(5),
.large-intervention-main-diary-table td:nth-child(5),
.large-intervention-main-diary-table th:nth-child(12),
.large-intervention-main-diary-table td:nth-child(12),
.large-intervention-main-diary-table th:nth-child(13),
.large-intervention-main-diary-table td:nth-child(13),
.large-intervention-main-diary-table th:nth-child(14),
.large-intervention-main-diary-table td:nth-child(14) {
  width: auto !important;
}

.large-intervention-main-diary-table th:nth-child(7),
.large-intervention-main-diary-table td:nth-child(7),
.large-intervention-main-diary-table th:nth-child(11),
.large-intervention-main-diary-table td:nth-child(11),
.large-intervention-main-diary-table th:nth-child(12),
.large-intervention-main-diary-table td:nth-child(12),
.large-intervention-main-diary-table th:nth-child(14),
.large-intervention-main-diary-table td:nth-child(14) {
  width: 1% !important;
  white-space: nowrap;
}

.large-intervention-main-diary-table th:nth-child(7),
.large-intervention-main-diary-table td:nth-child(7),
.large-intervention-main-diary-table th:nth-child(13),
.large-intervention-main-diary-table td:nth-child(13) {
  width: 15% !important;
  white-space: normal;
}

.large-intervention-main-diary-table input,
.large-intervention-main-diary-table textarea,
.large-intervention-main-diary-table select,
.large-intervention-main-diary-table .unit-picker summary {
  max-width: 100%;
}

.diary-map-button svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: #d92d20;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Final diary layout override for deployed CSS caches and the map column. */
.large-intervention-main-diary-table {
  table-layout: fixed !important;
  width: 100% !important;
}

.large-intervention-main-diary-table col.col-number {
  width: 24px !important;
}

.large-intervention-main-diary-table col.col-time {
  width: 48px !important;
}

.large-intervention-main-diary-table col.col-arrival-time {
  width: 50px !important;
}

.large-intervention-main-diary-table col.col-map {
  width: 32px !important;
}

.large-intervention-main-diary-table col.col-count {
  width: 45px !important;
}

.large-intervention-main-diary-table col.col-actions {
  width: 54px !important;
}

.large-intervention-main-diary-table col.col-waiting {
  width: 30px !important;
}

.large-intervention-main-diary-table col.col-location,
.large-intervention-main-diary-table col.col-event,
.large-intervention-main-diary-table col.col-info,
.large-intervention-main-diary-table col.col-unit,
.large-intervention-main-diary-table col.col-leader,
.large-intervention-main-diary-table col.col-contact,
.large-intervention-main-diary-table col.col-notes,
.large-intervention-main-diary-table col.col-equipment {
  width: auto !important;
}

.large-intervention-main-diary-table th,
.large-intervention-main-diary-table td {
  min-width: 0 !important;
  overflow: hidden;
}

.large-intervention-main-diary-table td.unit-picker-cell,
.large-intervention-main-diary-table td:nth-child(9) {
  position: relative;
  overflow: visible !important;
}

.large-intervention-main-diary-table tr.has-open-unit-picker,
.large-intervention-main-diary-table tr:has(.unit-picker[open]) {
  position: relative;
  z-index: 1000;
}

.large-intervention-main-diary-table tr.has-open-unit-picker td.unit-picker-cell,
.large-intervention-main-diary-table td.unit-picker-cell:has(.unit-picker[open]),
.large-intervention-main-diary-table td:nth-child(9):has(.unit-picker[open]) {
  z-index: 1001;
}

.large-intervention-main-diary-table .unit-picker,
.large-intervention-main-diary-table .unit-picker-menu {
  z-index: 1002;
}

.large-intervention-main-diary-table .unit-picker[open],
.large-intervention-main-diary-table .unit-picker[open] .unit-picker-menu {
  z-index: 10000;
}

.large-intervention-main-diary-table .unit-picker[open] .unit-picker-menu {
  position: fixed;
  top: auto;
  left: auto;
}

.unit-picker-menu.is-unit-picker-portal {
  position: fixed !important;
  z-index: 2147483000 !important;
  transform: translateZ(0);
  isolation: isolate;
}

.unit-picker-menu.is-unit-picker-portal,
.unit-picker-menu.is-unit-picker-portal * {
  backface-visibility: hidden;
}

.unit-picker-menu.is-unit-picker-portal label,
.unit-picker-menu.is-unit-picker-portal input {
  position: relative;
  z-index: 1;
}

.large-intervention-main-diary-table input,
.large-intervention-main-diary-table textarea,
.large-intervention-main-diary-table select,
.large-intervention-main-diary-table .unit-picker summary {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

.large-intervention-main-diary-table .time-field {
  width: 100% !important;
  max-width: none !important;
}

.large-intervention-main-diary-table .diary-map-button {
  width: 24px !important;
  min-width: 24px !important;
}

/* Final column sizing after diary/status column reordering. */
.large-intervention-diary-table col.col-leader {
  width: 138px !important;
}

.large-intervention-diary-table col.col-contact {
  width: 86px !important;
}

.large-intervention-diary-table col.col-equipment {
  width: 96px !important;
}

.large-intervention-diary-table col.col-info,
.large-intervention-diary-table col.col-notes {
  width: 11% !important;
}

.large-intervention-diary-table th:nth-child(11),
.large-intervention-diary-table td:nth-child(11),
.large-intervention-diary-table th:nth-child(12),
.large-intervention-diary-table td:nth-child(12),
.large-intervention-diary-table th:nth-child(14),
.large-intervention-diary-table td:nth-child(14) {
  white-space: nowrap;
}

.large-intervention-diary-table th:nth-child(6),
.large-intervention-diary-table td:nth-child(6),
.large-intervention-diary-table th:nth-child(13),
.large-intervention-diary-table td:nth-child(13) {
  width: 11% !important;
  white-space: normal;
}

.large-intervention-diary-table th:nth-child(3),
.large-intervention-diary-table td:nth-child(3),
.large-intervention-diary-table th:nth-child(5),
.large-intervention-diary-table td:nth-child(5),
.large-intervention-diary-table th:nth-child(8),
.large-intervention-diary-table td:nth-child(8) {
  width: auto !important;
  white-space: normal;
}

.large-intervention-diary-table th:nth-child(2),
.large-intervention-diary-table td:nth-child(2),
.large-intervention-diary-table th:nth-child(7),
.large-intervention-diary-table td:nth-child(7),
.large-intervention-diary-table th:nth-child(9),
.large-intervention-diary-table td:nth-child(9),
.large-intervention-diary-table th:nth-child(15),
.large-intervention-diary-table td:nth-child(15) {
  width: 48px !important;
  white-space: nowrap;
}

.large-intervention-diary-table td:nth-child(6) textarea,
.large-intervention-diary-table td:nth-child(13) textarea,
.large-intervention-diary-table td:nth-child(3) textarea,
.large-intervention-diary-table td:nth-child(5) textarea {
  line-height: 1.25;
  min-height: 30px;
  height: auto;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.large-intervention-main-diary-table th:nth-child(16),
.large-intervention-main-diary-table td:nth-child(16) {
  width: 30px !important;
  min-width: 30px !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
  text-align: center;
}

.large-intervention-main-diary-table th:nth-child(17),
.large-intervention-main-diary-table td:nth-child(17) {
  width: 54px !important;
  min-width: 54px !important;
  text-align: center;
}

.diary-waiting-cell {
  text-align: center;
}

.large-intervention-main-diary-table .diary-waiting-checkbox {
  width: 16px !important;
  min-width: 16px !important;
  height: 16px;
  margin: 0 auto;
  accent-color: #7c3aed;
}

.diary-number-cell {
  position: relative;
  font-weight: 900;
}

.large-intervention-excel-table tr.large-row-not-started td {
  background-color: #ff5f57 !important;
}

.large-intervention-excel-table tr.large-row-waiting td {
  background-color: #a855f7 !important;
}

.large-intervention-excel-table tr.large-row-in-progress td {
  background-color: #ffd54f !important;
}

.large-intervention-excel-table tr.large-row-closed td {
  background-color: #63d989 !important;
}

.large-intervention-vehicle-list tr.large-row-not-started td {
  background-color: #ff5f57 !important;
}

.large-intervention-vehicle-list tr.large-row-waiting td {
  background-color: #a855f7 !important;
}

.large-intervention-vehicle-list tr.large-row-in-progress td {
  background-color: #ffd54f !important;
}

.large-intervention-vehicle-list tr.large-row-closed td {
  background-color: #63d989 !important;
}

.large-vehicle-new-incident-bubble {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483200;
  display: grid;
  gap: 4px;
  min-width: min(360px, calc(100vw - 28px));
  max-width: min(420px, calc(100vw - 28px));
  padding: 16px 18px;
  border: 2px solid #d92d20;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.28);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.large-vehicle-new-incident-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.large-vehicle-new-incident-bubble strong {
  color: #d92d20;
  font-size: 16px;
  text-transform: uppercase;
}

.large-vehicle-new-incident-bubble span {
  font-weight: 800;
  line-height: 1.25;
}

.large-intervention-excel-table tr.is-editing-row td {
  box-shadow: inset 0 2px 0 #d6a400, inset 0 -2px 0 #d6a400;
}

.large-intervention-excel-table tr.is-locked-by-other {
  position: relative;
  z-index: 50;
}

.large-intervention-excel-table td.is-locked-cell {
  position: relative;
  overflow: visible !important;
  background-color: #ffb4ad !important;
  outline: 2px solid #d92d20;
  outline-offset: -2px;
}

.large-intervention-excel-table td.is-locked-cell::after {
  content: attr(data-lock-label);
  position: absolute;
  z-index: 2147483000;
  top: -34px;
  left: 4px;
  padding: 6px 10px;
  border: 2px solid #d92d20;
  border-radius: 6px;
  background: #fff1f0;
  color: #b42318;
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.32);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
}

.diary-actions-cell {
  text-align: center;
}

.diary-delete-button {
  width: auto;
  min-width: 0;
  height: 24px;
  padding: 2px 3px;
  border: 1px solid #d92d20;
  border-radius: 4px;
  background: #fff1f0;
  color: #b42318;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.diary-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: 24px;
  padding: 2px 5px;
  border: 1px solid #1f8f4d;
  border-radius: 4px;
  background: #ecfdf3;
  color: #166534;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.diary-database-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 2px 7px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.large-intervention-excel-table input,
.large-intervention-excel-table textarea,
.large-intervention-excel-table select,
.unit-picker summary {
  text-align: center;
}

.diary-delete-button:hover {
  background: #fee4e2;
}

.unit-picker-cell {
  position: relative;
}

.unit-picker {
  position: relative;
}

.unit-picker summary {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  list-style: none;
}

.unit-picker summary::-webkit-details-marker {
  display: none;
}

.unit-picker-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  width: 210px;
  max-height: 240px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

.unit-picker-menu label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.unit-picker-menu input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.unit-picker-menu [data-unit-manual] {
  margin-top: 4px;
}

.large-intervention-combo-menu {
  position: absolute;
  z-index: 10000;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
}

.large-intervention-combo-menu[hidden] {
  display: none;
}

.large-intervention-combo-option {
  display: block;
  width: 100%;
  min-height: 28px;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.large-intervention-combo-option:hover,
.large-intervention-combo-option:focus {
  background: #fff1f0;
  color: #b42318;
  outline: none;
}

.large-intervention-status-grid .stat-card {
}

.large-status-red {
  border-color: #d92d20 !important;
  background: #ff8a80 !important;
}

.large-status-yellow {
  border-color: #d6a400 !important;
  background: #ffe27a !important;
}

.large-status-green {
  border-color: #1f8f4d !important;
  background: #a7f3c5 !important;
}

.module-card.large-status-red,
.module-card.large-status-yellow,
.module-card.large-status-green,
.module-card.large-status-gray,
.module-card.large-status-red strong,
.module-card.large-status-yellow strong,
.module-card.large-status-green strong,
.module-card.large-status-gray strong,
.module-card.large-status-red p,
.module-card.large-status-yellow p,
.module-card.large-status-green p,
.module-card.large-status-gray p {
  color: #000 !important;
}

.large-intervention-status-panel.large-status-red,
.large-intervention-status-panel.large-status-yellow,
.large-intervention-status-panel.large-status-green,
.large-intervention-status-panel.large-status-red *,
.large-intervention-status-panel.large-status-yellow *,
.large-intervention-status-panel.large-status-green * {
  color: #101828 !important;
}

.large-status-gray {
  border-color: #667085 !important;
  background: #f2f4f7 !important;
}

.large-status-pill {
  display: inline-flex;
  min-width: 96px;
  justify-content: center;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.large-intervention-diary-table:not(.large-intervention-excel-table) th,
.large-intervention-diary-table:not(.large-intervention-excel-table) td {
  white-space: nowrap;
}

.large-intervention-status-panel {
  margin-top: 18px;
  padding: 10px 14px;
}

@media (min-width: 761px) {
  .large-interventions-page.has-app-sidebar .app-main > .app-topbar + .container > .large-intervention-status-panel.large-intervention-diary-page {
    width: calc(100% + 48px);
    max-width: none;
    margin-top: -24px !important;
    margin-right: -24px;
    margin-left: -24px;
    border-radius: 0 !important;
  }
}

.large-intervention-status-panel .panel-header {
  margin-bottom: 0;
  align-items: center;
}

.large-intervention-status-panel .eyebrow,
.large-intervention-status-panel h1,
.large-intervention-status-panel p {
  margin-top: 0;
  margin-bottom: 2px;
}

.large-intervention-status-panel h1 {
  font-size: 22px;
  line-height: 1.1;
}

.large-intervention-status-list {
  display: grid;
  gap: 10px;
}

.large-intervention-status-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.large-intervention-status-row:last-child {
  border-bottom: 0;
}

.large-intervention-map-shell {
  position: relative;
  min-height: 560px;
}

.large-map-page-panel + .large-map-page-panel {
  margin-top: 18px;
}

.large-intervention-map {
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.large-intervention-map .leaflet-overlay-pane {
  z-index: 650 !important;
}

.large-intervention-map .leaflet-tile-pane {
  z-index: 200 !important;
}

.large-intervention-map .leaflet-marker-pane {
  z-index: 700 !important;
}

.large-intervention-map .leaflet-popup-pane {
  z-index: 800 !important;
}

.large-intervention-map .large-sector-map-polygon {
  display: block !important;
  visibility: visible !important;
  stroke-opacity: 1 !important;
  stroke-width: 5px !important;
  fill-opacity: 0.18 !important;
  pointer-events: auto !important;
}

.large-intervention-map-status {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.large-intervention-map-status:empty {
  display: none;
}

.large-intervention-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
}

.large-intervention-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.large-map-actions-panel {
  padding-top: 14px;
  padding-bottom: 14px;
}

.large-sector-editor-panel {
  display: grid;
  gap: 18px;
}

.large-sector-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

.large-sector-card {
  display: grid;
  gap: 14px;
  border-top: 6px solid var(--primary);
  align-content: start;
  align-items: start;
}

.large-sector-card-head h3 {
  margin: 0;
}

.large-sector-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.large-sector-block {
  display: grid;
  gap: 8px;
}

.large-sector-block .eyebrow {
  margin-bottom: 0;
}

.large-sector-vehicle,
.large-sector-incident {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.large-sector-vehicle strong,
.large-sector-incident strong {
  font-size: 14px;
}

.large-sector-vehicle span,
.large-sector-incident span {
  color: var(--muted);
  font-size: 13px;
}

.large-sector-status-not_started {
  background: #fff1f0;
}

.large-sector-status-waiting {
  background: #f5edff;
}

.large-sector-status-in_progress {
  background: #fff8dc;
}

.large-sector-status-closed {
  background: #ecfdf3;
}

.large-sector-modal {
  max-width: 720px;
}

.large-sector-settings {
  min-width: 42px;
  padding: 0 10px;
  font-size: 20px;
  line-height: 1;
}

.large-intervention-equipment-map-marker,
.large-intervention-road-map-marker {
  background: transparent !important;
  border: 0 !important;
}

.large-map-tool-marker,
.large-map-road-marker {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.28);
}

.large-map-tool-marker svg,
.large-map-road-marker svg {
  width: 17px;
  height: 17px;
  display: block;
}

.large-map-tool-marker svg {
  fill: #fff;
}

.large-map-road-marker {
  width: 28px;
  height: 28px;
  background: #fff;
  border-color: #b42318;
}

.large-map-road-marker svg circle {
  fill: #d92d20;
}

.large-map-road-marker svg rect {
  fill: #fff;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 50%;
}

.legend-dot.is-red {
  background: #d92d20;
}

.legend-dot.is-yellow {
  background: #d6a400;
}

.legend-dot.is-green {
  background: #1f8f4d;
}

.legend-dot.is-equipment {
  background: #6b7280;
}

.legend-dot.is-road {
  background: #d92d20;
  box-shadow: inset 0 0 0 3px #fff;
  border: 1px solid #b42318;
}

.legend-vehicle-marker {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 5px;
  background: #ed1c24;
  border: 2px solid #fff;
  border-radius: 2px;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
}

.large-intervention-map-marker span {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}

.large-intervention-vehicle-marker {
  background: transparent !important;
  border: 0 !important;
}

.large-intervention-vehicle-marker .vehicle-marker-box {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: #ed1c24;
  border: 3px solid #fff;
  border-radius: 3px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.36);
}

.large-intervention-map-popup {
  display: grid;
  gap: 2px;
  min-width: 210px;
  max-width: 280px;
  font-size: 11px;
  line-height: 1.18;
}

.leaflet-popup-content .large-intervention-map-popup p {
  margin: 0 !important;
  padding: 0 !important;
}

.leaflet-popup-content .large-intervention-map-popup b {
  font-weight: 800;
}

.leaflet-popup-content .large-intervention-map-popup a {
  display: inline-block;
  margin-top: 1px;
  font-weight: 700;
}

.large-intervention-map-popup-location {
  padding: 3px 5px 4px;
  border-radius: 4px;
  color: #fff;
}

.leaflet-popup-content .large-intervention-map-popup {
  margin: -5px 8px -5px -3px !important;
}

.leaflet-popup-content:has(.large-intervention-map-popup) {
  margin: 8px 18px 8px 10px !important;
  padding-right: 8px;
}

.leaflet-popup-close-button {
  z-index: 1000;
}

.large-intervention-map-popup-location-not_started {
  background: #d92d20;
}

.large-intervention-map-popup-location-waiting {
  background: #a855f7;
}

.large-intervention-map-popup-location-in_progress {
  background: #b77900;
}

.large-intervention-map-popup-location-closed {
  background: #1f8f4d;
}

.large-intervention-crew-table th:nth-child(2),
.large-intervention-crew-table td:nth-child(2),
.large-intervention-crew-table th:nth-child(4),
.large-intervention-crew-table td:nth-child(4) {
  width: 90px;
  text-align: center;
}

.large-intervention-crew-table th:nth-child(3),
.large-intervention-crew-table td:nth-child(3),
.large-intervention-crew-table th:nth-child(5),
.large-intervention-crew-table td:nth-child(5) {
  width: 130px;
}

.large-intervention-crew-table input[type="time"] {
  min-height: 38px !important;
  height: 38px !important;
  padding: 6px 8px !important;
}

.large-intervention-summary {
  display: grid;
  gap: 14px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.large-intervention-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.large-intervention-call {
  margin: 0;
}

.danger-zone {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.danger-button {
  border-color: #c62828;
  color: #c62828;
}

.events-table td {
  font-weight: 400;
}

.events-table .action-cell,
.events-table .action-cell a,
.events-table .action-cell span {
  font-weight: 800;
}

.events-table .event-row-red td,
.events-table .event-row-red .action-cell a,
.events-table .event-row-red .action-cell span {
  color: #e51b2a;
}

.events-table .event-row-red-soft td,
.events-table .event-row-red-soft .action-cell a,
.events-table .event-row-red-soft .action-cell span {
  color: #ffffff;
}

.events-table .event-row-red-soft td {
  background: #e51b2a !important;
}

.events-table .event-row-red-soft .action-cell {
  background: #e51b2a !important;
}

.events-table .event-row-blue td,
.events-table .event-row-blue .action-cell a,
.events-table .event-row-blue .action-cell span {
  color: #1d5fbd;
}

.events-table .event-row-blue-soft td,
.events-table .event-row-blue-soft .action-cell a,
.events-table .event-row-blue-soft .action-cell span {
  color: #ffffff;
}

.events-table .event-row-blue-soft td {
  background: #1d5fbd !important;
}

.events-table .event-row-blue-soft .action-cell {
  background: #1d5fbd !important;
}

.events-table .event-row-green td,
.events-table .event-row-green .action-cell a,
.events-table .event-row-green .action-cell span {
  color: #178143;
}

.events-table .event-row-green-soft td,
.events-table .event-row-green-soft .action-cell a,
.events-table .event-row-green-soft .action-cell span {
  color: #ffffff;
}

.events-table .event-row-green-soft td {
  background: #178143 !important;
}

.events-table .event-row-green-soft .action-cell {
  background: #178143 !important;
}

.events-table .event-row-purple td,
.events-table .event-row-purple .action-cell a,
.events-table .event-row-purple .action-cell span {
  color: #7c3bb4;
}

.events-table .event-row-purple-soft td,
.events-table .event-row-purple-soft .action-cell a,
.events-table .event-row-purple-soft .action-cell span {
  color: #ffffff;
}

.events-table .event-row-purple-soft td {
  background: #7c3bb4 !important;
}

.events-table .event-row-purple-soft .action-cell {
  background: #7c3bb4 !important;
}

.events-table .event-row-brown td,
.events-table .event-row-brown .action-cell a,
.events-table .event-row-brown .action-cell span {
  color: #8a5a25;
}

.events-table .event-row-brown-soft td,
.events-table .event-row-brown-soft .action-cell a,
.events-table .event-row-brown-soft .action-cell span {
  color: #ffffff;
}

.events-table .event-row-brown-soft td {
  background: #8a5a25 !important;
}

.events-table .event-row-brown-soft .action-cell {
  background: #8a5a25 !important;
}

.events-table .event-row-default-soft td,
.events-table .event-row-default-soft .action-cell a,
.events-table .event-row-default-soft .action-cell span {
  color: #ffffff;
}

.events-table .event-row-default-soft td {
  background: var(--text) !important;
}

.events-table .event-row-default-soft .action-cell {
  background: var(--text) !important;
}

.event-view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  gap: 16px;
  align-items: start;
}

.event-view-main,
.event-cost-panel,
.event-view-full {
  display: grid;
  gap: 16px;
}

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

.event-view-main .subpanel,
.event-cost-panel .subpanel,
.event-view-full .subpanel {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.04);
}

.event-view-main p,
.event-cost-panel p,
.event-view-full p {
  margin-top: 0;
}

.event-details-list .detail-card {
  display: flex;
  align-items: center;
}

.event-details-list .detail-card p {
  margin: 0;
}

.cost-total {
  grid-column: 1 / -1;
}

.cost-total h3 {
  margin: 0;
  font-size: 18px;
}

.event-subtitle {
  margin: 4px 0 -6px;
}

.vehicle-page-grid {
  grid-template-columns: minmax(640px, 1fr) minmax(420px, 1fr);
}

.vehicle-form {
  align-items: start;
}

.vehicle-section {
  display: grid;
  gap: 16px;
}

.vehicle-fieldset {
  margin: 0;
  padding: 18px 14px 14px;
  border: 1px solid var(--border);
}

.vehicle-fieldset legend {
  padding: 0 10px;
  font-weight: 800;
}

.compact-header {
  margin-bottom: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 16px;
}

.form-static-label {
  align-self: end;
  margin: 0 0 10px;
  font-weight: 800;
}

.member-medical-list {
  display: grid;
  gap: 18px;
}

.member-medical-block {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.member-medical-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.member-medical-block h3 {
  margin: 0;
  font-size: 1rem;
}

.member-view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  gap: 16px;
  align-items: start;
}

.member-view-main,
.member-documents-panel {
  display: grid;
  gap: 16px;
}

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

.member-info-grid .detail-card {
  min-height: 190px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.04);
}

.member-info-grid .detail-card p {
  margin: 0 0 12px;
}

.member-info-grid .detail-card p:last-child {
  margin-bottom: 0;
}

.reports-page {
  gap: 22px;
}

.reports-filter {
  display: grid;
  gap: 18px;
}

.reports-filter .panel-header {
  margin-bottom: 0;
}

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

.reports-kpis .stat-card strong {
  font-size: 24px;
}

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

.report-chart-card {
  min-height: 320px;
}

.reports-sections {
  column-count: 2;
  column-gap: 16px;
}

.reports-sections .panel {
  display: grid;
  gap: 16px;
  width: 100%;
  margin: 0 0 16px;
  break-inside: avoid;
  page-break-inside: avoid;
}

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

.report-summary-list p,
.report-compare-box p {
  margin: 0;
}

.report-compare-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.report-map-shell {
  display: grid;
  gap: 12px;
}

.report-map {
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.report-map-status {
  color: var(--muted);
  font-size: 14px;
}

.report-map-popup-item {
  line-height: 1.4;
}

.report-print-body {
  background: #fff;
}

.report-print-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px;
  background: #fff;
}

.report-print-header,
.report-print-section {
  margin-bottom: 22px;
}

@media (max-width: 1100px) {
  .event-view-grid,
  .detail-grid-two,
  .cost-grid,
  .reports-kpis,
  .reports-chart-grid {
    grid-template-columns: 1fr;
  }
}

.permission-item {
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.preset-group-button.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.hidden {
  display: none !important;
}

.totals-box,
.note-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.totals-box p,
.print-totals p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.grand-total {
  font-size: 1.15rem;
  font-weight: 700;
}

.print-body {
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

.fixed-print-header,
.fixed-print-footer {
  width: min(900px, 100%);
  margin: 0 auto;
}

.print-document {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 132px 24px 120px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.graphic-header img,
.graphic-footer img {
  width: 100%;
  display: block;
}

.print-header,
.print-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.print-intro {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-top: 18px;
  margin-bottom: 18px;
}

.print-recipient,
.print-meta-card {
  font-size: 13px;
  line-height: 1.45;
}

.print-label {
  margin-bottom: 10px;
  font-weight: 700;
}

.print-section,
.print-totals,
.tax-breakdown {
  margin-top: 22px;
}

.compact-table th,
.compact-table td {
  font-size: 12px;
}

.print-tax-breakdown h2 {
  margin-bottom: 10px;
  font-size: 16px;
}

.print-footer-block {
  margin-top: 24px;
  align-items: flex-end;
}

.signature-box {
  min-width: 230px;
  text-align: center;
  font-size: 12px;
}

.signature-line {
  height: 48px;
  border-bottom: 1px solid #111;
  margin: 8px 0;
}

@media (max-width: 900px) {
  .module-grid,
  .stats-grid,
  .details-grid,
  .page-grid.two-columns,
  .form-grid,
  .form-grid-2,
  .permissions-grid,
  .member-checklist,
  .vehicle-assignment-grid,
  .member-view-grid,
  .member-info-grid,
  .invoice-calculator,
  .invoice-view-grid,
  .reports-chart-grid,
  .reports-kpis {
    grid-template-columns: 1fr;
  }

  .reports-sections {
    column-count: 1;
  }

  .login-layout {
    grid-template-columns: minmax(190px, 0.7fr) minmax(340px, 1fr);
    gap: 28px;
    padding: 32px 24px;
  }

  .login-brand-logo {
    max-width: 190px;
  }

  .login-panel-inner {
    padding: 26px;
  }
}

@media (max-width: 700px) {
  html {
    font-size: 80%;
  }

  .container {
    padding: 0 10px;
  }

  .panel,
  .hero-card,
  .stat-card,
  .detail-card,
  .subpanel,
  .module-card {
    padding: 14px;
  }

  .topbar {
    padding: 8px 10px;
  }

  .topbar-logo {
    height: 30px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .button,
  .button,
  .primary-button,
  .secondary-button,
  .table-action,
  .invoice-tab,
  .invoice-row-remove,
  .login-submit {
    min-height: 35px;
    padding: 0 12px;
    font-size: 12.8px;
    border-radius: 8px;
  }

  .drive-log-create-button,
  .drive-log-page-button,
  .drive-log-save-button {
    min-height: 48px;
    padding: 0 18px;
    font-size: 16px;
    width: 100%;
    justify-content: center;
  }

  .input,
  .select,
  .textarea,
  input[type="text"],
  input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    min-height: 42px;
    font-size: 16px;
  }

  .login-topbar {
    min-height: 42px;
  }

  .login-topbar-inner {
    min-height: 42px;
    padding: 0 18px;
    font-size: 12px;
  }

  .login-layout {
    min-height: calc(100dvh - 42px);
    grid-template-columns: 1fr;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 12px;
  }

  .login-brand-side {
    flex: none;
    padding-top: 0;
  }

  .login-brand-logo {
    max-width: 76px;
    margin: 0 auto;
  }

  .login-panel {
    flex: none;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }

  .login-panel-inner {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .login-title {
    font-size: 23px;
    text-align: center;
  }

  .login-heading {
    margin-bottom: 12px;
    text-align: center;
  }

  .login-page .login-form {
    gap: 10px;
  }

  .login-page .login-form .input {
    min-height: 46px;
    padding: 11px 14px;
  }

  .login-remember-row {
    display: inline-flex;
    flex-direction: row;
    white-space: nowrap;
    min-height: 32px;
    padding: 5px 10px;
    gap: 8px;
  }

  .login-actions {
    margin-top: 8px;
  }

  .login-submit {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .login-panel-inner .muted {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.35;
  }

  .data-table th,
  .data-table td {
    padding: 6px 8px;
    font-size: 12.8px;
  }

  .report-map {
    min-height: 320px;
  }

  .large-map-page-panel + .large-map-page-panel {
    margin-top: 16px;
  }

  .large-map-view-panel {
    padding: 10px;
  }

  .large-intervention-map-shell {
    min-height: 420px;
  }

  .large-intervention-map {
    min-height: 420px;
  }

  .large-intervention-map-legend {
    gap: 8px 12px;
    margin-top: 10px;
    padding: 0 2px;
    line-height: 1.25;
  }

  .large-map-actions-panel {
    padding: 14px;
  }

  .large-intervention-map-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .large-intervention-map-toolbar .secondary-button,
  .large-intervention-map-toolbar .primary-button {
    width: 100%;
    justify-content: center;
  }

  .large-sector-editor-panel,
  .large-sector-board-panel {
    padding: 14px;
  }

  .large-sector-board {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .large-sector-card {
    gap: 12px;
  }

  .table-wrap.large-intervention-diary-wrap {
    overflow: visible;
  }

  .large-intervention-diary-wrap::before {
    content: "Odpri modul na napravi z večjo resolucijo.";
    display: block;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
  }

  .large-intervention-diary-wrap .large-intervention-main-diary-table {
    display: none;
  }

  .wide-table-wrap,
  .members-table-wrap,
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .page-grid,
  .page-grid > * {
    min-width: 0;
  }

  .inventory-audits-wrap {
    width: 100%;
    overflow-x: auto;
  }

  .wide-data-table th,
  .wide-data-table td,
  .members-data-table th,
  .members-data-table td {
    position: static !important;
    left: auto !important;
    right: auto !important;
    box-shadow: none !important;
  }

  .inventory-audit-table th,
  .inventory-audit-table td {
    padding: 4px 5px;
    font-size: 10px;
    line-height: 1.15;
  }

  .inventory-audit-table .segmented-buttons {
    gap: 4px;
  }

  .inventory-audit-table .secondary-button.is-small,
  .inventory-audit-table .primary-button.is-small {
    min-height: 28px;
    padding: 0 6px;
    font-size: 10px;
  }

  .inventory-audit-table textarea {
    min-height: 54px;
    padding: 6px;
    font-size: 10px;
  }

  .inventory-audit-table th:nth-child(4),
  .inventory-audit-table td:nth-child(4),
  .inventory-audit-table th:nth-child(6),
  .inventory-audit-table td:nth-child(6) {
    display: none;
  }

  .inventory-audit-divider-label {
    margin-top: 6px;
    padding: 8px 10px 6px;
    font-size: 10px;
  }

  .event-finalize-dialog {
    max-height: calc(100dvh - 20px);
    padding: 20px 16px;
    border-radius: 16px;
  }

  .event-finalize-dialog label {
    margin-top: 20px;
  }

  .event-finalize-dialog h2 {
    font-size: 23px;
  }

  .event-finalize-modal {
    align-items: center;
    padding: 10px;
  }

  .event-finalize-check {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .event-finalize-check-marker {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .event-finalize-edit {
    grid-column: 2;
    justify-self: start;
    padding: 4px 0;
  }

  .event-finalize-dialog .form-actions {
    margin-top: 28px;
    gap: 14px;
  }

  .event-finalize-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .event-finalize-actions .secondary-button,
  .event-finalize-actions .primary-button {
    width: 100%;
  }

  .events-table th:nth-child(4),
  .events-table td:nth-child(4),
  .events-table th:nth-child(5),
  .events-table td:nth-child(5),
  .events-table th:nth-child(7),
  .events-table td:nth-child(7) {
    display: none;
  }

  .large-intervention-detail-grid {
    grid-template-columns: 1fr;
  }

  .large-intervention-summary-head {
    align-items: stretch;
    flex-direction: column;
  }

  .large-intervention-crew-table th:nth-child(3),
  .large-intervention-crew-table td:nth-child(3),
  .large-intervention-crew-table th:nth-child(5),
  .large-intervention-crew-table td:nth-child(5) {
    display: none;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  html,
  body.invoice-print-body {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    background: #fff;
  }

  .invoice-print-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none;
    page-break-after: always;
  }

  .invoice-letterfoot {
    position: fixed;
    bottom: 0;
  }

  .fixed-print-header,
  .fixed-print-footer {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    z-index: 10;
    background: #fff;
  }

  .fixed-print-header {
    top: 0;
  }

  .fixed-print-footer {
    bottom: 0;
  }

  .fixed-print-header img,
  .fixed-print-footer img {
    width: 100%;
    display: block;
  }

  .print-document {
    width: 100%;
    max-width: none;
    padding: 138px 24px 128px;
  }

  .print-intro {
    grid-template-columns: 1fr 1fr;
  }

  .report-print-page {
    width: 100%;
    padding: 14mm;
  }

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

/* Operation room redesign */
:root {
  --primary: #ed1c24;
  --primary-dark: #b5121b;
  --sidebar: #3a3a3a;
  --sidebar-muted: #94a3b8;
  --bg: #f3f4f6;
  --card: #ffffff;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #2563eb;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 16px 42px rgba(15, 23, 42, 0.06);
  --radius: 18px;
}

body {
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  min-height: 100vh;
}

.has-app-sidebar .app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.app-main {
  min-width: 0;
}

.has-app-sidebar .container {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px;
}

.large-interventions-page.has-app-sidebar .container,
.vehicle-tracking-page.has-app-sidebar .container {
  max-width: none;
}

.login-page .container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.app-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar);
  color: #e5e7eb;
  padding: 18px 16px;
  z-index: 100100;
  box-shadow: 12px 0 32px rgba(15, 23, 42, 0.18);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
  line-height: 1.15;
}

.sidebar-brand strong {
  color: #fff;
  font-size: 17px;
}

.sidebar-brand small {
  color: var(--sidebar-muted);
  font-size: 12px;
  margin-top: 4px;
}

.sidebar-close {
  display: none;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.sidebar-nav {
  display: grid;
  gap: 24px;
}

.sidebar-section-title {
  margin: 0 0 8px;
  padding: 0 10px;
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 750;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  background: rgba(237, 28, 36, 0.16);
  color: #fff;
}

.sidebar-link.is-active {
  box-shadow: inset 4px 0 0 var(--primary);
}

.sidebar-link svg {
  display: block;
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  fill: currentColor;
  flex: 0 0 18px;
}

.sidebar-backdrop {
  display: none;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 14px 24px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 28px rgba(181, 18, 27, 0.22);
}

.large-interventions-page .app-topbar {
  position: static;
}

.topbar-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-kicker {
  margin: 0 0 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-topbar h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.05;
}

.sidebar-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  border-radius: 999px;
  background: #fff;
}

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

.topbar-user {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.topbar-user span {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}

.topbar-user small {
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 700;
}

.app-topbar .button,
.topbar-logout,
.app-topbar .secondary-button,
.app-topbar .primary-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #fff;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.panel,
.hero-card,
.stat-card,
.detail-card,
.subpanel,
.module-card,
.ui-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.panel,
.hero-card,
.ui-card {
  padding: 26px;
}

.panel-header,
.ui-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.panel-header h1,
.ui-card-header h2,
.ops-hero h1,
.ops-page-hero h1 {
  margin: 0;
  color: var(--text);
  line-height: 1.08;
}

.ui-card-header h2 {
  font-size: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ops-dashboard {
  display: grid;
  gap: 24px;
}

.ops-hero,
.ops-page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 190px;
  padding: 32px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(237, 28, 36, 0.08), rgba(16, 25, 35, 0.02)),
    var(--card);
}

.ops-hero p,
.ops-page-hero p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.35;
}

.ops-hero-mark {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border: 2px solid rgba(237, 28, 36, 0.2);
  border-radius: 32px;
  color: var(--primary);
  font-size: 38px;
  font-weight: 900;
  transform: rotate(-4deg);
}

.ops-stat-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.ops-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 112px;
  padding: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.ops-stat-label,
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
}

.ops-stat-card strong,
.stat-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
}

.ops-stat-icon {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--primary);
  background: rgba(237, 28, 36, 0.1);
}

.ops-stat-icon svg {
  display: block;
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  fill: currentColor;
}

.tone-danger .ops-stat-icon,
.vehicle-status-card.tone-danger em {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.1);
}

.tone-warning .ops-stat-icon,
.vehicle-status-card.tone-warning em {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
}

.tone-info .ops-stat-icon {
  color: var(--info);
  background: rgba(37, 99, 235, 0.1);
}

.tone-success .ops-stat-icon,
.vehicle-status-card.tone-success em {
  color: var(--success);
  background: rgba(22, 163, 74, 0.1);
}

.ops-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.8fr);
  gap: 24px;
}

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

.empty-state,
.compact-placeholder,
.map-placeholder {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 190px;
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  color: var(--muted);
}

.empty-state strong,
.compact-placeholder span {
  color: var(--text);
  font-size: 34px;
  line-height: 1;
}

.map-placeholder {
  min-height: 220px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
}

.vehicle-status-grid {
  display: grid;
  gap: 12px;
}

.vehicle-status-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.vehicle-status-card > strong {
  justify-self: start;
}

.vehicle-status-card strong,
.vehicle-status-card span {
  display: block;
}

.vehicle-status-card strong {
  font-size: 17px;
}

.vehicle-status-card span {
  margin-top: 4px;
  color: var(--muted);
}

.vehicle-status-card .vehicle-status-number {
  justify-self: center;
  display: block;
  min-width: 44px;
  margin-top: 0;
  color: var(--text);
  font-size: 42px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-align: center;
}

.vehicle-status-card.tone-success .vehicle-status-number {
  color: var(--success);
}

.vehicle-status-card.tone-warning .vehicle-status-number {
  color: var(--warning);
}

.vehicle-status-card.tone-danger .vehicle-status-number {
  color: var(--danger);
}

.vehicle-status-card em {
  justify-self: end;
  padding: 8px 10px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.vehicle-status-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.vehicle-status-list span,
.vehicle-status-unknown span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
}

.vehicle-status-list span.is-empty {
  color: #6b7280;
  font-weight: 750;
}

.vehicle-status-unknown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.vehicle-status-unknown strong {
  color: #475569;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.ui-badge-danger {
  color: #fff;
  background: var(--danger);
}

.ui-badge-warning {
  color: #78350f;
  background: #fef3c7;
}

.ui-badge-success {
  color: #065f46;
  background: #dcfce7;
}

.ui-badge-info {
  color: #1d4ed8;
  background: #dbeafe;
}

.ui-badge-neutral {
  color: #334155;
  background: #e2e8f0;
}

.module-grid {
  gap: 16px;
}

.redesigned-module-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.module-card {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 20px;
  border-radius: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.module-card-active:hover {
  transform: translateY(-2px);
  border-color: rgba(237, 28, 36, 0.28);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.module-card strong {
  color: var(--text);
  font-size: 20px;
}

.module-card p {
  color: var(--muted);
  line-height: 1.42;
}

.primary-button,
.secondary-button,
.button,
.ui-button,
.table-action,
button {
  font-family: inherit;
}

.primary-button,
.button-primary,
.ui-button-primary {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.secondary-button,
.button,
.ui-button-secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.primary-button,
.secondary-button,
.button,
.ui-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-button:hover,
.ui-button-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.secondary-button:hover,
.button:hover,
.ui-button-secondary:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

input,
select,
textarea {
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  min-height: 48px;
  padding: 12px 14px;
  outline: none;
}

textarea {
  min-height: 132px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.12);
}

input[type="checkbox"]:focus,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus,
input[type="radio"]:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

label,
.ui-form-field {
  color: var(--text);
  font-weight: 800;
}

.ui-form-field {
  display: grid;
  gap: 8px;
}

.ui-form-field small {
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  gap: 18px;
}

.form-actions,
.button-row {
  gap: 12px;
}

.table-wrap,
.ui-table-wrap,
.wide-table-wrap,
.members-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.data-table,
.wide-data-table,
.members-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.data-table th,
.data-table td,
.wide-data-table th,
.wide-data-table td,
.members-data-table th,
.members-data-table td {
  border-color: var(--border);
  padding: 13px 14px;
  vertical-align: top;
}

.data-table thead th,
.wide-data-table thead th,
.members-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fafc;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.data-table tbody tr:nth-child(even) td,
.wide-data-table tbody tr:nth-child(even) td,
.members-data-table tbody tr:nth-child(even) td {
  background: #f9fafb;
}

.data-table tbody tr:hover td,
.wide-data-table tbody tr:hover td,
.members-data-table tbody tr:hover td {
  background: #fff7f7;
}

.events-table td {
  font-weight: 500;
}

.events-table .action-cell,
.events-table .action-cell a {
  font-weight: 900;
}

.event-title-cell a {
  font-weight: 850;
}

.events-table .event-row-intervention td:first-child {
  box-shadow: inset 5px 0 0 var(--primary);
}

.event-summary-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.event-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.event-summary-card h3 {
  margin: 0;
  font-size: 20px;
}

.event-summary-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.event-summary-card div {
  min-width: 0;
}

.event-summary-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.event-summary-card dd {
  margin: 2px 0 0;
  font-weight: 750;
}

.notice {
  border-radius: 14px;
  padding: 14px 16px;
}

@media (max-width: 1180px) {
  .has-app-sidebar .app-shell {
    display: block;
  }

  .app-main,
  .has-app-sidebar .app-main,
  .app-topbar,
  .has-app-sidebar .container {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 330px);
    padding: 16px 12px;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
  }

  .sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .sidebar-toggle {
    display: block;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: none;
    border: 0;
    background: rgba(15, 23, 42, 0.46);
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .app-topbar {
    width: 100%;
    max-width: 100vw;
    overflow: visible;
  }

  .topbar-title-group,
  .topbar-heading {
    min-width: 0;
  }

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

  .ops-content-grid,
  .ops-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .has-app-sidebar .app-shell {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 330px);
    transform: translateX(-105%);
    transition: transform 0.18s ease;
  }

  .sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .sidebar-toggle {
    display: block;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: none;
    border: 0;
    background: rgba(15, 23, 42, 0.46);
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .app-topbar {
    min-height: 68px;
    padding: 12px 14px;
  }

  .topbar-user {
    display: none;
  }

  .has-app-sidebar .container {
    padding: 14px;
  }

  .panel,
  .hero-card,
  .ui-card {
    padding: 18px;
  }

  .ops-hero,
  .ops-page-hero {
    min-height: auto;
    padding: 22px;
  }

  .ops-hero-mark {
    display: none;
  }

  .ops-hero p,
  .ops-page-hero p {
    font-size: 17px;
  }

  .ops-stat-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .ops-stat-card {
    min-height: 108px;
  }

  .panel-header,
  .ui-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row,
  .form-actions {
    width: 100%;
  }

  .button-row > *,
  .form-actions > * {
    flex: 1 1 auto;
  }

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

  .span-two {
    grid-column: auto;
  }

  .r1r2-date-row {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .r1r2-page .form-actions {
    flex-wrap: wrap;
  }

  .r1r2-page .form-actions > * {
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .r1r2-date-row {
    grid-template-columns: 1fr;
  }
}

/* Events module redesign */
.events-index-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 126px;
  margin-bottom: 20px;
  padding: 26px;
}

.events-index-hero h1 {
  font-size: 34px;
}

.events-index-hero p {
  max-width: 720px;
  font-size: 17px;
}

.events-stats {
  margin-bottom: 20px;
}

.events-filter-panel {
  margin-bottom: 20px;
}

.events-table-wrap {
  box-shadow: none;
}

.events-table thead th {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.events-table tbody tr {
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.events-table tbody tr:hover {
  transform: translateY(-1px);
}

.events-table .event-row-red-soft td,
.events-table .event-row-blue-soft td,
.events-table .event-row-green-soft td,
.events-table .event-row-purple-soft td,
.events-table .event-row-brown-soft td,
.events-table .event-row-default-soft td,
.event-row-red-soft td,
.event-row-blue-soft td,
.event-row-green-soft td,
.event-row-purple-soft td,
.event-row-brown-soft td,
.event-row-default-soft td {
  color: var(--text) !important;
  background: #fff7f7 !important;
}

.events-table .event-row-red-soft td:first-child,
.events-table .event-row-blue-soft td:first-child,
.events-table .event-row-green-soft td:first-child,
.events-table .event-row-purple-soft td:first-child,
.events-table .event-row-brown-soft td:first-child,
.events-table .event-row-default-soft td:first-child {
  box-shadow: inset 5px 0 0 var(--primary);
}

.events-table .event-row-red-soft .action-cell,
.events-table .event-row-blue-soft .action-cell,
.events-table .event-row-green-soft .action-cell,
.events-table .event-row-purple-soft .action-cell,
.events-table .event-row-brown-soft .action-cell,
.events-table .event-row-default-soft .action-cell {
  background: #fff7f7 !important;
}

.events-table .event-row-red-soft .action-cell a,
.events-table .event-row-blue-soft .action-cell a,
.events-table .event-row-green-soft .action-cell a,
.events-table .event-row-purple-soft .action-cell a,
.events-table .event-row-brown-soft .action-cell a,
.events-table .event-row-default-soft .action-cell a,
.events-table .event-row-red-soft .action-cell span,
.events-table .event-row-blue-soft .action-cell span,
.events-table .event-row-green-soft .action-cell span,
.events-table .event-row-purple-soft .action-cell span,
.events-table .event-row-brown-soft .action-cell span,
.events-table .event-row-default-soft .action-cell span {
  color: var(--primary) !important;
}

.event-badge-intervention {
  color: #991b1b !important;
  background: #fee2e2 !important;
}

.event-badge-blue {
  color: #1d4ed8 !important;
  background: #dbeafe !important;
}

.event-badge-orange {
  color: #9a3412 !important;
  background: #ffedd5 !important;
}

.event-badge-green {
  color: #166534 !important;
  background: #dcfce7 !important;
}

.event-badge-gray,
.event-badge-default {
  color: #374151 !important;
  background: #f3f4f6 !important;
}

.event-badge-teal {
  color: #0f766e !important;
  background: #ccfbf1 !important;
}

.event-form-panel {
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.event-form-panel > .panel-header {
  margin-bottom: 18px;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.event-form-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.event-form-layout > .span-two {
  grid-column: auto;
}

.event-form-layout > .event-section-core,
.event-form-layout > .event-section-pocsag,
.event-form-layout > .event-section-general,
.event-form-layout > .event-section-intervention,
.event-form-layout > .event-section-members,
.event-form-layout > .event-submit-bar {
  grid-column: 1 / -1;
}

.event-form-layout > .event-section-drive,
.event-form-layout > .event-section-spin,
.event-form-layout > .event-leader-check,
.event-form-layout > label[data-intervention-section] {
  grid-column: span 1;
}

.event-form-layout > .event-section-units {
  grid-column: 1 / -1;
}

.event-form-layout > .event-section-vehicles,
.event-form-layout > .event-section-drive {
  grid-column: span 1;
}

.event-form-layout > .event-section-vehicles {
  grid-column: span 2;
}

.event-intervention-description {
  min-height: 170px;
}

.event-form-layout > .event-section-general-costs,
.event-form-layout > .event-section-costs,
.event-form-layout > .event-section-other-members {
  grid-column: 1 / -1;
}

.event-builder .event-section,
.event-builder > label[data-intervention-section],
.event-builder > .event-leader-check {
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.event-builder > label[data-intervention-section],
.event-builder > .event-leader-check {
  min-height: 138px;
}

.event-builder > .event-leader-check {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.event-builder .event-section[hidden],
.event-builder [data-intervention-section][hidden] {
  display: none !important;
}

.event-section-core {
}

.event-section-intervention {
  background: linear-gradient(135deg, #fff 0%, #fff7f7 100%) !important;
}

.event-section-general {
}

.event-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.event-section-title h2 {
  margin: 0;
  font-size: 21px;
}

.event-section-title .eyebrow,
.event-section-title .muted {
  margin-bottom: 3px;
}

.event-section-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.event-section-general .event-section-icon,
.event-section-drive .event-section-icon {
  background: var(--info);
}

.event-section-members .event-section-icon,
.event-section-other-members .event-section-icon {
  background: var(--success);
}

.event-section-vehicles .event-section-icon {
  background: var(--warning);
}

.event-section-costs .event-section-icon {
  background: var(--primary-dark);
}

.event-builder .form-grid {
  gap: 14px;
}

.event-builder label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.event-builder input,
.event-builder select,
.event-builder textarea {
  min-height: 46px;
  border-radius: 10px;
}

.event-builder textarea {
  min-height: 112px;
}

.event-check-grid,
.vehicle-card-grid,
.equipment-usage-grid {
  gap: 10px;
}

.event-check-card {
  display: grid;
  gap: 8px;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.event-check-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.event-check-card:has(input:checked),
.checkbox-row:has(input:checked) {
  border-color: rgba(237, 28, 36, 0.36);
  background: #fff7f7;
}

.event-section-drive [data-drive-log-suggestions] .event-check-card {
  padding: 16px 18px;
  align-content: start;
}

.event-section-drive [data-drive-log-suggestions] .checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
}

.event-section-drive [data-drive-log-suggestions] .checkbox-row input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0;
}

.event-section-drive [data-drive-log-suggestions] .checkbox-row span {
  display: block;
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.event-section-drive [data-drive-log-suggestions] .event-check-card small {
  display: block;
  padding: 0 2px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.checkbox-row {
  align-items: center;
  min-height: 42px;
  border-radius: 12px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.selected-member-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}

.selected-member-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.selected-member-chip {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.event-member-search {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 850;
}

.event-member-search input {
  width: 100%;
}

.large-intervention-crew-title {
  color: var(--primary) !important;
}

.large-intervention-crew-search {
  margin-bottom: 14px;
}

.vehicle-assignment-card {
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: none;
}

.vehicle-assignment-card h3 {
  margin: 0;
  color: var(--text);
}

.equipment-usage-card {
  align-content: start;
}

.event-leader-check {
  display: grid;
  gap: 12px;
}

.event-leader-check p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.event-plain-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  width: fit-content;
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.event-plain-checkbox span {
  font-weight: 850;
}

.event-plain-checkbox input[type="checkbox"],
.has-app-sidebar .app-main .event-plain-checkbox input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.event-submit-bar {
  position: sticky;
  bottom: 12px;
  z-index: 8;
  justify-content: flex-end;
  padding: 14px !important;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
}

.event-submit-bar .primary-button,
.event-submit-bar .secondary-button {
  min-width: 124px;
}

.event-submit-bar [data-delete-event-button] {
  color: #991b1b;
  border-color: #fecaca;
  background: #fff;
}

.pocsag-suggestion-button {
  border-radius: 12px;
  background: #fff;
}

.event-show-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  gap: 20px;
}

.event-show-layout .panel,
.event-show-layout .subpanel,
.event-show-layout .detail-card {
  border-radius: 18px;
}

.event-show-hero {
  align-items: center;
  margin-bottom: 2px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.event-show-hero h1 {
  margin: 0 0 10px;
  font-size: 32px;
}

.event-show-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.event-show-intervention .event-view-main {
}

.event-show-general .event-view-main {
}

.event-view-main .subpanel,
.event-cost-panel .subpanel {
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: none;
}

.event-view-main .subpanel > .muted,
.event-cost-panel .subpanel > .muted {
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.event-cost-sticky {
  position: sticky;
  top: 96px;
}

.event-cost-panel h2 {
  margin: 0 0 4px;
  font-size: 26px;
}

.event-cost-panel .button-row {
  align-items: stretch;
}

.event-cost-panel .button-row > * {
  flex: 1 1 160px;
}

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

.cost-total {
  grid-column: 1 / -1;
  border-color: rgba(237, 28, 36, 0.28) !important;
  background: linear-gradient(135deg, #fff 0%, #fff7f7 100%) !important;
}

.cost-total h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 24px;
}

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

  .event-form-layout > .event-section-core,
  .event-form-layout > .event-section-pocsag,
  .event-form-layout > .event-section-general,
  .event-form-layout > .event-section-intervention,
  .event-form-layout > .event-section-vehicles,
  .event-form-layout > .event-section-drive,
  .event-form-layout > .event-section-general-costs,
  .event-form-layout > .event-section-costs,
  .event-form-layout > .event-section-other-members,
  .event-form-layout > .event-submit-bar {
    grid-column: 1 / -1;
  }

  .event-show-layout {
    grid-template-columns: 1fr;
  }

  .event-cost-sticky {
    position: static;
  }
}

@media (max-width: 760px) {
  .events-index-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .events-index-hero .primary-button {
    width: 100%;
  }

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

  .event-form-layout > .event-section,
  .event-form-layout > label[data-intervention-section],
  .event-form-layout > .event-submit-bar {
    grid-column: 1 / -1;
  }

  .event-builder .event-section,
  .event-builder > label[data-intervention-section] {
    padding: 14px;
    border-radius: 14px;
  }

  .event-check-grid,
  .vehicle-card-grid,
  .equipment-usage-grid,
  .detail-grid-two,
  .cost-grid {
    grid-template-columns: 1fr;
  }

  .event-submit-bar {
    position: static;
    align-items: stretch;
  }

  .event-submit-bar > * {
    width: 100%;
  }

  .event-show-hero {
    align-items: stretch;
  }
}

@media (max-width: 700px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .app-topbar h1 {
    font-size: 20px;
  }

  .app-topbar .button,
  .topbar-logout {
    min-height: 42px;
    padding: 0 12px;
  }

  .events-table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .events-table {
    display: block;
    background: transparent;
  }

  .events-table thead {
    display: none;
  }

  .events-table tbody,
  .events-table tr,
  .events-table td {
    display: block;
    width: 100%;
  }

  .events-table tr {
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .events-table td,
  .events-table th:nth-child(4),
  .events-table td:nth-child(4),
  .events-table th:nth-child(5),
  .events-table td:nth-child(5),
  .events-table th:nth-child(7),
  .events-table td:nth-child(7) {
    display: flex;
  }

  .events-table td {
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border: 0;
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
  }

  .events-table td:last-child {
    border-bottom: 0;
  }

  .events-table td::before {
    content: attr(data-label);
    flex: 0 0 96px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .events-table .action-cell {
    justify-content: flex-start;
  }

  .events-table .action-cell::before {
    margin-right: auto;
  }

  .drive-table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .drive-data-table {
    display: block;
    min-width: 0;
    background: transparent;
  }

  .drive-data-table thead {
    display: none;
  }

  .drive-data-table tbody,
  .drive-data-table tr,
  .drive-data-table td {
    display: block;
    width: 100%;
  }

  .drive-data-table tr {
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .drive-data-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border: 0;
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
    text-align: right;
  }

  .drive-data-table td:last-child {
    border-bottom: 0;
  }

  .drive-data-table td::before {
    content: attr(data-label);
    flex: 0 0 96px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
  }

  .drive-data-table .action-cell {
    justify-content: flex-start;
    text-align: left;
  }

  .drive-data-table .action-cell::before {
    margin-right: auto;
  }
}

/* Dispatch-board tuning based on the reference layout */
.has-app-sidebar .app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
}

.app-sidebar {
  padding: 22px 14px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.05), transparent 36%),
    linear-gradient(180deg, #3a3a3a 0%, #353535 58%, #303030 100%);
}

.sidebar-brand {
  min-height: 52px;
  margin-bottom: 20px;
  padding-bottom: 18px;
}

.sidebar-brand img {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  flex: 0 0 42px;
}

.sidebar-brand strong {
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-brand small {
  font-size: 12px;
}

.sidebar-nav {
  gap: 22px;
}

.sidebar-section-title {
  margin-bottom: 10px;
  padding: 0 8px;
  font-size: 11px;
}

.sidebar-link {
  min-height: 46px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 15px;
}

.sidebar-link.is-active {
  background: var(--primary);
  box-shadow: none;
  color: #fff;
}

.sidebar-link:not(.is-active):hover {
  background: rgba(255, 255, 255, 0.08);
}

.app-topbar {
  min-height: 76px;
  padding: 14px 26px;
  background: linear-gradient(135deg, #ed1c24 0%, #b5121b 100%);
}

.sidebar-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-toggle span {
  width: 19px;
  margin: 2px 0;
}

.topbar-kicker {
  display: none;
}

.app-topbar h1 {
  font-size: 25px;
  font-weight: 900;
}

.topbar-user {
  position: relative;
  display: grid;
  min-width: 178px;
  min-height: 48px;
  padding: 8px 36px 8px 54px;
  border-radius: 10px;
  background: rgba(181, 18, 27, 0.36);
}

.topbar-user::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: inset 0 -10px 0 rgba(237, 28, 36, 0.14);
}

.topbar-user span {
  text-transform: uppercase;
}

.app-topbar .button,
.topbar-logout,
.app-topbar .secondary-button,
.app-topbar .primary-button {
  min-height: 46px;
  border-radius: 10px;
}

.app-sidebar img,
.topbar-logo,
.login-brand-logo {
  object-fit: contain;
}

.app-logo-mark,
img[src*="logotip_cb_notext.svg"] {
  display: block !important;
  width: 42px !important;
  height: 53px !important;
  max-width: 42px !important;
  max-height: 53px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: contain !important;
}

.topbar-logo {
  width: auto !important;
  height: 42px !important;
  max-width: 48px !important;
  max-height: 42px !important;
}

.topbar-logo.app-logo-mark {
  width: 34px !important;
  height: 43px !important;
  max-width: 34px !important;
  max-height: 43px !important;
}

.login-brand-logo {
  width: min(220px, 56vw) !important;
  height: auto !important;
  max-width: 220px !important;
  max-height: 240px !important;
}

.dispatch-dashboard {
  gap: 20px;
}

.dispatch-dashboard .ops-stat-grid {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 20px;
}

.dispatch-dashboard .ops-stat-card {
  position: relative;
  justify-content: flex-start;
  min-height: 118px;
  padding: 20px 54px 20px 22px;
  border-radius: 12px;
  overflow: hidden;
}

.dispatch-dashboard .ops-stat-card::after {
  content: "›";
  position: absolute;
  right: 22px;
  top: 50%;
  color: #64748b;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
}

.dispatch-dashboard .ops-stat-card.no-arrow {
  padding-right: 22px;
}

.dispatch-dashboard .ops-stat-card.no-arrow::after {
  content: none;
}

.dispatch-dashboard .ops-stat-card.tone-danger {
  background: linear-gradient(135deg, #fff 0%, #fff1f2 100%);
}

.dispatch-dashboard .ops-stat-card.tone-warning {
  background: linear-gradient(135deg, #fff 0%, #fff7ed 100%);
}

.dispatch-dashboard .ops-stat-card.tone-info {
  background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
}

.dispatch-dashboard .ops-stat-card.tone-success {
  background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%);
}

.dispatch-dashboard .ops-stat-icon {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
}

.dispatch-dashboard .tone-warning .ops-stat-icon {
  background: #f97316;
}

.dispatch-dashboard .tone-info .ops-stat-icon {
  background: #2563eb;
}

.dispatch-dashboard .tone-success .ops-stat-icon {
  background: #16a34a;
}

.dispatch-dashboard .tone-neutral .ops-stat-icon {
  background: #374151;
}

.dispatch-dashboard .dashboard-clock-card strong {
  font-size: 34px;
}

.dispatch-dashboard .ops-stat-icon svg {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
}

.dispatch-dashboard .ops-stat-label {
  color: #374151;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.dispatch-dashboard .ops-stat-card strong {
  margin-top: 8px;
  font-size: 30px;
}

.events-stats {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 20px;
}

.events-stats .ops-stat-card {
  position: relative;
  justify-content: flex-start;
  min-height: 118px;
  padding: 20px 22px;
  border-radius: 12px;
  overflow: hidden;
}

.events-stats .ops-stat-card.tone-danger {
  background: linear-gradient(135deg, #fff 0%, #fff1f2 100%);
}

.events-stats .ops-stat-card.tone-warning {
  background: linear-gradient(135deg, #fff 0%, #fff7ed 100%);
}

.events-stats .ops-stat-card.tone-info {
  background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
}

.events-stats .ops-stat-card.tone-success {
  background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%);
}

.events-stats .ops-stat-card.tone-neutral {
  background: linear-gradient(135deg, #fff 0%, #f3f4f6 100%);
}

.events-stats .ops-stat-icon {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 50%;
  color: #fff;
}

.events-stats .tone-danger .ops-stat-icon {
  background: var(--primary);
}

.events-stats .tone-warning .ops-stat-icon {
  background: #f97316;
}

.events-stats .tone-info .ops-stat-icon {
  background: #2563eb;
}

.events-stats .tone-success .ops-stat-icon {
  background: #16a34a;
}

.events-stats .tone-neutral .ops-stat-icon {
  background: #374151;
}

.events-stats .ops-stat-icon svg {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
}

.events-stats .ops-stat-label {
  color: #374151;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.events-stats .ops-stat-card strong {
  margin-top: 8px;
  font-size: 30px;
}

.events-stats .ops-stat-card:nth-child(4) strong {
  font-size: 22px;
  line-height: 1.08;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-stats .ops-stat-card:nth-child(4) > div {
  min-width: 0;
}

.member-stats.events-stats .ops-stat-card:nth-child(4) strong {
  font-size: 30px;
  line-height: 1;
  overflow: visible;
  text-overflow: clip;
}

.member-stats.events-stats .tone-success .ops-stat-icon {
  color: #fff;
  background: #16a34a;
}

.drive-stats .ops-stat-card:nth-child(3) strong,
.drive-stats .ops-stat-card:nth-child(4) strong {
  font-size: 22px;
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.reports-top-actions,
.members-top-actions,
.sms-status-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-card-link {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.stat-card-link[hidden] {
  display: none !important;
}

.stat-card-link .ops-stat-card {
  height: 100%;
}

.sms-top-block {
  display: grid;
  gap: 18px;
}

.reports-stats .ops-stat-card strong,
.sms-stats .ops-stat-card strong,
.invoice-stats .ops-stat-card strong,
.inventory-stats .ops-stat-card strong,
.member-stats .ops-stat-card strong {
  overflow-wrap: anywhere;
}

.reports-stats .ops-stat-card strong,
.sms-stats .ops-stat-card strong,
.invoice-stats .ops-stat-card strong {
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.08;
}

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

@media (max-width: 680px) {
  .events-stats {
    grid-template-columns: 1fr;
  }
}

.dispatch-dashboard .ops-content-grid {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr);
  gap: 20px;
}

.dashboard-notices-strip {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 22px;
  border: 1px solid #ed1c24;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

.dashboard-notices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-notices-header h2 {
  margin: 0;
  font-size: 24px;
}

.dashboard-notices-eyebrow {
  margin: 0;
}

.dashboard-notices-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.dashboard-notice-card,
.dashboard-notice-empty {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 88px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
}

.dashboard-notice-card span {
  font-size: 12px;
  font-weight: 900;
  color: #6b7280;
  text-transform: uppercase;
}

.dashboard-notice-card strong {
  color: #111827;
  font-size: 16px;
  line-height: 1.35;
}

.dashboard-notice-card small {
  color: #6b7280;
  font-weight: 700;
}

.dashboard-notice-nujno {
  border-color: #fecaca;
  background: #fee2e2;
}

.dashboard-notice-nujno span,
.dashboard-notice-nujno strong {
  color: #7f1d1d;
}

.dashboard-notice-operativa {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.dashboard-notice-clani {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.dispatch-dashboard .ops-bottom-grid {
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.05fr) minmax(280px, 1.05fr);
  gap: 20px;
}

.dispatch-panel,
.dispatch-dashboard .ui-card {
  border-radius: 12px;
}

.dispatch-dashboard .ui-card-header {
  margin-bottom: 16px;
}

.dispatch-dashboard .ui-card-header h2 {
  font-size: 21px;
}

.dispatch-dashboard .empty-state,
.dispatch-dashboard .compact-placeholder,
.dispatch-dashboard .map-placeholder {
  min-height: 168px;
  border-radius: 10px;
}

.dispatch-dashboard .vehicle-status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dispatch-dashboard .vehicle-status-card {
  min-height: 94px;
  align-items: center;
  border-radius: 10px;
}

.dispatch-dashboard .vehicle-status-card.tone-success {
  border-color: #bbf7d0;
}

.dispatch-dashboard .vehicle-status-card.tone-warning {
  border-color: #fde68a;
}

.dispatch-dashboard .vehicle-status-card.tone-danger {
  border-color: #fecaca;
  background: #fff5f5;
}

.dispatch-dashboard .vehicle-status-card em {
  align-self: center;
}

.dispatch-dashboard .ops-modules-card {
  margin-top: 2px;
}

.dispatch-dashboard .redesigned-module-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dispatch-dashboard .module-card {
  min-height: 124px;
  border-radius: 12px;
}

.dispatch-dashboard .dashboard-event-list {
  display: grid;
  gap: 10px;
}

.dispatch-dashboard .dashboard-event-row {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.dispatch-dashboard .dashboard-event-row:hover {
  border-color: #fecaca;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.dispatch-dashboard .dashboard-event-row.is-open {
  border-color: #fecaca;
  background: #fff5f5;
}

.dispatch-dashboard .dashboard-call-row {
  border-color: #fecaca;
}

.dispatch-dashboard .dashboard-event-time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dispatch-dashboard .dashboard-event-row strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.25;
}

.dispatch-dashboard .dashboard-event-row span:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.dispatch-dashboard .dashboard-tracking-card .ui-card-body {
  display: grid;
  gap: 10px;
}

.dispatch-dashboard .dashboard-tracking-map {
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #e5e7eb;
}

.dispatch-dashboard .dashboard-tracking-map iframe {
  display: block;
  width: 100%;
  min-height: 320px;
  height: 100%;
  border: 0;
}

.dispatch-dashboard .dashboard-map-link {
  justify-self: flex-start;
}

/* Reports / statistics dashboard */
.reports-dashboard {
  display: grid;
  gap: 24px;
}

.reports-hero-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 30px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(237, 28, 36, 0.08), rgba(37, 99, 235, 0.04)),
    #fff;
}

.reports-hero-card h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(32px, 3.8vw, 48px);
  line-height: 1.02;
}

.reports-hero-card p:not(.eyebrow) {
  max-width: 760px;
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 18px;
  line-height: 1.45;
}

.reports-period-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff5f5;
  color: #b5121b;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.reports-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.reports-filter-card {
  border-radius: 24px;
}

.reports-filter-card .panel-header {
  align-items: flex-start;
  margin-bottom: 4px;
}

.reports-filter-card .muted {
  margin: 6px 0 0;
}

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

.reports-filter-grid label {
  display: grid;
  gap: 8px;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
}

.reports-filter-actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.reports-filter-actions .primary-button,
.reports-filter-actions .secondary-button {
  min-width: 142px;
}

.reports-section {
  display: grid;
  gap: 16px;
}

.reports-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 4px;
}

.reports-section-heading h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.1;
}

.reports-kpis {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.reports-kpi-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 126px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-bottom: 5px solid #ed1c24;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.reports-kpi-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(237, 28, 36, 0.07);
}

.reports-kpi-card .stat-label {
  position: relative;
  z-index: 1;
  color: #6b7280;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reports-kpi-card strong {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #111827;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.05;
}

.has-app-sidebar .app-main .reports-page .reports-kpis {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.has-app-sidebar .app-main .reports-page .reports-kpi-card strong {
  font-size: clamp(22px, 1.8vw, 30px);
}

.reports-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.report-chart-card,
.reports-full-panel,
.reports-map-card {
  display: grid;
  gap: 16px;
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.report-chart-card {
  min-height: auto;
}

.report-chart-card h2,
.reports-full-panel h2,
.reports-map-card h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.18;
}

.report-chart-card canvas,
.reports-full-panel canvas {
  max-width: 100%;
}

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

.report-summary-list p {
  padding: 13px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
}

.report-summary-list p strong {
  color: #111827;
}

.reports-two-column-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.reports-two-column-section > .panel,
.reports-chart-grid > .panel {
  align-self: start;
}

.reports-section-heading-wide {
  grid-column: 1 / -1;
}

.reports-table-wrap {
  border-radius: 16px;
}

.reports-table-wrap .data-table th {
  background: #f3f4f6;
}

.reports-table-wrap .data-table td,
.reports-table-wrap .data-table th {
  padding: 12px 14px;
}

.reports-table-wrap .data-table tbody tr:hover td {
  background: #fff7f7;
}

.reports-map-card {
  gap: 18px;
}

.report-map-shell {
  gap: 10px;
}

.report-map {
  min-height: 500px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.report-map-status {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.report-intervention-marker {
  width: 28px !important;
  height: 36px !important;
  background: transparent;
  border: 0;
}

.report-intervention-marker span {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #ed1c24;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.28);
  transform: rotate(-45deg);
}

.report-intervention-marker span::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 999px;
  background: #fff;
}

.report-map-popup-item strong {
  color: #111827;
}

.report-map-popup-item a {
  color: #b5121b;
  font-weight: 900;
}

.report-compare-box {
  gap: 10px;
  margin-top: 0;
  border-radius: 18px;
  background: #f9fafb;
}

.report-compare-box h3 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 18px;
}

.reports-warning-panel {
}

.reports-warning-panel.has-warnings {
}

.reports-warning-panel tr.has-warning td {
  background: #fff7ed !important;
  color: #7c2d12;
  font-weight: 850;
}

.reports-warning-panel tr.is-clear td:last-child {
  color: #16a34a;
  font-weight: 900;
}

.reports-analytics-center {
  --reports-red: #ed1c24;
  --reports-success: #16a34a;
  --reports-warning: #f59e0b;
  --reports-info: #2563eb;
}

.reports-metric-grid,
.reports-history-grid,
.reports-quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

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

.reports-quality-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  padding: 0;
  margin-top: 14px;
  border: 1px solid #e5e7eb;
  background: #e5e7eb;
}

.reports-quality-summary > div {
  display: grid;
  gap: 6px;
  padding: 20px;
  background: #fff;
}

.reports-quality-summary strong {
  color: #111827;
  font-size: 28px;
}

.reports-quality-summary.has-warnings .reports-quality-score {
  color: #b45309;
}

.reports-quality-summary.is-clear .reports-quality-score {
  color: #15803d;
}

.reports-quality-list {
  margin-top: 14px;
}

.reports-quality-details {
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.reports-quality-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  color: #111827;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.reports-quality-details summary::-webkit-details-marker {
  display: none;
}

.reports-quality-count {
  min-width: 36px;
  padding: 5px 9px;
  border-radius: 999px;
  text-align: center;
  background: #ecfdf5;
  color: #15803d;
}

.reports-quality-count.has-warning {
  background: #fff7ed;
  color: #b45309;
}

.reports-quality-items {
  display: grid;
  border-top: 1px solid #e5e7eb;
}

.reports-quality-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid #edf0f3;
}

.reports-quality-item:last-child {
  border-bottom: 0;
}

.reports-quality-item p,
.reports-quality-empty {
  margin: 4px 0 0;
  color: #6b7280;
}

.reports-quality-empty,
.reports-quality-items > .muted {
  padding: 16px 18px;
}

.reports-record-card {
  display: grid;
  gap: 8px;
  align-self: start;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.reports-record-card strong {
  color: #111827;
  font-size: 18px;
  line-height: 1.3;
}

.reports-kpi-card.is-success {
  border-bottom-color: var(--reports-success);
}

.reports-kpi-card.is-success::after {
  background: rgba(22, 163, 74, 0.08);
}

.reports-kpi-card.is-warning {
  border-bottom-color: var(--reports-warning);
}

.reports-kpi-card.is-warning::after {
  background: rgba(245, 158, 11, 0.11);
}

.reports-kpi-card.is-info {
  border-bottom-color: var(--reports-info);
}

.reports-kpi-card.is-info::after {
  background: rgba(37, 99, 235, 0.08);
}

.reports-kpi-card.is-danger {
  border-bottom-color: var(--reports-red);
}

.reports-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  font-weight: 750;
}

@media (max-width: 1280px) {
  .reports-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reports-two-column-section {
    grid-template-columns: 1fr;
  }

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

  .dispatch-dashboard .ops-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dispatch-dashboard .ops-content-grid,
  .dispatch-dashboard .ops-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .reports-hero-card,
  .reports-section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .reports-period-badge {
    width: fit-content;
    white-space: normal;
  }

  .reports-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .reports-hero-actions .secondary-button {
    width: 100%;
  }

  .reports-filter-grid,
  .reports-chart-grid,
  .reports-kpis,
  .reports-metric-grid,
  .reports-history-grid,
  .reports-quality-grid,
  .reports-record-grid,
  .report-summary-cards {
    grid-template-columns: 1fr;
  }

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

  .reports-quality-item {
    align-items: stretch;
    flex-direction: column;
  }

  .reports-quality-item .secondary-button {
    width: 100%;
  }

  .reports-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .reports-filter-actions .primary-button,
  .reports-filter-actions .secondary-button {
    width: 100%;
  }

  .report-chart-card {
    min-height: 280px;
  }

  .report-map {
    min-height: 340px;
  }

  .has-app-sidebar .app-shell {
    grid-template-columns: 1fr;
  }

  .app-topbar {
    padding: 12px 14px;
  }

  .topbar-user {
    display: none;
  }

  .dispatch-dashboard .ops-stat-grid {
    grid-template-columns: 1fr;
  }

  .dispatch-dashboard .vehicle-status-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-notices-strip {
    padding: 18px;
    border: 1px solid #ed1c24;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.06);
  }

  .dashboard-notices-list {
    grid-template-columns: 1fr;
  }

  .dashboard-notice-card,
  .dashboard-notice-empty {
    min-height: 0;
    padding: 16px 18px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.06);
  }
}

/* Drive log / fleet module redesign */
.drive-module {
  display: grid;
  gap: 20px;
}

.drive-two-columns {
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.drive-card,
.drive-page-hero {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.drive-page-hero {
  padding: 28px;
}

.drive-page-header,
.drive-section-header {
  align-items: flex-start;
  margin-bottom: 20px;
}

.drive-page-header h1,
.drive-section-header h1,
.drive-section-header h2 {
  margin-bottom: 6px;
}

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

.drive-stat-card {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}

.drive-stat-card span,
.drive-card-metrics small,
.drive-inline-metrics small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.drive-stat-card strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.drive-fleet-section {
  display: grid;
  gap: 18px;
}

.drive-fuel-action-card,
.drive-vehicle-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.drive-fuel-action-card:hover,
.drive-vehicle-card:hover {
  transform: translateY(-2px);
  border-color: rgba(237, 28, 36, 0.28);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.drive-fuel-action-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 118px;
  padding: 22px;
}

.drive-fuel-action-card strong,
.drive-vehicle-card strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1.12;
}

.drive-fuel-action-card p,
.drive-vehicle-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.drive-card-arrow {
  color: #94a3b8;
  font-size: 36px;
  line-height: 1;
}

.drive-card-icon,
.drive-section-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(237, 28, 36, 0.1);
  color: var(--primary);
}

.drive-card-icon svg,
.drive-section-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.drive-card-icon-muted {
  background: #f3f4f6;
  color: #475569;
}

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

.drive-vehicle-card {
  min-height: 210px;
  padding: 20px;
}

.drive-vehicle-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drive-vehicle-code,
.drive-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.drive-card-metrics,
.drive-inline-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drive-card-metrics span,
.drive-inline-metrics span {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
}

.drive-card-metrics b,
.drive-inline-metrics b {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.drive-vehicle-card-empty {
  align-content: center;
  border-style: dashed;
  box-shadow: none;
}

.drive-form-card,
.drive-table-card {
  padding: 22px;
}

.drive-form-grid {
  gap: 14px;
}

.drive-field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.drive-field input,
.drive-field select,
.drive-field textarea,
.drive-form-grid input,
.drive-form-grid select,
.drive-form-grid textarea {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
}

.drive-field textarea {
  min-height: 128px;
}

.drive-checkbox-card {
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
}

.drive-checkbox-card:has(input:checked) {
  border-color: rgba(237, 28, 36, 0.36);
  background: #fff7f7;
}

.drive-form-actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.drive-entry-form {
  display: grid;
  gap: 16px;
}

.drive-form-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.drive-form-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drive-form-section-title h2 {
  margin: 0;
  font-size: 20px;
}

.drive-form-section-title .eyebrow {
  margin-bottom: 3px;
}

.drive-section-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: var(--primary);
}

.drive-section-icon svg {
  width: 20px;
  height: 20px;
}

.drive-section-icon-info {
  background: var(--info);
}

.drive-section-icon-warning {
  background: var(--warning);
}

.drive-section-icon-muted {
  background: #64748b;
}

.drive-table-wrap {
  border-radius: 16px;
  box-shadow: none;
}

.drive-data-table {
  min-width: 980px;
}

.drive-data-table thead th {
  background: #f8fafc;
  color: #111827;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.drive-data-table tbody tr {
  transition: background-color 0.14s ease;
}

.drive-data-table tbody tr:hover td {
  background: #fff7f7;
}

.drive-data-table .action-cell a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(237, 28, 36, 0.28);
  border-radius: 999px;
  color: var(--primary);
  font-weight: 900;
}

.drive-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.drive-status-danger {
  color: #991b1b;
  background: #fee2e2;
}

.drive-status-info {
  color: #1d4ed8;
  background: #dbeafe;
}

.drive-status-warning {
  color: #92400e;
  background: #fef3c7;
}

.drive-status-neutral {
  color: #374151;
  background: #f3f4f6;
}

.drive-vehicle-summary {
  align-items: center;
}

.drive-inline-metrics {
  max-width: 430px;
  margin-top: 14px;
}

.drive-load-more {
  margin-top: 18px;
  justify-content: center;
}

@media (max-width: 1380px) {
  .drive-vehicle-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .drive-two-columns {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 700px) {
  .drive-page-hero,
  .drive-form-card,
  .drive-table-card {
    padding: 16px;
    border-radius: 16px;
  }

  .drive-page-header,
  .drive-section-header,
  .drive-vehicle-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .drive-stat-grid,
  .drive-vehicle-grid,
  .drive-card-metrics,
  .drive-inline-metrics,
  .drive-form-grid {
    grid-template-columns: 1fr;
  }

  .drive-fuel-action-card {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 18px;
  }

  .drive-fuel-action-card .drive-card-arrow {
    display: none;
  }

  .drive-vehicle-card {
    min-height: auto;
  }

  .drive-form-section {
    padding: 14px;
  }

  .drive-form-actions,
  .drive-load-more {
    align-items: stretch;
  }

  .drive-form-actions > *,
  .drive-load-more > *,
  .drive-log-create-button,
  .drive-log-page-button,
  .drive-log-save-button {
    width: 100%;
  }

  .drive-data-table {
    min-width: 860px;
  }
}

/* Breadcrumb topbar */
.app-topbar {
  align-items: center;
  min-height: 86px;
}

.topbar-title-group {
  flex: 1 1 auto;
  align-items: center;
}

.topbar-heading {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.app-topbar .topbar-heading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 2.7vw, 36px);
  font-weight: 750;
  line-height: 1;
}

.app-topbar .topbar-heading h1 a {
  color: inherit;
  text-decoration: none;
}

.app-topbar .topbar-heading h1 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
}

.topbar-breadcrumb a,
.topbar-breadcrumb span {
  min-width: 0;
}

.topbar-breadcrumb > a:first-child + span,
.topbar-breadcrumb > a:first-child + span + a,
.topbar-breadcrumb > a:first-child + span + span {
  display: none;
}

.topbar-breadcrumb > a:first-child {
  display: none;
}

.topbar-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.topbar-breadcrumb a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topbar-breadcrumb svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: 0 0 20px;
}

.topbar-actions {
  flex: 0 0 auto;
}

.topbar-user-menu-wrap {
  position: relative;
}

.topbar-user {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.topbar-user-menu-wrap .topbar-user {
  display: grid;
}

.topbar-user-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  fill: rgba(255, 255, 255, 0.78);
  transform: translateY(-50%);
  transition: transform 0.15s ease;
}

.topbar-user-menu-wrap.is-open .topbar-user-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.topbar-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100010;
  min-width: 190px;
  padding: 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.topbar-user-dropdown[hidden] {
  display: none !important;
}

.topbar-user-dropdown .topbar-logout {
  width: 100%;
  min-height: 42px;
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.topbar-user-dropdown .topbar-profile-link {
  width: 100%;
  min-height: 42px;
  margin-bottom: 8px;
  text-decoration: none;
}

@media (max-width: 820px) {
  .topbar-user-menu-wrap {
    display: block;
  }

  .topbar-user-menu-wrap .topbar-user {
    display: grid;
  }
}

@media (max-width: 700px) {
  .app-topbar {
    min-height: 72px;
    gap: 10px;
    padding: 10px 12px;
  }

  .topbar-title-group {
    gap: 10px;
  }

  .app-topbar .topbar-heading h1 {
    font-size: 22px;
  }

  .topbar-breadcrumb {
    gap: 6px;
    max-width: calc(100vw - 128px);
    overflow: hidden;
    font-size: 13px;
    white-space: nowrap;
  }

  .topbar-breadcrumb span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-user-menu-wrap .topbar-user {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
  }

  .topbar-user-menu-wrap .topbar-user span,
  .topbar-user-menu-wrap .topbar-user small,
  .topbar-user-chevron {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .topbar-user::before {
    left: 50%;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
  }
}

/* Persistent collapsible sidebar */
@media (min-width: 1181px) {
  .has-app-sidebar .app-shell {
    transition: grid-template-columns 0.18s ease;
  }

  html.sidebar-collapsed-pending body.has-app-sidebar .app-shell,
  .has-app-sidebar.sidebar-collapsed .app-shell {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  html.sidebar-collapsed-pending body.has-app-sidebar .app-sidebar,
  .has-app-sidebar.sidebar-collapsed .app-sidebar {
    width: 0;
    min-width: 0;
    padding-right: 0;
    padding-left: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
    box-shadow: none;
  }

  html.sidebar-collapsed-pending body.has-app-sidebar .sidebar-backdrop,
  .has-app-sidebar.sidebar-collapsed .sidebar-backdrop {
    display: none !important;
  }

  .sidebar-toggle {
    display: flex !important;
  }

  .sidebar-toggle[aria-expanded="false"] {
    background: rgba(255, 255, 255, 0.2);
  }
}

/* Members PGD visual register */
.members-page {
  gap: 22px;
}

.members-page .panel,
.member-profile-page .panel {
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.members-list-panel,
.members-form-panel,
.member-view-main,
.member-documents-panel {
  display: grid;
  gap: 20px;
}

.members-hero,
.members-form-header,
.member-profile-hero {
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
}

.members-header-copy {
  display: grid;
  gap: 6px;
}

.members-header-copy h1,
.members-form-header h1,
.member-profile-hero h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
}

.members-header-copy .muted {
  margin: 0;
  color: #6b7280;
  font-size: 16px;
}

.members-actions {
  align-items: center;
  justify-content: flex-end;
}

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

.member-stat-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
}

.member-stat-card span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.member-stat-card strong {
  color: #111827;
  font-size: 30px;
  line-height: 1;
}

.members-filter-form {
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f9fafb;
}

.members-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.member-form-section {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
}

.member-form-section-compact,
.member-alert-section {
  background: #f9fafb;
}

.member-alert-section {
  border-color: #fde68a;
}

.member-form-section-heading {
  display: grid;
  gap: 4px;
}

.member-form-section-heading h2 {
  margin: 0;
  color: #111827;
  font-size: 21px;
  line-height: 1.2;
}

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

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

.members-form label,
.members-filter-form label {
  display: grid;
  gap: 8px;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
}

.members-form input:not([type="checkbox"]),
.members-form select,
.members-form textarea,
.members-filter-form input:not([type="checkbox"]),
.members-filter-form select,
.members-filter-form textarea {
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
}

.members-form input[type="file"] {
  min-height: 48px;
  padding: 10px;
}

.member-checkbox-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.member-checkbox-card,
.member-active-toggle {
  display: flex !important;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

.member-checkbox-card input[type="checkbox"],
.member-active-toggle input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #ed1c24;
}

.member-medical-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(360px, auto);
  gap: 16px;
  min-width: 0;
  align-items: stretch;
}

.member-medical-block {
  display: grid;
  min-width: 0;
  min-height: 360px;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-top: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f9fafb;
}

.member-medical-block:first-child {
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.member-medical-block h3 {
  color: #111827;
  font-size: 17px;
  font-weight: 950;
}

.member-medical-block .muted,
.member-medical-block a {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.member-date-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.member-date-input-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.member-date-reset {
  flex: 0 0 auto;
  white-space: nowrap;
}

.members-form input[type="file"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: normal;
}

.member-submit-bar {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: none;
}

.member-submit-bar .form-actions {
  justify-content: flex-end;
}

.member-danger-button {
  border-color: #fecaca;
  color: #dc2626;
}

.members-table-wrap {
  max-height: 72vh;
  border-radius: 18px;
  box-shadow: none;
}

.members-data-table {
  min-width: 2500px;
  font-size: 14px;
}

.members-data-table thead th {
  background: #f3f4f6;
  color: #111827;
  font-size: 12px;
  text-transform: uppercase;
}

.members-data-table th,
.members-data-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.members-data-table a {
  color: #b5121b;
  font-weight: 900;
}

.members-data-table th:nth-child(1),
.members-data-table td:nth-child(1),
.members-data-table th:nth-child(2),
.members-data-table td:nth-child(2),
.members-data-table th:last-child,
.members-data-table td:last-child {
  background: #ffffff;
}

.members-data-table tbody tr:nth-child(even) td:nth-child(1),
.members-data-table tbody tr:nth-child(even) td:nth-child(2),
.members-data-table tbody tr:nth-child(even) td:last-child {
  background: #f9fafb;
}

.member-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.member-badge-success {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.member-badge-warning {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.member-badge-info {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.member-badge-neutral {
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #4b5563;
}

.member-profile-page {
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.55fr);
  gap: 20px;
}

.member-profile-hero {
  align-items: center;
}

.member-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.member-info-grid {
  gap: 16px;
}

.member-detail-card {
  min-height: auto !important;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: none !important;
}

.member-warning-detail-card {
  border-color: #fde68a;
  border-left: 6px solid #f59e0b;
  background: #fffbeb;
}

.member-detail-card > .muted,
.member-documents-panel .eyebrow {
  margin: 0 0 14px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.member-detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.member-detail-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.48fr) minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid #f3f4f6;
}

.member-detail-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.member-detail-list dt {
  color: #6b7280;
  font-size: 13px;
  font-weight: 900;
}

.member-detail-list dd {
  margin: 0;
  color: #111827;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.member-medical-detail-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.member-medical-detail-list div {
  grid-template-columns: 1fr;
  align-content: start;
  min-height: 96px;
  padding: 14px 18px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
}

.member-medical-detail-list dd {
  line-height: 1.25;
}

.member-documents-panel h2 {
  margin: 0;
  color: #111827;
  font-size: 24px;
}

.member-documents-wrap {
  border-radius: 18px;
  overflow-x: hidden;
}

.member-documents-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.member-documents-table th,
.member-documents-table td {
  overflow-wrap: anywhere;
}

.member-documents-table a {
  color: #b5121b;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .member-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .member-profile-page {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .members-page,
  .members-form-panel,
  .members-form,
  .member-form-section,
  .member-medical-list,
  .member-medical-block {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .members-actions,
  .member-submit-bar,
  .member-submit-bar .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .members-actions > *,
  .member-submit-bar .form-actions > * {
    width: 100%;
  }

  .member-stats-grid,
  .member-form-grid,
  .member-form-grid-two,
  .member-medical-list,
  .member-info-grid,
  .member-medical-detail-list {
    grid-template-columns: 1fr;
  }

  .member-medical-list {
    grid-auto-rows: auto;
  }

  .member-medical-block {
    min-height: 0;
  }

  .member-submit-bar {
    position: static;
  }

  .member-detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .members-table-wrap {
    max-height: none;
  }

  .members-list-panel {
    display: flex;
    flex-direction: column;
  }

  .members-list-panel .stats-grid.events-stats.member-stats {
    order: 1;
  }

  .members-list-panel .members-top-actions {
    order: 2;
  }

  .members-list-panel .members-filter-form {
    order: 3;
  }

  .members-list-panel .members-table-wrap {
    order: 4;
  }
}

@media (max-width: 700px) {
  .members-page .panel,
  .member-profile-page .panel,
  .member-form-section {
    border-radius: 18px;
  }

  .member-stat-card,
  .member-form-section,
  .member-detail-card {
    padding: 16px;
  }

  .has-app-sidebar .app-main .members-page .panel-header .primary-button,
  .has-app-sidebar .app-main .members-page .panel-header .secondary-button,
  .has-app-sidebar .app-main .members-page .form-actions .primary-button,
  .has-app-sidebar .app-main .members-page .form-actions .secondary-button {
    width: auto;
    min-height: 38px;
    padding: 0 13px;
    font-size: 13px;
    border-radius: 10px;
  }

  .has-app-sidebar .app-main .members-page .panel-header,
  .has-app-sidebar .app-main .members-page .form-actions {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .member-date-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .member-date-reset {
    width: 100%;
  }
}

/* Stabno vodenje v2 */
.stab-page {
  display: grid;
  gap: 20px;
}

.stab-hero,
.stab-command-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ed1c24, #b5121b);
  color: #fff;
  box-shadow: 0 18px 42px rgba(181, 18, 27, 0.22);
}

.stab-hero h1,
.stab-command-strip h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

.stab-hero p,
.stab-command-strip p,
.stab-hero .eyebrow,
.stab-command-strip .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}

.stab-command-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.stab-nav {
  display: flex;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  overflow-x: auto;
}

.stab-nav a {
  flex: 0 0 auto;
  padding: 10px 13px;
  border-radius: 12px;
  color: #111827;
  font-weight: 900;
}

.stab-nav a.is-active,
.stab-nav-back {
  background: #ed1c24;
  color: #fff !important;
}

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

.stab-kpi-grid-nine {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

.stab-kpi-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.stab-kpi-card span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.stab-kpi-card strong {
  color: #111827;
  font-size: 30px;
  line-height: 1;
}

.stab-panel {
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.stab-layout-two,
.stab-dashboard-grid,
.stab-map-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.stab-layout-two {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.stab-dashboard-grid {
  grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.35fr) minmax(280px, 0.72fr);
}

.stab-map-layout {
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.5fr);
}

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

.stab-form-grid label {
  display: grid;
  gap: 7px;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  min-width: 0;
}

.stab-form-grid input,
.stab-form-grid select,
.stab-form-grid textarea,
.stab-inline-form select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  color: #111827;
}

.stab-location-picker-field span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
  align-items: stretch;
}

.stab-location-picker-field .is-icon {
  min-height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.stab-map-tools .stab-form-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.stab-map-tools .span-two {
  grid-column: auto;
}

.stab-map-tools form + form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.stab-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.stab-table {
  min-width: 980px;
}

.stab-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.stab-badge-success { background: #dcfce7; color: #166534; }
.stab-badge-warning { background: #fef3c7; color: #92400e; }
.stab-badge-danger { background: #fee2e2; color: #991b1b; }
.stab-badge-info { background: #dbeafe; color: #1d4ed8; }
.stab-badge-neutral { background: #f3f4f6; color: #4b5563; }

.stab-phase-indicator {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.stab-phase-indicator span {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #6b7280;
  text-align: center;
  font-weight: 950;
  text-transform: uppercase;
}

.stab-phase-indicator .is-active {
  border-color: #ed1c24;
  background: #ed1c24;
  color: #fff;
}

.stab-card-grid,
.stab-mini-list {
  display: grid;
  gap: 12px;
}

.stab-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stab-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.stab-task-card,
.stab-sector-card,
.stab-resource-card,
.stab-call-card,
.stab-alert-card,
.stab-sitrep-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}

.stab-task-card p,
.stab-sector-card p,
.stab-resource-card p,
.stab-call-card p,
.stab-alert-card p,
.stab-sitrep-card p {
  margin: 0;
  color: #111827;
  line-height: 1.35;
}

.stab-kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(240px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.stab-kanban-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 360px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f9fafb;
}

.stab-kanban-column h3 {
  margin: 0;
  color: #111827;
  font-size: 15px;
  text-transform: uppercase;
}

.stab-map-panel {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #dbeafe;
}

.stab-map-canvas {
  min-height: 560px;
  width: 100%;
}

.stab-map-legend {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}

.stab-map-legend span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.18);
}

.stab-leaflet-marker {
  border: 0;
  background: transparent;
}

.stab-leaflet-marker span {
  display: block;
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.32);
}

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

.stab-timeline article {
  display: grid;
  grid-template-columns: 170px minmax(0, 0.4fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}

.stab-timeline time {
  color: #6b7280;
  font-weight: 900;
}

.stab-timeline p {
  margin: 0;
}

@media (max-width: 1280px) {
  .stab-kpi-grid-nine {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stab-dashboard-grid,
  .stab-map-layout,
  .stab-layout-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .stab-hero,
  .stab-command-strip {
    flex-direction: column;
  }

  .stab-kpi-grid,
  .stab-kpi-grid-nine,
  .stab-form-grid,
  .stab-phase-indicator {
    grid-template-columns: 1fr;
  }

  .stab-timeline article {
    grid-template-columns: 1fr;
  }
}

/* Vozila in oprema: modern visual layer. Backend hooks stay untouched. */
.inventory-module {
  gap: 20px;
}

.inventory-module .panel,
.inventory-module .hero-card,
.inventory-detail-page .panel {
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.inventory-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(237, 28, 36, 0.14) !important;
  background:
    linear-gradient(135deg, rgba(237, 28, 36, 0.08), rgba(255, 255, 255, 0) 40%),
    #ffffff !important;
}

.inventory-hero h1,
.inventory-detail-hero h1 {
  margin-bottom: 8px;
  color: #111827;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.03;
  letter-spacing: 0;
}

.inventory-hero p,
.inventory-detail-hero p {
  max-width: 760px;
  color: #6b7280;
}

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

.inventory-stat-card,
.inventory-audit-stats .stat-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.inventory-stat-card::before,
.inventory-audit-stats .stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #ed1c24;
}

.inventory-audit-stats .stat-card-ok::before {
  background: #16a34a;
}

.inventory-audit-stats .stat-card-not-ok::before {
  background: #dc2626;
}

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

.inventory-hub-card {
  position: relative;
  min-height: 230px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  color: #111827;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.inventory-hub-card:hover {
  transform: translateY(-2px);
  border-color: rgba(237, 28, 36, 0.35);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.11);
}

.inventory-card-icon {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 18px;
  background: #ed1c24;
  color: #ffffff;
  font-size: 24px;
  font-weight: 950;
}

.inventory-hub-card:nth-child(2) .inventory-card-icon {
  background: #2563eb;
}

.inventory-hub-card:nth-child(3) .inventory-card-icon {
  background: #f59e0b;
}

.inventory-hub-card:nth-child(4) .inventory-card-icon {
  background: #111827;
}

.inventory-form-panel,
.inventory-list-panel,
.inventory-filter-card,
.inventory-search-panel {
  min-width: 0;
}

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

.inventory-form-section,
.inventory-filter-card,
.inventory-start-panel,
.inventory-search-panel {
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
}

.inventory-form-section {
  background: #fbfcfe;
}

.inventory-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.inventory-section-title h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.15;
}

.inventory-section-title .eyebrow {
  margin-bottom: 4px;
  color: #ed1c24;
}

.inventory-form .form-grid,
.inventory-filter-card.form-grid,
.inventory-filter-card .form-grid {
  gap: 16px;
}

.inventory-form input,
.inventory-form select,
.inventory-form textarea,
.inventory-filter-card input,
.inventory-filter-card select,
.inventory-filter-card textarea,
.inventory-search-panel input {
  min-height: 52px;
  border-color: #d7dce3;
  border-radius: 14px;
  background: #ffffff;
}

.inventory-form textarea,
.inventory-filter-card textarea {
  min-height: 116px;
}

.inventory-checkbox-row {
  min-height: 52px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #d7dce3;
  border-radius: 14px;
  background: #ffffff;
  box-sizing: border-box;
}

.equipment-inventory-checkbox,
.admin-option-checkbox {
  height: 52px;
  min-height: 52px;
  align-content: center;
  padding: 12px 14px;
  box-sizing: border-box;
}

.equipment-page .inventory-form .equipment-inventory-checkbox,
.has-app-sidebar .app-main .equipment-page .inventory-form .equipment-inventory-checkbox {
  align-self: end;
  height: 52px;
  min-height: 52px;
  padding: 0 14px;
}

.location-active-checkbox,
.has-app-sidebar .app-main .location-active-checkbox {
  align-self: end;
  height: 52px;
  min-height: 52px;
}

.notices-page {
  align-items: start;
}

.notice-form-panel textarea {
  min-height: 170px;
  resize: vertical;
}

.notices-table td {
  vertical-align: top;
}

.notices-table td:nth-child(2) {
  min-width: 280px;
}

.notices-table td:nth-child(2) strong,
.notices-table td:nth-child(2) small,
.notices-table td:nth-child(3) small {
  display: block;
}

.notices-table td:nth-child(2) strong {
  margin-bottom: 6px;
  white-space: pre-wrap;
}

.notices-table td:nth-child(2) small,
.notices-table td:nth-child(3) small {
  color: #6b7280;
  font-weight: 700;
}

.notices-table .notice-row-closed td,
.notices-table .notice-row-expired td {
  color: #6b7280;
  background: #f9fafb;
}

.inventory-checkbox-row input[type="checkbox"] {
  min-height: auto;
}

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

.inventory-mini-card,
.vehicle-fieldset.inventory-mini-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
}

.inventory-mini-card legend {
  padding: 0 8px;
  color: #111827;
  font-weight: 950;
}

.vehicle-optional-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.inventory-actions-section {
  display: grid;
  gap: 16px;
  background: #ffffff;
}

.inventory-status-grid,
.inventory-status-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inventory-detail-page {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.55fr);
  gap: 20px;
}

.equipment-detail-page {
  grid-template-columns: 1fr;
}

.inventory-detail-hero {
  align-items: center;
}

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

.inventory-detail-card {
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: none;
}

.inventory-detail-card > .muted,
.inventory-documents-panel > .eyebrow {
  margin: 0 0 14px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.inventory-detail-card p {
  margin-bottom: 10px;
}

.inventory-detail-card p:last-child {
  margin-bottom: 0;
}

.inventory-detail-card strong {
  color: #111827;
}

.inventory-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.inventory-badge,
.inventory-date-badge,
.inventory-location-badge,
.inventory-progress-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.inventory-badge-success {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.inventory-badge-warning {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.inventory-badge-muted {
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #4b5563;
}

.inventory-date-badge {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
}

.inventory-location-badge {
  border-color: #fee2e2;
  background: #fff1f2;
  color: #b5121b;
}

.inventory-progress-badge {
  border-color: #e0e7ff;
  background: #eef2ff;
  color: #3730a3;
}

.inventory-table-wrap {
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

.inventory-data-table thead th {
  background: #f8fafc;
  color: #111827;
  font-weight: 950;
}

.inventory-data-table tbody tr:hover td {
  background: #fff7f7;
}

.inventory-data-table a {
  color: #b5121b;
  font-weight: 900;
}

.inventory-documents-panel h2,
.inventory-list-panel h2 {
  margin: 0;
  color: #111827;
}

.inventory-documents-panel .inventory-table-wrap:has(.vehicle-documents-table) {
  overflow-x: hidden;
}

.vehicle-documents-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.vehicle-documents-table th,
.vehicle-documents-table td {
  overflow-wrap: anywhere;
}

.vehicle-documents-table a {
  color: #b5121b;
  font-weight: 900;
}

.inventory-print-actions,
.inventory-list-panel .actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-picker-table {
  width: auto;
  min-width: max-content;
  table-layout: auto;
}

.label-picker-table th,
.label-picker-table td {
  position: static !important;
  left: auto !important;
  right: auto !important;
  z-index: auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  white-space: nowrap;
}

.label-picker-table th:nth-child(3),
.label-picker-table td:nth-child(3) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.inventory-audit-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.inventory-audit-toggle {
  display: flex;
  gap: 8px;
}

.inventory-audit-toggle .secondary-button.is-small {
  min-width: 78px;
  border-radius: 12px;
  font-weight: 950;
}

.inventory-audit-toggle .is-active-positive {
  border-color: #16a34a;
  background: #16a34a;
  color: #ffffff;
}

.inventory-audit-toggle .is-active-negative {
  border-color: #dc2626;
  background: #dc2626;
  color: #ffffff;
}

.inventory-audit-divider-label {
  border-top-color: #ed1c24;
  color: #b5121b;
}

.audit-scan-grid {
  grid-template-columns: minmax(0, 1fr) auto;
}

.audit-scan-grid .actions-row {
  align-self: end;
}

.audit-scan-grid .primary-button {
  min-height: 48px;
  border-radius: 12px;
}

.equipment-list-panel .panel-header,
.inventory-list-panel .panel-header {
  align-items: center;
}

.equipment-table-wrap,
.members-table-wrap {
  scrollbar-gutter: stable;
}

.vehicles-page .inventory-list-panel,
.equipment-page .inventory-list-panel {
  align-self: start;
}

@media (max-width: 1180px) {
  .inventory-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-detail-page,
  .page-grid.two-columns.vehicle-page-grid,
  .page-grid.two-columns.equipment-page {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .inventory-stats,
  .inventory-hub-grid,
  .inventory-detail-grid,
  .inventory-subgrid,
  .inventory-form .form-grid,
  .inventory-filter-card.form-grid,
  .inventory-filter-card .form-grid,
  .stats-grid.stats-grid-five.inventory-audit-stats {
    grid-template-columns: 1fr;
  }

  .inventory-module .panel,
  .inventory-module .hero-card,
  .inventory-detail-page .panel,
  .inventory-form-section,
  .inventory-filter-card,
  .inventory-search-panel {
    border-radius: 18px;
  }

  .inventory-detail-page {
    grid-template-columns: 1fr;
  }

  .inventory-detail-hero,
  .inventory-list-panel .panel-header,
  .equipment-list-panel .panel-header,
  .inventory-section-title,
  .inventory-print-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-module .primary-button,
  .inventory-module .secondary-button,
  .inventory-detail-page .primary-button,
  .inventory-detail-page .secondary-button {
    width: 100%;
  }

  .audit-scan-grid {
    grid-template-columns: 1fr;
  }

  .inventory-audit-toggle {
    flex-direction: column;
  }

  .inventory-audit-toggle .secondary-button.is-small {
    width: 100%;
    min-height: 44px;
  }

  .label-picker-table,
  .inventory-audits-list-table {
    min-width: 760px;
  }

  .inventory-labels-page .inventory-print-actions {
    align-items: center;
    flex-direction: row;
  }

  .inventory-labels-page .inventory-print-actions .primary-button {
    width: auto;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
  }
}

@media (max-width: 700px) {
  .inventory-hero h1,
  .inventory-detail-hero h1 {
    font-size: 30px;
  }

  .inventory-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 21px;
  }

  .inventory-form-section,
  .inventory-detail-card {
    padding: 16px;
  }
}

/* Meratch sensors */
.meratch-dashboard-page {
  gap: 20px;
}

.meratch-dashboard-page .panel,
.meratch-dashboard-page .hero-card {
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.meratch-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(237, 28, 36, 0.08), rgba(255, 255, 255, 0) 42%),
    #ffffff;
}

.meratch-hero-card h1 {
  margin-bottom: 8px;
  color: #111827;
  font-size: clamp(32px, 3vw, 48px);
  line-height: 1.03;
}

.meratch-hero-card p {
  max-width: 760px;
  color: #6b7280;
}

.meratch-webhook-note {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f8fafc;
  color: #374151;
  font-size: 13px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

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

.meratch-kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 122px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
}

.meratch-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #ed1c24;
}

.meratch-kpi-card.is-ok::before {
  background: #16a34a;
}

.meratch-kpi-card.is-warning::before {
  background: #f59e0b;
}

.meratch-kpi-card.is-danger::before {
  background: #dc2626;
}

.meratch-panel h2 {
  margin: 0;
  color: #111827;
}

.meratch-table-wrap {
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

.meratch-table {
  min-width: 1180px;
}

.meratch-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fafc;
  color: #111827;
  font-weight: 950;
}

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

.meratch-table tbody tr:hover td {
  background: #fff7f7;
}

.meratch-metric {
  color: #111827;
  font-size: 18px;
  font-weight: 950;
}

.meratch-status-badge,
.meratch-indicator {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.meratch-status-badge.is-success,
.meratch-indicator.is-success {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.meratch-status-badge.is-warning,
.meratch-indicator.is-warning {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.meratch-status-badge.is-danger,
.meratch-indicator.is-danger {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.meratch-status-badge.is-muted,
.meratch-indicator.is-muted {
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #4b5563;
}

.meratch-indicator.is-info {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.meratch-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

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

.meratch-detail-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.meratch-detail-list div {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f3f4f6;
}

.meratch-detail-list div:last-child {
  border-bottom: 0;
}

.meratch-detail-list dt {
  color: #6b7280;
  font-weight: 900;
}

.meratch-detail-list dd {
  margin: 0;
  color: #111827;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.meratch-chart-panel canvas {
  max-height: 360px;
  margin-top: 18px;
}

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

.meratch-overview-chart-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fbfcfe;
}

.meratch-chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.meratch-chart-card-header strong {
  display: block;
  color: #111827;
  font-size: 17px;
  font-weight: 950;
}

.meratch-chart-card-header span:not(.meratch-indicator) {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 850;
}

.meratch-frequency-panel {
  margin-top: 16px;
}

.meratch-frequency-table-wrap {
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}

.meratch-frequency-table {
  width: auto;
  min-width: 0;
  table-layout: auto;
}

.meratch-frequency-table th,
.meratch-frequency-table td {
  width: auto;
  white-space: nowrap;
}

.meratch-frequency-table select {
  width: auto;
  min-width: 150px;
}

.large-call-reception-hero {
  margin-bottom: 18px;
}

.large-intervention-status-panel.large-call-reception-hero {
  border-radius: 0;
  box-shadow: none;
}

.large-call-reception-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.large-call-reception-form,
.large-call-map-panel {
  min-width: 0;
}

.large-call-side-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.large-call-reception-form {
  display: grid;
  gap: 16px;
}

.large-call-reception-form .panel-header {
  margin-bottom: -8px;
}

.large-call-reception-form label {
  display: grid;
  gap: 8px;
  font-weight: 850;
}

.large-call-reception-form input,
.large-call-reception-form textarea {
  width: 100%;
}

.large-call-reception-form .large-call-datetime-field {
  justify-self: start;
  min-width: 230px;
  max-width: 280px;
  width: auto;
}

.large-call-reception-form .large-call-datetime-field input {
  width: auto;
  min-width: 230px;
}

.large-call-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.large-call-reception-form .large-call-info-input {
  min-height: 48px;
  height: 48px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: none;
}

.large-call-map {
  width: 100%;
  min-height: 360px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  background: #f3f4f6;
}

.large-call-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.large-call-recent-table {
  table-layout: fixed;
  width: 100%;
}

.large-call-recent-table col.col-call-time {
  width: 96px;
}

.large-call-recent-table col.col-call-location {
  width: 24%;
}

.large-call-recent-table col.col-call-event {
  width: 24%;
}

.large-call-recent-table col.col-call-info {
  width: auto;
}

.large-call-recent-table th,
.large-call-recent-table td {
  padding: 8px 7px;
  font-size: 12px;
  line-height: 1.22;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .large-call-reception-layout {
    grid-template-columns: 1fr;
  }

  .large-call-map {
    min-height: 380px;
  }

  .large-call-contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .meratch-frequency-panel,
  .meratch-frequency-panel .table-wrap,
  .meratch-frequency-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .meratch-frequency-table-wrap {
    padding-bottom: 72px;
  }

  .meratch-frequency-table {
    width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .meratch-frequency-table th,
  .meratch-frequency-table td {
    padding-right: 6px;
    padding-left: 6px;
    white-space: normal;
    word-break: break-word;
  }

  .meratch-frequency-table select {
    width: 100%;
    min-width: 0;
    scroll-margin-bottom: 140px;
  }
}

.meratch-frequency-actions {
  margin-top: 16px;
}

.meratch-overview-chart-card canvas {
  width: 100% !important;
  height: 240px !important;
}

.meratch-empty-chart {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  color: #6b7280;
  font-weight: 850;
}

.meratch-period-buttons .secondary-button.is-selected {
  border-color: #ed1c24;
  background: #ed1c24;
  color: #ffffff;
}

.meratch-json-details {
  max-width: 460px;
}

.meratch-json-details summary {
  cursor: pointer;
  color: #b5121b;
  font-weight: 900;
}

.meratch-json-preview {
  max-width: 100%;
  max-height: 260px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #111827;
  color: #e5e7eb;
  font: 12px/1.45 Consolas, "Courier New", monospace;
  white-space: pre;
}

.meratch-sensor-form {
  display: grid;
  gap: 18px;
}

.meratch-form-section {
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fbfcfe;
}

.meratch-section-title {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.meratch-section-title h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
}

.meratch-checkbox-row {
  min-height: 52px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #d7dce3;
  border-radius: 14px;
  background: #ffffff;
}

.meratch-checkbox-row input[type="checkbox"] {
  min-height: auto;
}

.meratch-sensor-form small {
  display: block;
  margin-top: 8px;
  color: #6b7280;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .meratch-kpi-grid,
  .meratch-detail-grid,
  .meratch-overview-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .meratch-hero-card,
  .meratch-hero-card .button-row,
  .meratch-chart-panel .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .meratch-kpi-grid,
  .meratch-detail-grid,
  .meratch-overview-chart-grid,
  .meratch-sensor-form .form-grid {
    grid-template-columns: 1fr;
  }

  .meratch-dashboard-page .primary-button,
  .meratch-dashboard-page .secondary-button {
    width: 100%;
  }

  .meratch-detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .meratch-table {
    min-width: 960px;
  }

  .meratch-json-details {
    max-width: 320px;
  }
}

/* UI harmonization layer */
.has-app-sidebar .app-main {
  background:
    radial-gradient(circle at 100% 0%, rgba(237, 28, 36, 0.045), transparent 32%),
    var(--bg);
}

.has-app-sidebar .container {
  display: grid;
  gap: 22px;
}

.has-app-sidebar .app-main .page-grid,
.has-app-sidebar .app-main .reports-dashboard,
.has-app-sidebar .app-main .inventory-module,
.has-app-sidebar .app-main .drive-module,
.has-app-sidebar .app-main .events-page,
.has-app-sidebar .app-main .member-profile-page,
.has-app-sidebar .app-main .meratch-dashboard-page {
  gap: 22px;
}

.has-app-sidebar .app-main .panel,
.has-app-sidebar .app-main .hero-card,
.has-app-sidebar .app-main .stat-card,
.has-app-sidebar .app-main .detail-card,
.has-app-sidebar .app-main .subpanel,
.has-app-sidebar .app-main .module-card,
.has-app-sidebar .app-main .ui-card,
.has-app-sidebar .app-main .drive-card,
.has-app-sidebar .app-main .drive-page-hero,
.has-app-sidebar .app-main .member-detail-card,
.has-app-sidebar .app-main .inventory-detail-card,
.has-app-sidebar .app-main .inventory-form-section,
.has-app-sidebar .app-main .event-summary-card,
.has-app-sidebar .app-main .meratch-overview-chart-card {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 45px rgba(15, 23, 42, 0.055);
}

.has-app-sidebar .app-main .hero-card,
.has-app-sidebar .app-main .drive-page-hero,
.has-app-sidebar .app-main .reports-hero-card,
.has-app-sidebar .app-main .inventory-hero,
.has-app-sidebar .app-main .meratch-hero-card,
.has-app-sidebar .app-main .events-index-hero {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(237, 28, 36, 0.075), rgba(255, 255, 255, 0) 46%),
    #ffffff;
}

.has-app-sidebar .app-main .hero-card h1,
.has-app-sidebar .app-main .panel-header h1,
.has-app-sidebar .app-main .panel-header h2,
.has-app-sidebar .app-main .ui-card-header h2,
.has-app-sidebar .app-main .drive-section-header h1,
.has-app-sidebar .app-main .drive-section-header h2,
.has-app-sidebar .app-main .inventory-section-title h2,
.has-app-sidebar .app-main .event-section-title h2,
.has-app-sidebar .app-main .reports-section-heading h2 {
  letter-spacing: 0;
}

.has-app-sidebar .app-main .hero-card p:not(.eyebrow),
.has-app-sidebar .app-main .lead,
.has-app-sidebar .app-main .muted,
.has-app-sidebar .app-main .panel-header p:not(.eyebrow) {
  color: var(--muted);
}

.has-app-sidebar .app-main .panel-header,
.has-app-sidebar .app-main .ui-card-header,
.has-app-sidebar .app-main .drive-page-header,
.has-app-sidebar .app-main .drive-section-header,
.has-app-sidebar .app-main .inventory-detail-hero,
.has-app-sidebar .app-main .reports-section-heading {
  align-items: center;
  gap: 18px;
}

.has-app-sidebar .app-main .module-grid {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 18px;
}

.has-app-sidebar .app-main .module-card {
  min-height: 156px;
  padding: 22px;
  color: var(--text);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.has-app-sidebar .app-main .module-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--primary);
  opacity: 0.92;
}

.has-app-sidebar .app-main .module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(237, 28, 36, 0.34);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.09), 0 22px 52px rgba(15, 23, 42, 0.08);
}

.has-app-sidebar .app-main .module-card strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
}

.has-app-sidebar .app-main .module-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.has-app-sidebar .app-main .stats-grid,
.has-app-sidebar .app-main .ops-stat-grid,
.has-app-sidebar .app-main .reports-kpis,
.has-app-sidebar .app-main .drive-stat-grid,
.has-app-sidebar .app-main .member-stats-grid,
.has-app-sidebar .app-main .meratch-kpi-grid {
  gap: 18px;
}

.has-app-sidebar .app-main .stat-card,
.has-app-sidebar .app-main .ops-stat-card,
.has-app-sidebar .app-main .drive-stat-card,
.has-app-sidebar .app-main .member-stat-card,
.has-app-sidebar .app-main .reports-kpi-card,
.has-app-sidebar .app-main .meratch-kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 20px;
}

.has-app-sidebar .app-main .stat-card::after,
.has-app-sidebar .app-main .drive-stat-card::after,
.has-app-sidebar .app-main .member-stat-card::after,
.has-app-sidebar .app-main .reports-kpi-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -36px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: rgba(237, 28, 36, 0.08);
}

.has-app-sidebar .app-main .stat-label,
.has-app-sidebar .app-main .drive-stat-card span,
.has-app-sidebar .app-main .member-stat-card span,
.has-app-sidebar .app-main .reports-kpi-card .stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.has-app-sidebar .app-main .stat-card strong,
.has-app-sidebar .app-main .drive-stat-card strong,
.has-app-sidebar .app-main .member-stat-card strong,
.has-app-sidebar .app-main .reports-kpi-card strong {
  color: var(--text);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 950;
  line-height: 1;
}

.has-app-sidebar .app-main .drive-stat-card strong {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.15;
}

.has-app-sidebar .app-main .button,
.has-app-sidebar .app-main .primary-button,
.has-app-sidebar .app-main .secondary-button,
.has-app-sidebar .app-main .table-action,
.has-app-sidebar .app-main button:not(.sidebar-toggle):not(.sidebar-close):not(.topbar-user):not(.sidebar-backdrop) {
  min-height: 46px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.has-app-sidebar .app-main .primary-button,
.has-app-sidebar .app-main .button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.has-app-sidebar .app-main .primary-button:hover,
.has-app-sidebar .app-main .button-primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.has-app-sidebar .app-main .secondary-button,
.has-app-sidebar .app-main .button,
.has-app-sidebar .app-main .table-action {
  border-color: #d7dde5;
  background: #ffffff;
  color: var(--text);
}

.has-app-sidebar .app-main .secondary-button:hover,
.has-app-sidebar .app-main .button:hover,
.has-app-sidebar .app-main .table-action:hover {
  border-color: rgba(237, 28, 36, 0.32);
  background: #fff7f7;
  color: var(--primary-dark);
}

.has-app-sidebar .app-main .danger-button,
.has-app-sidebar .app-main .secondary-button.danger-button {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
}

.has-app-sidebar .app-main .button-row,
.has-app-sidebar .app-main .form-actions,
.has-app-sidebar .app-main .actions-row,
.has-app-sidebar .app-main .reports-filter-actions,
.has-app-sidebar .app-main .inventory-print-actions {
  gap: 12px;
}

.has-app-sidebar .app-main label,
.has-app-sidebar .app-main .form-group,
.has-app-sidebar .app-main .ui-form-field,
.has-app-sidebar .app-main .drive-field {
  gap: 8px;
}

.has-app-sidebar .app-main label,
.has-app-sidebar .app-main .ui-form-field,
.has-app-sidebar .app-main .drive-field,
.has-app-sidebar .app-main .form-group {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.has-app-sidebar .app-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.has-app-sidebar .app-main select,
.has-app-sidebar .app-main textarea {
  min-height: 50px;
  border: 1px solid #d7dde5;
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

.has-app-sidebar .app-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.has-app-sidebar .app-main select:focus,
.has-app-sidebar .app-main textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.11);
}

.has-app-sidebar .app-main input[type="file"] {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}

.has-app-sidebar .app-main input[type="checkbox"],
.has-app-sidebar .app-main input[type="radio"] {
  accent-color: var(--primary);
}

.has-app-sidebar .app-main .checkbox-row,
.has-app-sidebar .app-main .member-checkbox-card,
.has-app-sidebar .app-main .inventory-checkbox-row,
.has-app-sidebar .app-main .drive-checkbox-card,
.has-app-sidebar .app-main .event-checkbox-card {
  border: 1px solid #d7dde5;
  border-radius: 14px;
  background: #ffffff;
}

/* Event form refinements kept after the global checkbox skin. */
.has-app-sidebar .app-main .event-equipment-toggle,
.has-app-sidebar .app-main .event-equipment-toggle:has(input:checked),
.has-app-sidebar .app-main .event-billable-confirm,
.has-app-sidebar .app-main .event-billable-confirm:has(input:checked),
.event-equipment-toggle,
.event-equipment-toggle:has(input:checked),
.event-billable-confirm,
.event-billable-confirm:has(input:checked) {
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.event-cost-sticky {
  position: static !important;
  top: auto !important;
}

.has-app-sidebar .app-main .client-vat-checkbox,
.has-app-sidebar .app-main .invoice-option-checkbox,
.has-app-sidebar .app-main .admin-user-option-checkbox,
.has-app-sidebar .app-main .admin-option-checkbox,
.client-vat-checkbox,
.invoice-option-checkbox,
.admin-user-option-checkbox,
.admin-option-checkbox {
  min-height: 52px;
  padding: 12px 16px;
}

.intervention-billing-form {
  display: grid;
  gap: 28px;
}

.intervention-billing-commander {
  margin-bottom: 16px;
}

.intervention-billing-section-title {
  margin: 24px 0 16px;
}

.intervention-billing-table {
  margin-bottom: 16px;
}

.intervention-billing-actions {
  margin-top: 22px;
}

.has-app-sidebar .app-main .table-wrap,
.has-app-sidebar .app-main .table-wrapper,
.has-app-sidebar .app-main .ui-table-wrap,
.has-app-sidebar .app-main .wide-table-wrap,
.has-app-sidebar .app-main .members-table-wrap,
.has-app-sidebar .app-main .inventory-table-wrap,
.has-app-sidebar .app-main .reports-table-wrap,
.has-app-sidebar .app-main .drive-table-wrap,
.has-app-sidebar .app-main .activity-log-table-wrap,
.has-app-sidebar .app-main .meratch-table-wrap {
  border: 1px solid #dfe5ec;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

.has-app-sidebar .app-main .data-table,
.has-app-sidebar .app-main .wide-data-table,
.has-app-sidebar .app-main .members-data-table {
  color: var(--text);
}

.has-app-sidebar .app-main .data-table thead th,
.has-app-sidebar .app-main .wide-data-table thead th,
.has-app-sidebar .app-main .members-data-table thead th {
  background: #f8fafc;
  color: #111827;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.has-app-sidebar .app-main .data-table th,
.has-app-sidebar .app-main .data-table td,
.has-app-sidebar .app-main .wide-data-table th,
.has-app-sidebar .app-main .wide-data-table td,
.has-app-sidebar .app-main .members-data-table th,
.has-app-sidebar .app-main .members-data-table td {
  border-color: #e5e7eb;
  padding: 14px 16px;
  vertical-align: top;
}

.has-app-sidebar .app-main .data-table tbody tr:nth-child(even) td,
.has-app-sidebar .app-main .wide-data-table tbody tr:nth-child(even) td,
.has-app-sidebar .app-main .members-data-table tbody tr:nth-child(even) td {
  background: #f9fafb;
}

.has-app-sidebar .app-main .data-table tbody tr:hover td,
.has-app-sidebar .app-main .wide-data-table tbody tr:hover td,
.has-app-sidebar .app-main .members-data-table tbody tr:hover td {
  background: #fff7f7;
}

.admin-permissions-table .table-checkbox-row,
.has-app-sidebar .app-main .admin-permissions-table .table-checkbox-row,
.has-app-sidebar .app-main .admin-permissions-table .table-checkbox-row:has(input:checked) {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-permissions-table .table-checkbox-row span {
  font-weight: 800;
}

.admin-users-table .clickable-table-row {
  cursor: pointer;
}

.admin-users-table .clickable-table-row:focus-visible td {
  outline: 2px solid rgba(237, 28, 36, 0.32);
  outline-offset: -2px;
}

.admin-users-table .clickable-table-row.user-password-pending td,
.admin-users-table .clickable-table-row.user-password-pending td a {
  color: #d92d20 !important;
}

.admin-notification-settings {
  display: grid;
  gap: 8px;
}

.admin-notification-settings + .admin-user-option-checkbox {
  margin-top: 18px;
}

.has-app-sidebar .app-main .action-cell,
.has-app-sidebar .app-main .action-cell a,
.has-app-sidebar .app-main .table-action {
  color: var(--primary-dark);
  font-weight: 950;
}

.has-app-sidebar .app-main .inventory-audit-table tbody tr.audit-status-ok td {
  background: #ecfdf3 !important;
}

.has-app-sidebar .app-main .inventory-audit-table tbody tr.audit-status-not_ok td {
  background: #fff1f2 !important;
}

.has-app-sidebar .app-main .events-table .event-row-red td,
.has-app-sidebar .app-main .events-table .event-row-red .action-cell,
.has-app-sidebar .app-main .event-row-red td {
  background: var(--primary) !important;
  color: #ffffff !important;
}

.has-app-sidebar .app-main .events-table .event-row-red a,
.has-app-sidebar .app-main .event-row-red a,
.has-app-sidebar .app-main .events-table .event-row-red span,
.has-app-sidebar .app-main .event-row-red span {
  color: #ffffff !important;
}

/* Event list color contract: finalized rows use text color only, saved rows use row color. */
.has-app-sidebar .app-main .events-table tbody tr:not(.event-row-red):not(.event-row-blue):not(.event-row-green):not(.event-row-purple):not(.event-row-brown):not(.event-row-red-soft):not(.event-row-blue-soft):not(.event-row-green-soft):not(.event-row-purple-soft):not(.event-row-brown-soft):not(.event-row-default-soft) .action-cell a,
.has-app-sidebar .app-main .events-table tbody tr:not(.event-row-red):not(.event-row-blue):not(.event-row-green):not(.event-row-purple):not(.event-row-brown):not(.event-row-red-soft):not(.event-row-blue-soft):not(.event-row-green-soft):not(.event-row-purple-soft):not(.event-row-brown-soft):not(.event-row-default-soft) .action-cell span {
  color: var(--text) !important;
}

.has-app-sidebar .app-main .events-table .event-row-red td {
  background: #ffffff !important;
  color: #e51b2a !important;
}

.has-app-sidebar .app-main .events-table .event-row-blue td {
  background: #ffffff !important;
  color: #1d5fbd !important;
}

.has-app-sidebar .app-main .events-table .event-row-green td {
  background: #ffffff !important;
  color: #178143 !important;
}

.has-app-sidebar .app-main .events-table .event-row-purple td {
  background: #ffffff !important;
  color: #7c3bb4 !important;
}

.has-app-sidebar .app-main .events-table .event-row-brown td {
  background: #ffffff !important;
  color: #8a5a25 !important;
}

.has-app-sidebar .app-main .events-table .event-row-red:nth-child(even) td,
.has-app-sidebar .app-main .events-table .event-row-blue:nth-child(even) td,
.has-app-sidebar .app-main .events-table .event-row-green:nth-child(even) td,
.has-app-sidebar .app-main .events-table .event-row-purple:nth-child(even) td,
.has-app-sidebar .app-main .events-table .event-row-brown:nth-child(even) td {
  background: #f9fafb !important;
}

.has-app-sidebar .app-main .events-table .event-row-red .action-cell,
.has-app-sidebar .app-main .events-table .event-row-blue .action-cell,
.has-app-sidebar .app-main .events-table .event-row-green .action-cell,
.has-app-sidebar .app-main .events-table .event-row-purple .action-cell,
.has-app-sidebar .app-main .events-table .event-row-brown .action-cell {
  background: #ffffff !important;
}

.has-app-sidebar .app-main .events-table .event-row-red:nth-child(even) .action-cell,
.has-app-sidebar .app-main .events-table .event-row-blue:nth-child(even) .action-cell,
.has-app-sidebar .app-main .events-table .event-row-green:nth-child(even) .action-cell,
.has-app-sidebar .app-main .events-table .event-row-purple:nth-child(even) .action-cell,
.has-app-sidebar .app-main .events-table .event-row-brown:nth-child(even) .action-cell {
  background: #f9fafb !important;
}

.has-app-sidebar .app-main .events-table .event-row-red a,
.has-app-sidebar .app-main .events-table .event-row-red span {
  color: #e51b2a !important;
}

.has-app-sidebar .app-main .events-table .event-row-blue a,
.has-app-sidebar .app-main .events-table .event-row-blue span {
  color: #1d5fbd !important;
}

.has-app-sidebar .app-main .events-table .event-row-green a,
.has-app-sidebar .app-main .events-table .event-row-green span {
  color: #178143 !important;
}

.has-app-sidebar .app-main .events-table .event-row-purple a,
.has-app-sidebar .app-main .events-table .event-row-purple span {
  color: #7c3bb4 !important;
}

.has-app-sidebar .app-main .events-table .event-row-brown a,
.has-app-sidebar .app-main .events-table .event-row-brown span {
  color: #8a5a25 !important;
}

.has-app-sidebar .app-main .events-table .event-row-red-soft td,
.has-app-sidebar .app-main .events-table .event-row-red-soft .action-cell {
  background: #e51b2a !important;
  color: #ffffff !important;
}

.has-app-sidebar .app-main .events-table .event-row-blue-soft td,
.has-app-sidebar .app-main .events-table .event-row-blue-soft .action-cell {
  background: #1d5fbd !important;
  color: #ffffff !important;
}

.has-app-sidebar .app-main .events-table .event-row-green-soft td,
.has-app-sidebar .app-main .events-table .event-row-green-soft .action-cell {
  background: #178143 !important;
  color: #ffffff !important;
}

.has-app-sidebar .app-main .events-table .event-row-purple-soft td,
.has-app-sidebar .app-main .events-table .event-row-purple-soft .action-cell {
  background: #7c3bb4 !important;
  color: #ffffff !important;
}

.has-app-sidebar .app-main .events-table .event-row-brown-soft td,
.has-app-sidebar .app-main .events-table .event-row-brown-soft .action-cell {
  background: #8a5a25 !important;
  color: #ffffff !important;
}

.has-app-sidebar .app-main .events-table .event-row-default-soft td,
.has-app-sidebar .app-main .events-table .event-row-default-soft .action-cell {
  background: var(--text) !important;
  color: #ffffff !important;
}

.has-app-sidebar .app-main .events-table .event-row-red-soft a,
.has-app-sidebar .app-main .events-table .event-row-blue-soft a,
.has-app-sidebar .app-main .events-table .event-row-green-soft a,
.has-app-sidebar .app-main .events-table .event-row-purple-soft a,
.has-app-sidebar .app-main .events-table .event-row-brown-soft a,
.has-app-sidebar .app-main .events-table .event-row-default-soft a,
.has-app-sidebar .app-main .events-table .event-row-red-soft span,
.has-app-sidebar .app-main .events-table .event-row-blue-soft span,
.has-app-sidebar .app-main .events-table .event-row-green-soft span,
.has-app-sidebar .app-main .events-table .event-row-purple-soft span,
.has-app-sidebar .app-main .events-table .event-row-brown-soft span,
.has-app-sidebar .app-main .events-table .event-row-default-soft span {
  color: #ffffff !important;
}

.has-app-sidebar .app-main .events-table .event-row-red-soft .event-badge-intervention,
.has-app-sidebar .app-main .events-table .event-row-red-soft .event-badge-intervention span,
.has-app-sidebar .app-main .events-table .event-row-red-soft .event-badge-intervention * {
  background: #fee2e2 !important;
  color: #7f1d1d !important;
}

.has-app-sidebar .app-main .events-table .event-row-blue-soft .event-badge-blue,
.has-app-sidebar .app-main .events-table .event-row-blue-soft .event-badge-blue span,
.has-app-sidebar .app-main .events-table .event-row-blue-soft .event-badge-blue * {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
}

.has-app-sidebar .app-main .events-table .event-row-green-soft .event-badge-green,
.has-app-sidebar .app-main .events-table .event-row-green-soft .event-badge-green span,
.has-app-sidebar .app-main .events-table .event-row-green-soft .event-badge-green *,
.has-app-sidebar .app-main .events-table .event-row-green-soft .event-badge-teal,
.has-app-sidebar .app-main .events-table .event-row-green-soft .event-badge-teal span,
.has-app-sidebar .app-main .events-table .event-row-green-soft .event-badge-teal * {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.has-app-sidebar .app-main .events-table .event-row-purple-soft .event-badge-default,
.has-app-sidebar .app-main .events-table .event-row-purple-soft .event-badge-default span,
.has-app-sidebar .app-main .events-table .event-row-purple-soft .event-badge-default * {
  background: #f3e8ff !important;
  color: #6b21a8 !important;
}

.has-app-sidebar .app-main .events-table .event-row-brown-soft .event-badge-orange,
.has-app-sidebar .app-main .events-table .event-row-brown-soft .event-badge-orange span,
.has-app-sidebar .app-main .events-table .event-row-brown-soft .event-badge-orange *,
.has-app-sidebar .app-main .events-table .event-row-brown-soft .event-badge-green,
.has-app-sidebar .app-main .events-table .event-row-brown-soft .event-badge-green span,
.has-app-sidebar .app-main .events-table .event-row-brown-soft .event-badge-green * {
  background: #ffedd5 !important;
  color: #9a3412 !important;
}

.has-app-sidebar .app-main .events-table .event-row-default-soft .event-badge-default,
.has-app-sidebar .app-main .events-table .event-row-default-soft .event-badge-default span,
.has-app-sidebar .app-main .events-table .event-row-default-soft .event-badge-default *,
.has-app-sidebar .app-main .events-table .event-row-default-soft .event-badge-gray,
.has-app-sidebar .app-main .events-table .event-row-default-soft .event-badge-gray span,
.has-app-sidebar .app-main .events-table .event-row-default-soft .event-badge-gray * {
  background: #f3f4f6 !important;
  color: #374151 !important;
}

.has-app-sidebar .app-main .event-form-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.has-app-sidebar .app-main .event-form-panel > .panel-header {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(237, 28, 36, 0.075), rgba(255, 255, 255, 0) 46%),
    #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 45px rgba(15, 23, 42, 0.055);
}

.has-app-sidebar .app-main .reports-warning-panel.has-warnings {
  border-color: #fde68a;
  background: #fffbeb;
}

.has-app-sidebar .app-main .reports-warning-panel.is-clear {
  border-color: #bbf7d0;
}

.has-app-sidebar .app-main .event-badge,
.has-app-sidebar .app-main .ui-badge,
.has-app-sidebar .app-main .member-badge,
.has-app-sidebar .app-main .inventory-badge,
.has-app-sidebar .app-main .inventory-date-badge,
.has-app-sidebar .app-main .inventory-location-badge,
.has-app-sidebar .app-main .drive-status-badge,
.has-app-sidebar .app-main .meratch-status-badge {
  border-radius: 999px;
  font-weight: 950;
  letter-spacing: 0;
}

.has-app-sidebar .app-main .notice {
  border: 1px solid #d7dde5;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.055);
}

.has-app-sidebar .app-main .notice.success {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #166534;
}

.has-app-sidebar .app-main .notice.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.has-app-sidebar .app-main .notice.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.has-app-sidebar .app-sidebar img,
.has-app-sidebar .app-logo-mark,
.has-app-sidebar .sidebar-icon,
.has-app-sidebar .topbar-breadcrumb svg {
  flex: 0 0 auto;
}

.has-app-sidebar .app-logo-mark {
  width: 42px !important;
  height: 53px !important;
  max-width: 42px !important;
  max-height: 53px !important;
  object-fit: contain;
}

.login-page .login-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-page .login-submit {
  min-height: 52px;
  border-radius: 14px;
}

@media (max-width: 980px) {
  .has-app-sidebar .app-main .panel-header,
  .has-app-sidebar .app-main .ui-card-header,
  .has-app-sidebar .app-main .drive-page-header,
  .has-app-sidebar .app-main .drive-section-header,
  .has-app-sidebar .app-main .inventory-detail-hero,
  .has-app-sidebar .app-main .reports-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .has-app-sidebar .app-main .button-row > *,
  .has-app-sidebar .app-main .form-actions > *,
  .has-app-sidebar .app-main .actions-row > *,
  .has-app-sidebar .app-main .reports-filter-actions > *,
  .has-app-sidebar .app-main .inventory-print-actions > * {
    flex: 1 1 180px;
  }

  .has-app-sidebar .app-main .inventory-labels-page .inventory-print-actions .primary-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
  }
}

@media (max-width: 760px) {
  .has-app-sidebar .container {
    padding: 16px;
  }

  .has-app-sidebar .app-main .panel,
  .has-app-sidebar .app-main .hero-card,
  .has-app-sidebar .app-main .stat-card,
  .has-app-sidebar .app-main .detail-card,
  .has-app-sidebar .app-main .subpanel,
  .has-app-sidebar .app-main .module-card,
  .has-app-sidebar .app-main .ui-card,
  .has-app-sidebar .app-main .drive-card,
  .has-app-sidebar .app-main .drive-page-hero,
  .has-app-sidebar .app-main .member-detail-card,
  .has-app-sidebar .app-main .inventory-detail-card,
  .has-app-sidebar .app-main .inventory-form-section {
    border-radius: 18px;
    padding: 18px;
  }

  .has-app-sidebar .app-main .hero-card h1,
  .has-app-sidebar .app-main .panel-header h1 {
    font-size: 30px;
  }

  .has-app-sidebar .app-main .primary-button,
  .has-app-sidebar .app-main .secondary-button,
  .has-app-sidebar .app-main .button,
  .has-app-sidebar .app-main .table-action {
    width: 100%;
  }

  .has-app-sidebar .app-main .data-table th,
  .has-app-sidebar .app-main .data-table td,
  .has-app-sidebar .app-main .wide-data-table th,
  .has-app-sidebar .app-main .wide-data-table td,
  .has-app-sidebar .app-main .members-data-table th,
  .has-app-sidebar .app-main .members-data-table td {
    padding: 12px 13px;
  }
}

/* Large intervention diary final visual pass. Keep this after the sidebar harmonization layer. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page {
  margin-top: 0;
  padding: 16px 22px !important;
  border: 0 !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  background: #ed1c24 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page .panel-header {
  min-height: 0;
  margin: 0;
  gap: 8px;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page .eyebrow {
  display: none !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page h1 {
  margin: 0 0 4px;
  color: #ffffff !important;
  font-size: 26px;
  line-height: 1.08;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92) !important;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed !important;
  background: transparent;
  color: #111827;
  font-size: 13px;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table thead th {
  height: 20px;
  padding: 2px 4px !important;
  border: 1px solid #cbd5e1 !important;
  border-right: 0 !important;
  background: #e5e7eb !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
  letter-spacing: 0;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table thead th:last-child {
  border-right: 1px solid #cbd5e1 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td {
  height: 66px;
  padding: 4px 3px !important;
  border: 1px solid rgba(255, 255, 255, 0.62) !important;
  color: #111827;
  text-align: center;
  vertical-align: middle;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table tr.large-row-not-started td {
  background-color: #ff514b !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table tr.large-row-waiting td {
  background-color: #a855f7 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table tr.large-row-in-progress td {
  background-color: #ffd84f !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table tr.large-row-closed td {
  background-color: #57d786 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table textarea,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table select,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker summary {
  min-height: 38px !important;
  height: auto;
  padding: 6px 7px !important;
  border: 1px solid #d8dee6 !important;
  border-radius: 5px !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.18;
  text-align: center;
  box-shadow: none !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table textarea {
  display: block;
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .time-field,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td:nth-child(10) input {
  min-height: 38px !important;
  padding-right: 2px !important;
  padding-left: 2px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-number-cell {
  width: 24px !important;
  padding: 0 2px !important;
  font-size: 13px;
  font-weight: 950;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-map-button {
  width: 28px !important;
  min-width: 28px !important;
  height: 38px;
  min-height: 38px;
  margin: 0 auto;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  background: #ffffff;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-map-button svg {
  width: 18px;
  height: 18px;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-waiting-checkbox {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px;
  border-radius: 4px;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-delete-button,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-open-button,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-database-badge {
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-open-button {
  border: 1px solid #15803d;
  background: #dcfce7;
  color: #166534;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-delete-button {
  border: 1px solid #dc2626;
  background: #ffffff;
  color: #dc2626;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-database-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #9ca3af;
  background: #e5e7eb;
  color: #374151;
}

/* Large intervention diary sticky and compact interaction fixes. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-change-notices {
  position: sticky !important;
  top: 0 !important;
  z-index: 2000002 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap .large-intervention-main-diary-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2000001 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td {
  font-weight: 400 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table textarea,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table select,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker summary {
  font-weight: 400 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu,
.unit-picker-menu.is-unit-picker-portal {
  gap: 1px !important;
  width: min(250px, calc(100vw - 28px)) !important;
  max-height: 300px;
  padding: 5px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu label,
.unit-picker-menu.is-unit-picker-portal label {
  min-height: 0 !important;
  gap: 5px !important;
  padding: 3px 4px !important;
  border-radius: 4px;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu input[type="checkbox"],
.unit-picker-menu.is-unit-picker-portal input[type="checkbox"] {
  width: 13px !important;
  min-width: 13px !important;
  height: 13px !important;
  flex: 0 0 13px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu [data-unit-manual],
.unit-picker-menu.is-unit-picker-portal [data-unit-manual] {
  min-height: 30px !important;
  margin-top: 3px !important;
  padding: 5px 7px !important;
  font-size: 12px !important;
  text-align: left !important;
}

/* Extra compact diary rows and unit menu. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td {
  font-size: 11px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table textarea,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table select,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker summary {
  font-size: 12px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table col.col-actions {
  width: 42px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table th:nth-child(17),
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table td:nth-child(17) {
  width: 42px !important;
  min-width: 42px !important;
  padding-right: 1px !important;
  padding-left: 1px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-delete-button,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-open-button,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-database-badge {
  min-height: 24px !important;
  padding: 4px 5px !important;
  border-radius: 4px !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu,
.unit-picker-menu.is-unit-picker-portal {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  width: 220px !important;
  padding: 3px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu label,
.unit-picker-menu.is-unit-picker-portal label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  min-height: 20px !important;
  margin: 0 !important;
  padding: 1px 3px !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.1 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu label span,
.unit-picker-menu.is-unit-picker-portal label span {
  display: inline !important;
  margin: 0 !important;
  line-height: 1.1 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu input[type="checkbox"],
.unit-picker-menu.is-unit-picker-portal input[type="checkbox"] {
  width: 11px !important;
  min-width: 11px !important;
  height: 11px !important;
  min-height: 11px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 11px !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .unit-picker-menu [data-unit-manual],
.unit-picker-menu.is-unit-picker-portal [data-unit-manual] {
  min-height: 24px !important;
  margin-top: 2px !important;
  padding: 3px 5px !important;
  font-size: 11px !important;
}
/* Fixed fallback for diary header when native table sticky is unreliable. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table.has-fixed-diary-header thead {
  position: fixed !important;
  top: var(--large-intervention-sticky-header-top, 0px) !important;
  left: var(--large-intervention-sticky-header-left, 0px) !important;
  z-index: 2000001 !important;
  display: table !important;
  width: var(--large-intervention-sticky-header-width, 100%) !important;
  table-layout: fixed !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table.has-fixed-diary-header tbody {
  position: relative;
}
/* These tables no longer have a trailing action column, so the last data column must not stick to the right edge. */
.has-app-sidebar .app-main .vehicles-data-table thead th:last-child,
.has-app-sidebar .app-main .equipment-data-table thead th:last-child,
.has-app-sidebar .app-main .members-data-table thead th:last-child {
  position: sticky !important;
  top: 0 !important;
  right: auto !important;
  z-index: 4 !important;
  box-shadow: none !important;
}

.has-app-sidebar .app-main .vehicles-data-table tbody td:last-child,
.has-app-sidebar .app-main .equipment-data-table tbody td:last-child,
.has-app-sidebar .app-main .members-data-table tbody td:last-child {
  position: static !important;
  right: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
}

.equipment-page .inventory-form .form-grid > .inventory-checkbox-row {
  min-height: 78px;
  align-self: stretch;
}

.equipment-page .inventory-form .form-grid > .equipment-inventory-checkbox,
.has-app-sidebar .app-main .equipment-page .inventory-form .form-grid > .equipment-inventory-checkbox {
  height: 52px;
  min-height: 52px;
  align-self: end;
}

.vehicle-tire-grid {
  grid-template-columns: 1fr !important;
}

.vehicle-tire-grid .vehicle-fieldset {
  width: 100%;
}

.vehicle-fieldset .form-grid-compact input {
  height: 52px;
  min-height: 52px;
}

.inventory-audit-stats .stat-card-neutral::before {
  background: #9ca3af !important;
}

.inventory-audit-toggle .secondary-button.is-small.is-active-positive,
.has-app-sidebar .app-main .inventory-audit-toggle .secondary-button.is-small.is-active-positive {
  border-color: #15803d !important;
  background: #15803d !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18) !important;
}

.inventory-audit-toggle .secondary-button.is-small.is-active-negative,
.has-app-sidebar .app-main .inventory-audit-toggle .secondary-button.is-small.is-active-negative {
  border-color: #b91c1c !important;
  background: #b91c1c !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
}

/* Compact sidebar vertical rhythm. */
.has-app-sidebar .app-sidebar {
  padding-top: 14px;
  padding-bottom: 14px;
}

.has-app-sidebar .sidebar-brand {
  min-height: 46px;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.has-app-sidebar .sidebar-brand img {
  width: 38px !important;
  height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  flex-basis: 38px;
}

.has-app-sidebar .sidebar-brand strong {
  font-size: 14px;
  line-height: 1.1;
}

.has-app-sidebar .sidebar-brand small {
  margin-top: 2px;
  font-size: 11px;
}

.has-app-sidebar .sidebar-nav {
  gap: 14px;
}

.has-app-sidebar .sidebar-section-title {
  margin-bottom: 6px;
  font-size: 10px;
  line-height: 1.1;
}

.has-app-sidebar .sidebar-link {
  min-height: 38px;
  padding: 8px 10px;
  gap: 10px;
  font-size: 14px;
  line-height: 1.15;
}

.has-app-sidebar .sidebar-link svg {
  width: 17px !important;
  height: 17px !important;
  max-width: 17px !important;
  max-height: 17px !important;
  flex-basis: 17px;
}

/* Final large-intervention diary overrides: notices and sticky header must stack, not overlap. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-change-notices {
  position: sticky !important;
  top: 0 !important;
  z-index: 2000002 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap .large-intervention-main-diary-table thead,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap .large-intervention-main-diary-table thead th {
  top: 0 !important;
  z-index: 2000001 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table.has-fixed-diary-header thead {
  position: sticky !important;
  top: 0 !important;
  left: auto !important;
  display: table-header-group !important;
  width: auto !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table.has-fixed-diary-header tbody {
  transform: none !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-map-cell {
  text-align: center !important;
  vertical-align: middle !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-map-cell .diary-map-button,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .diary-map-cell .diary-map-indicator {
  margin-right: auto !important;
  margin-left: auto !important;
}

/* Responsive sidebar spacing, profile image, login mobile logo and stab mobile layout. */
@media (min-width: 821px) {
  .has-app-sidebar .app-sidebar {
    display: flex;
    flex-direction: column;
  }

  .has-app-sidebar .sidebar-brand {
    flex: 0 0 auto;
  }

  .has-app-sidebar .sidebar-nav {
    flex: 1 1 auto;
    align-content: start;
    gap: clamp(8px, 2.1vh, 24px);
  }

  .has-app-sidebar .sidebar-section {
    display: grid;
    gap: clamp(2px, 0.6vh, 8px);
  }

  .has-app-sidebar .sidebar-link {
    min-height: clamp(34px, 4.35vh, 46px);
    padding-top: clamp(6px, 0.9vh, 11px);
    padding-bottom: clamp(6px, 0.9vh, 11px);
  }

  .has-app-sidebar .sidebar-section-title {
    margin-bottom: clamp(2px, 0.7vh, 8px);
  }
}

.has-app-sidebar .topbar-user::before {
  background:
    #ffffff url("/assets/images/fire-helmet-profile.svg") center / 25px 25px no-repeat !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45), 0 6px 14px rgba(17, 24, 39, 0.16) !important;
}

.has-app-sidebar .topbar-user[data-sync-state="ok"]::before {
  box-shadow: 0 0 0 3px #22c55e, 0 6px 14px rgba(17, 24, 39, 0.16) !important;
}

.has-app-sidebar .topbar-user[data-sync-state="pending"]::before {
  box-shadow: 0 0 0 3px #f59e0b, 0 6px 14px rgba(17, 24, 39, 0.16) !important;
}

@media (max-width: 700px) {
  .login-page,
  .login-shell {
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .login-layout {
    min-height: calc(100dvh - 42px);
    height: auto;
    align-content: start;
  }

  .login-brand-card {
    width: 100%;
    min-height: 134px;
    aspect-ratio: auto;
  }

  .login-brand-logo {
    width: auto !important;
    height: 130px !important;
    max-width: min(42vw, 112px) !important;
    max-height: 130px !important;
  }
}

@media (max-width: 520px) and (max-height: 760px) {
  .login-page {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .login-shell {
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .login-layout {
    min-height: auto;
    align-content: start;
    padding-top: 8px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .login-brand-card {
    min-height: 97px;
  }

  .login-brand-logo {
    width: auto !important;
    height: 93px !important;
    max-width: 86px !important;
    max-height: 93px !important;
  }

  .login-panel-inner {
    padding: 14px;
  }

  .login-title {
    font-size: 21px;
  }

  .login-panel-inner .muted {
    font-size: 12px;
  }
}

@media (max-width: 760px) {
  .stab-page {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    gap: 14px;
  }

  .stab-hero,
  .stab-command-strip {
    width: 100%;
    min-width: 0;
    padding: 16px;
    border-radius: 18px;
  }

  .stab-hero h1,
  .stab-command-strip h1 {
    font-size: 26px;
  }

  .stab-command-actions,
  .stab-command-actions form,
  .stab-command-actions a,
  .stab-command-actions button {
    width: 100%;
  }

  .stab-nav {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    gap: 6px;
    border-radius: 14px;
    scroll-snap-type: x proximity;
  }

  .stab-nav a {
    padding: 9px 11px;
    font-size: 13px;
    scroll-snap-align: start;
  }

  .stab-panel,
  .stab-kpi-card,
  .stab-task-card,
  .stab-sector-card,
  .stab-resource-card,
  .stab-call-card,
  .stab-alert-card,
  .stab-sitrep-card {
    min-width: 0;
  }

  .stab-kpi-card {
    min-height: auto;
    padding: 14px;
  }

  .stab-kpi-card strong {
    font-size: 26px;
  }

  .stab-map-panel,
  .stab-map-canvas {
    min-height: 360px;
  }

  .stab-map-panel {
    border-radius: 18px;
  }

  .stab-map-legend {
    left: 10px;
    right: 10px;
    bottom: 10px;
    gap: 5px;
  }

  .stab-map-legend span {
    padding: 5px 7px;
    font-size: 10px;
  }

  .stab-kanban {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
  }

  .stab-kanban-column {
    flex: 0 0 82vw;
    min-height: 300px;
  }

  .stab-card-head,
  .stab-inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .stab-inline-form > *,
  .stab-inline-form select,
  .stab-inline-form button,
  .stab-form-grid .primary-button,
  .stab-form-grid .secondary-button {
    width: 100%;
  }

  .stab-location-picker-field span {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .stab-table {
    min-width: 720px;
  }

  .stab-panel .table-wrap,
  .stab-panel .ui-table-wrap,
  .stab-panel .wide-table-wrap {
    overflow-x: auto;
  }
}

/* Stab index mobile: avoid squeezed desktop table on the base tab. */
@media (max-width: 760px) {
  .stab-index-page .stab-hero {
    gap: 12px;
    padding: 14px;
  }

  .stab-index-page .stab-hero p:not(.eyebrow) {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.35;
  }

  .stab-index-page .stab-hero .primary-button {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
  }

  .stab-index-page .stab-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stab-index-page .stab-kpi-card {
    gap: 6px;
    padding: 12px;
    border-radius: 14px;
  }

  .stab-index-page .stab-kpi-card span {
    font-size: 10px;
    line-height: 1.15;
  }

  .stab-index-page .stab-kpi-card strong {
    font-size: 24px;
  }

  .stab-index-page .stab-panel {
    border-radius: 16px;
  }

  .stab-index-page .stab-panel .panel-header {
    padding: 14px;
  }

  .stab-index-page .stab-form-grid {
    gap: 10px;
    padding: 0 14px 14px;
  }

  .stab-index-page .stab-form-grid .span-two {
    grid-column: auto;
  }

  .stab-index-page .stab-form-grid input,
  .stab-index-page .stab-form-grid select,
  .stab-index-page .stab-form-grid textarea {
    min-height: 42px;
    border-radius: 10px;
    font-size: 15px;
  }

  .stab-index-page .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stab-index-page .form-actions .primary-button {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
  }

  .stab-index-page .table-wrap {
    padding: 0 14px 14px;
    overflow: visible;
  }

  .stab-index-page .stab-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .stab-index-page .stab-table thead {
    display: none;
  }

  .stab-index-page .stab-table,
  .stab-index-page .stab-table tbody,
  .stab-index-page .stab-table tr,
  .stab-index-page .stab-table td {
    display: block;
    width: 100%;
  }

  .stab-index-page .stab-table tr {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  }

  .stab-index-page .stab-table td {
    display: grid;
    grid-template-columns: minmax(88px, 0.38fr) minmax(0, 1fr);
    gap: 10px;
    padding: 6px 0;
    border: 0;
    text-align: left;
  }

  .stab-index-page .stab-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .stab-index-page .stab-table td:first-child {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .stab-index-page .stab-table td:first-child::before,
  .stab-index-page .stab-table .action-cell::before {
    display: none;
  }

  .stab-index-page .stab-table .action-cell {
    grid-template-columns: 1fr;
    padding-top: 10px;
  }

  .stab-index-page .stab-table .action-cell a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 10px;
    background: #ed1c24;
    color: #fff;
    font-weight: 900;
  }
}

/* Members mobile: keep action buttons compact, not card-sized. */
@media (max-width: 760px) {
  .has-app-sidebar .app-main .members-page .members-actions,
  .has-app-sidebar .app-main .members-page .member-submit-bar .form-actions {
    gap: 10px !important;
  }

  .has-app-sidebar .app-main .members-page .members-actions > *,
  .has-app-sidebar .app-main .members-page .member-submit-bar .form-actions > * {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
  }
}

/* Final colors for large intervention navigation/status blocks. */
.module-card.large-status-gray,
.large-intervention-status-panel.large-status-gray.large-intervention-diary-page {
  border-color: #4b5563 !important;
  background: #4b5563 !important;
  color: #ffffff !important;
}

.module-card.large-status-red,
.large-intervention-status-panel.large-status-red.large-intervention-diary-page {
  border-color: #ed1c24 !important;
  background: #ed1c24 !important;
  color: #ffffff !important;
}

.module-card.large-status-yellow,
.large-intervention-status-panel.large-status-yellow.large-intervention-diary-page {
  border-color: #f59e0b !important;
  background: #facc15 !important;
  color: #111827 !important;
}

.module-card.large-status-green,
.large-intervention-status-panel.large-status-green.large-intervention-diary-page {
  border-color: #15803d !important;
  background: #16a34a !important;
  color: #ffffff !important;
}

.module-card.large-status-gray *,
.module-card.large-status-red *,
.module-card.large-status-green *,
.large-intervention-status-panel.large-status-gray.large-intervention-diary-page *,
.large-intervention-status-panel.large-status-red.large-intervention-diary-page *,
.large-intervention-status-panel.large-status-green.large-intervention-diary-page * {
  color: #ffffff !important;
}

.module-card.large-status-yellow *,
.large-intervention-status-panel.large-status-yellow.large-intervention-diary-page * {
  color: #111827 !important;
}

.large-interventions-index-page .large-intervention-menu-grid .module-card.large-diary-card,
.large-interventions-index-page .large-intervention-menu-grid .module-card.large-diary-card strong,
.large-interventions-index-page .large-intervention-menu-grid .module-card.large-diary-card p {
  color: #ffffff !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-diary-title-panel.large-intervention-diary-page {
  border-color: #4b5563 !important;
  background: #4b5563 !important;
  color: #ffffff !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-diary-title-panel.large-intervention-diary-page *,
.large-interventions-page.has-app-sidebar .app-main .large-diary-title-panel.large-intervention-diary-page p:not(.eyebrow) {
  color: #ffffff !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-status-yellow.large-intervention-diary-page {
  border-color: #f59e0b !important;
  background: #facc15 !important;
  color: #111827 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-status-yellow.large-intervention-diary-page *,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-status-yellow.large-intervention-diary-page p:not(.eyebrow) {
  color: #111827 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-status-green.large-intervention-diary-page {
  border-color: #15803d !important;
  background: #16a34a !important;
  color: #ffffff !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-status-green.large-intervention-diary-page *,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-status-green.large-intervention-diary-page p:not(.eyebrow) {
  color: #ffffff !important;
}

/* Vehicle leader: only the active operation title strip is red. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel.large-intervention-diary-page {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  box-shadow: none !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel.large-intervention-diary-page .panel-header {
  padding: 16px 22px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ed1c24 !important;
  color: #ffffff !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel.large-intervention-diary-page .panel-header *,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel.large-intervention-diary-page .panel-header p:not(.eyebrow) {
  color: #ffffff !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel .large-intervention-menu-grid {
  margin: 18px 0 0;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel .module-card {
  border-color: #e5e7eb !important;
  background: #ffffff !important;
  color: #111827 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel .module-card *,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel .module-card p {
  color: #111827 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel .module-card p {
  color: #6b7280 !important;
}

.pgd-admin-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pgd-admin-standalone {
  min-height: 100vh;
  margin: 0;
  background: #f3f4f6;
}

.pgd-admin-standalone-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.pgd-admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #fff4f4 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.pgd-admin-hero h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 56px);
}

.pgd-admin-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.pgd-admin-user-card {
  min-width: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.pgd-admin-user-card span,
.pgd-admin-user-card small {
  display: block;
}

.pgd-admin-user-card span {
  font-weight: 900;
}

.pgd-admin-user-card small {
  margin: 4px 0 12px;
  color: var(--muted);
  font-weight: 700;
}

.pgd-admin-module-section {
  padding-top: 10px;
}

.pgd-admin-module-section h3 {
  margin: 0 0 6px;
}

.pgd-admin-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.pgd-admin-module-toggle,
.pgd-admin-checkbox {
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.pgd-admin-module-toggle:has(input:checked),
.pgd-admin-checkbox:has(input:checked) {
  border-color: rgba(237, 28, 36, 0.45);
  background: rgba(237, 28, 36, 0.06);
}

.pgd-admin-module-toggle span,
.pgd-admin-checkbox span {
  font-weight: 900;
}

.pgd-admin-table .status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.pgd-admin-table .status-badge.is-ok {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.pgd-admin-table .status-badge.is-muted {
  background: #f3f4f6;
  color: #6b7280;
}

.pgd-admin-table .clickable-table-row {
  cursor: pointer;
}

@media (max-width: 760px) {
  .pgd-admin-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 22px;
    border-radius: 22px;
  }

  .pgd-admin-user-card {
    min-width: 0;
  }

  .pgd-admin-module-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile layout for the base Štabno vodenje page. */
@media (max-width: 760px) {
  .large-interventions-index-page .app-main {
    overflow-x: hidden;
  }

  .large-interventions-index-page .large-interventions-stats {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .large-interventions-index-page .large-interventions-action-panel,
  .large-interventions-index-page .panel {
    border-radius: 22px;
  }

  .large-interventions-index-page .panel-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .large-interventions-index-page .panel-header h1 {
    font-size: 28px;
    line-height: 1.1;
  }

  .large-interventions-index-page .button-row,
  .large-interventions-index-page .button-row a,
  .large-interventions-index-page .form-actions,
  .large-interventions-index-page .form-actions button {
    width: 100%;
  }

  .large-interventions-index-page .large-intervention-menu-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .large-interventions-index-page .large-intervention-menu-grid .module-card {
    min-height: 0;
    padding: 18px;
    border-radius: 18px;
  }

  .large-interventions-index-page .form-grid {
    grid-template-columns: 1fr !important;
  }

  .large-interventions-index-page .form-grid .span-two {
    grid-column: auto !important;
  }

  .large-interventions-index-page .table-wrap {
    overflow: visible;
  }

  .large-interventions-index-page .data-table {
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .large-interventions-index-page .data-table thead {
    display: none;
  }

  .large-interventions-index-page .data-table,
  .large-interventions-index-page .data-table tbody,
  .large-interventions-index-page .data-table tr,
  .large-interventions-index-page .data-table td {
    display: block;
    width: 100%;
  }

  .large-interventions-index-page .data-table tr {
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  }

  .large-interventions-index-page .data-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.34fr) minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0 !important;
    border: 0 !important;
    text-align: left;
    white-space: normal;
  }

  .large-interventions-index-page .data-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .large-interventions-index-page .data-table td:first-child {
    grid-template-columns: 1fr;
    padding-top: 0 !important;
    font-size: 20px;
    font-weight: 950;
  }

  .large-interventions-index-page .data-table td:first-child::before {
    display: none;
  }

  .large-interventions-index-page .data-table .action-cell {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 12px !important;
  }

  .large-interventions-index-page .data-table .action-cell::before,
  .large-interventions-index-page .data-table .action-cell span {
    display: none;
  }

  .large-interventions-index-page .data-table .action-cell a {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border: 1px solid rgba(237, 28, 36, 0.24);
    border-radius: 12px;
    background: rgba(237, 28, 36, 0.08);
    color: #b5121b;
    font-weight: 950;
    text-decoration: none;
  }
}

/* Inventory audit mobile: compact status controls and single-line table headers. */
@media (max-width: 760px) {
  .inventory-audit-table th {
    padding: 4px 3px !important;
    font-size: 9px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    word-break: normal !important;
  }

  .inventory-audit-table td {
    padding: 4px 3px !important;
    font-size: 10px !important;
  }

  .inventory-audit-table th:nth-child(5),
  .inventory-audit-table td:nth-child(5) {
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
  }

  .inventory-audit-table .inventory-audit-toggle {
    gap: 3px !important;
    justify-content: center;
  }

  .inventory-audit-table .inventory-audit-toggle .secondary-button.is-small {
    min-width: 36px !important;
    min-height: 26px !important;
    padding: 0 4px !important;
    border-radius: 8px !important;
    font-size: 9px !important;
    line-height: 1 !important;
  }
}

/* Final mobile containment pass: pages shown on iPhone must not widen the viewport. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell,
  .app-main,
  .has-app-sidebar .app-shell,
  .has-app-sidebar .app-main,
  .has-app-sidebar .container,
  .app-topbar,
  .topbar {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }

  .has-app-sidebar .container {
    padding-right: 14px;
    padding-left: 14px;
    overflow-x: hidden;
  }

  .app-topbar,
  .topbar {
    overflow: hidden;
  }

  .app-topbar:has(.topbar-user-menu-wrap.is-open) {
    overflow: visible;
  }

  .topbar-actions,
  .topbar-user-menu-wrap {
    overflow: visible;
    z-index: 100020;
  }

  .topbar-user-dropdown {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 82px);
    right: 14px;
    z-index: 100030;
    width: min(240px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
  }

  .topbar-title-group,
  .topbar-heading {
    min-width: 0;
  }

  .app-topbar .topbar-heading h1 {
    max-width: calc(100vw - 128px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-breadcrumb {
    max-width: calc(100vw - 128px);
  }

  .has-app-sidebar .app-main .page-grid,
  .has-app-sidebar .app-main .drive-module,
  .has-app-sidebar .app-main .meratch-dashboard-page,
  .large-interventions-page.has-app-sidebar .app-main,
  .large-interventions-page.has-app-sidebar .container,
  .large-interventions-page.has-app-sidebar .large-interventions-page,
  .large-interventions-page.has-app-sidebar .large-intervention-diary-table-section,
  .large-interventions-page.has-app-sidebar .large-intervention-vehicle-leader-panel,
  .large-interventions-page.has-app-sidebar .large-intervention-status-panel,
  .large-interventions-page.has-app-sidebar .large-intervention-menu-grid,
  .large-interventions-page.has-app-sidebar .module-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .large-interventions-page.has-app-sidebar .container {
    padding-right: 0;
    padding-left: 0;
  }

  .large-interventions-page.has-app-sidebar .app-main > .app-topbar + .container {
    overflow-x: hidden;
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel.large-intervention-diary-page .panel-header,
  .large-interventions-page.has-app-sidebar .app-main .large-diary-title-panel.large-intervention-diary-page {
    width: 100%;
    max-width: 100vw;
    padding-right: 16px !important;
    padding-left: 16px !important;
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page h1,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel.large-intervention-diary-page h1,
  .large-interventions-page.has-app-sidebar .app-main .large-diary-title-panel.large-intervention-diary-page h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: clamp(24px, 8vw, 34px) !important;
    line-height: 1.05 !important;
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page p,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel.large-intervention-diary-page p,
  .large-interventions-page.has-app-sidebar .app-main .large-diary-title-panel.large-intervention-diary-page p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel .large-intervention-menu-grid {
    grid-template-columns: 1fr !important;
    margin: 14px 0 0;
    padding: 0 14px;
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel .module-card {
    width: 100%;
    max-width: 100%;
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-diary-wrap,
  .large-interventions-page.has-app-sidebar .large-intervention-diary-wrap {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table {
    min-width: 980px !important;
    width: max-content !important;
  }

  .drive-module,
  .drive-two-columns,
  .drive-vehicle-page,
  .drive-fuel-page,
  .drive-card,
  .drive-form-card,
  .drive-table-card,
  .drive-page-hero {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .drive-table-card {
    overflow: hidden;
  }

  .drive-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .drive-vehicle-page .drive-data-table {
    min-width: 0 !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .drive-vehicle-page .drive-data-table thead {
    display: none;
  }

  .drive-vehicle-page .drive-data-table,
  .drive-vehicle-page .drive-data-table tbody,
  .drive-vehicle-page .drive-data-table tr,
  .drive-vehicle-page .drive-data-table td {
    display: block;
    width: 100%;
  }

  .drive-vehicle-page .drive-data-table tr {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .drive-vehicle-page .drive-data-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px !important;
    border: 0;
    border-bottom: 1px solid #edf0f4;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .drive-vehicle-page .drive-data-table td:last-child {
    border-bottom: 0;
  }

  .drive-vehicle-page .drive-data-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .drive-vehicle-page .drive-data-table .action-cell a {
    width: fit-content;
    justify-self: start;
  }

  .drive-fuel-page .drive-data-table,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list {
    min-width: 0 !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .drive-fuel-page .drive-data-table thead,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list thead {
    display: none;
  }

  .drive-fuel-page .drive-data-table,
  .drive-fuel-page .drive-data-table tbody,
  .drive-fuel-page .drive-data-table tr,
  .drive-fuel-page .drive-data-table td,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list tbody,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list tr,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list td {
    display: block;
    width: 100%;
  }

  .drive-fuel-page .drive-data-table tr,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list tr {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list tr.large-row-not-started,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list tr.large-row-in-progress,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list tr.large-row-closed {
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list tr.large-row-in-progress {
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list tr.large-row-closed {
  }

  .drive-fuel-page .drive-data-table td,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list td {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px !important;
    border: 0;
    border-bottom: 1px solid #edf0f4;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .drive-fuel-page .drive-data-table td:last-child,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list td:last-child {
    border-bottom: 0;
  }

  .drive-fuel-page .drive-data-table td::before,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list td::before {
    content: attr(data-label);
    color: #6b7280;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .drive-fuel-page .drive-data-table td[colspan]::before,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list td[colspan]::before {
    content: "";
    display: none;
  }

  .drive-fuel-page .drive-data-table .action-cell a,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-list .action-cell a {
    width: fit-content;
    justify-self: start;
  }

  .meratch-dashboard-page,
  .meratch-frequency-panel,
  .meratch-frequency-panel .table-wrap,
  .meratch-frequency-table-wrap,
  .meratch-table-wrap,
  .meratch-overview-chart-grid,
  .meratch-overview-chart-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .meratch-frequency-panel {
    overflow: visible !important;
  }

  .meratch-frequency-panel .table-wrap {
    overflow: visible !important;
    overflow-y: visible !important;
    max-width: 100%;
  }

  .meratch-frequency-table-wrap {
    overflow: visible !important;
    overflow-y: visible !important;
    padding-bottom: 220px;
  }

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

  .meratch-frequency-table select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .meratch-table {
    min-width: 760px !important;
  }
}

@media (max-width: 1180px) {
  body.has-app-sidebar.sidebar-open .app-sidebar {
    transform: translateX(0) !important;
  }

  body.has-app-sidebar.sidebar-open .sidebar-backdrop {
    display: block !important;
  }
}

@media (max-width: 430px) {
  .app-topbar .topbar-heading h1 {
    max-width: calc(100vw - 116px);
    font-size: 20px;
  }

  .topbar-breadcrumb {
    max-width: calc(100vw - 116px);
  }

  .large-interventions-page.has-app-sidebar .app-main .large-intervention-status-panel.large-intervention-diary-page,
  .large-interventions-page.has-app-sidebar .app-main .large-intervention-vehicle-leader-panel.large-intervention-diary-page .panel-header,
  .large-interventions-page.has-app-sidebar .app-main .large-diary-title-panel.large-intervention-diary-page {
    padding-right: 14px !important;
    padding-left: 14px !important;
  }

  .drive-form-card,
  .drive-table-card {
    padding: 14px !important;
  }
}

/* Stab dashboard stats: five compact cards with consistent number sizing. */
.large-interventions-index-page .stab-stats {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.large-interventions-index-page .stab-stats .ops-stat-card strong,
.large-interventions-index-page .stab-stats .ops-stat-card:nth-child(4) strong,
.large-interventions-index-page .stab-stats .ops-stat-card:nth-child(5) strong {
  font-size: 30px;
  line-height: 1;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.large-interventions-index-page .stab-stats .stab-active-operation-card strong {
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.large-interventions-index-page .stab-stats .ops-stat-card:nth-child(4) {
  background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}

.large-interventions-index-page .stab-stats .ops-stat-card:nth-child(4) .ops-stat-icon {
  background: #f59e0b;
}

@media (max-width: 1180px) {
  .large-interventions-index-page .stab-stats {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .large-interventions-index-page .stab-stats {
    grid-template-columns: 1fr !important;
  }
}

/* Vehicles mobile table: keep the whole code and name columns frozen, not only the headers. */
@media (max-width: 760px) {
  .has-app-sidebar .app-main .vehicles-data-table th:nth-child(1),
  .has-app-sidebar .app-main .vehicles-data-table td:nth-child(1),
  .has-app-sidebar .app-main .vehicles-data-table th:nth-child(2),
  .has-app-sidebar .app-main .vehicles-data-table td:nth-child(2) {
    position: sticky !important;
    background: #ffffff !important;
  }

  .has-app-sidebar .app-main .vehicles-data-table th:nth-child(1),
  .has-app-sidebar .app-main .vehicles-data-table td:nth-child(1) {
    left: 0 !important;
    z-index: 32 !important;
  }

  .has-app-sidebar .app-main .vehicles-data-table th:nth-child(2),
  .has-app-sidebar .app-main .vehicles-data-table td:nth-child(2) {
    left: 64px !important;
    z-index: 31 !important;
    box-shadow: 8px 0 14px rgba(17, 24, 39, 0.08) !important;
  }

  .has-app-sidebar .app-main .vehicles-data-table thead th:nth-child(1),
  .has-app-sidebar .app-main .vehicles-data-table thead th:nth-child(2) {
    top: 0 !important;
    z-index: 42 !important;
    background: #f8fafc !important;
  }
}

/* R1/R2 mobile: center the event selection checkbox inside its narrow cell. */
@media (max-width: 760px) {
  .r1r2-events-table th:first-child,
  .r1r2-events-table td:first-child {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    text-align: center !important;
    vertical-align: middle !important;
  }

  .r1r2-events-table td:first-child input[type="checkbox"] {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 auto !important;
  }
}
/* Large intervention staff, waiting column and dispatch/location states. */
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table th.diary-waiting-header {
  max-width: 30px !important;
  width: 30px !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .is-dispatch-locked-input {
  cursor: not-allowed;
  background: #f3f4f6 !important;
  color: #4b5563 !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .is-dispatch-locked-button {
  cursor: not-allowed;
  opacity: 0.55;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .needs-manual-location-input {
  border-color: #dc2626 !important;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.28) !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .needs-manual-location-cell {
  box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.45);
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .needs-manual-location-button {
  border-color: #111827 !important;
  background: #111827 !important;
  color: #ffffff !important;
}

.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .needs-manual-location-button svg path,
.large-interventions-page.has-app-sidebar .app-main .large-intervention-main-diary-table .needs-manual-location-button svg circle {
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

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

.large-staff-panel .vehicle-fieldset {
  margin: 0;
}

.large-staff-checkbox-grid {
  max-height: 320px;
  overflow: auto;
  align-content: start;
}

.large-staff-readonly-grid > div {
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f8fafc;
}

.large-staff-readonly-grid h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.large-staff-readonly-grid p {
  margin: 0;
  color: #4b5563;
}

@media (max-width: 760px) {
  .large-staff-panel .large-staff-grid,
  .large-staff-readonly-grid {
    grid-template-columns: 1fr;
  }
}

.large-basic-form {
  display: grid;
  gap: 22px;
}

.large-repeatable-block {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: #f8fafc;
}

.large-repeatable-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.large-repeatable-head h3 {
  margin: 0;
  font-size: 1rem;
}

.large-repeatable-rows {
  display: grid;
  gap: 10px;
}

.large-repeatable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.large-sector-leader-list {
  display: grid;
  gap: 12px;
}

.large-sector-leader-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.large-sector-leader-row > span {
  font-weight: 800;
}

.large-staff-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
  margin-bottom: 18px;
}

.large-staff-definition-list {
  display: grid;
  gap: 10px;
}

.large-staff-definition-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.large-staff-definition-list span {
  color: var(--muted);
  font-weight: 800;
}

.large-sector-board.is-static {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

@media (max-width: 700px) {
  .large-staff-overview-grid {
    grid-template-columns: 1fr;
  }

  .large-repeatable-row,
  .large-sector-leader-row,
  .large-staff-definition-list > div {
    grid-template-columns: 1fr;
  }
}
/* Documentation pages */
.docs-page {
  display: grid;
  gap: 28px;
}

.docs-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 34px;
  border: 1px solid #e5e7eb;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(237, 28, 36, 0.12), transparent 34%),
    #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.docs-hero h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(2rem, 3vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.docs-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 12px 0 0;
  color: #64748b;
  font-size: 1.02rem;
  line-height: 1.55;
}

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

.docs-visual-card {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.docs-visual-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f8fafc;
}

.docs-visual-card div {
  padding: 18px 20px 20px;
}

.docs-visual-card strong {
  display: block;
  color: #111827;
  font-size: 1.05rem;
}

.docs-visual-card p {
  margin: 8px 0 0;
  color: #64748b;
  line-height: 1.45;
}

.docs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.docs-side-card,
.docs-document-card {
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.docs-side-card {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 132px);
  overflow-y: auto;
  padding: 20px;
}

.docs-side-card a {
  display: block;
  padding: 10px 12px;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 10px;
  color: #111827;
  font-weight: 800;
  text-decoration: none;
  line-height: 1.25;
}

.docs-side-card a.is-active {
  border-left-color: #ed1c24;
  background: #fff5f5;
  color: #b5121b;
}

.docs-document-card {
  overflow: hidden;
}

.docs-document-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 26px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
}

.docs-document-header span {
  color: #ed1c24;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.docs-body {
  padding: 30px;
  color: #111827;
  font-size: 1rem;
  line-height: 1.72;
}

.docs-body h1,
.docs-body h2,
.docs-body h3,
.docs-body h4 {
  color: #111827;
  letter-spacing: 0;
  line-height: 1.18;
}

.docs-body h1 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 3vw, 3rem);
}

.docs-body h2 {
  margin: 36px 0 14px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
  font-size: 1.7rem;
}

.docs-body h3 {
  margin: 28px 0 12px;
  font-size: 1.25rem;
}

.docs-body p {
  margin: 0 0 16px;
}

.docs-body ul,
.docs-body ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

.docs-body li + li {
  margin-top: 6px;
}

.docs-body a {
  color: #ed1c24;
  font-weight: 800;
}

.docs-body code {
  padding: 2px 6px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #b5121b;
  font-weight: 800;
}

.docs-body pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 16px;
  background: #101923;
  color: #e5e7eb;
}

.docs-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.docs-body blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 5px solid #ed1c24;
  border-radius: 12px;
  background: #fff5f5;
  color: #4b5563;
}

.docs-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
}

.docs-body th,
.docs-body td {
  padding: 12px 14px;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.docs-body th {
  background: #f8fafc;
  color: #111827;
  font-weight: 900;
}

.docs-body tr:last-child td {
  border-bottom: 0;
}

.docs-body th:last-child,
.docs-body td:last-child {
  border-right: 0;
}

@media (max-width: 980px) {
  .docs-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 28px;
  }

  .docs-visual-grid,
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-side-card {
    position: static;
  }
}

@media (max-width: 640px) {
  .docs-page {
    gap: 18px;
  }

  .docs-hero,
  .docs-side-card,
  .docs-document-card,
  .docs-visual-card {
    border-radius: 20px;
  }

  .docs-hero {
    padding: 20px;
  }

  .docs-body {
    padding: 22px;
    font-size: 0.96rem;
  }

  .docs-document-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .docs-body th,
  .docs-body td {
    white-space: normal;
    min-width: 160px;
  }
}

/* Tablet containment pass: shared module cards must fit portrait and landscape tablets. */
@media (min-width: 761px) and (max-width: 1180px) {
  body.has-app-sidebar {
    overflow-x: hidden;
  }

  .has-app-sidebar .app-main,
  .has-app-sidebar .container,
  .has-app-sidebar .app-main .events-page,
  .has-app-sidebar .app-main .reports-page,
  .has-app-sidebar .app-main .drive-module,
  .has-app-sidebar .app-main .members-page,
  .has-app-sidebar .app-main .inventory-module,
  .has-app-sidebar .app-main .meratch-dashboard-page,
  .large-interventions-page.has-app-sidebar .app-main,
  .large-interventions-page.has-app-sidebar .container,
  .large-interventions-page.has-app-sidebar .large-interventions-index-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .has-app-sidebar .container {
    padding-right: 20px;
    padding-left: 20px;
    overflow-x: hidden;
  }

  .has-app-sidebar .app-main .stats-grid.events-stats,
  .has-app-sidebar .app-main .stats-grid.drive-stats,
  .has-app-sidebar .app-main .stats-grid.invoice-stats,
  .has-app-sidebar .app-main .stats-grid.inventory-stats,
  .has-app-sidebar .app-main .stats-grid.sms-stats,
  .has-app-sidebar .app-main .stats-grid.reports-stats,
  .has-app-sidebar .app-main .member-stats.events-stats,
  .large-interventions-index-page .stab-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }

  .has-app-sidebar .app-main .events-stats .ops-stat-card,
  .large-interventions-index-page .stab-stats .ops-stat-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .has-app-sidebar .app-main .events-stats .ops-stat-card strong,
  .large-interventions-index-page .stab-stats .ops-stat-card strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .has-app-sidebar .app-main .events-filter-panel,
  .has-app-sidebar .app-main .events-table-wrap,
  .large-interventions-index-page .large-interventions-action-panel,
  .large-interventions-index-page .panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .has-app-sidebar .app-main .events-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .has-app-sidebar .app-main .events-table {
    width: max-content;
    min-width: 100%;
  }

  .has-app-sidebar .app-main .events-table th,
  .has-app-sidebar .app-main .events-table td {
    white-space: normal;
  }

  .has-app-sidebar .app-main .events-table th:nth-child(2),
  .has-app-sidebar .app-main .events-table td:nth-child(2) {
    min-width: 240px;
    max-width: 360px;
    overflow-wrap: anywhere;
  }

  .large-interventions-index-page .large-intervention-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Mass casualties module: keep forms, tables and action buttons usable on tablets and phones. */
.mass-casualties-page .panel,
.mass-casualties-page .form-grid,
.mass-casualties-page .data-grid,
.mass-casualties-page label,
.mass-casualties-page .table-wrap {
  min-width: 0;
}

.mass-casualties-page .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mass-casualties-page .data-table {
  min-width: 760px;
}

.mass-casualties-page .panel-header .button-row,
.mass-casualties-page .form-actions {
  flex-wrap: wrap;
}

.mass-casualties-page .signature-pad {
  max-width: 100%;
}

.mass-casualties-page .events-stats .mass-active-event-card strong {
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.mass-casualties-page .mass-casualty-close-actions {
  justify-content: flex-start;
  margin-top: 16px;
}

@media (min-width: 761px) {
  .mass-casualties-page .mass-casualty-close-actions {
    margin-top: 28px;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .mass-casualties-page.has-app-sidebar,
  .mass-casualties-page.has-app-sidebar .app-main,
  .mass-casualties-page.has-app-sidebar .container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .mass-casualties-page.has-app-sidebar .container {
    padding-right: 20px;
    padding-left: 20px;
  }

  .mass-casualties-page .stats-grid,
  .mass-casualties-page .events-stats,
  .mass-casualties-page .module-grid,
  .mass-casualties-page .large-intervention-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .mass-casualties-page .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mass-casualties-page .panel-header .button-row {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .mass-casualties-page .container {
    padding-right: 12px;
    padding-left: 12px;
    overflow-x: hidden;
  }

  .mass-casualties-page .panel {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .mass-casualties-page .container > section + section {
    margin-top: 14px;
  }

  .mass-casualties-page .stats-grid,
  .mass-casualties-page .events-stats {
    gap: 14px !important;
  }

  .mass-casualties-page .panel-header {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .mass-casualties-page .panel-header h1 {
    font-size: clamp(25px, 7vw, 34px);
    line-height: 1.05;
  }

  .mass-casualties-page .panel-header p,
  .mass-casualties-page .module-card p,
  .mass-casualties-page .detail-card p,
  .mass-casualties-page .detail-card strong {
    overflow-wrap: anywhere;
  }

  .mass-casualties-page .form-grid,
  .mass-casualties-page .data-grid.two-columns,
  .mass-casualties-page .page-grid.two-columns,
  .mass-casualties-page .module-grid,
  .mass-casualties-page .large-intervention-menu-grid,
  .mass-casualties-page .events-stats,
  .mass-casualties-page .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .mass-casualties-page .span-two {
    grid-column: auto !important;
  }

  .mass-casualties-page .button-row,
  .mass-casualties-page .form-actions {
    width: 100%;
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
  }

  .mass-casualties-page .button-row > *,
  .mass-casualties-page .form-actions > * {
    width: auto;
    flex: 0 0 auto;
    justify-content: center;
  }

  .mass-casualties-page .mass-equipment-picker > .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .mass-casualties-page .mass-equipment-picker {
    grid-template-columns: 1fr !important;
  }

  .mass-casualties-page .signature-pad {
    height: 150px;
    border-radius: 16px;
  }

  .mass-casualties-page .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .mass-casualties-page .data-table {
    width: 100%;
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .mass-casualties-page .data-table thead {
    display: none;
  }

  .mass-casualties-page .data-table,
  .mass-casualties-page .data-table tbody,
  .mass-casualties-page .data-table tr,
  .mass-casualties-page .data-table td {
    display: block;
    width: 100%;
  }

  .mass-casualties-page .data-table tr {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  }

  .mass-casualties-page .data-table tbody tr:nth-child(even) td {
    background: transparent;
  }

  .mass-casualties-page .data-table td {
    display: grid;
    grid-template-columns: minmax(98px, 0.38fr) minmax(0, 1fr);
    gap: 10px;
    padding: 8px 12px !important;
    border-right: 0 !important;
    border-bottom: 1px solid #eef2f7;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mass-casualties-page .data-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .mass-casualties-page .data-table td:first-child {
    grid-template-columns: 1fr;
    padding-top: 12px !important;
    font-size: 18px;
    font-weight: 950;
  }

  .mass-casualties-page .data-table td:first-child::before,
  .mass-casualties-page .data-table td[colspan]::before {
    display: none;
  }

  .mass-casualties-page .data-table td:last-child {
    border-bottom: 0;
  }

  .mass-casualties-page .data-table .action-cell {
    display: flex;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    background: #f8fafc !important;
  }

  .mass-casualties-page .data-table .action-cell::before,
  .mass-casualties-page .data-table .action-cell span {
    display: none;
  }

  .mass-casualties-page .data-table .action-cell a,
  .mass-casualties-page .data-table .action-cell button {
    display: flex;
    width: auto;
    min-height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7dde5;
    border-radius: 12px;
    background: #ffffff;
    padding: 6px 12px;
  }

  .mass-casualties-page .data-table input[type="number"],
  .mass-casualties-page .data-table input[type="text"] {
    width: 100%;
    min-width: 0;
  }

  .mass-casualties-page .data-table img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 430px) {
  .mass-casualties-page .panel {
    padding: 16px 12px;
  }

  .mass-casualties-page .data-table td {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .mass-casualties-page .data-table td:first-child {
    font-size: 17px;
  }

  .mass-casualties-page .signature-pad {
    height: 132px;
  }
}

@media (max-width: 1180px) {
  .mass-casualties-page.has-app-sidebar .app-main .primary-button,
  .mass-casualties-page.has-app-sidebar .app-main .secondary-button,
  .mass-casualties-page.has-app-sidebar .app-main .danger-button,
  .mass-casualties-page.has-app-sidebar .app-main .button,
  .mass-casualties-page.has-app-sidebar .app-main .table-action,
  .mass-casualties-page.has-app-sidebar .app-main .button-row > *,
  .mass-casualties-page.has-app-sidebar .app-main .form-actions > *,
  .mass-casualties-page.has-app-sidebar .app-main .mass-equipment-picker > .secondary-button,
  .mass-casualties-page.has-app-sidebar .app-main .data-table .action-cell a,
  .mass-casualties-page.has-app-sidebar .app-main .data-table .action-cell button {
    width: auto !important;
    flex: 0 0 auto !important;
  }

  .mass-casualties-page.has-app-sidebar .app-main .button-row,
  .mass-casualties-page.has-app-sidebar .app-main .form-actions,
  .mass-casualties-page.has-app-sidebar .app-main .data-table .action-cell {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

.mass-casualties-page .module-card.mass-loan-return-none,
.mass-casualties-page .data-table tbody tr.mass-loan-return-none,
.mass-casualties-page .data-table tbody tr.mass-loan-return-none td:not(.action-cell) {
  border-color: rgba(255, 255, 255, 0.62) !important;
  background: #ff514b !important;
  color: #111827 !important;
}

.mass-casualties-page .module-card.mass-loan-return-partial,
.mass-casualties-page .data-table tbody tr.mass-loan-return-partial,
.mass-casualties-page .data-table tbody tr.mass-loan-return-partial td:not(.action-cell) {
  border-color: rgba(255, 255, 255, 0.62) !important;
  background: #ffd84f !important;
  color: #111827 !important;
}

.mass-casualties-page .module-card.mass-loan-return-full,
.mass-casualties-page .data-table tbody tr.mass-loan-return-full,
.mass-casualties-page .data-table tbody tr.mass-loan-return-full td:not(.action-cell) {
  border-color: rgba(255, 255, 255, 0.62) !important;
  background: #57d786 !important;
  color: #111827 !important;
}

.mass-casualties-page .module-card.mass-loan-return-none *,
.mass-casualties-page .module-card.mass-loan-return-full *,
.mass-casualties-page .data-table tbody tr.mass-loan-return-none td::before,
.mass-casualties-page .data-table tbody tr.mass-loan-return-full td::before {
  color: #111827 !important;
}

.mass-casualties-page .module-card.mass-loan-return-partial *,
.mass-casualties-page .data-table tbody tr.mass-loan-return-partial td::before {
  color: #111827 !important;
}

.mass-casualties-page .data-table tbody tr.mass-loan-return-none .action-cell a,
.mass-casualties-page .data-table tbody tr.mass-loan-return-none .action-cell button,
.mass-casualties-page .data-table tbody tr.mass-loan-return-partial .action-cell a,
.mass-casualties-page .data-table tbody tr.mass-loan-return-partial .action-cell button,
.mass-casualties-page .data-table tbody tr.mass-loan-return-full .action-cell a,
.mass-casualties-page .data-table tbody tr.mass-loan-return-full .action-cell button {
  border-color: rgba(17, 24, 39, 0.18) !important;
  background: #ffffff !important;
  color: #111827 !important;
}

.mass-casualties-page .data-table tbody tr.mass-loan-return-none td.action-cell,
.mass-casualties-page .data-table tbody tr.mass-loan-return-partial td.action-cell,
.mass-casualties-page .data-table tbody tr.mass-loan-return-full td.action-cell {
  border-color: #eef2f7 !important;
  background: #f8fafc !important;
  color: #111827 !important;
}

.mass-casualties-page .data-table tbody tr.mass-loan-return-none td.action-cell *,
.mass-casualties-page .data-table tbody tr.mass-loan-return-partial td.action-cell *,
.mass-casualties-page .data-table tbody tr.mass-loan-return-full td.action-cell * {
  color: #111827 !important;
}

@media (max-width: 760px) {
  .mass-casualties-page .data-table.mass-no-mobile-accent tr {
  }
}

/* Tablet refinements for SMS and vehicle tracking modules. */
@media (min-width: 761px) and (max-width: 1180px) {
  .has-app-sidebar .app-main .sms-compose-grid {
    grid-template-columns: 1fr !important;
  }

  .has-app-sidebar .app-main .sms-compose-form {
    grid-template-columns: 1fr !important;
  }

  .has-app-sidebar .app-main .sms-compose-form .span-two {
    grid-column: 1 / -1;
  }

  .has-app-sidebar .app-main #predloge .form-actions > .secondary-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.15;
  }

  .vehicle-tracking-page.has-app-sidebar .vehicle-tracking-live-layout,
  .has-app-sidebar .app-main .vehicle-tracking-live-layout {
    grid-template-columns: 1fr !important;
  }

  .vehicle-tracking-page.has-app-sidebar .vehicle-tracking-interventions,
  .has-app-sidebar .app-main .vehicle-tracking-interventions {
    display: contents;
  }

  .vehicle-tracking-page.has-app-sidebar .vehicle-tracking-active-section,
  .has-app-sidebar .app-main .vehicle-tracking-active-section {
    order: 1;
  }

  .vehicle-tracking-page.has-app-sidebar .vehicle-tracking-map-card,
  .has-app-sidebar .app-main .vehicle-tracking-map-card {
    order: 2;
  }

  .vehicle-tracking-page.has-app-sidebar .vehicle-tracking-legend-section,
  .has-app-sidebar .app-main .vehicle-tracking-legend-section {
    order: 3;
  }

  .vehicle-tracking-page.has-app-sidebar .vehicle-tracking-vehicles-section,
  .has-app-sidebar .app-main .vehicle-tracking-vehicles-section {
    order: 4;
  }
}
/* Maintenance module */
.maintenance-page .panel,
.maintenance-form-page .panel,
.maintenance-show-page .panel {
    overflow: visible;
}

.maintenance-form-page.two-columns,
.maintenance-show-page.two-columns {
    align-items: start;
}

.maintenance-show-page .inventory-detail-hero h1 {
    font-size: 32px;
    line-height: 1.08;
}

.maintenance-help-list {
    display: grid;
    gap: 14px;
}

.maintenance-help-list p {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f9fafb;
}

.maintenance-gallery {
    margin-top: 24px;
}

.maintenance-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.maintenance-image-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f3f4f6;
}

.maintenance-timeline {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.maintenance-section-header {
    margin-top: 28px;
}

.maintenance-timeline article {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.maintenance-timeline small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.maintenance-table tr.maintenance-assignee-row > td {
    background: var(--maintenance-assignee-color);
}

.maintenance-table tr.maintenance-assignee-row:hover > td {
    background: color-mix(in srgb, var(--maintenance-assignee-color) 82%, #ffffff);
}

.maintenance-table .maintenance-location-cell,
.maintenance-table .maintenance-description-cell,
.maintenance-table .maintenance-empty-cell {
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
}

.maintenance-table .maintenance-description-cell {
    min-width: 260px;
    white-space: normal;
}

.maintenance-table-link {
    color: inherit;
    font-size: 1em !important;
    font-weight: inherit;
    line-height: inherit;
    text-decoration: none;
}

.maintenance-table-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.maintenance-delete-button {
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.28);
    background: #fff;
}

.maintenance-complete-button {
    color: var(--success);
    border-color: rgba(22, 163, 74, 0.28);
    background: #fff;
}

.compact-panel-header {
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

@media (max-width: 760px) {
    .maintenance-page .stats-grid,
    .maintenance-form-page.two-columns,
    .maintenance-show-page.two-columns {
        grid-template-columns: 1fr;
    }

    .maintenance-show-page .form-actions {
        width: 100%;
    }

    .maintenance-show-page .form-actions > * {
        flex: 1 1 auto;
    }

    .maintenance-table .maintenance-location-cell,
    .maintenance-table .maintenance-description-cell,
    .maintenance-table .maintenance-empty-cell {
        font-size: 12.8px !important;
        font-weight: 700 !important;
        line-height: 1.35 !important;
    }

    .maintenance-table .maintenance-description-cell {
        min-width: 520px;
    }
}
