:root {
  --navy: #153a5b;
  --navy-dark: #0c263f;
  --blue: #27718b;
  --teal: #2e938f;
  --green: #2e8b57;
  --amber: #bd7600;
  --red: #bd3943;
  --ink: #1e2c38;
  --muted: #647480;
  --line: #d6e0e6;
  --soft-line: #e9eff2;
  --canvas: #f2f6f7;
  --card: #ffffff;
  --shadow: 0 14px 32px rgba(21, 58, 91, 0.08);
  --radius: 14px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

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

button {
  cursor: pointer;
}

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

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 80% 10%, rgba(46, 147, 143, 0.18), transparent 33rem),
    linear-gradient(135deg, #0c263f 0%, #153a5b 55%, #27718b 100%);
}

.login-card {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.98);
  padding: 42px;
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.24);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 26px;
}

.brand-mark {
  min-width: 58px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0 10px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: #eaf3f5;
  box-shadow: inset 0 0 0 1px rgba(21, 58, 91, 0.1);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
}

.brand-lockup strong {
  display: block;
  color: var(--navy);
  font-size: 18px;
}

.brand-lockup span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.6px;
}

.login-card > p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.5;
}

.credentials-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 13px 15px;
  margin-top: 20px;
  color: #3d596a;
  font-size: 13px;
  background: #edf7f6;
  border-left: 3px solid var(--teal);
  border-radius: 8px;
}

.login-action-link {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 0;
  color: var(--blue);
  font-size: 14px;
  font-weight: 650;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  border: 0;
  background: transparent;
}

.login-action-link:hover,
.login-action-link:focus-visible {
  color: var(--navy);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 14px;
  color: #d9e7ef;
  background: var(--navy-dark);
}

