/* Flight Reservation System - stylesheet (no external libraries) */
:root {
  --navy: #0b2545;
  --blue: #1d4ed8;
  --blue-dark: #1e3a8a;
  --blue-light: #e8eefc;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f3f5f9;
  --green: #15803d;
  --green-light: #dcfce7;
  --red: #b91c1c;
  --red-light: #fee2e2;
  --amber: #b45309;
  --amber-light: #fef3c7;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- navigation bar ---------- */
.navbar { background: var(--navy); color: #fff; }
.navbar .inner {
  max-width: 1160px; margin: 0 auto; padding: .7rem 1.2rem;
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
}
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: .3px; }
.brand:hover { text-decoration: none; }
.brand span { color: #8fb3ff; }
.nav-links { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.nav-links a, .nav-user button {
  color: #dbe5ff; padding: .35rem .65rem; border-radius: 6px; font-size: .93rem;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: #dbe5ff; }
.nav-user form { margin: 0; }
.nav-user button { background: none; border: 1px solid rgba(255,255,255,.35); cursor: pointer; }
.nav-user button:hover { background: rgba(255,255,255,.12); color: #fff; }
.role-tag {
  font-size: .7rem; font-weight: 700; letter-spacing: .5px; padding: .1rem .45rem;
  border-radius: 999px; background: #8fb3ff; color: var(--navy);
}

/* ---------- layout ---------- */
main { max-width: 1160px; margin: 1.4rem auto 2.5rem; padding: 0 1.2rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; margin-bottom: 1.1rem; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 800px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem 0 2rem; }

/* ---------- hero / search ---------- */
.hero {
  background: linear-gradient(120deg, var(--navy), var(--blue-dark) 60%, var(--blue));
  color: #fff; border-radius: 14px; padding: 1.6rem 1.6rem 1.3rem; margin-bottom: 1.3rem;
}
.hero h1 { font-size: 1.75rem; }
.hero p { margin: .2rem 0 1.1rem; color: #dbe5ff; }
.search-form { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr .7fr 1fr auto; gap: .6rem; align-items: end; }
.hero .search-form label { color: #dbe5ff; }
@media (max-width: 900px) { .search-form { grid-template-columns: 1fr 1fr; } }

/* ---------- forms ---------- */
label { display: block; font-size: .82rem; font-weight: 600; color: #374151; margin-bottom: .25rem; }
input, select {
  width: 100%; padding: .55rem .65rem; border: 1px solid #cbd5e1; border-radius: 7px;
  font: inherit; font-size: .95rem; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid #93b4ff; border-color: var(--blue); }
.field { margin-bottom: .8rem; }
.form-actions { display: flex; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem .3rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .35rem; color: var(--navy); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: .55rem 1rem; border-radius: 7px; border: 1px solid transparent;
  background: var(--blue); color: #fff; font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; text-align: center; white-space: nowrap;
}
.btn:hover { background: var(--blue-dark); text-decoration: none; }
.btn-light { background: #fff; color: var(--ink); border-color: #cbd5e1; }
.btn-light:hover { background: #f3f4f6; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: .3rem .6rem; font-size: .82rem; }
.inline { display: inline; margin: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
     border-bottom: 2px solid var(--line); padding: .55rem .6rem; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; vertical-align: middle; }
tr:hover td { background: #fafbff; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .3px; }
.badge-SCHEDULED { background: var(--blue-light); color: var(--blue-dark); }
.badge-DELAYED { background: var(--amber-light); color: var(--amber); }
.badge-CANCELLED { background: var(--red-light); color: var(--red); }
.badge-DEPARTED { background: #e5e7eb; color: #374151; }
.badge-ARRIVED, .badge-CONFIRMED { background: var(--green-light); color: var(--green); }
.badge-BUSINESS { background: #ede9fe; color: #5b21b6; }
.badge-ECONOMY { background: #e0f2fe; color: #075985; }
.badge-ADMIN { background: #fde68a; color: #78350f; }
.badge-CUSTOMER { background: var(--blue-light); color: var(--blue-dark); }

/* ---------- flash messages ---------- */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .7rem; border: 1px solid; font-size: .93rem; }
.flash-success { background: var(--green-light); border-color: #86efac; color: #14532d; }
.flash-error { background: var(--red-light); border-color: #fca5a5; color: #7f1d1d; }
.flash-info { background: var(--blue-light); border-color: #a5b4fc; color: var(--blue-dark); }

/* ---------- flight cards ---------- */
.flight-row { display: grid; grid-template-columns: 1.1fr 2.2fr 1.1fr 1.2fr auto; gap: 1rem; align-items: center; }
@media (max-width: 800px) { .flight-row { grid-template-columns: 1fr; } }
.flight-no { font-weight: 700; font-size: 1.05rem; }
.route { display: flex; align-items: center; gap: .8rem; }
.route .time { font-size: 1.35rem; font-weight: 700; }
.route .code { font-size: .82rem; color: var(--muted); font-weight: 600; }
.route .line { flex: 1; text-align: center; color: var(--muted); font-size: .8rem; border-bottom: 2px dashed #cbd5e1; padding-bottom: .1rem; }
.price { font-size: 1.2rem; font-weight: 700; color: var(--navy); }
.seats-left { font-size: .82rem; color: var(--muted); }

/* ---------- statistics ---------- */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat .value { font-size: 1.55rem; font-weight: 700; color: var(--navy); }
.stat .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.bar { background: #e5e7eb; border-radius: 999px; height: 8px; overflow: hidden; min-width: 90px; }
.bar > span { display: block; height: 100%; background: var(--blue); }

/* ---------- seat map ---------- */
.seatmap { overflow-x: auto; padding: .4rem 0 .2rem; }
.seatmap table { width: auto; border-collapse: separate; border-spacing: 3px; }
.seatmap td, .seatmap th { border: 0; padding: 0; text-align: center; background: none !important; }
.seatmap th { font-size: .68rem; color: var(--muted); padding-bottom: 2px; letter-spacing: 0; }
.seatmap .letter { font-size: .7rem; color: var(--muted); padding-right: 4px; font-weight: 700; }
.seat {
  width: 24px; height: 22px; border-radius: 5px 5px 3px 3px; font-size: .6rem; line-height: 22px;
  border: 1px solid #93c5fd; background: #eff6ff; color: #1e40af; cursor: default; padding: 0;
}
.seat.business { border-color: #c4b5fd; background: #f5f3ff; color: #5b21b6; }
.seat.taken { background: #d1d5db; border-color: #d1d5db; color: #9ca3af; }
.seat.selected { background: var(--green); border-color: var(--green); color: #fff; }
button.seat.free { cursor: pointer; }
button.seat.free:hover { outline: 2px solid var(--blue); }
.aisle td { height: 10px; }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); margin-top: .4rem; flex-wrap: wrap; }
.legend .seat { display: inline-block; vertical-align: middle; margin-right: .3rem; }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .35rem .8rem; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.total-line { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 700; border-top: 2px solid var(--line); padding-top: .6rem; margin-top: .6rem; }
.auth-card { max-width: 430px; margin: 2rem auto; }
.note { font-size: .82rem; color: var(--muted); background: #f9fafb; border: 1px dashed #d1d5db; border-radius: 8px; padding: .6rem .8rem; }
.empty { text-align: center; color: var(--muted); padding: 1.5rem; }
