:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #60707b;
  --line: #d8e1e5;
  --panel: #ffffff;
  --paper: #f5f7f4;
  --nav: #22313a;
  --nav-2: #31444f;
  --accent: #36495a;
  --accent-soft: #e9eef2;
  --accent-2: #ca8a04;
  --danger: #b42318;
  --good-bg: #e7f6ef;
  --warn-bg: #fff5d6;
  --shadow: 0 18px 50px rgba(23, 36, 43, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  overflow: hidden;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: auto;
  background: var(--paper);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  position: relative;
  z-index: 10001;
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px 24px 34px;
  pointer-events: auto;
}

.login-card input,
.login-card button {
  pointer-events: auto;
  touch-action: manipulation;
}

.login-card input {
  user-select: text;
  caret-color: var(--ink);
}

.login-card .login-version {
  position: absolute;
  right: 14px;
  bottom: 10px;
  color: #000000;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.login-card .indmex-logo {
  justify-items: center;
  color: #000000;
  text-align: center;
}

.login-card .indmex-logo p {
  color: #000000;
  text-align: center;
}

.login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.sidebar {
  background: var(--nav);
  color: #f8faf8;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-version {
  color: #ffffff;
  font-weight: 800;
  font-size: 0.86rem;
  line-height: 1;
}

.brand {
  display: grid;
  align-items: start;
}

.indmex-logo {
  color: #ffffff;
  line-height: 1;
  gap: 6px;
}

.indmex-logo img {
  display: block;
  width: min(220px, 100%);
  height: auto;
  object-fit: contain;
}

.login-card .indmex-logo img {
  width: min(270px, 100%);
}

.indmex-logo p {
  margin: 2px 0 0;
  color: #ffffff;
  font-size: clamp(0.78rem, 1.6vw, 1.1rem);
  font-weight: 900;
  letter-spacing: 0;
}

.sidebar .indmex-logo p {
  font-size: 0.78rem;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2,
.panel-title h3,
.table-header h3,
.empty-state h3 {
  margin: 0;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 0;
  color: #dce5e9;
  background: transparent;
  text-align: left;
  padding: 12px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-item:disabled {
  cursor: default;
  opacity: 0.42;
}

.sub-nav {
  display: grid;
  gap: 6px;
  margin: -18px 0 0 26px;
}

.sub-nav-item {
  padding: 9px 10px;
  font-size: 0.9rem;
}

.vehicle-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vehicle-icon svg {
  width: 22px;
  height: 16px;
  overflow: visible;
}

.vehicle-icon path,
.vehicle-icon circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-stack {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.summary-stack div {
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.summary-stack div[role="button"] {
  cursor: pointer;
}

.summary-stack div[role="button"]:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.summary-stack span {
  display: block;
  font-size: 2.48rem;
  font-weight: 750;
  line-height: 1;
}

#pastDueVehicles {
  color: #ff0000;
}

#failedInspections {
  color: #ff0000;
}

#totalAssets {
  color: #00cc00;
}

#needServicing {
  color: #ffcc00;
}

.summary-stack p {
  margin: 0;
  color: #aebdc5;
  font-size: 1.24rem;
  font-weight: 750;
  line-height: 1.05;
  text-align: center;
}

.workspace {
  height: 100vh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 20px;
}

.view {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

#assetsView {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.view[hidden] {
  display: none;
}

.topbar,
.toolband,
.table-header,
.panel-title,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar {
  text-align: center;
}

.app-version {
  align-self: flex-start;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  min-width: 52px;
  text-align: left;
}

.topbar > div:first-child {
  flex: 1;
}

.airport-icon-button {
  min-width: 58px;
  min-height: 58px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.airport-icon-button:focus-visible {
  outline: 3px solid rgba(54, 73, 90, 0.45);
  outline-offset: 3px;
  border-radius: 6px;
}

.agency-header-logo {
  width: auto;
  min-width: 58px;
  max-width: 150px;
  height: 58px;
  object-fit: contain;
  border-radius: 6px;
}

.site-switcher {
  display: grid;
  gap: 3px;
  min-width: 190px;
  color: var(--label);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: left;
}

.site-switcher select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 5px 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}

.system-title {
  color: var(--accent);
  font-size: clamp(1.1rem, 2.5vw, 2.08rem);
  line-height: 1;
}

.airport-header-name {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 850;
  line-height: 1;
}

.section-label {
  margin: 0;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 800;
}

