@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root, body[data-theme="warden"] {
  --bg: #0b1120;
  --panel: rgba(30, 41, 59, 0.65);
  --panel-2: rgba(36, 50, 71, 0.75);
  --panel-3: rgba(22, 32, 51, 0.85);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --olive: #0284c7;
  --olive-2: #0369a1;
  --blue: #38bdf8;
  --danger: #ef4444;
  --success: #10b981;
  --warn: #f59e0b;
  --shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 10px 20px -10px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --gradient-center: #1e293b;
  --nav-bg: rgba(15, 23, 42, .96);
  --input-bg: rgba(15, 23, 42, 1);
  --chip-bg: rgba(15, 23, 42, .72);
  --empty-bg: rgba(15, 23, 42, .58);
  --button-bg: rgba(30, 41, 59, .72);
  --button-hover: rgba(51, 65, 85, .85);
  --button-secondary-bg: #334155;
  --skeleton-bg: #2d3748;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body[data-theme="colonial"] {
  --bg: #0d1a11;
  --panel: rgba(26, 46, 31, 0.65);
  --panel-2: rgba(32, 56, 38, 0.75);
  --panel-3: rgba(18, 33, 22, 0.85);
  --olive: #10b981;
  --olive-2: #059669;
  --blue: #0ea5e9;
  --gradient-center: #163622;
  --nav-bg: rgba(18, 30, 21, .96);
  --input-bg: rgba(18, 30, 21, 1);
  --chip-bg: rgba(18, 30, 21, .72);
  --empty-bg: rgba(18, 30, 21, .58);
  --button-bg: rgba(30, 50, 35, .72);
  --button-hover: rgba(45, 75, 52, .85);
  --button-secondary-bg: #2d4533;
  --skeleton-bg: #1b3826;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(circle at 50% 0%, var(--gradient-center) 0%, transparent 70%);
  background-attachment: fixed;
  font-family: var(--sans);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

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

/* Hide native number input scroll wheels */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"],
td,
time,
.numeric,
.badge,
.chip strong,
.metric strong,
.kpi .value,
.home-strong-number,
.delivery-entry-amount,
.delivery-contributor-total,
.mpf-queue-size-input,
.mpf-inline-input,
.mpf-load-chip,
.mpf-queue-size-badge,
.resource-pill,
.depot-chip,
.mpf-chip,
.home-inline-chip {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.mpf-queue-size-input {
  width: 60px !important;
  text-align: center;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

.app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--nav-bg);
  box-shadow: 0 -16px 34px rgba(2, 6, 23, .38);
}

.brand-mark {
  display: none;
}

.nav {
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-zone {
  display: contents;
}

.nav-zone-title {
  display: none;
}

.nav-auth {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.nav button,
.btn {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  background: var(--button-bg);
  backdrop-filter: blur(8px);
  color: var(--soft);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 12px;
}

.nav button:hover:not(:disabled),
.btn:hover:not(:disabled) {
  background: var(--button-hover);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav button {
  width: 72px;
  min-width: 72px;
  padding: 8px 7px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
}

.nav-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.05;
  text-align: center;
}

.nav button.active,
.btn-primary {
  background: var(--olive);
  color: #f8fafc;
  font-weight: 800;
}

.btn-secondary {
  background: var(--button-secondary-bg);
}

.btn-danger {
  background: rgba(127, 29, 29, .92);
  color: #fee2e2;
}
.btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.btn:disabled,
.nav button:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.wrap {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 16px 14px 96px;
}

.shell,
.card,
.row-box,
.status-line,
.kpi,
.urgent-card,
.post-card,
.quiet-card,
.owner-terminal-shell,
.owner-terminal-block {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.title h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.12;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.title p,
.desc,
.muted,
.tiny {
  color: var(--muted);
}

.title p,
.panel p.desc {
  margin: 0;
  line-height: 1.5;
}

.officer-desk-header {
  position: sticky;
  top: 76px;
  z-index: 8;
}

.officer-tabs {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-zone {
  margin-top: 14px;
  border-color: rgba(239, 68, 68, .45);
  box-shadow: inset 4px 0 0 var(--danger), var(--shadow-sm);
}

.color-swatch {
  display: inline-block;
  width: 34px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.22);
  vertical-align: middle;
}

.page,
.view-section {
  display: none;
}

.page.active,
.view-section.active {
  display: block;
}

.panel {
  padding: 18px;
  margin-top: 14px;
}

.panel h2,
.card h3,
.card h4 {
  margin: 0 0 10px;
}

.grid,
.section-stack,
.stack-sm,
.home-row-list,
.home-card-stack,
.mpf-layout,
.mpf-column,
.mpf-stack,
.mpf-queue-table,
.mpf-requirement-list,
.mpf-queue-groups,
.depot-grid,
.home-command-grid,
.command-list {
  display: grid;
  gap: 14px;
}

.grid.one { grid-template-columns: minmax(0, 1fr); }
.grid.two,
.grid.three,
.grid.cards,
.home-dashboard-grid,
.home-hero-grid,
.urgent-dashboard {
  grid-template-columns: 1fr;
}

.card {
  padding: 16px;
  overflow: hidden;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.tiny {
  font-size: 12px;
  line-height: 1.45;
}

.split-header,
.toolbar,
.task-top,
.row-head,
.depot-row,
.delivery-contributor-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar {
  margin: 16px 0;
}

.inline-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--empty-bg);
  border-radius: 8px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 8px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.toolbar .left,
.toolbar .right,
.quick-actions,
.badges,
.chips,
.resource-pills,
.planner-mode-row,
.home-inline-list,
.home-asset-badge-list,
.depot-meta,
.depot-actions,
.mpf-item-actions,
.mpf-item-meta,
.mpf-discount-grid,
.mpf-icon-stack,
.mpf-container-loadout,
.mpf-container-queues {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

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

.planner-ammo-loadouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.planner-ammo-loadout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--input-bg);
}

.planner-ammo-loadout-main {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.planner-ammo-loadout-main label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field label {
  font-size: 12px;
  font-weight: 750;
  color: var(--soft);
}

.inline-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.inline-input-group > input,
.inline-input-group > select {
  flex: 1;
  min-width: 0;
}

.field input,
.field select,
.field textarea,
.mpf-inline-input,
.mpf-queue-size-input,
.mpf-item-actions select,
.mpf-queue-cell select {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 0;
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .14);
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(116, 129, 58, .82);
  outline-offset: 2px;
}

.input-invalid,
.field input.input-invalid,
.field select.input-invalid,
.field textarea.input-invalid {
  box-shadow: inset 0 0 0 2px var(--danger);
}

.field-error,
.status.error { color: #fecaca; }
.status.success { color: var(--success); }
.status.warning { color: #fde68a; }
.status:empty { display: none; }

.leaderboard-window {
  margin-top: 10px;
}

.leaderboard-actions {
  margin-top: 14px;
}

.leaderboard-summary {
  margin: 14px 0;
}

.select-with-icon,
.mpf-queue-item-main,
.mpf-requirement-row .meta,
.mpf-queue-row .meta,
.home-asset-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.select-with-icon select,
.select-with-icon input {
  flex: 1 1 auto;
  min-width: 0;
}

.chip,
.badge,
.resource-pill,
.depot-chip,
.mpf-chip,
.mpf-load-chip,
.home-inline-chip,
.mpf-queue-size-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--soft);
  padding: 7px 10px;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .10);
}

.chip {
  min-height: 42px;
  cursor: pointer;
  font-weight: 750;
}

.chip input[type="checkbox"],
.field input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  accent-color: var(--olive);
}

.toggle-chip {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.row-box {
  padding: 16px;
  margin-bottom: 12px;
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.chip-success {
  color: var(--success);
  background: rgba(20, 83, 45, .42);
}

.chip-danger {
  color: #fecaca;
  background: rgba(127, 29, 29, .42);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, .10);
}

th {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.supply-table,
.task-requirements-table {
  min-width: 680px;
}

.empty,
.warning,
.mpf-warning-box {
  padding: 14px;
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--empty-bg);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .12);
}

.warning,
.mpf-warning-box {
  color: #fde68a;
  background: rgba(113, 63, 18, .30);
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--skeleton-bg);
  border-radius: var(--radius);
  animation: skeletonPulse 1.4s ease-in-out infinite;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(203, 213, 225, .12), transparent);
  animation: skeletonShimmer 1.8s infinite;
}

