:root {
  --font-sans: "Aptos", "Avenir Next", "Segoe UI", sans-serif;
  --font-display: "Aptos", "Avenir Next", "Segoe UI", sans-serif;
  --color-jet: #070a0f;
  --color-navy: #0b1424;
  --color-ink: #101827;
  --color-panel: rgba(16, 25, 42, 0.74);
  --color-panel-strong: rgba(18, 29, 49, 0.91);
  --color-cloud: #f7f9fc;
  --color-silver: #c8d0da;
  --color-muted: #8e9aae;
  --color-gold: #d7b46a;
  --color-sky: #5bb7e8;
  --color-teal: #4fd1c5;
  --color-rose: #ef6f8e;
  --color-amber: #f2b84b;
  --color-line: rgba(255, 255, 255, 0.13);
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-round: 999px;
  --shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.26);
  --shadow-lift: 0 24px 70px rgba(3, 8, 20, 0.42);
  --blur-panel: blur(18px) saturate(145%);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --ease-standard: cubic-bezier(.2, .8, .2, 1);
  --duration-fast: 140ms;
  --duration-base: 220ms;
  --duration-slow: 420ms;
}

[data-theme="light"] {
  --color-jet: #edf3f8;
  --color-navy: #f7f9fc;
  --color-panel: rgba(255, 255, 255, 0.42); /* Higher transparency for glassmorphism */
  --color-panel-strong: rgba(255, 255, 255, 0.68);
  --color-cloud: #152033;
  --color-silver: #445066;
  --color-muted: #66748a;
  --color-line: rgba(255, 255, 255, 0.65); /* Glass highlighted border */
  --shadow-soft: 0 16px 44px rgba(15, 32, 59, 0.08); /* Softer shadows for glass layers */
  --shadow-lift: 0 24px 70px rgba(15, 32, 59, 0.12);
  --blur-panel: blur(25px) saturate(190%); /* Enhanced blur to diffuse blueprint wing behind panels */
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: dark;
}

[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  letter-spacing: 0;
  color: var(--color-cloud);
  background:
    linear-gradient(130deg, rgba(91, 183, 232, 0.16), transparent 34%),
    linear-gradient(215deg, rgba(215, 180, 106, 0.15), transparent 36%),
    radial-gradient(ellipse at top left, rgba(24, 48, 84, 0.95), transparent 46%),
    var(--color-jet);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), transparent 84%);
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-sky);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}

.skyfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.runway-line {
  position: absolute;
  height: 1px;
  width: 70vw;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.20), transparent);
  transform-origin: center;
}

.runway-line-a {
  right: -18vw;
  top: 18vh;
  transform: rotate(-18deg);
}

.runway-line-b {
  left: 18vw;
  bottom: 12vh;
  transform: rotate(-18deg);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  height: 100vh;
  padding: var(--space-5);
  border-right: 2px dashed rgba(255, 255, 255, 0.22);
  background: var(--color-panel);
  backdrop-filter: var(--blur-panel);
  z-index: 20;
}

[data-theme="light"] .sidebar {
  border-right-color: rgba(16, 24, 39, 0.18);
}

.runway-plane {
  position: absolute;
  right: -13px;
  top: 0;
  width: 24px;
  height: 24px;
  color: var(--color-cloud); /* Cloud plane that adapts to theme */
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4)); /* Stronger shadow for larger plane */
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  will-change: transform, opacity;
}

