:root {
  color-scheme: dark;
  --bg: #07090d;
  --bg-2: #0d1017;
  --panel: #171b25;
  --panel-2: #1c212d;
  --panel-3: #222938;
  --ink: #f5f7fb;
  --muted: #9aa2b3;
  --faint: #687185;
  --line: #2a3141;
  --line-soft: #1f2532;
  --accent: #19b8d8;
  --accent-strong: #58dcff;
  --ok: #43d98b;
  --warn: #f4b34a;
  --danger: #ff637d;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  margin: 0;
  background:
    linear-gradient(180deg, #06080c 0, #0b0e14 150px, var(--bg-2) 100%);
  color: var(--ink);
  font-family: Inter, Roboto, "Helvetica Neue", Arial, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

::selection {
  background: rgba(25, 184, 216, 0.28);
  color: #fff;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  min-height: 50px;
  background: #07090d;
  border-bottom: 1px solid #111722;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 248px;
  padding: 0 18px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.brand::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 20%, rgba(255, 255, 255, 0.72) 20% 30%, transparent 30% 44%, rgba(255, 255, 255, 0.72) 44% 54%, transparent 54% 68%, rgba(255, 255, 255, 0.72) 68% 78%, transparent 78%),
    linear-gradient(145deg, #126f8f, var(--accent-strong));
  box-shadow: 0 0 0 1px rgba(88, 220, 255, 0.24), 0 0 18px rgba(25, 184, 216, 0.42);
  transform: rotate(45deg);
}

.brand span {
  opacity: 0.92;
}

.global-search {
  position: relative;
  align-self: center;
  width: min(360px, 28vw);
  min-width: 220px;
  margin: 0 10px;
  flex: 0 1 360px;
}

.global-search input {
  min-height: 34px;
  padding: 8px 10px;
  background: #0d121b;
  border-color: #182131;
  font-size: 12px;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 4px;
  max-height: 420px;
  overflow: auto;
  padding: 8px;
  background: #10151f;
  border: 1px solid rgba(88, 220, 255, 0.24);
  border-radius: 4px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.54);
}

.global-search-result {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 2px 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #151b27;
}

.global-search-result:hover,
.global-search-result.is-active {
  border-color: rgba(88, 220, 255, 0.38);
  background: #1b2432;
}

.global-search-result span {
  grid-row: span 2;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.global-search-result strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-result small,
.global-search-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.topbar nav {
  display: flex;
  flex: 1 1 620px;
  flex-wrap: wrap;
  min-width: 0;
  justify-content: flex-end;
  overflow: visible;
  color: #dce2ee;
  scrollbar-width: thin;
}

.topbar nav a,
.topbar nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 16px;
  border-left: 1px solid #10151f;
  border-right: 1px solid rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar nav button {
  appearance: none;
  background: transparent;
  border-top: 0;
  border-bottom: 0;
  cursor: pointer;
  font-family: inherit;
}

.nav-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}

.topbar nav a:hover,
.topbar nav a:focus-visible,
.topbar nav button:hover,
.topbar nav button:focus-visible,
.nav-menu:focus-within > .nav-menu-trigger {
  color: #fff;
  background: var(--panel);
  outline: none;
}

.nav-menu {
  position: relative;
  display: inline-flex;
}

.nav-menu-trigger {
  position: relative;
}

.nav-chevron {
  margin-left: 2px;
  color: var(--accent-strong);
  font-size: 10px;
  line-height: 1;
}

.nav-submenu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 60;
  display: none;
  min-width: 210px;
  padding: 6px;
  background: #10151f;
  border: 1px solid rgba(88, 220, 255, 0.24);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.54);
}

.nav-menu:hover .nav-submenu,
.nav-menu:focus-within .nav-submenu {
  display: grid;
  gap: 4px;
}

.topbar nav .nav-submenu a {
  justify-content: flex-start;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  background: #151b27;
  font-size: 11px;
}

.topbar nav .nav-submenu a:hover,
.topbar nav .nav-submenu a:focus-visible {
  border-color: rgba(88, 220, 255, 0.38);
  background: #1b2432;
}

.page {
  width: min(1880px, calc(100% - 34px));
  margin: 16px auto 52px;
}

.section-head {
  display: grid;
  place-items: center;
  min-height: 64px;
  margin: 0 0 14px;
  padding: 12px 18px;
  background: #090c12;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  text-align: center;
}

