/* ============================================
   BravoLog — Premium Dark Nautical Theme
   ============================================ */

:root {
  /* Core palette */
  --bg-deep: #060d18;
  --bg-primary: #0a1628;
  --bg-secondary: #0f1f38;
  --bg-card: rgba(15, 31, 56, 0.7);
  --bg-card-hover: rgba(20, 40, 72, 0.8);
  --bg-glass: rgba(15, 25, 50, 0.6);

  /* Accent */
  --gold: #d4a054;
  --gold-light: #f0c987;
  --gold-glow: rgba(212, 160, 84, 0.3);

  /* Status colors */
  --blue: #4a9eff;
  --blue-glow: rgba(74, 158, 255, 0.2);
  --teal: #2dd4bf;
  --teal-glow: rgba(45, 212, 191, 0.2);
  --rose: #f472b6;
  --rose-glow: rgba(244, 114, 182, 0.2);
  --red: #ef4444;
  --green: #22c55e;

  /* Text */
  --text-primary: #e8ecf4;
  --text-secondary: #8899b4;
  --text-muted: #5a6b85;

  /* Borders */
  --border: rgba(136, 153, 180, 0.12);
  --border-light: rgba(136, 153, 180, 0.06);

  /* Spacing */
  --nav-height: 72px;
  --topbar-height: 64px;
  --sidebar-width: 260px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --shadow-glow-gold: 0 0 30px rgba(212, 160, 84, 0.15);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea {
  font: inherit;
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238899b4' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
textarea { resize: vertical; min-height: 100px; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); font-size: 0.875rem; }

/* ---- Splash Screen ---- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.splash.fade-out { opacity: 0; visibility: hidden; }
.splash-content { text-align: center; }
.splash-icon {
  font-size: 4rem;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.splash-title {
  font-family: 'Playfair Display', serif;
  font-size: 3rem; font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0.5rem 0 0.25rem;
}
.splash-sub { color: var(--text-secondary); font-size: 1.1rem; letter-spacing: 0.1em; font-weight: 300; }
.splash-loader { width: 200px; height: 3px; background: var(--bg-secondary); border-radius: 2px; margin: 2rem auto 0; overflow: hidden; }
.loader-bar { width: 40%; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 2px; animation: load 1.2s ease-in-out infinite; }
@keyframes load {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ---- App Shell ---- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---- Top Bar ---- */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-height);
  background: rgba(6, 13, 24, 0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
}
.top-bar-left { display: flex; align-items: center; gap: 0.75rem; }
.top-bar-right { display: flex; align-items: center; gap: 0.75rem; }
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-primary);
}
.logo span {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.menu-btn {
  display: flex; flex-direction: column; gap: 5px; padding: 4px;
}
.menu-btn span {
  display: block; width: 20px; height: 2px; background: var(--text-secondary);
  border-radius: 1px; transition: 0.3s var(--ease);
}
.menu-btn:hover span { background: var(--text-primary); }

.icon-btn {
  position: relative; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-secondary);
  transition: 0.2s var(--ease);
}
.icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.notif-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); display: none;
}

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg-deep); font-weight: 700; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width); z-index: 200;
  background: rgba(8, 16, 32, 0.97);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-light);
  transform: translateX(-100%);
  transition: transform 0.35s var(--ease);
  display: flex; flex-direction: column;
}
.sidebar.open { transform: translateX(0); }
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,0.5); opacity: 0; visibility: hidden;
  transition: 0.35s var(--ease);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 700;
}
.sidebar-icon { font-size: 1.5rem; }
.sidebar-close {
  font-size: 1.25rem; color: var(--text-muted);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: 0.2s;
}
.sidebar-close:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.925rem; font-weight: 500;
  transition: 0.2s var(--ease);
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.nav-item.active {
  background: var(--gold-glow);
  color: var(--gold-light);
}
.nav-item.active svg { stroke: var(--gold-light); }