.runway-plane svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(215, 180, 106, 0.46);
  border-radius: var(--radius-md);
  color: var(--color-gold);
  font-family: var(--font-display);
  font-size: 1.8rem;
  background: linear-gradient(145deg, rgba(215, 180, 106, 0.18), rgba(91, 183, 232, 0.08));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.brand small {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.nav-list {
  display: grid;
  gap: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-silver);
  transition: transform var(--duration-base) var(--ease-standard), background var(--duration-base), border-color var(--duration-base);
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(215, 180, 106, 0.28);
  color: var(--color-cloud);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

.nav-icon,
.icon-theme,
.icon-menu {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.nav-icon {
  transition: transform 0.8s var(--ease-standard);
  transition-delay: 0.05s;
}

.nav-item:hover .nav-icon,
.nav-item.is-active .nav-icon {
  transform: rotateY(360deg);
}

.nav-icon::before,
.nav-icon::after,
.icon-theme::before,
.icon-theme::after,
.icon-menu::before,
.icon-menu::after {
  position: absolute;
  content: "";
}

.nav-icon-radar::before {
  inset: 2px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.nav-icon-radar::after {
  left: 8px;
  top: 1px;
  width: 1.5px;
  height: 16px;
  background: currentColor;
  transform: rotate(40deg);
}

.nav-icon-flight::before {
  left: 2px;
  top: 8px;
  width: 15px;
  height: 2px;
  background: currentColor;
  transform: rotate(66deg);
}

.nav-icon-flight::after {
  left: 7px;
  top: 2px;
  width: 2px;
  height: 14px;
  background: currentColor;
  transform: rotate(-24deg);
}

.nav-icon-route::before,
.nav-icon-settings::before {
  inset: 2px;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-xs);
}

.nav-icon-service::before {
  left: 2px;
  right: 2px;
  bottom: 1px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-xs);
}

.nav-icon-service::after {
  left: 6px;
  right: 6px;
  top: 1px;
  height: 6px;
  border: 1.5px solid currentColor;
  border-bottom: none;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}

.nav-icon-chef::before {
  left: 1px;
  right: 1px;
  top: 1px;
  bottom: 5px;
  border: 1.5px solid currentColor;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

.nav-icon-chef::after {
  left: 3px;
  right: 3px;
  bottom: 1px;
  height: 4px;
  border: 1.5px solid currentColor;
  border-radius: 1px;
}

.nav-icon-route::after {
  left: 4px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.nav-icon-ledger::before {
  inset: 3px 1px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.nav-icon-ledger::after {
  left: 1px;
  right: 1px;
  top: 6px;
  height: 2px;
  background: currentColor;
}

.nav-icon-settings::after {
  inset: 6px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.nav-icon-menu::before {
  left: 2px;
  right: 2px;
  top: 1px;
  bottom: 4px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.nav-icon-menu::after {
  left: 6px;
  width: 2px;
  top: 1px;
  bottom: 1px;
  background: currentColor;
}

/* Quote icon — document with corner fold */
.nav-icon-quote::before {
  inset: 2px 2px 2px 3px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}
.nav-icon-quote::after {
  right: 2px;
  top: 2px;
  width: 6px;
  height: 6px;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
}

/* Chart icon — bar chart */
.nav-icon-chart::before {
  left: 3px;
  bottom: 3px;
  width: 4px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 1px;
}
.nav-icon-chart::after {
  right: 3px;
  bottom: 3px;
  width: 4px;
  height: 6px;
  border: 1.5px solid currentColor;
  border-radius: 1px;
}

.sidebar-card {
  margin-top: auto;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  border: 1px solid rgba(215, 180, 106, 0.25);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(215, 180, 106, 0.10), rgba(91, 183, 232, 0.08));
  color: var(--color-silver);
}

.sidebar-card strong {
  color: var(--color-cloud);
}

.main-panel {
  min-width: 0;
  padding: var(--space-5);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.topbar h1,
.hero-strip h2,
.panel h2,
.panel h3,
.login-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
}

.topbar h1 {
  font-size: clamp(1.4rem, 2.5vw, 2.25rem);
}

.topbar-actions,
.hero-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-block;
  color: var(--color-gold);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.button,
.pill-link,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  min-height: 40px;
  padding: 0 var(--space-4);
  color: var(--color-cloud);
  background: rgba(255, 255, 255, 0.07);
  transition: transform var(--duration-base) var(--ease-standard), border-color var(--duration-base), background var(--duration-base);
}

.button:hover,
.pill-link:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(215, 180, 106, 0.42);
}

.button.primary {
  border-color: rgba(215, 180, 106, 0.48);
  color: #08111d;
  background: linear-gradient(135deg, #f1d58c, #d7b46a);
  box-shadow: 0 16px 36px rgba(215, 180, 106, 0.20);
}

.button.secondary {
  border-color: rgba(91, 183, 232, 0.38);
  background: rgba(91, 183, 232, 0.10);
}

.button.danger {
  border-color: rgba(239, 111, 142, 0.45);
  background: rgba(239, 111, 142, 0.15);
  color: var(--color-rose);
}

.button.ghost {
  background: transparent;
}

.button.full {
  width: 100%;
}

.pill-link {
  min-height: 34px;
  font-size: var(--text-sm);
}

.pill-link.warning {
  border-color: rgba(242, 184, 75, 0.45);
  color: var(--color-amber);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.theme-icon-sun,
.theme-icon-moon {
  width: 18px;
  height: 18px;
  transition: transform var(--duration-base) var(--ease-standard), opacity var(--duration-base);
  display: block;
}

html[data-theme="dark"] .theme-icon-sun {
  display: block;
}
html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

html[data-theme="light"] .theme-icon-sun {
  display: none;
}
html[data-theme="light"] .theme-icon-moon {
  display: block;
}

.icon-button:hover .theme-icon-sun {
  transform: rotate(45deg);
}
.icon-button:hover .theme-icon-moon {
  transform: rotate(-15deg);
}

.icon-menu::before {
  left: 2px;
  right: 2px;
  top: 5px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor;
}

.mobile-only {
  display: none;
}

.hero-strip,
.panel,
.metric-card,
.board-column,
.login-card,
.minimal-card {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--blur-panel);
}

.hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  background:
    linear-gradient(120deg, rgba(215, 180, 106, 0.14), transparent 42%),
    linear-gradient(300deg, rgba(91, 183, 232, 0.12), transparent 42%),
    var(--color-panel);
}

.hero-strip h2 {
  max-width: 760px;
  margin-top: var(--space-2);
  font-size: clamp(1.6rem, 3vw, 3rem);
  line-height: 1.05;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.metric-card {
  position: relative;
  min-height: 156px;
  padding: var(--space-5);
  overflow: hidden;
}

.metric-card::after {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-4);
  width: 78px;
  height: 4px;
  border-radius: var(--radius-round);
  background: var(--color-teal);
  content: "";
}

.metric-card.accent-sky::after {
  background: var(--color-sky);
}

.metric-card.accent-gold::after {
  background: var(--color-gold);
}

.metric-card.accent-rose::after {
  background: var(--color-rose);
}

.metric-card span,
.metric-card small,
.muted {
  color: var(--color-muted);
}

.metric-card strong {
  display: block;
  margin: var(--space-2) 0;
  font-family: var(--font-display);
  font-size: 2.6rem;
}

.dashboard-grid,
.board-grid,
.form-grid,
.order-builder {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.panel {
  padding: var(--space-5);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.text-link {
  color: var(--color-sky);
  font-weight: 700;
}

.timeline-list,
.route-list,
.checklist,
.form-stack,
.detail-list {
  display: grid;
  gap: var(--space-3);
}

.timeline-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  min-height: 72px;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-line);
}

.timeline-pin {
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-sky);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(91, 183, 232, 0.12);
}

.timeline-row strong,
.timeline-row span:not(.status-badge) {
  display: block;
}

.timeline-row span:not(.status-badge),
.timeline-meta {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.timeline-meta {
  display: grid;
  justify-items: end;
  gap: var(--space-2);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 1px var(--space-3) 0;
  border: 1px solid currentColor;
  border-radius: var(--radius-round);
  color: var(--color-silver);
  background: rgba(255, 255, 255, 0.06);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: normal;
  white-space: nowrap;
}

.status-catering_pending,
.status-submitted,
.status-sent {
  color: var(--color-sky);
}

.status-pending_review,
.status-draft {
  color: var(--color-amber);
}

.status-in_production,
.status-in_kitchen {
  color: #b28cff;
}

.status-ready_for_dispatch {
  color: var(--color-gold);
}

.status-approved,
.status-confirmed,
.status-delivered,
.status-completed {
  color: var(--color-teal);
}

.status-overdue,
.status-expired,
.status-declined,
.status-cancelled {
  color: var(--color-rose);
}

.status-converted {
  color: var(--color-sky);
}

.status-sent {
  color: var(--color-gold);
}

.status-accepted {
  color: var(--color-teal);
}

.progress-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
  margin: var(--space-5) 0;
}

.progress-track span {
  height: 7px;
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.12);
}

.progress-track .is-done,
.progress-track .is-active {
  background: linear-gradient(90deg, var(--color-gold), var(--color-sky));
}

.detail-list {
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-line);
}

