:root {
  --bg-1: #041522;
  --bg-2: #102b3f;
  --bg-3: #7dc2e6;
  --panel: rgba(9, 29, 43, 0.72);
  --panel-border: rgba(173, 226, 255, 0.2);
  --text: #e6f5ff;
  --muted: #9fc3d6;
  --accent: #ffd166;
  --accent-2: #ff8c42;
  --danger: #ff6b6b;
  --ok: #6effb0;
  --shadow: 0 18px 45px rgba(3, 11, 20, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 18% 20%, #173953 0%, var(--bg-1) 38%),
              linear-gradient(135deg, var(--bg-2), #071a29 50%, #01060b 100%);
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 420px at 88% 6%, rgba(125, 194, 230, 0.18), transparent 62%),
    radial-gradient(500px 320px at 15% 85%, rgba(255, 209, 102, 0.16), transparent 65%);
  z-index: -1;
}

.app-shell {
  width: min(1200px, 94vw);
  margin: 1.8rem auto 2.8rem;
  display: grid;
  gap: 1rem;
}

.app-locked {
  filter: blur(3px) saturate(0.75);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 10, 18, 0.5);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.auth-gate[hidden] {
  display: none;
}

.login-card {
  width: min(480px, 92vw);
  display: grid;
  gap: 0.7rem;
  padding: 1.2rem;
  backdrop-filter: blur(8px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero,
.panel,
.stat-card {
  backdrop-filter: blur(8px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  animation: rise 550ms ease-out;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
}

h1,
h2 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
}

h1 {
  font-size: clamp(1.45rem, 3.4vw, 2.2rem);
}

.subtitle {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 0.9rem;
  border-radius: 999px;
  background: rgba(173, 226, 255, 0.2);
  border: 1px solid rgba(173, 226, 255, 0.22);
  color: var(--text);
  font-weight: 700;
}

.btn,
.btn-xs {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease, opacity 140ms;
}

.btn {
  padding: 0.64rem 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn:hover,
.btn-xs:hover {
  transform: translateY(-1px);
}

.btn-strong {
  color: #0c1924;
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(255, 140, 66, 0.34);
}

.btn-muted {
  color: var(--text);
  background: rgba(173, 226, 255, 0.15);
  border: 1px solid rgba(173, 226, 255, 0.22);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.stat-card {
  padding: 0.9rem;
  animation: rise 700ms ease both;
}

.stat-card h2 {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.stat-card p {
  margin: 0.35rem 0 0;
  font-size: 1.65rem;
  font-weight: 800;
}

.panel {
  padding: 1rem;
  animation: rise 820ms ease both;
}

.flight-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.84rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(173, 226, 255, 0.22);
  background: rgba(4, 19, 31, 0.85);
  color: var(--text);
  border-radius: 12px;
  padding: 0.64rem 0.74rem;
  font: inherit;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(255, 209, 102, 0.3);
  border-color: rgba(255, 209, 102, 0.75);
}

.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 0.6rem;
}

.filters {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr) auto auto;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(173, 226, 255, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: rgba(4, 19, 31, 0.8);
}

th,
td {
  padding: 0.62rem 0.72rem;
  border-bottom: 1px solid rgba(173, 226, 255, 0.14);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.76rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.08em;
}

tbody tr:hover {
  background: rgba(173, 226, 255, 0.08);
}

.row-actions {
  display: flex;
  gap: 0.35rem;
}

.btn-xs {
  padding: 0.36rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(173, 226, 255, 0.2);
  color: var(--text);
}

.btn-xs.delete {
  background: rgba(255, 107, 107, 0.24);
  color: #ffd9d9;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
}

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

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

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

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

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

  .stats-grid,
  .flight-form,
  .filters {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }
}
