/* ============================================================
   FishTrack — styles.css  (Deep ocean / slate blue theme)
   Base:  navy #0B1220 / elevated #141B2E
   Accent: ocean blue #38BDF8  ·  amber kept for warnings
   Text:  #EEF2F7 primary · #8CA0B8 muted
   Look:  dark frosted glass cards on a near-black navy field.
   ============================================================ */

:root {
  /* Brand blues (kept for logo + a few accents) */
  --deep-sea: #1E3A5F;
  --deep-sea-deep: #14283F;

  /* Navy surfaces */
  --bg: #0B1220;
  --bg-2: #080D18;
  --surface: #141B2E;
  --surface-2: #1B2540;

  /* Ocean accent scale */
  --ocean: #38BDF8;
  --ocean-bright: #7DD3FC;
  --ocean-deep: #0EA5E9;
  --ocean-dim: rgba(56, 189, 248, 0.14);
  --ocean-dim-2: rgba(56, 189, 248, 0.22);

  /* Supporting */
  --amber: #E0B23C;
  --amber-deep: #C7922A;
  --ember: #E0673C;
  --danger: #E0673C;
  --slate: #7C93B3;
  --ok: #38BDF8;

  /* Text */
  --ink: #EEF2F7;
  --stone: #8CA0B8;
  --line: rgba(255, 255, 255, 0.10);

  --radius: 16px;
  --radius-sm: 10px;

  /* Dark glass surfaces */
  --glass-bg: rgba(20, 28, 48, 0.55);
  --glass-bg-strong: rgba(15, 21, 38, 0.85);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-blur: blur(18px);
  --shadow-glass: 0 8px 30px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-pop: 0 24px 70px rgba(0, 0, 0, 0.55);

  --font-display: "Bitter", Georgia, serif;
  --font-body: "Public Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --waves: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke='%2338BDF8' stroke-opacity='0.06' stroke-width='1.5'%3E%3Cpath d='M-10 40c30 20 60 20 90 0s60-20 90 0 60 20 90 0'/%3E%3Cpath d='M-10 90c30 20 60 20 90 0s60-20 90 0 60 20 90 0'/%3E%3Cpath d='M-10 140c30 20 60 20 90 0s60-20 90 0 60 20 90 0'/%3E%3Cpath d='M-10 190c30 20 60 20 90 0s60-20 90 0 60 20 90 0'/%3E%3Cpath d='M-10 235c30 15 60 15 90 0s60-15 90 0 60 15 90 0'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

body {
  background: var(--bg);
  position: relative;
  min-height: 100vh;
}

/* Subtle blue glow wash over the navy — gives the glass something to
   pick up. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(700px 520px at 6% -8%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(760px 620px at 100% 4%, rgba(30, 58, 95, 0.18), transparent 55%),
    radial-gradient(900px 760px at 30% 108%, rgba(56, 189, 248, 0.08), transparent 55%),
    var(--bg);
}

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0 0 .35em; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p  { margin: 0 0 .8em; }
a  { color: var(--ocean); }

.mono { font-family: var(--font-mono); font-size: .85em; }
.muted { color: var(--stone); }
.small { font-size: .85rem; }

/* ---------- Brand mark ---------- */
.brand-mark { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-mark svg { display: block; }
.wordmark-fish { color: inherit; }
.wordmark-track { color: var(--ocean); }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 244px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0F1830 0%, var(--bg-2) 100%);
  background-image: var(--waves), linear-gradient(180deg, #0F1830 0%, var(--bg-2) 100%);
  border-right: 1px solid var(--line);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
}
.brand .wordmark-fish { color: #fff; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  color: #c3ccd6;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active {
  background: var(--ocean-dim);
  border: 1px solid var(--ocean-dim-2);
  color: var(--ocean-bright);
  font-weight: 600;
}
.nav a:focus-visible { outline: 2px solid var(--ocean); outline-offset: 2px; }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; font-size: .85rem; color: var(--stone); }
.settings-link {
  display: flex; align-items: center; gap: 8px;
  color: #c3ccd6; text-decoration: none; font-weight: 500; font-size: .9rem;
  padding: 8px 10px; border-radius: var(--radius-sm); margin-bottom: 8px;
}
.settings-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.settings-link.active { background: var(--ocean-dim); color: var(--ocean-bright); font-weight: 600; }
.sidebar-foot button {
  margin-top: 8px; width: 100%;
  background: rgba(255, 255, 255, .05); color: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px; cursor: pointer; font-family: var(--font-body);
}
.sidebar-foot button:hover { background: rgba(255, 255, 255, .12); }