.detail-list dt {
  color: var(--color-muted);
}

.detail-list dd {
  margin: 0;
  text-align: right;
}

.board-column {
  grid-column: span 4;
  padding: var(--space-4);
}

.board-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  color: var(--color-muted);
}

.board-column header strong {
  color: var(--color-cloud);
  font-size: var(--text-xl);
}

.mini-card,
.route-list article {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-line);
}

.mini-card span,
.route-list span {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: var(--space-3);
  border-top: 1px solid var(--color-line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--color-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
}

.form-grid .form-panel,
.order-builder .span-8 {
  grid-column: span 8;
}

.form-grid aside,
.cart-panel {
  grid-column: span 4;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

label {
  display: grid;
  gap: var(--space-2);
  color: var(--color-silver);
  font-size: var(--text-sm);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--color-cloud);
  background: rgba(255, 255, 255, 0.07);
}

textarea {
  resize: vertical;
}

.form-actions {
  margin-top: var(--space-4);
  justify-content: flex-end;
}

.menu-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.menu-tile {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.menu-photo {
  min-height: 132px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.20), transparent),
    linear-gradient(45deg, rgba(215, 180, 106, 0.18), rgba(91, 183, 232, 0.16));
}

.menu-photo-b {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    linear-gradient(45deg, rgba(79, 209, 197, 0.18), rgba(215, 180, 106, 0.16));
}