.topbar h2 {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 800;
  text-align: left;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#cancelInspection {
  flex: 0 0 auto;
  width: auto;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.filter {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 750;
}

.secondary-button {
  border-color: #253544;
  border-width: 2px;
  background: #ffffff;
  color: var(--accent);
  font-weight: 750;
}

.compact-button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.ghost-button {
  border-color: #253544;
  border-width: 2px;
  background: #ffffff;
  color: var(--danger);
  font-weight: 750;
}

.filter {
  border-color: #253544;
  border-width: 2px;
}

.icon-button {
  border-color: #253544;
  border-width: 2px;
  width: 42px;
  padding: 0;
}

.save-icon-button {
  color: var(--accent);
}

.delete-button {
  width: 40px;
  padding: 0;
}

.trash-icon,
.floppy-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inco-status-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--label);
  font-size: 0.78rem;
  font-weight: 800;
  min-height: 40px;
}

.inco-status-control span {
  min-width: 0;
}

.inco-check-button {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 900;
}

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

.inco-check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.logout-button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: #36495a;
  color: #ffffff;
  font-weight: 750;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.toolband {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow);
}

.search-box {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
}

.panel-search {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.panel-search .search-box {
  min-width: 0;
}

.filter-group {
  display: flex;
  gap: 6px;
}

.filter.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.content-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.attention-section {
  border: 2px solid #ffcc00;
  border-radius: 8px;
  margin-top: 25px;
  background: var(--panel);
  overflow: hidden;
}

.attention-section + .table-header {
  margin-top: 24px;
}

.operational-section {
  margin-top: 24px;
  background: var(--panel);
  overflow: hidden;
}

.inspection-grid {
  min-height: 0;
  display: grid;
  grid-template-columns:
    minmax(220px, var(--inspection-panel-left, 300px))
    8px
    minmax(280px, var(--inspection-panel-middle, 420px))
    8px
    minmax(var(--inspection-panel-right, 520px), 1fr);
  gap: 6px;
  align-items: stretch;
  padding-top: 50px;
  overflow-x: auto;
}

.inspection-panel {
  min-width: 0;
}

.inspection-panel-resizer {
  align-self: stretch;
  width: 8px;
  min-width: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent 0, transparent 2px, #c8d2d8 2px, #c8d2d8 6px, transparent 6px);
  cursor: col-resize;
  opacity: 0.72;
}

.inspection-panel-resizer:hover,
.inspection-panel-resizing .inspection-panel-resizer {
  background: linear-gradient(90deg, transparent 0, transparent 2px, var(--accent) 2px, var(--accent) 6px, transparent 6px);
  opacity: 1;
}

.panel-layout-resizer {
  align-self: stretch;
  justify-self: stretch;
  width: 8px;
  min-width: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent 0, transparent 2px, #c8d2d8 2px, #c8d2d8 6px, transparent 6px);
  cursor: col-resize;
  opacity: 0.72;
}

.panel-layout-resizer:hover,
.panel-layout-resizing .panel-layout-resizer {
  background: linear-gradient(90deg, transparent 0, transparent 2px, var(--accent) 2px, var(--accent) 6px, transparent 6px);
  opacity: 1;
}

.panel-layout-stacked > .panel-layout-resizer {
  width: 100%;
  min-width: 0;
  height: 8px;
  min-height: 8px;
  background: linear-gradient(0deg, transparent 0, transparent 2px, #c8d2d8 2px, #c8d2d8 6px, transparent 6px);
  cursor: row-resize;
}

.panel-layout-stacked > .panel-layout-resizer:hover,
.panel-layout-resizing .panel-layout-stacked > .panel-layout-resizer {
  background: linear-gradient(0deg, transparent 0, transparent 2px, var(--accent) 2px, var(--accent) 6px, transparent 6px);
}

.devices-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(300px, 0.72fr) minmax(360px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.icao-address-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(360px, 0.32fr);
  gap: 10px;
  align-items: stretch;
}

.icao-address-table {
  min-width: 720px;
}

.device-table {
  min-width: 640px;
}

.device-register-panel {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
}

.device-entry-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.rma-panel {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.compact-header {
  padding: 0 0 10px;
  border-bottom: 0;
}

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

.rma-form-grid .full-span {
  grid-column: 1 / -1;
}

.rma-history-wrap {
  margin-top: 12px;
  max-height: 220px;
}

.rma-list-panel .rma-history-wrap {
  margin-top: 0;
  max-height: none;
}

.rma-table {
  min-width: 520px;
}

.rma-issue-row td {
  color: var(--muted);
  font-size: 0.86rem;
  text-align: left;
  background: var(--paper);
}

.rma-list-panel .table-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.rma-detail-panel {
  overflow: auto;
}

.inspection-grid .inspection-side {
  margin-top: -50px;
}

.inspection-grid > .table-panel,
.inspection-side > .detail-panel,
.inspection-side > form {
  height: 100%;
}

.table-panel,
.detail-panel,
.resource-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 0;
  max-height: 100%;
}

.table-panel {
  min-width: 0;
  overflow: auto;
}

#assetsView .table-panel {
  background: var(--paper);
}

.table-header {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.table-header span {
  color: var(--muted);
  font-size: 0.9rem;
}

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

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.asset-table {
  table-layout: fixed;
  min-width: 700px;
}

.resizable-data-table {
  table-layout: fixed;
}

.resizable-data-table th {
  position: relative;
  overflow: visible;
}

.resizable-data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-table th {
  position: relative;
  padding: 5px 8px;
  overflow: visible;
  min-width: 56px;
}

.asset-table td {
  padding: 3px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-table th:nth-child(1),
.asset-table td:nth-child(1) {
  width: 80px;
  min-width: 56px;
}

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

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

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

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

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

.asset-table th:nth-child(7),
.asset-table td:nth-child(7) {
  width: 56px;
  padding-right: 0;
  padding-left: 0;
  text-align: center;
  vertical-align: middle;
}

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

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 3px;
  border-left: 2px solid rgba(54, 73, 90, 0.45);
}

body.column-resizing {
  cursor: col-resize;
  user-select: none;
}

.inspection-table {
  min-width: 260px;
}

.inspection-table th,
.inspection-date-table th {
  padding: 4px 6px;
  font-size: 0.82rem;
}

.inspection-table td,
.inspection-date-table td {
  padding: 4px 6px;
}

.inspection-date-table {
  min-width: 360px;
}

.inspection-date-table td:last-child {
  max-width: 160px;
  white-space: normal;
}

th,
td {
  padding: 6px 14px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 1rem;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: none;
  letter-spacing: 0;
  background: #f8faf8;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover,
tbody tr.selected {
  background: var(--accent-soft);
}

tbody tr {
  cursor: pointer;
}

.past-due-section {
  border: 2px solid var(--danger);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.past-due-date {
  color: var(--danger);
  font-weight: 800;
}

.detail-panel {
  overflow-y: auto;
  padding: 14px;
}

#assetForm {
  overflow: hidden;
  padding: 10px;
}

#assetForm .panel-title {
  gap: 8px;
}

#assetForm .panel-title h3 {
  font-size: 1.15rem;
}

#assetForm fieldset {
  margin-top: 7px;
  gap: 5px;
}