/* Full-width main content — fills the viewport instead of hugging left.
   Content caps at a wide, comfortable width and centers on ultrawide
   screens, but on typical laptops it uses essentially the whole area. */
.main { flex: 1; padding: 30px 40px 64px; width: 100%; max-width: 1500px; margin: 0 auto; }

.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }

/* ---------- Glass cards & grids ---------- */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glass);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.dash-grid { grid-template-columns: 2fr 1fr; }
.dash-grid > * { min-width: 0; }
.stats-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ---------- Recent Catches feed (dashboard) ---------- */
.catch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.catch-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.catch-photo { width: 100%; height: 130px; object-fit: cover; display: block; cursor: pointer; }
.catch-photo-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; background: rgba(56, 189, 248, 0.08); color: var(--ocean);
}
.catch-card-body { padding: 10px 12px; }

/* ---------- Catch Leaderboard ---------- */
.leaderboard-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 10px; margin-bottom: 8px;
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}
.leaderboard-rank {
  width: 34px; flex-shrink: 0; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--stone);
}
.leaderboard-medal { font-size: 1.5rem; line-height: 1; display: block; }
.leaderboard-photo {
  width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm);
  cursor: pointer; flex-shrink: 0; border: 1px solid var(--line);
}
.leaderboard-photo-empty {
  width: 64px; height: 64px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  background: rgba(56, 189, 248, 0.08); color: var(--ocean);
}
.leaderboard-row.rank-1 { border-color: rgba(255, 215, 0, 0.5); background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), transparent 60%); }
.leaderboard-row.rank-2 { border-color: rgba(192, 192, 192, 0.5); background: linear-gradient(90deg, rgba(192, 192, 192, 0.12), transparent 60%); }
.leaderboard-row.rank-3 { border-color: rgba(205, 127, 50, 0.5); background: linear-gradient(90deg, rgba(205, 127, 50, 0.14), transparent 60%); }
.leaderboard-row.rank-1 .leaderboard-rank { color: #FFD700; }
.leaderboard-row.rank-2 .leaderboard-rank { color: #C0C0C0; }
.leaderboard-row.rank-3 .leaderboard-rank { color: #CD7F32; }
.live-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--stone); }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ocean);
  animation: live-pulse 1.6s ease-in-out infinite;
}
.live-dot.offline { background: var(--stone); animation: none; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- Lure Suggestions ---------- */
.suggestion-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--line);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-icon { font-size: 1.3rem; line-height: 1.4; }
.suggestion-technique {
  display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ocean-bright); margin-bottom: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ocean); color: #0B1220;
  border: none; border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: .93rem; font-weight: 700;
  font-family: var(--font-body); cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--ocean-bright); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--ocean); outline-offset: 2px; }
.btn-amber { background: var(--ocean); color: #0B1220; }
.btn-amber:hover { background: var(--ocean-bright); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  color: var(--ink); border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.10); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: .82rem; }

.btn-oauth {
  width: 100%; justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  color: var(--ink); border: 1px solid var(--line);
  font-weight: 600; padding: 10px 16px;
}
.btn-oauth:hover { background: rgba(255, 255, 255, 0.12); }
.btn-oauth svg { flex-shrink: 0; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .87rem; margin: 12px 0 4px; color: var(--ink); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: .95rem;
  font-family: var(--font-body);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #6d7784; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ocean); border-color: var(--ocean); background: rgba(255, 255, 255, 0.07); }
textarea { min-height: 90px; resize: vertical; }
select option { background: var(--surface); color: var(--ink); }
input[type="date"], input[type="time"], input[type="number"] { color-scheme: dark; }
select { color-scheme: dark; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; }
.field-hint { font-size: .8rem; color: var(--stone); margin-top: 3px; }

/* ---------- Password strength checklist ---------- */
.pw-checklist { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 4px; }
.pw-rule { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--stone); transition: color .15s; }
.pw-rule-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; font-size: .85rem; }
.pw-rule-ok { color: var(--ocean-bright); }