.sidebar .brand-lockup {
  padding: 4px 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar .brand-mark {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.sidebar .brand-lockup strong {
  color: #fff;
}

.sidebar .brand-lockup span {
  color: #a8bfcc;
}

.nav-group-title {
  padding: 22px 10px 7px;
  color: #8cabbc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  color: #d9e7ef;
  text-align: left;
  background: transparent;
  transition: background 120ms ease, color 120ms ease;
}

.nav-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.nav-button.active {
  color: #fff;
  background: rgba(46, 147, 143, 0.32);
  box-shadow: inset 3px 0 0 #67d2c0;
}

.nav-icon {
  width: 21px;
  text-align: center;
  font-size: 17px;
}

.sidebar-user {
  margin-top: 26px;
  padding: 15px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
}

.sidebar-user strong {
  color: #fff;
  font-size: 14px;
}

.sidebar-user span {
  margin-top: 3px;
  color: #9bb6c5;
  font-size: 12px;
}

.sign-out {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  color: #bcd1dd;
  background: transparent;
  font-size: 13px;
}

.sign-out:hover {
  color: #fff;
  text-decoration: underline;
}

.main {
  min-width: 0;
  padding: 28px 32px 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.page-kicker {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  color: var(--navy-dark);
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.8px;
}

.topbar p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  max-width: 840px;
  line-height: 1.45;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.button {
  border: 1px solid transparent;
  padding: 10px 14px;
  border-radius: 9px;
  color: #fff;
  background: var(--navy);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #0f304e;
  box-shadow: 0 5px 12px rgba(21, 58, 91, 0.16);
}

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

.button.secondary:hover:not(:disabled) {
  background: #f5f9fa;
}

.button.teal {
  background: var(--teal);
}

.button.teal:hover:not(:disabled) {
  background: #207b78;
}

.button.danger {
  color: var(--red);
  border-color: #ebc2c5;
  background: #fff;
}

.button.small {
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
}

.button.icon-only {
  padding: 8px 10px;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 122px;
  padding: 19px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.metric-card::after {
  content: "";
  position: absolute;
  width: 88px;
  height: 88px;
  right: -24px;
  bottom: -36px;
  border-radius: 50%;
  opacity: 0.16;
  background: var(--metric-color, var(--teal));
}

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

.metric-value {
  position: relative;
  z-index: 1;
  margin-top: 11px;
  color: var(--navy-dark);
  font-size: 31px;
  font-weight: 760;
  letter-spacing: -0.9px;
}

.metric-foot {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 20px;
}

.stack {
  display: grid;
  gap: 20px;
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.panel.compact {
  padding: 0;
  overflow: hidden;
}

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

.panel-header h2 {
  margin: 0;
  color: var(--navy-dark);
  font-size: 17px;
  letter-spacing: -0.25px;
}

.panel-header .hint {
  color: var(--muted);
  font-size: 12px;
}

.notice {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 15px;
  color: #725104;
  background: #fff8e7;
  border: 1px solid #f1dfab;
  border-radius: 10px;
  line-height: 1.45;
  font-size: 13px;
}

.notice strong {
  color: #5d4100;
}

.branch-list {
  display: grid;
  gap: 13px;
}

.branch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  font-size: 13px;
}

.branch-row strong {
  color: var(--navy-dark);
}

.branch-row span {
  color: var(--muted);
  text-align: right;
}

.progress-track {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: #e7eef1;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #69baae);
}

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

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #466174;
  background: #f7fafb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:hover {
  background: #fafcfc;
}

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

.table-title {
  color: var(--navy-dark);
  font-weight: 700;
}

.table-subtitle {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.tag.available,
.tag.completed {
  color: #186140;
  background: #e2f4e9;
}

.tag.assigned,
.tag.planned {
  color: #175a79;
  background: #e2f2f8;
}

.tag.in_progress {
  color: #7a5000;
  background: #fff1ce;
}

.tag.maintenance,
.tag.repair,
.tag.cancelled,
.tag.inactive {
  color: #8b2d37;
  background: #f9e6e8;
}

.tag.stock-normal,
.tag.movement-receipt {
  color: #186140;
  background: #e2f4e9;
}

.tag.stock-low,
.tag.movement-adjustment {
  color: #7a5000;
  background: #fff1ce;
}

.tag.stock-zero,
.tag.movement-issue,
.tag.movement-write_off {
  color: #8b2d37;
  background: #f9e6e8;
}

.tag.review-draft {
  color: #52646f;
  background: #edf1f2;
}

.tag.review-submitted {
  color: #7a5000;
  background: #fff1ce;
}

.tag.review-accepted {
  color: #186140;
  background: #e2f4e9;
}

.tag.review-returned {
  color: #8b2d37;
  background: #f9e6e8;
}

.tag.audit-standard {
  color: #52646f;
  background: #edf1f2;
}

.tag.audit-important {
  color: #175a79;
  background: #e2f2f8;
}

.tag.audit-critical {
  color: #8b2d37;
  background: #f9e6e8;
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 17px;
}

.filter-bar .field {
  min-width: 160px;
  flex: 1 1 180px;
}

.filter-bar .field.search-field {
  flex: 2 1 280px;
}

.audit-panel {
  display: grid;
  gap: 17px;
}

.audit-panel .audit-boundary,
.audit-panel .audit-filter {
  margin: 0;
}

.audit-filter .field {
  min-width: 145px;
}

.audit-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 2px;
  color: #315869;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.audit-check input {
  width: auto;
  min-height: auto;
  accent-color: var(--teal);
}

.audit-result-meta {
  color: var(--muted);
  font-size: 13px;
}

.audit-table td {
  vertical-align: top;
}

.audit-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: #516c7d;
  font-size: 12px;
  font-weight: 650;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  outline: none;
  border: 1px solid #cbd8df;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  transition: border 120ms ease, box-shadow 120ms ease;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(46, 147, 143, 0.14);
}

input[readonly] {
  color: #627786;
  background: #f6f9fa;
}

.empty-state {
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state .empty-icon {
  margin-bottom: 9px;
  font-size: 28px;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 29, 46, 0.5);
  animation: fade-in 120ms ease;
}

.modal {
  width: min(850px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 23px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
}

.modal.narrow {
  width: min(580px, 100%);
}

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

.modal-header h2 {
  margin: 0;
  color: var(--navy-dark);
  font-size: 21px;
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.close-modal {
  padding: 2px 7px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 25px;
  line-height: 1;
}

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

.form-grid .span-2 {
  grid-column: span 2;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--soft-line);
}

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

.month-plan-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: -8px 0 20px;
}

.month-plan-scope span {
  padding: 7px 10px;
  color: #426273;
  background: #eaf3f5;
  border: 1px solid #d5e5e8;
  border-radius: 999px;
  font-size: 12px;
}

.month-plan-scope strong {
  color: var(--navy-dark);
  font-variant-numeric: tabular-nums;
}

.month-plan-panel {
  padding: 22px;
}

.month-plan-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  padding: 15px;
  background: #f6fafb;
  border: 1px solid var(--soft-line);
  border-radius: 11px;
}

.month-plan-toolbar-note {
  max-width: 680px;
  padding-bottom: 2px;
  color: #496575;
  font-size: 13px;
  line-height: 1.45;
}

.month-plan-rows {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.month-plan-row {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: #fff;
}

.month-plan-row-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  background: #f8fbfc;
  border-bottom: 1px solid var(--soft-line);
}

.month-plan-row-header strong,
.month-plan-row-header span {
  display: block;
}

.month-plan-row-header strong {
  color: var(--navy-dark);
  font-size: 14px;
}

.month-plan-row-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.month-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 15px;
}