#assetForm legend {
  margin-bottom: 4px;
  font-size: 0.94rem;
}

#assetForm label {
  font-size: 0.83rem;
}

#assetForm label input,
#assetForm label select,
#assetForm label textarea {
  min-height: 28px;
  margin-top: 2px;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.9rem;
  font-weight: 400;
}

#assetForm label textarea {
  min-height: 46px;
  resize: none;
}

fieldset {
  border: 0;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

legend {
  color: var(--ink);
  font-weight: 760;
  margin-bottom: 10px;
}

label {
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 700;
}

label input,
label select,
label textarea {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  background: #ffffff;
}

label input[readonly],
label input[disabled],
label select[disabled],
label textarea[readonly],
label textarea[disabled] {
  background: #edf1f3;
  color: #4b5b65;
  border-color: #cbd5da;
  opacity: 1;
}

label textarea {
  min-height: 108px;
  resize: vertical;
}

label input:focus,
label select:focus,
label textarea:focus {
  outline: 2px solid rgba(54, 73, 90, 0.22);
  border-color: var(--accent);
}

.uppercase-field {
  text-transform: uppercase;
}

input:not([type="date"]):not([type="datetime-local"]):not([type="email"]):not([type="file"]):not([type="number"]):not([type="password"]):not([type="search"]):not([type="tel"]),
textarea {
  text-transform: uppercase;
}

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

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

.hardware-row {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.9fr;
  gap: 8px;
}

.hardware-row label {
  display: grid;
  grid-template-rows: 32px auto;
  align-items: end;
}

.hardware-row label input {
  align-self: start;
}

.triple-row {
  display: grid;
  grid-template-columns: 1fr 0.65fr 1.2fr;
  gap: 8px;
}

.sat-row {
  grid-template-columns: minmax(150px, 180px) minmax(120px, 180px) minmax(150px, 180px);
  align-items: end;
}

.sat-row label {
  display: grid;
  grid-template-rows: 20px auto;
  align-items: end;
}

.config-compact-row {
  grid-template-columns: 120px 140px minmax(160px, 1fr);
  align-items: end;
}

.config-compact-row label {
  display: grid;
  grid-template-rows: 18px auto;
  align-items: end;
}

.asset-id-field {
  max-width: none;
}

.form-actions {
  margin-top: 16px;
}

#assetForm .form-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.inspection-side {
  min-height: calc(100% + 50px);
  max-height: calc(100% + 50px);
  overflow-y: auto;
  display: grid;
  gap: 10px;
  grid-template-rows: auto minmax(0, 1fr);
}