.skeleton-text {
  height: 12px;
  border-radius: 999px;
}

.skeleton-text-title {
  width: min(260px, 70%);
  height: 16px;
  margin-bottom: 10px;
}

.skeleton-text-small {
  width: min(190px, 55%);
}

.skeleton-text-count {
  width: 42px;
  height: 18px;
}

.skeleton-button {
  width: 96px;
  height: 42px;
}

.task-load-error {
  color: #fca5a5;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}

@keyframes skeletonShimmer {
  100% { transform: translateX(100%); }
}

.metric,
.home-detail-row,
.home-op-row,
.home-raw-row,
.mpf-requirement-row,
.mpf-queue-row,
.mpf-container-row,
.mpf-group-row,
.delivery-entry,
.status-line,
.kpi,
.command-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--empty-bg);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background 0.2s ease;
}

.mpf-item-row {
  display: grid;
  gap: 6px;
  padding: 2px 6px;
  border-radius: var(--radius);
  background: var(--empty-bg);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background 0.2s ease;
}

.mpf-item-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  background: var(--empty-bg);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  padding: 12px;
}

.mpf-catalog-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-radius: var(--radius);
  background: var(--empty-bg);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

.mpf-catalog-card:hover {
  background: var(--chip-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.mpf-catalog-card.is-active {
  background: var(--button-bg);
  box-shadow: inset 0 0 0 2px var(--olive);
}

.metric:hover,
.home-detail-row:hover,
.mpf-item-row:hover,
.delivery-entry:hover {
  background: var(--chip-bg);
}

.metric {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.list-plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-plain li {
  padding: 9px 0;
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, .10);
}

.list-plain li:last-child {
  box-shadow: none;
}

.command-motd {
  box-shadow:
    inset 4px 0 0 var(--olive),
    var(--shadow);
}

.command-table {
  margin-top: 8px;
}

.command-timezone {
  color: var(--muted);
  font-size: 12px;
}

.task-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.task-horizontal-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

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

.task-grid-resources {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.task-resource-item {
  background: var(--panel-2);
  padding: 6px 10px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}
.task-resource-item.status-done {
  border-left-color: var(--olive);
}
.task-resource-item.status-done .numeric {
  color: var(--olive);
}
.task-resource-item.status-processing {
  border-left-color: #f1c40f; /* Yellow/Amber */
  background: rgba(241, 196, 15, 0.05);
}
.task-resource-item.status-processing .numeric {
  color: #f1c40f;
}
.task-resource-item.status-partial {
  border-left-color: var(--blue);
}
.task-resource-item.status-partial .numeric {
  color: var(--blue);
}
.task-resource-item.status-missing {
  border-left-color: var(--panel-3);
}
.task-resource-item.status-missing .numeric {
  color: var(--muted);
}
      .readiness-wrap {
        margin-top: 8px;
        max-width: 280px;
      }
      .readiness-bar {
        height: 6px;
        background: rgba(148, 163, 184, .16);
        border-radius: 999px;
        overflow: hidden;
        margin-top: 4px;
      }
      .readiness-bar .fill {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, var(--olive), var(--olive-2));
        box-shadow: 0 0 8px rgba(116, 129, 58, .22);
      }
      .readiness-label {
        font-size: 11px;
        color: var(--muted);
      }
      .supply-tracking-card {
        padding: 0;
        overflow: hidden;
        background: var(--empty-bg);
        box-shadow: var(--shadow);
      }
      .supply-tracking-header {
        padding: 16px;
        background: var(--empty-bg);
        box-shadow: inset 0 -1px 0 rgba(148, 163, 184, .10);
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px;
        align-items: center;
      }
      .supply-tracking-header h3 {
        margin: 0;
        font-size: 18px;
        line-height: 1.2;
      }
      .supply-tabs {
        display: inline-flex;
        gap: 6px;
        flex-wrap: wrap;
        padding: 4px;
        border-radius: var(--radius);
        background: var(--chip-bg);
        box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .10);
      }
      .supply-tab {
        min-height: auto;
        background: transparent;
        border: 0;
        padding: 9px 12px;
        border-radius: 6px;
        color: var(--muted);
        cursor: pointer;
        box-shadow: none;
      }
      .supply-tab:hover {
        background: rgba(148, 163, 184, .10);
        color: var(--text);
      }
      .supply-tab.active {
        background: var(--olive);
        color: var(--text);
      }
      .supply-tracking-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        min-width: 820px;
      }
      .supply-tracking-table th {
        text-align: left;
        padding: 10px 12px;
        background: transparent;
        font-size: 11px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: .06em;
      }
      .supply-tracking-table td {
        padding: 12px;
        box-shadow: inset 0 -1px 0 rgba(148, 163, 184, .10);
        vertical-align: top;
      }
      .supply-tracking-body {
        overflow-x: auto;
      }
      .supply-task-breakdown {
        margin-top: 8px;
      }
      .supply-task-list {
        margin-top: 8px;
        background: var(--empty-bg);
        border-radius: 8px;
        padding: 8px;
      }
      .supply-task-item {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding: 4px 0;
        font-size: 11px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
      }
      .supply-task-item em {
        display: block;
        color: var(--muted);
        font-style: normal;
      }
      .supply-task-item:last-child {
        border-bottom: none;
      }
      .supply-row-note,
      .supply-credit-line {
        margin-top: 4px;
        color: var(--muted);
        font-size: 11px;
        line-height: 1.35;
      }
      .supply-progress-cell {
        min-width: 120px;
      }
      .supply-mini-bar {
        height: 7px;
        background: rgba(148, 163, 184, .16);
        border-radius: 999px;
        overflow: hidden;
        margin-top: 4px;
      }
      .supply-mini-bar .fill {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, var(--olive), var(--olive-2));
        transition: width .25s ease;
      }
      .btn-link.tiny {
        padding: 0;
        font-size: 11px;
        color: var(--blue);
        background: transparent;
        border: none;
        cursor: pointer;
      }
      .btn-link.tiny:hover {
        text-decoration: underline;
      }