.menu-photo-c {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    linear-gradient(45deg, rgba(239, 111, 142, 0.16), rgba(91, 183, 232, 0.16));
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.tag-cloud span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-round);
  color: var(--color-silver);
}

.checklist label {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 48px;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-line);
}

.toast-stack {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 20;
  display: grid;
  gap: var(--space-2);
  max-width: min(420px, calc(100vw - 32px));
}

.toast {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  background: var(--color-panel-strong);
  box-shadow: var(--shadow-soft);
}

.toast.success {
  border-color: rgba(79, 209, 197, 0.42);
}

.toast.warning,
.toast.error {
  border-color: rgba(242, 184, 75, 0.45);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: var(--space-5);
  overflow: hidden;
}

.auth-visual {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(7, 10, 15, 0.15), rgba(7, 10, 15, 0.76)),
    linear-gradient(28deg, rgba(215, 180, 106, 0.18), transparent 42%),
    linear-gradient(155deg, rgba(91, 183, 232, 0.20), transparent 48%),
    var(--color-jet);
}

.runway-beam {
  position: absolute;
  left: 10vw;
  right: 8vw;
  bottom: 14vh;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  transform: rotate(-11deg);
}

.login-card {
  position: relative;
  width: min(440px, 100%);
  border-radius: 150px;
  border: 14px solid rgba(142, 154, 174, 0.18);
  outline: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 24px 70px rgba(0, 0, 0, 0.75), 
    inset 0 0 40px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 0 8px rgba(255, 255, 255, 0.03);
  background: var(--color-panel);
  backdrop-filter: var(--blur-panel);
  overflow: hidden;
  padding: 64px 44px;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url('../img/sky_clouds_bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  pointer-events: none;
}

.login-card > * {
  position: relative;
  z-index: 2;
}


.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.login-copy {
  margin-bottom: var(--space-5);
  text-align: center;
}

.login-copy h1 {
  margin-top: var(--space-2);
  font-size: var(--text-3xl);
  line-height: 1.05;
}

.form-stack {
  gap: var(--space-4);
}

.fine-print {
  margin: var(--space-4) 0 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  text-align: center;
}

.minimal-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: var(--space-5);
}