.inspection-side .detail-panel {
  position: static;
}

.inspection-action-row {
  display: flex;
  justify-content: flex-end;
}

.inspection-side > .detail-panel,
.inspection-side > form {
  min-height: 0;
}

.inspection-history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.inspection-history-empty {
  color: var(--muted);
  margin-top: 16px;
}

.inspection-date-empty {
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.inspection-history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8faf8;
}

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

.inspection-history-head h4 {
  margin: 0;
}

.inspection-history-head span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.inspection-history-item dl {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.inspection-history-item dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.inspection-history-item dt {
  color: var(--muted);
  font-weight: 700;
}

.inspection-history-item dd,
.inspection-history-item p {
  margin: 0;
}

.inspection-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.inspection-photo-section {
  margin-top: 14px;
}

.inspection-photo-section h4 {
  margin: 0;
}

.inspection-photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.vehicle-photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.vehicle-photo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8faf8;
}

.vehicle-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.vehicle-photo-card span {
  display: block;
  padding: 6px 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.resource-panel {
  overflow-y: auto;
}

.client-config-layout {
  display: block;
  min-height: 0;
}

.site-details-layout {
  padding: 16px;
}

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

.client-form-grid label:nth-child(2),
.client-form-grid label:nth-child(3),
.client-form-grid label:nth-child(4) {
  grid-row: span 2;
}

.client-form-grid textarea {
  min-height: 86px;
}

.site-logo-preview-shell {
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #f7f9fa;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.site-logo-preview-shell img {
  display: block;
  max-width: 180px;
  max-height: 80px;
  object-fit: contain;
  margin: 6px 0;
}

.site-logo-preview-shell p {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
}

.available-status {
  color: #128233;
  font-weight: 800;
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.reports-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(85px, 0.09fr) minmax(0, 0.91fr);
  gap: 10px;
  overflow: hidden;
}

.report-menu {
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-y: auto;
}

.report-menu-item {
  width: 100%;
  border: 1px solid #253544;
  border-radius: 8px;
  background: #f8faf8;
  color: var(--ink);
  padding: 7px 6px;
  text-align: left;
}

.report-menu-item strong {
  font-size: 0.72rem;
  line-height: 1.2;
}

.report-menu-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.report-filter-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8faf8;
}

.report-filter-row label {
  max-width: 320px;
  display: block;
}

.report-date-filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 190px));
  gap: 10px;
  align-items: end;
}

.report-panel {
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: auto;
}

.report-table {
  min-width: 860px;
}

.report-table th,
.report-table td {
  padding: 5px 10px;
}

.report-table th {
  padding: 5px 10px;
  white-space: normal;
  vertical-align: bottom;
}

.report-sort-button,
.table-sort-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: center;
  padding: 0;
}

.report-sort-button {
  line-height: 1.05;
  white-space: normal;
}

.report-table td {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  overflow: hidden;
}

.config-grid .resource-panel {
  min-height: 0;
}

.config-wide {
  grid-column: 1 / -1;
}

.config-split {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 10px;
  padding: 14px;
}

.system-dropdown-layout {
  padding: 14px;
}