.sidebar-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-light);
}
.vessel-badge {
  display: flex; align-items: center; gap: 0.75rem;
}
.vessel-icon { font-size: 1.75rem; }
.vessel-name { font-weight: 600; font-size: 0.925rem; }
.vessel-type { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Main Content ---- */
.main-content {
  margin-top: var(--topbar-height);
  padding: 1.5rem 1.25rem calc(var(--nav-height) + 1.5rem);
  max-width: 960px;
  margin-left: auto; margin-right: auto;
  width: 100%;
}

/* ---- Views ---- */
.view { display: none; animation: fadeUp 0.35s var(--ease); }
.view.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.view-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem; font-weight: 700;
}
.view-subtitle { color: var(--text-secondary); font-size: 0.925rem; margin-top: 0.25rem; }

.back-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;
  margin-bottom: 0.5rem; padding: 0.25rem 0;
  transition: 0.2s;
}
.back-btn:hover { color: var(--gold-light); }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2rem 0 1rem;
}
.section-header h3 { font-size: 1.1rem; font-weight: 600; }
.text-btn {
  color: var(--gold); font-size: 0.875rem; font-weight: 500;
  transition: 0.2s;
}
.text-btn:hover { color: var(--gold-light); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.875rem;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #b8862e);
  color: var(--bg-deep);
  box-shadow: var(--shadow-glow-gold);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-1px);
  box-shadow: 0 0 40px rgba(212, 160, 84, 0.25);
}
.btn-ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.btn-danger-ghost {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--red);
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.8rem;
}
.btn-danger-ghost:hover { background: rgba(239,68,68,0.15); }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

/* ---- Glass Cards ---- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 1.5rem;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.glass-card:hover {
  border-color: rgba(136, 153, 180, 0.2);
}

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex; align-items: center; gap: 0.85rem;
  transition: 0.3s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon.blue { background: var(--blue-glow); color: var(--blue); }
.stat-icon.gold { background: var(--gold-glow); color: var(--gold-light); }
.stat-icon.teal { background: var(--teal-glow); color: var(--teal); }
.stat-icon.rose { background: var(--rose-glow); color: var(--rose); }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Weather Card ---- */
.weather-card { margin-bottom: 1rem; position: relative; overflow: hidden; }
.weather-card::before {
  content: '';
  position: absolute; top: -50%; right: -20%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--gold-glow), transparent 70%);
  pointer-events: none;
}
.weather-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; position: relative; }
.weather-header h3 { font-size: 0.925rem; font-weight: 600; }
.refresh-btn {
  color: var(--text-muted); padding: 4px;
  transition: 0.3s;
}
.refresh-btn:hover { color: var(--gold-light); transform: rotate(180deg); }
.weather-body { position: relative; }
.weather-main { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.weather-icon { font-size: 3rem; }
.weather-temp { font-size: 2.25rem; font-weight: 700; display: block; }
.weather-desc { color: var(--text-secondary); font-size: 0.925rem; }
.weather-details { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.weather-detail { text-align: center; }
.wd-label { display: block; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.wd-value { font-weight: 600; font-size: 0.925rem; }
.weather-location {
  display: flex; align-items: center; gap: 0.35rem;
  color: var(--text-muted); font-size: 0.8rem;
  margin-top: 1rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  position: relative;
}

/* ---- Trips / Cards ---- */
.trip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.trip-card::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(to bottom, var(--gold), var(--gold-light));
  opacity: 0; transition: 0.3s;
}
.trip-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(212, 160, 84, 0.2); }
.trip-card:hover::after { opacity: 1; }
.trip-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.trip-card-title { font-weight: 600; font-size: 1.05rem; }
.trip-card-date { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.trip-card-route { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 0.75rem; }
.trip-card-route svg { display: inline; vertical-align: middle; margin: 0 0.25rem; }
.trip-card-stats {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
}
.trip-stat { font-size: 0.8rem; }
.trip-stat span { color: var(--text-muted); }
.trip-stat strong { color: var(--text-primary); margin-left: 0.25rem; }

/* Trip photos in card */
.trip-card-photos {
  display: flex; gap: 0.5rem; margin-top: 0.75rem; overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.trip-card-photos::-webkit-scrollbar { display: none; }
.trip-card-thumb {
  width: 56px; height: 56px; border-radius: var(--radius-sm); flex-shrink: 0;
  object-fit: cover; border: 1px solid var(--border);
}

/* ---- Trip Detail ---- */
.detail-hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 1.5rem; min-height: 120px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  border: 1px solid var(--border);
  padding: 2rem 1.5rem;
}
.detail-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(212,160,84,0.08), transparent);
}
.detail-route {
  position: relative; z-index: 1;
  font-size: 1.1rem; font-weight: 600;
  display: flex; align-items: center; gap: 0.5rem;
}
.detail-route .arrow { color: var(--gold); }
.detail-date { position: relative; z-index: 1; color: var(--text-secondary); font-size: 0.875rem; margin-top: 0.35rem; }