.minimal-card {
  width: min(620px, 100%);
  padding: var(--space-6);
}

code {
  color: var(--color-gold);
}

.reveal {
  animation: reveal var(--duration-slow) var(--ease-standard) both;
}

.delay-1 {
  animation-delay: 80ms;
}

.delay-2 {
  animation-delay: 160ms;
}

.delay-3 {
  animation-delay: 240ms;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 286px;
    transform: translateX(-105%);
    transition: transform var(--duration-base) var(--ease-standard);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-flex;
  }

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

@media (max-width: 820px) {
  .main-panel {
    padding: var(--space-4);
  }

  .topbar,
  .hero-strip,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-grid,
  .board-grid,
  .form-grid,
  .order-builder {
    grid-template-columns: 1fr;
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12,
  .board-column,
  .form-grid .form-panel,
  .form-grid aside,
  .order-builder .span-8,
  .cart-panel {
    grid-column: 1;
  }

  .timeline-row {
    grid-template-columns: 18px 1fr;
  }

  .timeline-meta {
    grid-column: 2;
    justify-items: start;
  }

  .menu-picker,
  .field-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    border-radius: 100px;
    padding: 48px 28px;
    border-width: 10px;
  }
}

/* Animated Aviation Blueprint Background */
.aviation-blueprint {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.aviation-blueprint .blueprint-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom right;
  /* Premium micro-pulse to keep the dashboard feeling alive */
  animation: blueprint-pulse 12s ease-in-out infinite alternate;
  will-change: opacity;
}

@keyframes blueprint-pulse {
  0% {
    opacity: 0.85;
  }
  100% {
    opacity: 1;
  }
}

/* Pause animation if the user has requested reduced motion */
@media (prefers-reduced-motion: reduce) {
  .aviation-blueprint .blueprint-image {
    animation: none;
  }
}

.aviation-blueprint.dark-blueprint {
  display: flex;
  opacity: 0.85; /* Beautiful visibility for the dark blueprint */
}

.aviation-blueprint.light-blueprint {
  display: none;
}

/* Animated SVG watermark for light theme (fallback/unused but kept) */
.aviation-blueprint-svg {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.12;
  color: var(--color-sky, #5bb7e8);
  display: none;
  justify-content: flex-end;
  align-items: flex-end;
  overflow: hidden;
}

.aviation-blueprint-svg svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom right;
}

#fan-blades {
  transform-origin: 1450px 800px;
  transform-box: view-box;
  animation: spin-rotor 50s linear infinite;
  will-change: transform;
}

@keyframes spin-rotor {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Pause animation if the user has requested reduced motion */
@media (prefers-reduced-motion: reduce) {
  #fan-blades {
    animation: none;
  }
}

/* Theme overrides */
[data-theme="light"] .dark-blueprint {
  display: none;
}

[data-theme="light"] .light-blueprint {
  display: flex;
  opacity: 0.85; /* Beautiful visibility for the light blueprint */
}

[data-theme="light"] .aviation-blueprint-svg {
  display: none;
}