.admin-form-shell {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.admin-two-column {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  align-items: start;
}

.faa-fcc-layout {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.contact-config-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 10px;
}

.airport-only-grid {
  grid-template-columns: minmax(320px, 640px);
  padding: 14px;
}

.airport-info-panel,
.faa-info-panel {
  display: grid;
  gap: 12px 14px;
  align-content: start;
}

.fcc-license-panel {
  align-self: stretch;
}

.fcc-license-table-wrap {
  max-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fcc-license-table td,
.fcc-license-table th {
  text-align: center;
}

.fcc-license-table td:first-child {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.airport-info-panel h3 {
  grid-column: 1 / -1;
}

.config-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.config-form .primary-button {
  justify-self: start;
}

.dropdown-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px 14px;
}

.audit-panel {
  min-height: 0;
}

.audit-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 150px;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.audit-filter-bar label {
  gap: 3px;
  font-size: 0.72rem;
}

.audit-filter-bar input {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 0.88rem;
}

.audit-table {
  font-size: 0.82rem;
}

.audit-table th {
  padding: 5px 6px;
  font-size: 0.72rem;
}

.audit-table td {
  padding: 4px 6px;
  font-size: 0.82rem;
  text-align: center;
  vertical-align: middle;
  line-height: 1.15;
}

.audit-table td:nth-child(5) {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.airport-info-panel {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.faa-info-panel {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.faa-info-panel h3 {
  margin: 0 0 10px;
}

.faa-info-panel textarea {
  min-height: 92px;
}

.row-icon-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #253544;
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  font-weight: 800;
}

.user-table {
  min-width: 900px;
}

.resource-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.resource-header h3,
.resource-main h3 {
  margin: 0;
}

.resource-header p,
.resource-main p {
  margin: 4px 0 0;
  color: var(--muted);
}

.resource-list {
  display: grid;
}

.resource-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.resource-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 750;
}

.resource-actions {
  display: flex;
  gap: 8px;
}

.resource-actions a {
  text-decoration: none;
}

.empty-state {
  padding: 60px 24px;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
}

.radar-asset {
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(#e3ecef 1px, transparent 1px),
    linear-gradient(90deg, #e3ecef 1px, transparent 1px),
    #f8faf8;
  background-size: 24px 24px;
}

.sweep {
  width: 50%;
  height: 50%;
  position: absolute;
  left: 50%;
  top: 0;
  background: rgba(54, 73, 90, 0.2);
  transform-origin: 0 100%;
  transform: rotate(36deg);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.dot {
  width: 8px;
  height: 8px;
  position: absolute;
  border-radius: 50%;
  background: var(--accent-2);
}

.dot.one {
  left: 28px;
  top: 34px;
}

.dot.two {
  right: 24px;
  bottom: 28px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  background: var(--ink);
  color: #ffffff;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 32, 38, 0.36);
}

.app-dialog {
  width: min(460px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.app-dialog h3 {
  margin: 0 0 10px;
}

.dialog-message {
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-line;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.airport-list-dialog {
  display: grid;
  gap: 8px;
  color: var(--text);
}

.airport-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.airport-choice.active,
.airport-choice:hover {
  border-color: #36495a;
  background: #edf3f6;
}

.airport-choice span {
  color: var(--label);
  font-weight: 800;
}

.dialog-confirm {
  min-height: 38px;
  border: 1px solid #36495a;
  border-radius: 8px;
  background: #36495a;
  color: #ffffff;
  padding: 0 14px;
  font-weight: 750;
}

.dialog-cancel {
  min-height: 38px;
  border: 2px solid #253544;
  border-radius: 8px;
  background: #ffffff;
  color: #36495a;
  padding: 0 14px;
  font-weight: 750;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 18px;
  }

  .side-nav,
  .summary-stack {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .content-grid,
  .inspection-grid,
  .reports-layout,
  .devices-grid,
  .icao-address-layout,
  .config-grid {
    grid-template-columns: 1fr;
  }

  .inspection-panel-resizer {
    display: none;
  }

  .config-wide {
    grid-column: auto;
  }

  .dropdown-config-grid {
    grid-template-columns: 1fr;
  }

  .config-split {
    grid-template-columns: 1fr;
  }

  .contact-config-grid {
    grid-template-columns: 1fr;
  }

  .admin-two-column {
    grid-template-columns: 1fr;
  }

  .faa-fcc-layout {
    grid-template-columns: 1fr;
  }

  .airport-info-panel,
  .faa-info-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 14px;
  }

  .airport-info-panel {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .toolband,
  .panel-title,
  .resource-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .filter-group,
  .resource-actions {
    width: 100%;
  }

  .primary-button,
  .filter {
    flex: 1;
  }

  .side-nav,
  .summary-stack,
  .dimension-grid,
  .field-row,
  .hardware-row,
  .triple-row {
    grid-template-columns: 1fr;
  }

  .resource-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