.detail-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.detail-stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1rem;
}
.detail-stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.25rem; }
.detail-stat-value { font-size: 1.15rem; font-weight: 700; }

.detail-section { margin-bottom: 1.5rem; }
.detail-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }
.detail-notes {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.15rem;
  color: var(--text-secondary); font-size: 0.925rem; line-height: 1.7;
  white-space: pre-wrap;
}
.detail-crew-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.crew-tag {
  background: rgba(74,158,255,0.1); border: 1px solid rgba(74,158,255,0.2);
  color: var(--blue); padding: 0.35rem 0.85rem; border-radius: 100px;
  font-size: 0.825rem; font-weight: 500;
}

.detail-photos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.detail-photo {
  aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); transition: 0.3s;
}
.detail-photo:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Filters ---- */
.filters-bar {
  display: flex; gap: 0.75rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.search-input {
  flex: 1; min-width: 200px;
  background: rgba(255,255,255,0.04);
  padding-left: 1rem;
}
.filter-select { width: auto; min-width: 150px; flex-shrink: 0; }

/* ---- Forms ---- */
.trip-form { margin-bottom: 2rem; }
.form-section { margin-bottom: 2rem; }
.form-section-title {
  font-size: 1rem; font-weight: 600; margin-bottom: 1rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-light);
  color: var(--gold-light);
}
.form-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form-actions {
  display: flex; gap: 1rem; justify-content: flex-end;
  padding-top: 1.5rem; border-top: 1px solid var(--border-light);
}

/* ---- Photo Upload ---- */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  transition: 0.3s;
  cursor: pointer;
  overflow: hidden;
}
.photo-upload-area.drag-over {
  border-color: var(--gold);
  background: var(--gold-glow);
}
.upload-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  text-align: center;
}
.upload-placeholder svg { margin-bottom: 0.75rem; opacity: 0.5; }
.upload-placeholder p { font-weight: 500; font-size: 0.925rem; }
.upload-hint { font-size: 0.75rem; margin-top: 0.25rem; }

.photo-preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem; padding: 0.75rem;
}
.photo-preview-grid:empty { display: none; }
.photo-preview-item {
  position: relative; aspect-ratio: 1;
  border-radius: var(--radius-sm); overflow: hidden;
}
.photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-remove {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.7); color: white; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: 0.2s;
}
.photo-preview-item:hover .photo-preview-remove { opacity: 1; }

/* ---- Photo Gallery ---- */
.photo-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.gallery-item {
  aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden;
  cursor: pointer; position: relative;
  border: 1px solid var(--border);
  transition: 0.3s var(--ease);
}
.gallery-item:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  font-size: 0.75rem; color: rgba(255,255,255,0.8);
}

/* ---- Crew ---- */
.crew-list { display: flex; flex-direction: column; gap: 0.75rem; }
.crew-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex; align-items: center; gap: 1rem;
  transition: 0.3s;
}
.crew-card:hover { border-color: rgba(136, 153, 180, 0.2); }
.crew-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
  background: linear-gradient(135deg, var(--blue), #2563eb);
  color: white;
}
.crew-info { flex: 1; }
.crew-name { font-weight: 600; }
.crew-role { font-size: 0.825rem; color: var(--text-muted); }
.crew-trips { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.15rem; }
.crew-actions { display: flex; gap: 0.35rem; }
.crew-delete {
  color: var(--text-muted); width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: 0.2s; font-size: 1.1rem;
}
.crew-delete:hover { background: rgba(239,68,68,0.1); color: var(--red); }