/* Interactive Mouse-Tracking Background Glow */
#mouse-glow-layer {
  position: absolute;
  width: 600px;
  height: 600px;
  top: -300px;
  left: -300px;
  pointer-events: none;
  z-index: 1; /* Sits above the blueprint SVG but still inside fixed .skyfield (z-index -1) */
  opacity: 0; /* Invisible on load, fades in smoothly on first mouse movement */
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  background: radial-gradient(
    circle closest-side,
    rgba(0, 229, 255, 0.28) 0%,
    rgba(0, 132, 255, 0.12) 40%,
    rgba(0, 68, 255, 0.02) 70%,
    transparent 100%
  );
  mix-blend-mode: screen; /* Creates a vibrant light-source overlay against dark colors */
  will-change: transform;
  transform: translate3d(var(--mouse-x, -9999px), var(--mouse-y, -9999px), 0);
}

/* Light theme adjustments for a more subtle glow */
[data-theme="light"] #mouse-glow-layer {
  mix-blend-mode: normal; /* Normal blending is cleaner for light backgrounds */
  background: radial-gradient(
    circle closest-side,
    rgba(0, 120, 255, 0.08) 0%,
    rgba(0, 80, 240, 0.02) 45%,
    transparent 100%
  );
}

/* Hide the glow on touch devices to save resources and avoid layout glitches */
@media (max-width: 768px), (hover: none) {
  #mouse-glow-layer {
    display: none;
  }
}

/* Logout button siren alert hover effect */
.logout-btn:hover {
  animation: siren-alert 0.25s infinite alternate;
  color: var(--color-rose, #ef6f8e) !important;
  background: rgba(239, 111, 142, 0.08) !important;
}

@keyframes siren-alert {
  0% {
    border-color: rgba(239, 111, 142, 0.25);
    box-shadow: 0 0 4px rgba(239, 111, 142, 0.2);
  }
  100% {
    border-color: #ef6f8e;
    box-shadow: 0 0 12px rgba(239, 111, 142, 0.7);
  }
}

/* ═══════════════════════════════════════════════════
   CLIENTS MODULE
═══════════════════════════════════════════════════ */

/* Nav icon — briefcase shape */
.nav-icon-clients::before {
  left: 1px;
  right: 1px;
  top: 5px;
  bottom: 1px;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-xs);
}

.nav-icon-clients::after {
  left: 5px;
  right: 5px;
  top: 1px;
  height: 5px;
  border: 1.5px solid currentColor;
  border-bottom: none;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}

/* Client table rows */
.client-row {
  transition: background var(--duration-fast);
}

.client-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.client-name-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.client-name-cell > div {
  display: grid;
  gap: 2px;
}

.client-name-cell small {
  display: block;
  font-size: var(--text-xs);
}

/* Client avatar — gold gradient initials circle */
.client-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(215, 180, 106, 0.35);
  background: linear-gradient(135deg, rgba(215, 180, 106, 0.22), rgba(91, 183, 232, 0.14));
  color: var(--color-gold);
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Code pill for account codes */
.code-pill {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-sky);
  font-family: 'Courier New', monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.6px;
}

/* Clients empty state */
.clients-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-7) var(--space-5);
  text-align: center;
}

.clients-empty-icon {
  width: 64px;
  height: 64px;
  color: var(--color-muted);
  opacity: 0.6;
  animation: pulse-glow 3s ease-in-out infinite;
}

.clients-empty-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%       { opacity: 0.75; transform: scale(1.06); }
}

/* ── Form Section Headers ── */
.form-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.form-section-header h3 {
  margin: 0;
  font-size: var(--text-lg);
}

.form-section-icon {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(215, 180, 106, 0.30);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(215, 180, 106, 0.12), rgba(91, 183, 232, 0.08));
  color: var(--color-gold);
  transition: transform var(--duration-base) var(--ease-standard);
}

.form-section-header:hover .form-section-icon {
  transform: rotateY(360deg);
  transition: transform 0.8s var(--ease-standard);
}