.month-plan-grid .month-plan-title,
.month-plan-grid .month-plan-route,
.month-plan-grid .month-plan-note {
  grid-column: span 2;
}

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

.personal-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 0 0 18px;
  padding: 12px 14px;
  color: #285466;
  background: #eef7f8;
  border: 1px solid #cee5e6;
  border-radius: 10px;
  font-size: 13px;
}

.personal-totals strong {
  color: var(--navy-dark);
  font-variant-numeric: tabular-nums;
}

.personal-form-note {
  margin-top: 16px;
}

.review-summary {
  display: grid;
  gap: 4px;
  margin: 0 0 16px;
  padding: 13px 14px;
  color: #315869;
  background: #f2f7f8;
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.review-summary strong {
  color: var(--navy-dark);
}

.review-note {
  max-width: 280px;
}

.warehouse-note {
  margin-top: 16px;
}

.repair-expense-total {
  color: var(--navy-dark);
  font-variant-numeric: tabular-nums;
}

.repair-expense-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.repair-expense-summary > div,
.repair-expense-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #cee5e6;
  border-radius: 10px;
  background: #eef7f8;
}

.repair-expense-summary span,
.repair-expense-card .table-subtitle {
  color: #516c7d;
  font-size: 12px;
}

.repair-expense-summary strong {
  color: var(--navy-dark);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.repair-expense-card {
  margin-bottom: 20px;
  border-color: var(--soft-line);
  background: #f8fafb;
}

.repair-expense-card strong {
  color: var(--navy-dark);
}

.repair-expense-section + .repair-expense-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--soft-line);
}

.repair-expense-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.repair-expense-section-header h3 {
  margin: 0;
  color: var(--navy-dark);
  font-size: 16px;
}

.repair-expense-empty {
  padding: 20px;
}

.warehouse-quantity {
  color: var(--navy-dark);
  font-variant-numeric: tabular-nums;
}

.warehouse-quantity.low {
  color: var(--amber);
}

.warehouse-quantity.zero {
  color: var(--red);
}

.movement-quantity {
  font-variant-numeric: tabular-nums;
}

.movement-quantity.positive {
  color: var(--green);
}

.movement-quantity.negative {
  color: var(--red);
}

.warning-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.warning-list li {
  padding: 10px 11px;
  color: #7a5000;
  background: #fff8e7;
  border-left: 3px solid #e4a421;
  border-radius: 5px;
  font-size: 13px;
}

.role-admin {
  color: #593a8e;
  background: #eee5fa;
}

