/* Pacific Airlift Dispatch — Style */
/* Palette: deep ocean navy, sky blue accent, warm sand, cargo orange for alerts */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700&display=swap');

:root {
  --navy:       #0f2035;
  --navy-mid:   #1a3550;
  --navy-light: #254a6e;
  --sky:        #3a8fc9;
  --sky-light:  #e8f4fc;
  --sand:       #f5f0e8;
  --orange:     #e07b2a;
  --orange-light: #fdf0e3;
  --green:      #2a9d5c;
  --green-light: #e3f5ec;
  --red:        #c0392b;
  --red-light:  #fdecea;
  --text:       #1a1a2e;
  --text-mid:   #4a5568;
  --text-light: #718096;
  --border:     #dde3ea;
  --white:      #ffffff;
  --radius:     6px;
  --shadow:     0 2px 8px rgba(15,32,53,0.10);
  --shadow-lg:  0 4px 20px rgba(15,32,53,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--sand);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── NAV ── */
nav {
  background: var(--navy);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.nav-brand span {
  color: var(--sky);
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  transition: all 0.15s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--white);
  background: var(--navy-light);
}

.nav-links a.btn-nav {
  background: var(--sky);
  color: var(--white);
  margin-left: 0.5rem;
}

.nav-links a.btn-nav:hover {
  background: #2d7ab0;
}

/* ── LAYOUT ── */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.page-header p {
  color: var(--text-mid);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-body {
  padding: 1.25rem;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--sky);
  color: var(--white);
}
.btn-primary:hover { background: #2d7ab0; }

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--sky-light); border-color: var(--sky); }

.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #f5c6c2;
}
.btn-danger:hover { background: var(--red); color: var(--white); }

.btn-success {
  background: var(--green);
  color: var(--white);
}
.btn-success:hover { background: #228a4e; }

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

/* ── FORMS ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input, select, textarea {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(58,143,201,0.15);
}

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

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead tr {
  background: var(--navy);
}

thead th {
  padding: 0.65rem 0.9rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:hover { background: var(--sky-light); }

tbody td {
  padding: 0.7rem 0.9rem;
  vertical-align: middle;
  color: var(--text);
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-west  { background: var(--sky-light);   color: var(--sky); }
.badge-east  { background: var(--orange-light); color: var(--orange); }
.badge-inter { background: var(--green-light);  color: var(--green); }

/* ── CHECKLIST FLAGS ── */
.flags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.flag {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  title: attr(data-label);
}

.flag.done  { background: var(--green);  color: var(--white); }
.flag.todo  { background: var(--border); color: var(--text-light); }
.flag.todo:hover { border-color: var(--sky); background: var(--sky-light); }

/* ── STATS ROW ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 0.3rem;
}

.stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.stat-value.sky   { color: var(--sky); }
.stat-value.orange { color: var(--orange); }
.stat-value.green  { color: var(--green); }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.search-bar input {
  max-width: 380px;
}

/* ── ALERT ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-error   { background: var(--red-light);   color: var(--red);   border: 1px solid #f5c6c2; }
.alert-success { background: var(--green-light);  color: var(--green); border: 1px solid #b2dfcb; }
.alert-info    { background: var(--sky-light);    color: var(--sky);   border: 1px solid #b8d9ef; }

/* ── LOGIN PAGE ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}

.login-card {
  background: var(--white);
  border-radius: 10px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
}

.login-logo h1 span { color: var(--sky); }

.login-logo p {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.login-card .form-group { margin-bottom: 1rem; }

.login-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
  padding: 0.7rem;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,32,53,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--white);
  border-radius: 8px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
}

.modal-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
  padding: 0.2rem;
}

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ── UTILITY ── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.loading { color: var(--text-light); font-style: italic; font-size: 0.9rem; padding: 1.5rem; text-align: center; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .page { padding: 1.25rem 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .nav-links a span { display: none; }
}