/* Identity icon: person silhouette */
.form-section-icon-identity::before {
  position: absolute;
  content: "";
  left: 11px; top: 6px;
  width: 18px; height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 50% 50% 0 0;
}
.form-section-icon-identity::after {
  position: absolute;
  content: "";
  left: 6px; bottom: 5px;
  right: 6px; height: 9px;
  border: 1.5px solid currentColor;
  border-top: none;
  border-radius: 0 0 4px 4px;
}

/* Address icon: location pin */
.form-section-icon-address::before {
  position: absolute;
  content: "";
  left: 10px; top: 5px;
  width: 20px; height: 20px;
  border: 1.5px solid currentColor;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
.form-section-icon-address::after {
  position: absolute;
  content: "";
  left: 15px; top: 10px;
  width: 10px; height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

/* Tax icon: document with lines */
.form-section-icon-tax::before {
  position: absolute;
  content: "";
  inset: 5px 7px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}
.form-section-icon-tax::after {
  position: absolute;
  content: "";
  left: 12px; right: 12px;
  top: 14px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

/* Finance icon: coin/circle with line */
.form-section-icon-finance::before {
  position: absolute;
  content: "";
  inset: 6px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.form-section-icon-finance::after {
  position: absolute;
  content: "";
  left: 19px; top: 8px;
  width: 1.5px; height: 24px;
  background: currentColor;
  transform: rotate(-20deg);
}

/* Notes icon: notepad lines */
.form-section-icon-notes::before {
  position: absolute;
  content: "";
  inset: 5px 6px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}
.form-section-icon-notes::after {
  position: absolute;
  content: "";
  left: 11px; right: 11px;
  top: 12px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

/* ── Select inputs ── */
select {
  width: 100%;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--color-cloud);
  background: rgba(255, 255, 255, 0.07);
  font: inherit;
  cursor: pointer;
  appearance: none;
  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='%238e9aae' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select:focus {
  outline: 2px solid var(--color-sky);
  outline-offset: 2px;
}

[data-theme="light"] select {
  background-color: rgba(255, 255, 255, 0.68);
  color: #152033;
}

/* ── Checkbox labels ── */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-silver);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--color-gold);
  cursor: pointer;
}

/* ── Field validation error ── */
.field-error {
  display: block;
  margin-top: 2px;
  color: var(--color-rose);
  font-size: var(--text-xs);
  animation: field-shake 0.28s ease;
}

@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}

label abbr {
  color: var(--color-rose);
  text-decoration: none;
  margin-left: 2px;
}

/* ═══════════════════════════════════════════════════
   CLIENT EDIT DRAWER (SLIDE-OVER)
═══════════════════════════════════════════════════ */

/* Overlay backdrop */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 10, 20, 0.62);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-standard);
}

.drawer-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Slide-over panel */
.client-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 51;
  width: min(560px, 100vw);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(160deg, rgba(215, 180, 106, 0.08), transparent 40%),
    var(--color-panel-strong);
  backdrop-filter: blur(28px) saturate(160%);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.55);
  transform: translateX(100%);
  transition: transform 0.38s var(--ease-standard);
}

.client-drawer.is-open {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .client-drawer { transition: none; }
  .drawer-overlay { transition: none; }
}

[data-theme="light"] .client-drawer {
  background:
    linear-gradient(160deg, rgba(215, 180, 106, 0.06), transparent 40%),
    rgba(255, 255, 255, 0.82);
  border-left-color: rgba(10, 24, 39, 0.14);
  box-shadow: -24px 0 80px rgba(15, 32, 59, 0.18);
}

.drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Drawer Header */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-line);
}

.drawer-header-identity {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.drawer-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(215, 180, 106, 0.40);
  background: linear-gradient(135deg, rgba(215, 180, 106, 0.24), rgba(91, 183, 232, 0.16));
  color: var(--color-gold);
  font-weight: 700;
  font-size: 1.3rem;
  text-transform: uppercase;
}