.section-head h1,
.crew-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-head p {
  max-width: 900px;
  margin: 6px 0 0;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.metric-grid,
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(286px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.form-grid.single {
  grid-template-columns: minmax(286px, 820px);
}

.event-list-view {
  margin-bottom: 14px;
}

.event-list-tabs {
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  box-shadow: var(--shadow);
}

.event-list-view > .event-tab-panel .table-wrap,
.event-list-view > .event-tab-panel .project-event-tree {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.project-event-tree {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.project-event-tree > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
}

.project-event-tree h2 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-event-tree p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.project-tree-node {
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.project-tree-node summary {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  cursor: pointer;
}

.project-tree-node summary::marker {
  color: var(--accent-strong);
}

.project-tree-node summary strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tree-node summary span,
.project-tree-node summary small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-tree-children {
  display: grid;
  gap: 4px;
  padding: 0 10px 10px 26px;
}

.project-tree-event {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(90px, auto) minmax(100px, auto);
  gap: 10px;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  background: #0b1018;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 4px;
  color: #dce3ef;
}

.project-tree-event:hover,
.project-tree-event:focus-visible {
  border-color: rgba(88, 220, 255, 0.38);
  color: #fff;
  outline: none;
}

.project-tree-event strong,
.project-tree-event span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tree-event strong {
  font-size: 12px;
}

.project-tree-event span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 4px;
}

.modal-open-button {
  min-width: 148px;
}

.modal-dialog {
  width: min(820px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 36px));
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.modal-surface {
  max-height: min(860px, calc(100vh - 36px));
  overflow: auto;
  background: linear-gradient(180deg, #1c212d, #141924);
  border: 1px solid rgba(88, 220, 255, 0.24);
  border-radius: 6px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #090c12;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-header .modal-close-button {
  min-height: 34px;
  padding: 0 12px;
}

.modal-form-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.modal-form-card > h2 {
  display: none;
}

.event-editor-dialog {
  width: min(1220px, calc(100vw - 28px));
}

.event-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  text-align: left;
}

.event-workspace-head > div {
  min-width: 0;
}

.event-workspace-head h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.inline-action-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.inline-action-form button {
  white-space: nowrap;
}

.inline-action-form .checkline {
  min-height: 40px;
  margin: 0;
  padding: 0 10px;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.event-summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: flex-start;
}

.event-summary-line span {
  min-width: 0;
}

.recurrence-alerts {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(244, 179, 74, 0.14), rgba(15, 20, 29, 0.96));
  border: 1px solid rgba(244, 179, 74, 0.38);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.recurrence-alerts h2 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.recurrence-inline-alert {
  margin: 0;
  padding: 8px 10px;
  color: #ffe5b1;
  background: rgba(244, 179, 74, 0.12);
  border: 1px solid rgba(244, 179, 74, 0.32);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.event-workspace {
  min-height: calc(100vh - 160px);
  overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.event-editor-surface {
  max-height: min(900px, calc(100vh - 28px));
}

.event-editor-header > div {
  min-width: 0;
}

.event-editor-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.event-editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: #0b0f16;
  border-bottom: 1px solid var(--line);
}

.event-editor-tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  background: #151b27;
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none;
  font-size: 11px;
  text-decoration: none;
}

.event-editor-tab-button.is-active {
  background: linear-gradient(180deg, #159fc0, #087a99);
  border-color: rgba(88, 220, 255, 0.46);
  color: #fff;
}

.event-editor-body {
  padding: 12px;
}

.event-editor-wide {
  grid-column: 1 / -1;
}

.event-tab-panel {
  display: none;
}

.event-tab-panel.is-active {
  display: block;
}

.event-operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 10px;
}

.event-editor-panel {
  min-width: 0;
  padding: 14px;
  background: linear-gradient(180deg, #171d29, #131822);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.event-editor-panel h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.operation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.operation-header h3 {
  margin: 0;
}

.admin-reference-section {
  margin: 14px 0;
}

.admin-reference-section .operation-header h2 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.compact-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.event-editor-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.gps-lookup-status {
  display: block;
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.gps-lookup-status.is-error {
  color: #ff9d9d;
}

.event-related-list {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.event-related-list p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 8px 9px;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.event-related-list p.muted {
  display: block;
  color: var(--muted);
}

.event-related-list strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-related-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.sectioned-form {
  gap: 12px;
}

.form-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(8, 12, 18, 0.34);
}

.form-section legend {
  padding: 0 6px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.form-section-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
}

.form-primary-actions {
  position: sticky;
  top: 58px;
  z-index: 3;
  align-items: center;
  margin-bottom: 2px;
  padding: 10px 12px;
  background: #0b1018;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.form-section-actions button {
  width: auto;
  min-width: 132px;
}

.form-card h2,
.queue-grid h2,
.data-columns h2,
.crew-panel h2,
section > h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.data-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.data-columns article,
.metric,
.queue-grid article,
.form-card,
.crew-panel,
.login-panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.data-columns article,
.form-card,
.queue-grid article,
.crew-panel,
.login-panel {
  padding: 16px;
}

.data-columns p {
  margin: 0;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}

.data-columns p:first-of-type {
  border-top: 0;
}

.metric {
  position: relative;
  min-height: 102px;
  padding: 15px 16px;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(25, 184, 216, 0.55);
}

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

.metric strong {
  display: block;
  margin-top: 10px;
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.archive-table-stack {
  display: grid;
  gap: 8px;
}

.archive-table-panel {
  background: #10151f;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.archive-table-panel summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.archive-table-panel summary span {
  color: var(--muted);
}

.archive-table-panel .table-wrap {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

th {
  background: #111721;
  color: #dce3ef;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: #e7ebf4;
}

.table-title-link {
  color: #fff;
}

.table-title-link:hover,
.table-title-link:focus-visible {
  color: var(--accent-strong);
  outline: none;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(25, 184, 216, 0.055);
}

.cartrack-cache-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  color: #d8e5f2;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.cartrack-cache-status.is-loading {
  color: #9deeff;
  border-color: rgba(25, 184, 216, 0.42);
}

.cartrack-cache-status.is-ready {
  color: #9df0cb;
  border-color: rgba(76, 211, 151, 0.35);
}

.cartrack-cache-status.is-empty {
  color: #f6d38b;
  border-color: rgba(244, 179, 74, 0.35);
}

.cartrack-cache-status.is-error {
  color: #ffd6dd;
  border-color: rgba(255, 99, 125, 0.45);
}

.resource-type-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.resource-type-copy {
  min-width: 0;
}

.resource-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #dce7f6;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 4px;
  flex: 0 0 30px;
}

.resource-type-icon .button-ico {
  width: 16px;
  height: 16px;
}

.resource-type-icon--assembly {
  color: #9deeff;
  background: rgba(25, 184, 216, 0.12);
  border-color: rgba(25, 184, 216, 0.38);
}

.resource-type-icon--equipment {
  color: #f6d38b;
  background: rgba(244, 179, 74, 0.12);
  border-color: rgba(244, 179, 74, 0.36);
}

.resource-type-icon--vehicle {
  color: #9df0cb;
  background: rgba(76, 211, 151, 0.12);
  border-color: rgba(76, 211, 151, 0.34);
}

.resource-type-icon--service {
  color: #cdbdff;
  background: rgba(142, 116, 255, 0.13);
  border-color: rgba(142, 116, 255, 0.36);
}

.resource-actions-cell {
  position: relative;
  width: 1%;
  min-width: 86px;
}

.resource-context-menu {
  position: relative;
  display: inline-block;
}

.resource-context-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #dce7f6;
  list-style: none;
  cursor: pointer;
  background: #283142;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.resource-context-trigger::-webkit-details-marker {
  display: none;
}

.resource-context-menu[open] .resource-context-trigger {
  color: #061018;
  background: var(--accent);
  border-color: rgba(25, 184, 216, 0.62);
}

.resource-context-panel {
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 10px;
  margin-top: 6px;
  padding: 12px;
  background: #10151f;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.resource-context-panel > strong,
.resource-context-title {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.resource-context-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.resource-context-section .compact-form {
  margin-top: 0;
}

.team-filter-panel .event-filter-grid {
  flex: 1 1 100%;
}

.team-create-details {
  margin-bottom: 14px;
}

.team-create-details > summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  background: #151c28;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.team-create-details[open] > summary {
  margin-bottom: 10px;
  border-color: rgba(88, 220, 255, 0.34);
}

.team-filter-panel input[type="search"] {
  flex: 2 1 260px;
}

.team-grid-actions {
  position: sticky;
  top: 58px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #0b1018;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.team-grid-actions span {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-grid-form:not(.is-dirty) [data-team-reset] {
  opacity: 0.62;
}

.location-grid-form:not(.is-dirty) [data-location-reset] {
  opacity: 0.62;
}

.team-grid-wrap {
  max-height: calc(100vh - 190px);
}

.team-edit-grid {
  min-width: 2380px;
  table-layout: fixed;
}

.team-edit-grid th {
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.team-edit-grid td {
  min-width: 0;
  padding: 6px;
  vertical-align: middle;
}

.team-edit-grid th:nth-child(1),
.team-edit-grid td:nth-child(1) { width: 230px; }
.team-edit-grid th:nth-child(2),
.team-edit-grid td:nth-child(2) { width: 170px; }
.team-edit-grid th:nth-child(3),
.team-edit-grid td:nth-child(3) { width: 250px; }
.team-edit-grid th:nth-child(4),
.team-edit-grid td:nth-child(4) { width: 145px; }
.team-edit-grid th:nth-child(5),
.team-edit-grid td:nth-child(5) { width: 190px; }
.team-edit-grid th:nth-child(6),
.team-edit-grid td:nth-child(6) { width: 140px; }
.team-edit-grid th:nth-child(7),
.team-edit-grid td:nth-child(7),
.team-edit-grid th:nth-child(8),
.team-edit-grid td:nth-child(8),
.team-edit-grid th:nth-child(9),
.team-edit-grid td:nth-child(9),
.team-edit-grid th:nth-child(10),
.team-edit-grid td:nth-child(10) { width: 78px; text-align: center; }
.team-edit-grid th:nth-child(11),
.team-edit-grid td:nth-child(11),
.team-edit-grid th:nth-child(12),
.team-edit-grid td:nth-child(12) { width: 220px; }
.team-edit-grid th:nth-child(13),
.team-edit-grid td:nth-child(13),
.team-edit-grid th:nth-child(14),
.team-edit-grid td:nth-child(14),
.team-edit-grid th:nth-child(15),
.team-edit-grid td:nth-child(15) { width: 145px; }
.team-edit-grid th:nth-child(16),
.team-edit-grid td:nth-child(16) { width: 138px; }
.team-edit-grid th:nth-child(17),
.team-edit-grid td:nth-child(17) { width: 210px; }
.team-edit-grid th:nth-child(18),
.team-edit-grid td:nth-child(18) { width: 260px; }

.team-edit-grid .team-sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #131924;
  box-shadow: 1px 0 0 var(--line);
}

.team-edit-grid th.team-sticky-col {
  z-index: 5;
  background: #111721;
}

.team-primary-cell small {
  margin-top: 3px;
  padding-left: 8px;
}

.team-edit-grid input[type="hidden"] {
  display: none;
}

.team-grid-value,
.team-grid-choice-label,
.team-grid-boolean {
  display: block;
  min-height: 31px;
  padding: 6px 7px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #f3f6fb;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-grid-value {
  cursor: text;
}

.team-grid-value.multiline {
  max-height: 44px;
  white-space: pre-wrap;
}

.team-grid-value:empty::before {
  content: " ";
}

.team-grid-value:hover,
.team-grid-value:focus {
  background: #0f141d;
  border-color: var(--line);
  outline: none;
}

.team-grid-control {
  display: none;
}

.team-edit-grid tr.is-editing .team-grid-control {
  display: block;
}

.team-edit-grid tr.is-editing .team-grid-check.team-grid-control {
  display: inline-grid;
}

.team-edit-grid tr.is-editing .team-grid-choice-label,
.team-edit-grid tr.is-editing .team-grid-boolean {
  display: none;
}

.team-edit-grid select,
.team-edit-grid input[type="date"] {
  width: 100%;
  min-height: 31px;
  padding: 5px 7px;
  background: #0f141d;
  border-color: var(--line);
  border-radius: 3px;
  box-shadow: none;
  color: #f3f6fb;
  font-size: 12px;
}

.team-edit-grid input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.team-edit-grid tr.is-editing .team-grid-value.multiline,
.team-grid-value.multiline:focus {
  max-height: 120px;
  overflow: auto;
}

.team-edit-grid tr.is-editing {
  background: rgba(25, 184, 216, 0.07);
}

.team-edit-grid tr.is-dirty {
  box-shadow: inset 3px 0 0 var(--accent-strong);
}

.team-grid-check {
  display: inline-grid;
  place-items: center;
  min-height: 31px;
  width: 100%;
  margin: 0;
}

.team-grid-boolean {
  color: var(--faint);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.team-grid-boolean.is-on {
  color: var(--ok);
}

.team-user-cell,
.team-grid-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.team-user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 0 4px 3px 0;
  padding: 0 6px;
  border: 1px solid rgba(88, 220, 255, 0.25);
  border-radius: 3px;
  color: #dff8ff;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-user-empty {
  color: var(--faint);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-grid-meta small,
.team-user-cell small {
  margin-top: 2px;
  color: var(--muted);
}

.team-user-cell small {
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.location-filter-panel input[type="search"] {
  flex: 2 1 280px;
}

.location-geocode-panel {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.location-geocode-action {
  display: grid;
  gap: 4px;
}

.location-geocode-action small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.location-geocode-progress {
  display: grid;
  grid-template-columns: minmax(160px, 280px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.location-geocode-progress progress {
  width: 100%;
  height: 12px;
  accent-color: var(--accent);
}

.location-geocode-progress span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.location-edit-grid tr.is-geocoded {
  box-shadow: inset 3px 0 0 rgba(89, 213, 123, 0.85);
}

.location-edit-grid {
  min-width: 1760px;
}

.location-edit-grid th:nth-child(1),
.location-edit-grid td:nth-child(1) { width: 230px; }
.location-edit-grid th:nth-child(2),
.location-edit-grid td:nth-child(2) { width: 330px; }
.location-edit-grid th:nth-child(3),
.location-edit-grid td:nth-child(3) { width: 150px; }
.location-edit-grid th:nth-child(4),
.location-edit-grid td:nth-child(4) { width: 150px; }
.location-edit-grid th:nth-child(5),
.location-edit-grid td:nth-child(5) { width: 250px; }
.location-edit-grid th:nth-child(6),
.location-edit-grid td:nth-child(6) { width: 260px; }
.location-edit-grid th:nth-child(7),
.location-edit-grid td:nth-child(7) { width: 90px; }
.location-edit-grid th:nth-child(8),
.location-edit-grid td:nth-child(8) { width: 220px; }
.location-edit-grid th:nth-child(9),
.location-edit-grid td:nth-child(9) { width: 260px; }

.location-gps-cell {
  display: grid;
  gap: 6px;
}

.location-gps-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.location-gps-button {
  min-height: 30px;
  padding: 0 9px;
  justify-self: start;
}

.location-gps-button[hidden] {
  display: none;
}

.location-gps-cell .gps-lookup-status {
  min-height: 14px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.location-gps-cell .gps-lookup-status.is-error {
  color: #ffd6dd;
}

.location-grid-meta {
  text-align: center;
}

.location-grid-meta strong {
  display: block;
  color: var(--accent-strong);
  font-size: 15px;
}

.location-grid-meta small {
  margin-top: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill.warning {
  color: #ffe5b1;
  background: rgba(244, 179, 74, 0.12);
  border-color: rgba(244, 179, 74, 0.36);
}

.list-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.list-toolbar input {
  max-width: 380px;
}

.list-search-form {
  display: flex;
  flex: 1 1 520px;
  flex-wrap: wrap;
  gap: 8px;
}

.list-search-form input {
  flex: 1 1 260px;
}

.list-search-form select {
  flex: 0 0 128px;
}

.list-search-form button,
.list-search-form a {
  flex: 0 0 auto;
}

.event-scale-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.event-filter-form {
  flex: 1 1 100%;
}

.event-filter-form input[type="search"] {
  flex: 2 1 260px;
}

.event-filter-form input[type="date"],
.event-filter-form select,
.event-filter-form .searchable-select {
  flex: 1 1 150px;
}

.pagination-summary,
.pagination-links {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pagination-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.pagination-links a {
  min-height: 30px;
  padding: 7px 10px;
  color: var(--accent-strong);
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.list-toolbar span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: -4px 0 12px;
  padding: 8px 12px;
  background: #0b1018;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.pagination-bar a,
.pagination-bar span,
.pagination-bar strong {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pagination-bar a {
  color: var(--accent-strong);
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.pagination-bar a:hover,
.pagination-bar a:focus-visible {
  border-color: rgba(88, 220, 255, 0.38);
  color: #fff;
  outline: none;
}

.pagination-bar strong {
  color: #fff;
}

.row-manager {
  min-width: 128px;
}

.row-manager summary {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.row-manager[open] summary {
  margin-bottom: 10px;
}

.client-row-editor {
  display: grid;
  gap: 10px;
  min-width: min(760px, calc(100vw - 96px));
  padding: 10px;
  background: #0b1018;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.client-identity {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 260px;
}

.client-logo-thumb {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #0b1018;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.client-logo-thumb.placeholder {
  display: inline-grid;
  place-items: center;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-logo-large {
  width: 76px;
  height: 76px;
  font-size: 20px;
}

.editor-media-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.editor-media-preview > div {
  min-width: 0;
}

.editor-media-preview strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-media-preview small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-identity strong {
  display: block;
  color: #fff;
}

.client-identity a {
  color: var(--accent-strong);
}

.client-identity .table-title-link {
  color: #fff;
}

.client-identity .table-title-link:hover,
.client-identity .table-title-link:focus-visible {
  color: var(--accent-strong);
}

.client-contact-list {
  display: grid;
  gap: 5px;
  min-width: 240px;
}

.client-contact-list p {
  margin: 0;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}

.client-contact-list p:first-child {
  border-top: 0;
}

.client-contact-list strong,
.client-contact-list span {
  display: block;
}

.client-contact-list strong {
  color: #fff;
  font-size: 12px;
}

.client-contact-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-contact-create {
  grid-template-columns: repeat(2, minmax(150px, 1fr)) auto;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 4px;
}

.calendar-toolbar strong {
  margin: 0 auto 0 4px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(88, 220, 255, 0.26);
  border-radius: 4px;
  background: #111721;
  color: #dce3ef;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-nav-button.secondary {
  border-color: var(--line);
  color: var(--muted);
}

.calendar-filter {
  display: flex;
  gap: 8px;
  align-items: center;
}

.calendar-filter select {
  min-width: 220px;
}

.planner-toolbar .segmented-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.planner-company-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.planner-company-day {
  min-height: 96px;
  padding: 9px;
  background: #10151f;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.planner-company-day strong,
.planner-company-day span,
.planner-company-day small,
.planner-cell strong,
.planner-cell span,
.planner-cell small {
  display: block;
}

.planner-company-day strong {
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.planner-company-day span,
.planner-cell small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-company-day small {
  margin-top: 5px;
  color: #dce3ef;
  font-size: 11px;
  font-weight: 900;
}

.planner-matrix {
  overflow: auto;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.planner-row {
  display: grid;
  grid-template-columns: 190px repeat(var(--planner-days), minmax(92px, 1fr));
}

.planner-head-row {
  position: sticky;
  top: 0;
  z-index: 2;
}

.planner-office-head,
.planner-day-head,
.planner-office-cell,
.planner-cell {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.planner-office-head,
.planner-day-head {
  padding: 9px;
  background: #111721;
  color: #dce3ef;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.planner-office-head,
.planner-office-cell {
  position: sticky;
  left: 0;
  z-index: 1;
}

.planner-office-cell {
  padding: 10px;
  background: #10151f;
}

.planner-office-cell strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.planner-office-cell span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-day-head.is-today,
.planner-company-day.is-today,
.planner-cell.is-today {
  box-shadow: inset 0 0 0 1px rgba(88, 220, 255, 0.58);
}

.planner-company-day.has-events,
.planner-cell.has-events {
  box-shadow: inset 0 -3px 0 rgba(88, 220, 255, 0.54);
}

.planner-day-head.is-today.has-events,
.planner-company-day.is-today.has-events,
.planner-cell.is-today.has-events {
  box-shadow: inset 0 0 0 1px rgba(88, 220, 255, 0.58), inset 0 -3px 0 rgba(88, 220, 255, 0.54);
}

.planner-cell {
  min-height: 88px;
  padding: 9px;
  background: #151b27;
}

.planner-cell strong {
  color: #fff;
  font-size: 13px;
}

.planner-cell span {
  margin-top: 5px;
  color: #dce3ef;
  font-size: 11px;
  font-weight: 900;
}

.planner-company-day .planner-event-count,
.planner-cell .planner-event-count {
  color: #fff;
}

.planner-status-open {
  border-color: rgba(73, 206, 148, 0.32);
}

.planner-status-tight {
  background: rgba(244, 179, 74, 0.12);
  border-color: rgba(244, 179, 74, 0.34);
}

.planner-status-over {
  background: rgba(236, 86, 86, 0.13);
  border-color: rgba(236, 86, 86, 0.38);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(148px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--line-soft);
  box-shadow: var(--shadow);
}

.calendar-grid.is-loading {
  opacity: 0.58;
  pointer-events: none;
}

.calendar-weekday {
  padding: 10px;
  background: #111721;
  color: #dce3ef;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 150px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  padding: 9px;
  background: var(--panel);
}

.calendar-day.is-muted {
  background: #111620;
}

.calendar-day.is-muted > header,
.calendar-day.is-muted .calendar-empty {
  opacity: 0.45;
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(88, 220, 255, 0.58);
}

.calendar-day > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.calendar-day > header strong {
  color: var(--accent-strong);
  font-size: 10px;
  text-transform: uppercase;
}

.calendar-events {
  display: grid;
  align-content: start;
  gap: 6px;
}

.calendar-event {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 9px;
  border-left: 3px solid var(--client-color);
  border-radius: 3px;
  background: color-mix(in srgb, var(--client-color) 22%, #111721);
  color: #fff;
}

.calendar-event span,
.calendar-event small {
  color: rgba(255, 255, 255, 0.74);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-event strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-empty {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.operations-map-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  background: #10151f;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.operations-map-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.operations-map-filter label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.operations-map-filter input {
  min-height: 36px;
}

.operations-map-filter button,
.operations-map-filter a {
  min-height: 36px;
}

.operations-map-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.operations-map-kpis span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  background: #151b27;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.operations-map-kpis strong {
  color: var(--accent-strong);
  font-size: 14px;
}

.operations-map-load-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  color: #d8e5f2;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  background: #151b27;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  justify-self: end;
  white-space: nowrap;
}

.operations-map-load-status.is-loading {
  color: #9deeff;
  border-color: rgba(25, 184, 216, 0.42);
}

.operations-map-load-status.is-ready {
  color: #9df0cb;
  border-color: rgba(76, 211, 151, 0.35);
}

.operations-map-load-status.is-empty {
  color: #f6d38b;
  border-color: rgba(244, 179, 74, 0.35);
}

.operations-map-load-status.is-error {
  color: #ffd6dd;
  border-color: rgba(255, 99, 125, 0.45);
}

.operations-map-shell {
  position: relative;
  min-height: min(680px, 68vh);
  overflow: hidden;
  background: #0d121b;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.operations-map {
  width: 100%;
  height: min(680px, 68vh);
  min-height: 420px;
  background: #0d121b;
}

.operations-map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 6px;
  place-content: center;
  padding: 22px;
  background: #0d121b;
  color: var(--muted);
  text-align: center;
}

.operations-map-empty strong {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.operations-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.operations-map-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.operations-legend-pin,
.operations-map-marker span,
.operations-map-row strong > span:first-child {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.operations-legend-pin.is-event,
.operations-map-marker .is-event,
.operations-map-row strong > span:first-child {
  background: var(--pin-color, var(--row-color, var(--accent)));
}

.operations-legend-pin.is-vehicle,
.operations-map-marker .is-vehicle,
.operations-map-row strong > span.is-vehicle {
  background: var(--warn);
}

.operations-map-marker {
  display: grid;
  place-items: center;
}

.operations-map-marker span {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(7, 9, 13, 0.56), 0 8px 20px rgba(0, 0, 0, 0.42);
}

.operations-map-popup {
  display: grid;
  gap: 5px;
  min-width: 210px;
}

.operations-map-popup strong {
  color: #fff;
  font-size: 14px;
}

.operations-map-popup span,
.operations-map-popup small {
  color: var(--muted);
  font-size: 12px;
}

.operations-map-popup a {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.operations-map-popup .operations-map-action {
  justify-content: center;
  min-height: 32px;
  margin-top: 4px;
}

.operations-map-shell .leaflet-container {
  background: #0d121b;
}

.operations-map-shell .leaflet-popup-content-wrapper,
.operations-map-shell .leaflet-popup-tip {
  background: #111722;
  color: var(--ink);
}

.operations-map-shell .leaflet-popup-content {
  margin: 12px;
}

.operations-map-shell .leaflet-control-attribution {
  background: rgba(7, 9, 13, 0.82);
  color: var(--muted);
}

.operations-map-shell .leaflet-control-attribution a {
  color: var(--accent-strong);
}

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

.operations-map-lists article {
  min-width: 0;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.operations-map-lists h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.operations-map-row {
  display: grid;
  gap: 3px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}

.operations-map-row > a {
  display: grid;
  min-width: 0;
  gap: 3px;
  color: inherit;
}

.operations-map-row-with-action {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.operations-map-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.operations-map-row.is-refreshed small {
  color: #9df0cb;
}

.operations-map-row.is-error small {
  color: #ffd6dd;
}

.operations-map-row strong {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-map-row small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-editor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

input[type="color"] {
  width: 48px;
  min-height: 34px;
  padding: 3px;
}

.color-editor button {
  min-height: 34px;
  padding: 0 10px;
}

.inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.inline-list a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.currency-list {
  max-height: 220px;
  overflow: auto;
}

.currency-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.category-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 12px;
  min-width: 320px;
}

.category-check-grid .checkline {
  min-height: 28px;
  margin: 0;
}

.inline-create {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(180px, 1fr) auto;
  gap: 8px;
}

.inline-create input,
.inline-create button {
  min-height: 34px;
}

.client-profile-form {
  display: grid;
  gap: 10px;
  min-width: min(760px, 100%);
}

.client-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.client-summary strong {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.client-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.client-profile-actions label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.client-links-cell {
  min-width: 360px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 24px;
}

.login-panel h1 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 24px;
  text-transform: uppercase;
}

.login-panel h1::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  border-radius: 5px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(25, 184, 216, 0.45);
  vertical-align: -2px;
  transform: rotate(45deg);
}

.login-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  color: #ffe5b1;
  background: rgba(244, 179, 74, 0.12);
  border: 1px solid rgba(244, 179, 74, 0.36);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
}

.primary-action,
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(88, 220, 255, 0.26);
  border-radius: 4px;
  padding: 0 15px;
  background: linear-gradient(180deg, #159fc0, #087a99);
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

button:hover,
.primary-action:hover {
  filter: brightness(1.08);
}

button.secondary {
  background: #283142;
  border-color: var(--line);
  color: #d7dfeb;
}

button.danger-button,
.danger-button {
  border-color: rgba(255, 99, 125, 0.48);
  color: #ffd6dd;
}

button.danger-button:hover,
.danger-button:hover {
  background: rgba(255, 99, 125, 0.18);
}

button.icon-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
}

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

.inline-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.integration-record-columns {
  align-items: start;
}

.integration-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.integration-page-head > div {
  min-width: 0;
}

.integration-create-menu {
  position: relative;
  flex: 0 0 auto;
}

.integration-create-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  color: #061018;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
  background: var(--accent);
  border: 1px solid rgba(25, 184, 216, 0.6);
  border-radius: 4px;
}

.integration-create-menu summary::-webkit-details-marker {
  display: none;
}

.integration-create-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  width: min(260px, calc(100vw - 32px));
  gap: 4px;
  padding: 8px;
  background: #10151f;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.integration-create-options button {
  width: 100%;
  justify-content: flex-start;
  min-height: 36px;
  color: #dce7f6;
  background: transparent;
  border-color: transparent;
}

.integration-create-options button:hover,
.integration-create-options button:focus-visible {
  color: #fff;
  background: rgba(25, 184, 216, 0.12);
  border-color: rgba(25, 184, 216, 0.28);
}

.integration-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.integration-sidebar,
.integration-panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.integration-sidebar {
  position: sticky;
  top: 74px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.integration-sidebar h2,
.integration-panel h2,
.integration-subsection h3,
.integration-form-block h3 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.integration-support-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  color: #dce7f6;
  text-align: left;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.integration-support-item.is-active {
  background: rgba(25, 184, 216, 0.11);
  border-color: rgba(25, 184, 216, 0.52);
}

.integration-support-item span:first-child {
  min-width: 0;
}

.integration-support-item strong,
.integration-support-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-support-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.integration-settings-panels {
  min-width: 0;
}

.integration-panel {
  display: none;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
}

.integration-panel.is-active {
  display: grid;
  gap: 14px;
}

.integration-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.integration-panel-header > div {
  min-width: 0;
}

.integration-panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.integration-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 9px;
  color: #a7b0bf;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  background: rgba(167, 176, 191, 0.12);
  border: 1px solid rgba(167, 176, 191, 0.22);
  border-radius: 999px;
}

.integration-status-pill.is-active {
  color: #9df0cb;
  background: rgba(76, 211, 151, 0.12);
  border-color: rgba(76, 211, 151, 0.35);
}

.integration-status-pill.is-inactive {
  color: #a7b0bf;
}

.integration-create-card,
.integration-subsection {
  padding: 12px;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.integration-create-card summary {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.integration-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.integration-form-block {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.integration-form-block > form:first-child,
.integration-form-block > h3 + form {
  margin-top: 10px;
}

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

.integration-record {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.integration-record-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.integration-record-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: start;
  justify-content: flex-end;
  min-width: max-content;
}

.integration-record-head > div:first-child {
  min-width: 0;
}

.integration-record-head strong,
.integration-record-head small {
  display: block;
}

.integration-record-head small {
  margin-top: 4px;
  color: var(--muted);
}

.integration-record details {
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.integration-record summary {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.integration-empty-state {
  margin: 0;
}

.integration-run-line {
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}

.integration-run-line:first-of-type {
  border-top: 0;
}

@media (max-width: 900px) {
  .integration-page-head,
  .integration-panel-header {
    display: grid;
  }

  .integration-create-menu {
    width: 100%;
  }

  .integration-create-menu summary {
    width: 100%;
  }

  .integration-create-options {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .integration-workspace {
    grid-template-columns: 1fr;
  }

  .integration-sidebar {
    position: static;
  }

  .integration-record-head {
    grid-template-columns: 1fr;
  }

  .integration-record-actions {
    justify-content: flex-start;
    min-width: 0;
  }
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d5dce8;
}

.checkline input {
  width: auto;
}

label {
  color: #d5dce8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 11px;
  background: #0f141d;
  color: #f5f7fb;
  font: inherit;
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #737d91;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(88, 220, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(25, 184, 216, 0.13);
}

.searchable-select {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

.select-search-input {
  min-height: 34px;
  padding: 8px 10px;
  background: #0a1018;
  border-color: #1c2737;
  font-size: 12px;
}

.select-suggestion-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 240px;
  overflow: auto;
  padding: 4px;
  background: #090d14;
  border: 1px solid rgba(88, 220, 255, 0.3);
  border-radius: 4px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.48);
}

.select-suggestion {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 7px 8px;
  color: #e7ebf4;
  background: transparent;
  border: 0;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-transform: none;
}

.select-suggestion:hover,
.select-suggestion:focus-visible,
.select-suggestion.is-active {
  color: #fff;
  background: rgba(25, 184, 216, 0.18);
  outline: none;
}

.select-search-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.review-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  padding: 11px 0;
}

.review-item p {
  margin: 0;
}

.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  padding: 10px 0;
}

.compact-row p {
  margin: 0;
}

.crew-shell {
  background: #0b0f16;
}

.crew-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #07090d;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 4;
}

.crew-header h1 {
  font-size: 18px;
  text-align: center;
}

.crew-header a {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.crew-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.crew-list,
.crew-detail {
  display: grid;
  gap: 12px;
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.crew-scope-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.crew-scope-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  color: var(--muted);
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.crew-scope-tabs a.is-active {
  color: #fff;
  border-color: rgba(88, 220, 255, 0.42);
  background: #182232;
}

.crew-panel p {
  line-height: 1.55;
}

.crew-plan-panel {
  display: grid;
  gap: 14px;
}

.crew-plan-highlight {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: #10151f;
  border: 1px solid rgba(88, 220, 255, 0.24);
  border-radius: 4px;
}

.crew-plan-highlight strong,
.crew-plan-block h3 {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.crew-plan-highlight span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

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

.crew-plan-block {
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.crew-plan-block h3 {
  margin: 0 0 10px;
}

.crew-plan-list {
  margin-bottom: 0;
}

.crew-plan-note {
  margin: 0;
  padding: 10px 12px;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  white-space: pre-wrap;
}

.crew-actions-panel {
  display: grid;
  gap: 14px;
}

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

.crew-action-button {
  display: grid;
  gap: 5px;
  justify-items: start;
  min-height: 72px;
  padding: 14px;
  text-align: left;
}

.crew-action-button span {
  font-size: 14px;
  line-height: 1;
}

.crew-action-button small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.crew-action-button.is-active {
  border-color: rgba(88, 220, 255, 0.64);
  box-shadow: 0 0 0 3px rgba(25, 184, 216, 0.12), 0 12px 26px rgba(0, 0, 0, 0.34);
}

.crew-action-form {
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.receipt-capture {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.receipt-file-button {
  display: grid;
  gap: 8px;
  padding: 12px;
  color: #fff;
  background: #182232;
  border: 1px solid rgba(88, 220, 255, 0.28);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-file-button input {
  width: 100%;
  min-height: 36px;
  color: var(--muted);
}

.receipt-cropper {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.receipt-crop-canvas,
.receipt-preview-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #07090d;
  border: 1px solid var(--line);
  border-radius: 4px;
  touch-action: none;
}

.receipt-preview-canvas {
  max-height: 260px;
  object-fit: contain;
}

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

.receipt-tool-row button {
  min-height: 38px;
  padding: 0 8px;
  font-size: 11px;
}

.receipt-status {
  margin: 0;
  font-size: 12px;
}

.receipt-status.is-error {
  color: #ffb4a8;
}

.receipt-debug-json {
  min-height: 130px;
  max-height: 260px;
  overflow: auto;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.35;
  text-transform: none;
  white-space: pre;
}

.crew-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.crew-form-head h3 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.crew-form-head button {
  min-height: 34px;
  padding: 0 12px;
}

.event-card {
  display: grid;
  gap: 7px;
  padding: 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 4px;
}

.event-card-status {
  width: fit-content;
  color: var(--ok);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.event-card strong {
  color: #fff;
  font-size: 18px;
}

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

.event-card-time {
  display: grid;
  gap: 3px;
  width: fit-content;
  padding: 8px 10px;
  background: #10151f;
  border: 1px solid rgba(88, 220, 255, 0.18);
  border-radius: 4px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.event-card-time span {
  color: var(--muted);
  font-size: 10px;
}

.weather-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.event-card-weather {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 430px;
  min-height: 58px;
  padding: 9px 10px;
  background: #10151f;
  border: 1px solid rgba(88, 220, 255, 0.18);
  border-radius: 4px;
}

.crew-weather-detail {
  max-width: none;
  margin-top: 10px;
}

.weather-icon {
  width: 34px;
  height: 34px;
  color: var(--accent-strong);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.weather-temp {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.event-card-weather small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
}

.crew-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.crew-card-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  background: #10151f;
  border: 1px solid rgba(88, 220, 255, 0.22);
  border-radius: 4px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.crew-map-shell {
  position: relative;
  min-height: min(620px, 62vh);
  overflow: hidden;
  background: #0d121b;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.crew-map {
  width: 100%;
  height: min(620px, 62vh);
  min-height: 360px;
  background: #0d121b;
}

.crew-event-map-panel {
  display: grid;
  gap: 12px;
}

.crew-event-map-shell {
  min-height: min(420px, 48vh);
}

.crew-event-map-shell .crew-map {
  height: min(420px, 48vh);
  min-height: 300px;
}

.crew-map-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: #10151f;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.crew-map-summary strong {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.crew-map-summary span,
.crew-map-summary small {
  color: var(--muted);
}

.crew-map-status {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 6px;
  place-content: center;
  padding: 22px;
  background: #0d121b;
  color: var(--muted);
  text-align: center;
}

.crew-map-popup {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.crew-map-popup strong {
  color: #fff;
  font-size: 14px;
}

.crew-map-popup span,
.crew-map-popup small {
  color: var(--muted);
  font-size: 12px;
}

.crew-map-popup a {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.crew-map-shell .leaflet-container {
  background: #0d121b;
}

.crew-map-shell .leaflet-popup-content-wrapper,
.crew-map-shell .leaflet-popup-tip {
  background: #111722;
  color: var(--ink);
}

.crew-map-shell .leaflet-popup-content {
  margin: 12px;
}

.crew-map-shell .leaflet-control-attribution {
  background: rgba(7, 9, 13, 0.82);
  color: var(--muted);
}

.crew-map-shell .leaflet-control-attribution a {
  color: var(--accent-strong);
}

dl {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px;
}

dt {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  .crew-header {
    align-items: flex-start;
  }

  .crew-header h1 {
    text-align: left;
  }

  .crew-header-actions {
    flex-wrap: wrap;
  }

  .crew-action-grid {
    grid-template-columns: 1fr;
  }

  .crew-plan-grid {
    grid-template-columns: 1fr;
  }

  .crew-map {
    height: 58vh;
    min-height: 320px;
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    min-height: 50px;
    min-width: 0;
  }

  .global-search {
    width: calc(100% - 28px);
    margin: 0 14px 10px;
    flex-basis: auto;
  }

  .topbar nav {
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow: visible;
  }

  .topbar nav a,
  .topbar nav button {
    min-height: 44px;
    padding: 0 13px;
  }

  .nav-menu {
    position: static;
  }

  .nav-submenu {
    left: 0;
    right: auto;
  }

  .calendar-toolbar {
    align-items: stretch;
  }

  .calendar-toolbar strong {
    order: -1;
    width: 100%;
    margin: 0;
  }

  .calendar-filter {
    width: 100%;
  }

  .calendar-filter select {
    min-width: 0;
  }

  .operations-map-toolbar {
    grid-template-columns: 1fr;
  }

  .operations-map-kpis {
    justify-content: flex-start;
  }

  .operations-map-load-status {
    justify-self: start;
  }

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

  .event-workspace-head {
    align-items: stretch;
    flex-direction: column;
  }

  .event-workspace-head h1 {
    white-space: normal;
  }

  .project-tree-node summary,
  .project-tree-event {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .project-tree-children {
    padding-left: 12px;
  }

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

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-weekday {
    display: none;
  }

  .calendar-day {
    min-height: 0;
  }

  .event-operation-grid {
    grid-template-columns: 1fr;
  }

  .calendar-day.is-muted {
    display: none;
  }

  .calendar-event strong {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 13px;
  }

  .page {
    width: calc(100% - 18px);
    margin-top: 10px;
  }

  .section-head {
    min-height: 58px;
    padding: 10px;
  }

  .section-head h1 {
    font-size: 18px;
  }

  .metric-grid,
  .form-grid,
  .data-columns {
    grid-template-columns: 1fr;
  }

  .operations-map-filter,
  .operations-map-filter label,
  .operations-map-filter button,
  .operations-map-filter a {
    width: 100%;
  }

  .operations-map {
    height: 62vh;
    min-height: 360px;
  }

  .operations-map-lists {
    grid-template-columns: 1fr;
  }

  .review-item,
  .compact-row {
    grid-template-columns: 1fr;
  }

  .client-summary,
  .inline-create {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 10px;
  }
}