/* ---------- public footer ---------- */
.app-footer {
  text-align: center; padding: 22px 12px 26px; font-size: .75rem; color: var(--stone);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.app-footer-links { display: inline-flex; align-items: center; gap: 8px; }
.app-footer-links button {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  font-family: var(--font-body); font-size: .75rem; color: var(--stone); text-decoration: underline;
}
.app-footer-links button:hover { color: var(--ocean-bright); }

/* ---------- Toggle switch ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,0.15); border-radius: 99px; transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--ocean); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--ocean); outline-offset: 2px; }

.switch-sm { width: 34px; height: 20px; }
.switch-sm .slider::before { height: 14px; width: 14px; }
.switch-sm input:checked + .slider::before { transform: translateX(14px); }

.switch-field { display: inline-flex; align-items: center; gap: 8px; }
.switch-field label:not(.switch) { margin: 0; font-weight: 400; cursor: pointer; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; font-size: .74rem; font-weight: 700;
  padding: 3px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em;
}
.badge-upcoming { background: var(--ocean-dim); color: var(--ocean-bright); }
.badge-past { background: rgba(140, 160, 184, 0.15); color: var(--stone); }
.badge-active { background: var(--ocean); color: #0B1220; }
.badge-routine { background: rgba(124, 147, 179, 0.20); color: #a9c2da; }
.badge-repair { background: rgba(224, 103, 60, 0.18); color: #f0a184; }
.badge-public { background: var(--ocean-dim); color: var(--ocean-bright); }
.badge-hookup { background: rgba(124, 147, 179, 0.20); color: #a9c2da; }

/* ---------- Lists / tables ---------- */
.item-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: none; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--stone); padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* ---------- Avatars (profile picture, attribution) ---------- */
.avatar-picker { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.avatar-picker-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-img {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); background: rgba(255,255,255,0.06); flex-shrink: 0;
}
.avatar-img.avatar-sm { width: 28px; height: 28px; }
.avatar-img.avatar-md { width: 44px; height: 44px; }
.avatar-attribution { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.avatar-attribution a { font-weight: 600; color: var(--ocean-bright); text-decoration: none; }
.avatar-attribution a:hover { text-decoration: underline; }

/* ---------- Photos ---------- */
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-strip img {
  width: 92px; height: 92px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--line); cursor: pointer;
}
.photo-lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .88);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 60; cursor: zoom-out;
}
.photo-lightbox img { max-width: 92vw; max-height: 90vh; border-radius: var(--radius); }

/* ---------- Checklist (tackle box) ---------- */
.pack-item { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed var(--line); }
.pack-item .switch-field { flex: 1; }
.pack-item.done .switch-field label:not(.switch) { text-decoration: line-through; color: var(--stone); }
.pack-progress { height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.pack-progress > div { height: 100%; background: var(--ocean); border-radius: 99px; transition: width .25s; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; z-index: 50; overflow-y: auto;
}
.modal {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  width: 100%; max-width: 560px; padding: 22px 24px;
  box-shadow: var(--shadow-pop);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--stone); line-height: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  color: #fff;
  padding: 11px 20px; border-radius: 99px; font-size: .9rem;
  box-shadow: var(--shadow-glass); z-index: 70; opacity: 0; transition: opacity .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--stone); grid-column: 1 / -1; }
.empty .tent { font-size: 2.2rem; display: block; margin-bottom: 6px; }