.role-dispatcher {
  color: #175a79;
  background: #e2f2f8;
}

.role-manager {
  color: #75600c;
  background: #fff3cc;
}

.role-viewer {
  color: #52646f;
  background: #edf1f2;
}

.squadron-boundary,
.squadron-shared-panel,
.squadron-card {
  margin-bottom: 20px;
}

.squadron-shared-layout,
.squadron-setup-grid,
.squadron-mappings {
  display: grid;
  gap: 14px;
}

.squadron-shared-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  align-items: start;
}

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

.squadron-card {
  display: grid;
  gap: 18px;
}

.squadron-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.squadron-card-header h2,
.squadron-mappings h3 {
  margin: 0;
  color: var(--navy-dark);
}

.squadron-card-header h2 {
  font-size: 19px;
}

.squadron-card-header p,
.squadron-mappings h3 + .squadron-mapping-list,
.squadron-mappings h3 + .squadron-empty-mapping {
  margin-top: 5px;
}

.squadron-card-header p,
.squadron-empty-mapping {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.squadron-mappings > section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: #f9fbfc;
}

.squadron-mappings h3 {
  font-size: 14px;
}

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

.squadron-mapping-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--soft-line);
  font-size: 13px;
}

.squadron-mapping-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.squadron-mapping-list span,
.squadron-mapping-list strong,
.squadron-mapping-list small {
  display: block;
}

.squadron-mapping-list strong {
  color: var(--navy-dark);
  font-size: 12px;
}

.squadron-mapping-list small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.squadron-setup-panel {
  padding: 16px;
  border-color: #cee5e6;
  background: #f6fbfb;
  box-shadow: none;
}

.squadron-action-form {
  display: grid;
  gap: 8px;
}

.squadron-action-form label {
  color: #516c7d;
  font-size: 12px;
  font-weight: 650;
}

.squadron-action-form .button {
  justify-self: start;
}

.squadron-inactive-note,
.squadron-form-note {
  margin-top: 0;
}

.timeline-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.toast-region {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  width: min(410px, calc(100vw - 40px));
}

.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(7, 25, 37, 0.22);
  animation: slide-in 160ms ease;
}

.toast.success {
  background: #277a58;
}

.toast.error {
  background: #a7333b;
}

.toast.info {
  background: #1b607c;
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 13px;
}

.toast span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.35;
}

.loader {
  display: grid;
  place-items: center;
  min-height: 45vh;
  color: var(--muted);
}

.loader::before {
  content: "";
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border: 3px solid #c9dde0;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.loader {
  text-align: center;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

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

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

  .sidebar .brand-lockup,
  .nav-group-title,
  .sidebar-user {
    display: none;
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 5px;
  }

  .nav-button {
    width: auto;
    flex: 0 0 auto;
  }

  .main {
    padding: 20px 15px 34px;
  }

  .topbar {
    flex-direction: column;
    gap: 14px;
  }

  .toolbar {
    justify-content: flex-start;
  }

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

  .personal-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    min-height: 105px;
    padding: 15px;
  }

  .metric-value {
    font-size: 26px;
  }

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

  .form-grid .span-2 {
    grid-column: span 1;
  }

  .month-plan-toolbar,
  .month-plan-grid {
    grid-template-columns: 1fr;
  }

  .month-plan-grid .month-plan-title,
  .month-plan-grid .month-plan-route,
  .month-plan-grid .month-plan-note {
    grid-column: span 1;
  }

  .month-plan-row-header,
  .month-plan-panel .form-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .month-plan-row-header .button,
  .month-plan-panel .form-footer .button {
    width: 100%;
  }

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

  .repair-expense-section-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .squadron-shared-layout,
  .squadron-setup-grid,
  .squadron-mappings {
    grid-template-columns: 1fr;
  }

  .squadron-card-header {
    flex-direction: column;
  }

  .audit-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
    padding: 18px;
  }
}

@media (max-width: 430px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 28px 23px;
  }
}