/* ---- Crew picker in form ---- */
.crew-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.crew-chip {
  padding: 0.45rem 0.85rem; border-radius: 100px;
  font-size: 0.825rem; font-weight: 500; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-secondary); transition: 0.2s;
  user-select: none;
}
.crew-chip.selected {
  background: rgba(74,158,255,0.15); border-color: rgba(74,158,255,0.3);
  color: var(--blue);
}

/* ---- Maintenance ---- */
.engine-summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-bottom: 1.25rem; text-align: center;
}
.engine-value { font-size: 1.5rem; font-weight: 700; display: block; color: var(--gold-light); }
.engine-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.maintenance-list { display: flex; flex-direction: column; gap: 0.75rem; }
.maint-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.15rem;
  display: flex; gap: 1rem; align-items: flex-start;
}
.maint-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
  background: rgba(255,255,255,0.05);
}
.maint-info { flex: 1; }
.maint-title { font-weight: 600; font-size: 0.925rem; }
.maint-desc { font-size: 0.825rem; color: var(--text-secondary); margin-top: 0.15rem; }
.maint-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.maint-delete { color: var(--text-muted); font-size: 1.1rem; transition: 0.2s; }
.maint-delete:hover { color: var(--red); }

/* ---- Settings ---- */
.settings-content { display: flex; flex-direction: column; gap: 1.25rem; }
.settings-section h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 1.25rem; color: var(--gold-light); }
.settings-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---- Bottom Nav ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height);
  background: rgba(6, 13, 24, 0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  color: var(--text-muted); font-size: 0.65rem; font-weight: 500;
  padding: 0.5rem 0.75rem;
  transition: 0.2s;
}
.bnav-item.active { color: var(--gold-light); }
.bnav-item.active svg { stroke: var(--gold-light); }

.bnav-fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #b8862e);
  color: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  margin-top: -20px;
  box-shadow: 0 4px 20px rgba(212, 160, 84, 0.35);
  transition: 0.3s var(--ease);
}
.bnav-fab:hover { transform: scale(1.08); box-shadow: 0 6px 30px rgba(212, 160, 84, 0.45); }

/* Desktop FAB */
.fab {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 90;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #b8862e);
  color: var(--bg-deep);
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(212, 160, 84, 0.35);
  transition: 0.3s var(--ease);
}
.fab:hover { transform: scale(1.08) rotate(90deg); box-shadow: 0 8px 40px rgba(212, 160, 84, 0.45); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.active { display: flex; }
.modal {
  width: 100%; max-width: 480px; max-height: 85vh;
  overflow-y: auto; animation: modalIn 0.3s var(--ease-spring);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 1.25rem; }
.modal .form-group { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.95);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 100%; max-height: 85vh; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: white;
  font-size: 1.25rem; display: flex; align-items: center; justify-content: center;
}
.lightbox-caption {
  position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.7); font-size: 0.875rem; text-align: center;
}

/* ---- Toast ---- */
.toast-container {
  position: fixed; top: calc(var(--topbar-height) + 0.75rem);
  right: 1rem; z-index: 400;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.85rem 1.25rem;
  font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s var(--ease-spring);
  display: flex; align-items: center; gap: 0.5rem;
  min-width: 250px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.fade-out { animation: toastOut 0.3s var(--ease) forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ---- Empty States ---- */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state p { margin-bottom: 1rem; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(136, 153, 180, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(136, 153, 180, 0.25); }

/* ============ RESPONSIVE ============ */

/* Tablet+ */
@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-gallery { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .detail-grid { grid-template-columns: repeat(4, 1fr); }
  .detail-photos-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* Desktop */
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .fab { display: flex; }
  .main-content {
    padding-bottom: 3rem;
    max-width: 1000px;
  }
  .menu-btn { display: none; }
  .sidebar {
    transform: translateX(0);
    top: var(--topbar-height);
    width: var(--sidebar-width);
  }
  .sidebar-header { display: none; }
  .sidebar-overlay { display: none !important; }
  .main-content {
    margin-left: var(--sidebar-width);
    max-width: calc(100% - var(--sidebar-width));
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
  .top-bar { left: var(--sidebar-width); }
}

/* Small phones */
@media (max-width: 374px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .weather-details { grid-template-columns: repeat(2, 1fr); }
  .engine-summary { grid-template-columns: 1fr; }
}