.task-resource-item:hover {
  background: var(--panel-3);
  transform: translateY(-1px);
}

.task-resource-item .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--soft);
}

.task-info-block {
  display: flex;
  flex-direction: column;
}

.task-resources-block {
  border-left: 1px solid rgba(148, 163, 184, .1);
  padding-left: 20px;
}

@media (max-width: 900px) {
  .task-horizontal-layout {
    grid-template-columns: 1fr;
  }
  .task-resources-block {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid rgba(148, 163, 184, .1);
    padding-top: 16px;
  }
}

.task-requirements { margin-top: 12px; }
.task-requirements-empty { padding: 10px; text-align: left; }

.facility-request-requirements {
  justify-content: center;
  align-items: stretch;
  max-width: 900px;
  margin: 0 auto;
}

.delivery-entry {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.delivery-entry-title {
  font-weight: 800;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, .72);
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.loading-card {
  min-width: min(360px, calc(100vw - 48px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.loading-spinner,
.inline-spinner {
  width: 18px;
  height: 18px;
  display: inline-block;
  border-radius: 50%;
  background: var(--olive);
}

.inline-spinner {
  vertical-align: -4px;
  margin-right: 8px;
}

.mpf-workspace {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.mpf-item-grid {
  display: grid;
  gap: 8px;
  flex-grow: 1;
  min-height: 0;
  overflow-y: visible;
  overflow-x: hidden;
}

.mpf-item-grid.icon-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.mpf-item-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.mpf-icon-tile,
.mpf-icon-tile-sm,
.mpf-icon-tile-lg,
.mpf-icon-tile-xl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--input-bg);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .12);
  flex: 0 0 auto;
}

.mpf-icon-tile-xl { width: 64px; height: 64px; }
.mpf-icon-tile-lg { width: 50px; height: 50px; }
.mpf-icon-tile-sm { width: 34px; height: 34px; }
.mpf-icon { width: 26px; height: 26px; object-fit: contain; }
.mpf-icon.sm { width: 20px; height: 20px; }
.mpf-icon.lg { width: 30px; height: 30px; }
.mpf-icon.xl { width: 42px; height: 42px; }
.mpf-icon-fallback { display: none; font-size: 10px; text-align: center; }

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

.mpf-queue-table {
  width: 100%;
  overflow-x: auto;
}

.mpf-queue-item {
  min-width: 0;
}

.mpf-plan-cost-card,
.mpf-plan-cost-card .resource-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5rem;
}

.mpf-plan-cost-card .resource-pill {
  justify-content: space-between;
  width: 100%;
  max-width: 360px;
}

.mpf-queue-row,
.mpf-requirement-row,
.mpf-container-row {
  grid-template-columns: 1fr;
}

.mpf-queue-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.mpf-queue-size-wrap {
  flex: 0 0 auto;
}

.segmented {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--chip-bg);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .10);
}

.segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  cursor: pointer;
  box-shadow: none;
}

.segmented button.active {
  background: var(--olive);
  color: var(--text);
}

.segmented.mini button {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
}

.owner-terminal-bar,
.owner-terminal-screen {
  padding: 12px;
}

.owner-terminal-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
}

.owner-terminal-dot.is-red { background: var(--danger); }
.owner-terminal-dot.is-yellow { background: var(--warn); }
.owner-terminal-dot.is-green { background: var(--success); }

.status-urgent,
.owner-terminal-error { color: #fecaca; }
.owner-terminal-warning { color: #fde68a; }
.owner-terminal-success { color: var(--success); }

img { max-width: 100%; }

.mpf-item-row button {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  box-shadow: none;
  text-align: left;
  width: 100%;
}

.active-tasks-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.active-tasks-grid .task-card {
  margin-bottom: 0;
}

.resource-aggregate-card {
  margin-top: 2rem;
}

.facility-summary-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, rgba(255,255,255,0.1));
}

.badge-raw {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(100, 200, 120, 0.15);
  color: var(--success, #86efac);
  margin-left: 6px;
  vertical-align: middle;
}
.badge-intermediary {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(250, 204, 21, 0.15);
  color: var(--warn, #fde68a);
  margin-left: 6px;
  vertical-align: middle;
}
.badge-base {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(96, 165, 250, 0.15);
  color: var(--info, #93c5fd);
  margin-left: 6px;
  vertical-align: middle;
}
.badge-large {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  margin-left: 6px;
  vertical-align: middle;
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.3s ease;
}

@media (min-width: 980px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .app-nav {
    top: 0;
    right: auto;
    width: 260px;
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 18px 14px;
  }

  .brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0 0 18px;
    border-radius: var(--radius);
    background: var(--olive);
    color: #f8fafc;
    font-weight: 900;
    box-shadow: var(--shadow-sm);
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
  }

  .nav-zone {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
  }

  .nav-zone-title {
    display: block;
    padding: 3px 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
  }

  .nav button {
    width: 100%;
    min-width: 0;
    grid-template-columns: 28px minmax(0, 1fr);
    justify-items: start;
    text-align: left;
    padding: 10px 12px;
  }

  .nav-label {
    font-size: 13px;
    line-height: 1.2;
    text-align: left;
  }

  .nav-auth {
    margin-top: auto;
    display: grid;
    gap: 8px;
  }

  .wrap {
    grid-column: 2;
    padding: 24px;
  }

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

  .grid.three,
  .grid.cards,
  .home-dashboard-grid,
  .home-hero-grid,
  .urgent-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mpf-workspace {
    grid-template-columns: minmax(340px, .95fr) minmax(440px, 1.05fr);
  }

  .mpf-queue-row {
    grid-template-columns: minmax(140px, 1fr) minmax(220px, 1.9fr) minmax(110px, 110px) minmax(80px, auto);
  }

  .mpf-requirement-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(100px, 100px) minmax(100px, 100px);
  }

  .mpf-container-row {
    grid-template-columns: minmax(180px, 1.2fr) minmax(200px, 1fr) minmax(60px, auto) minmax(50px, auto);
  }
}

@media (max-width: 760px) {
  .span-2,
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-8,
  .span-12 {
    grid-column: span 12;
  }

  .topbar,
  .panel,
  .card {
    padding: 14px;
  }

  .title h1 {
    font-size: 20px;
  }
}

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

/* Regiment Switcher Premium Styles */
.nav-regiment-switcher {
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-select {
  appearance: none;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(148, 163, 184, 0.8)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  box-shadow: var(--shadow-sm);
}

.nav-select:hover {
  background-color: var(--button-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

@media (min-width: 1024px) {
  .app-shell {
    grid-template-columns: 280px 1fr;
  }

  .app-nav {
    position: sticky;
    top: 0;
    height: 100vh;
    flex-direction: column;
    padding: 24px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 16px 0 34px rgba(2, 6, 23, .38);
    overflow-y: auto;
  }

  .brand-mark {
    display: flex;
    width: 48px;
    height: 48px;
    background: var(--olive);
    color: #fff;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 32px;
    flex-shrink: 0;
  }

  .nav {
    flex-direction: column;
    overflow-x: visible;
    gap: 24px;
  }

  .nav-zone {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .nav-zone-title {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    padding-left: 12px;
  }

  .nav button {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px;
    gap: 12px;
    margin-top: 0;
  }

  .nav-label {
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
  }

  .nav-auth {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .nav-auth button {
    justify-content: center;
  }
}