/* ---------- Auth (login) page ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative;
  background:
    radial-gradient(680px 540px at 14% 0%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(820px 680px at 100% 100%, rgba(30, 58, 95, 0.30), transparent 55%),
    linear-gradient(160deg, #0F1830 0%, var(--bg-2) 78%);
  background-image:
    var(--waves),
    radial-gradient(680px 540px at 14% 0%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(820px 680px at 100% 100%, rgba(30, 58, 95, 0.30), transparent 55%),
    linear-gradient(160deg, #0F1830 0%, var(--bg-2) 78%);
  padding: 24px;
}
.auth-card {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px; padding: 34px 34px 30px; width: 100%; max-width: 430px;
  box-shadow: var(--shadow-pop);
}
.auth-brand { text-align: center; margin-bottom: 6px; color: #fff; }
.auth-brand .brand-mark { margin-bottom: 6px; }
.auth-brand h1 { margin: 8px 0 2px; font-size: 2rem; }
.auth-tagline {
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ocean); margin: 0 0 4px;
}
.auth-tabs { display: flex; gap: 6px; margin: 18px 0 4px; background: rgba(255, 255, 255, 0.05); border-radius: var(--radius-sm); padding: 4px; }
.auth-tabs button {
  flex: 1; border: none; background: transparent; padding: 9px;
  border-radius: 8px; font-weight: 600; cursor: pointer; font-family: var(--font-body); color: var(--stone);
}
.auth-tabs button.active { background: var(--ocean); color: #0B1220; box-shadow: var(--shadow-glass); }
.auth-error { background: rgba(224, 103, 60, 0.16); color: #f0a184; border-radius: var(--radius-sm); padding: 9px 12px; font-size: .87rem; margin-top: 12px; display: none; }
.auth-error.show { display: block; }
.auth-note { font-size: .78rem; color: var(--stone); margin-top: 16px; text-align: center; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--stone); font-size: .78rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.oauth-stack { display: flex; flex-direction: column; gap: 10px; }
#googleBtnContainer { display: flex; justify-content: center; }

/* ---------- Stat tiles ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat-tile {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}
.stat-tile .stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--ocean); line-height: 1.1; }
.stat-tile .stat-label { font-size: .78rem; color: var(--stone); margin-top: 2px; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .filter-field { min-width: 150px; flex: 1; }
.filter-bar label { margin: 0 0 4px; }
.filter-bar select, .filter-bar input { margin: 0; }

/* ---------- Mobile top bar & sidebar drawer (hidden on desktop) ---------- */
.mobile-topbar { display: none; }
.sidebar-close { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 820px) {
  .shell { flex-direction: column; }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 40;
    background: linear-gradient(180deg, #0F1830 0%, var(--bg-2) 100%);
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .mobile-topbar .brand { padding: 0; font-size: 1.05rem; }
  #mobileMenuBtn {
    background: rgba(255,255,255,0.08); border: 1px solid var(--line); color: #fff;
    font-size: 1.3rem; line-height: 1; border-radius: var(--radius-sm);
    width: 44px; height: 44px; cursor: pointer;
  }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 82vw; max-width: 300px;
    transform: translateX(-105%); transition: transform .25s ease;
    z-index: 60; flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    border-right: 1px solid var(--line); border-bottom: none;
    padding: 20px 14px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 40px rgba(0,0,0,.5); }
  .sidebar-close {
    display: block; align-self: flex-end; background: none; border: none;
    color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; padding: 4px 8px;
  }
  .sidebar .brand { padding: 0 8px 16px; }
  .nav { flex-direction: column; flex-wrap: nowrap; gap: 4px; }
  .nav a { padding: 12px; font-size: 1rem; }
  .sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; display: block; margin-left: 0; }
  .sidebar-foot .who { display: block; margin: 10px 0; }
  .settings-link { padding: 10px 12px; font-size: 1rem; }

  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55;
  }
  .sidebar-backdrop.show { display: block; }

  .main { padding: 16px 14px 60px; }

  .btn, input, select { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  input, select, textarea { font-size: 16px; } /* prevents iOS auto-zoom on focus */

  .form-row { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- FishTrack Assistant (floating chat widget) ---------- */
.assistant-bubble {
  position: fixed; bottom: 22px; right: 22px; z-index: 45;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--ocean); color: #0B1220; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-pop);
}
.assistant-bubble:hover { background: var(--ocean-bright); }
.assistant-panel {
  position: fixed; bottom: 22px; right: 22px; z-index: 45;
  width: min(360px, calc(100vw - 32px)); height: min(480px, calc(100vh - 100px));
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  flex-direction: column; overflow: hidden;
}
.assistant-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; font-weight: 700; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.assistant-close { background: none; border: none; font-size: 1.3rem; color: var(--stone); cursor: pointer; line-height: 1; }
.assistant-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.assistant-msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; font-size: .88rem; line-height: 1.4; }
.assistant-msg-user { align-self: flex-end; background: var(--ocean-dim); color: var(--ocean-bright); white-space: pre-wrap; }
.assistant-msg-bot { align-self: flex-start; background: rgba(255,255,255,0.06); }
.assistant-msg-bot p, .assistant-msg-bot ul { margin: 0 0 8px; }
.assistant-msg-bot p:last-child, .assistant-msg-bot ul:last-child { margin-bottom: 0; }
.assistant-msg-bot ul { padding-left: 18px; }
.assistant-msg-bot li { margin-bottom: 2px; }
.assistant-typing { display: flex; align-items: center; gap: 4px; padding: 12px; }
.assistant-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--stone);
  animation: assistant-typing-bounce 1.2s infinite ease-in-out;
}
.assistant-typing span:nth-child(2) { animation-delay: .15s; }
.assistant-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes assistant-typing-bounce {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.assistant-input-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex-shrink: 0; }
.assistant-input { flex: 1; margin: 0; }