.drawer-title {
  margin: 2px 0 0;
  font-size: var(--text-xl);
  font-weight: 600;
  font-family: var(--font-display);
}

/* Tab bar */
.drawer-tabs {
  display: flex;
  gap: 0;
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--color-line);
  flex-shrink: 0;
}

.drawer-tab {
  position: relative;
  padding: var(--space-3) var(--space-4);
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--duration-fast);
}

.drawer-tab::after {
  position: absolute;
  bottom: -1px;
  left: var(--space-4);
  right: var(--space-4);
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--color-gold);
  content: "";
  transform: scaleX(0);
  transition: transform var(--duration-base) var(--ease-standard);
}

.drawer-tab:hover {
  color: var(--color-cloud);
}

.drawer-tab.is-active {
  color: var(--color-cloud);
}

.drawer-tab.is-active::after {
  transform: scaleX(1);
}

/* Tab panels */
.drawer-tab-panel {
  display: none;
  flex: 1;
  padding: var(--space-5);
  overflow-y: auto;
}

.drawer-tab-panel.is-active {
  display: block;
  animation: panel-fade-in 0.22s var(--ease-standard);
}

@keyframes panel-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Drawer Footer */
.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-line);
  background: rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

[data-theme="light"] .drawer-footer {
  background: rgba(0, 0, 0, 0.04);
}

.drawer-account-code {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Row clickable cursor */
.client-row {
  cursor: pointer;
}

.client-row:hover td {
  background: rgba(215, 180, 106, 0.04);
}

/* Row active flash when opening drawer */
.client-row.is-editing td {
  background: rgba(91, 183, 232, 0.06);
}

/* No-clients warning notice inside a form field */
.no-clients-notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(239, 111, 142, 0.30);
  border-radius: var(--radius-md);
  background: rgba(239, 111, 142, 0.07);
  color: var(--color-rose);
  font-size: var(--text-sm);
}

.no-clients-notice a {
  color: var(--color-sky);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: auto;
  white-space: nowrap;
}

/* Inline info strip inside a form */
.form-info-strip {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(91, 183, 232, 0.22);
  border-radius: var(--radius-md);
  background: rgba(91, 183, 232, 0.06);
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   INVOICE WORKFLOW BANNER
═══════════════════════════════════════════════════ */

.invoice-workflow-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(215, 180, 106, 0.06), transparent 50%),
    var(--color-panel);
  backdrop-filter: var(--blur-panel);
}

.invoice-workflow-steps {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

.wf-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-muted);
  font-weight: 500;
}

.wf-step-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.wf-step-icon svg {
  width: 14px;
  height: 14px;
}

.wf-done {
  color: var(--color-teal);
}

.wf-done .wf-step-icon {
  border-color: rgba(79, 209, 197, 0.35);
  background: rgba(79, 209, 197, 0.10);
  color: var(--color-teal);
}

.wf-active {
  color: var(--color-sky);
}

.wf-active .wf-step-icon {
  border-color: rgba(91, 183, 232, 0.4);
  background: rgba(91, 183, 232, 0.12);
  color: var(--color-sky);
  animation: wf-pulse 2.2s ease-in-out infinite;
}

@keyframes wf-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 183, 232, 0); }
  50%       { box-shadow: 0 0 0 6px rgba(91, 183, 232, 0.18); }
}

.wf-trigger {
  color: var(--color-gold);
  font-weight: 600;
}

.wf-trigger .wf-step-icon,
.wf-step-icon-invoice {
  border-color: rgba(215, 180, 106, 0.45);
  background: linear-gradient(135deg, rgba(215, 180, 106, 0.20), rgba(91, 183, 232, 0.10));
  color: var(--color-gold);
}

.wf-arrow {
  color: var(--color-muted);
  font-size: var(--text-sm);
  opacity: 0.5;
}

