/* ═══════════════════════════════════════════════════════════
   SAILING LOGBOOK — Marine Theme Stylesheet
   ═══════════════════════════════════════════════════════════ */

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

/* ── Theme Variables ──────────────────────────────────────── */
:root {
  --primary: #0D47A1;
  --primary-light: #1976D2;
  --primary-lighter: #42A5F5;
  --primary-dark: #0A2342;
  --accent: #00838F;
  --accent-light: #26C6DA;
  --bg: #EEF2F7;
  --bg-alt: #E3EBF3;
  --surface: #FFFFFF;
  --surface-hover: #F5F8FC;
  --surface-border: #D6E0EA;
  --text: #1A2332;
  --text-sec: #546E7A;
  --text-ter: #90A4AE;
  --text-inv: #FFFFFF;
  --success: #2E7D32;
  --error: #C62828;
  --shadow-sm: 0 1px 3px rgba(10,35,66,.08);
  --shadow-md: 0 4px 14px rgba(10,35,66,.10);
  --shadow-lg: 0 8px 28px rgba(10,35,66,.14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --nav-h: 64px;
  --feed-w: 660px;
  --transition: 250ms ease;
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Playfair Display', serif;
}

[data-theme="dark"] {
  --primary: #42A5F5;
  --primary-light: #64B5F6;
  --primary-lighter: #90CAF9;
  --primary-dark: #1565C0;
  --accent: #00ACC1;
  --accent-light: #4DD0E1;
  --bg: #060E1A;
  --bg-alt: #0A1628;
  --surface: #0D2137;
  --surface-hover: #132D4A;
  --surface-border: #1A3A5C;
  --text: #E0E8F0;
  --text-sec: #90A4AE;
  --text-ter: #607D8B;
  --text-inv: #1A2332;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.45);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); color: var(--text); line-height: 1.3; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }

/* ── Navigation ───────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--primary-dark);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
[data-theme="dark"] .navbar { background: #0A1929; }
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
}
.nav-brand span.icon { font-size: 1.5rem; }
.nav-toggle {
  display: none;            /* hidden on desktop; shown on mobile via media query */
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.1); border: none; cursor: pointer;
  color: #fff; font-size: 1.35rem; align-items: center; justify-content: center;
}
.nav-toggle:hover { background: rgba(255,255,255,.2); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a, .nav-links button {
  color: rgba(255,255,255,.85); background: none; border: none; cursor: pointer;
  font: 500 .875rem var(--font); padding: 8px 14px; border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.nav-links a:hover, .nav-links button:hover {
  background: rgba(255,255,255,.12); color: #fff; text-decoration: none;
}
.nav-links .user-badge {
  background: rgba(255,255,255,.15); border-radius: var(--radius-full);
  padding: 4px 14px 4px 4px; display: flex; align-items: center; gap: 8px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-light); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .8rem; flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; }

/* ── Language Toggle ──────────────────────────────────────── */
.lang-toggle {
  height: 28px; padding: 0 11px; border-radius: var(--radius-full);
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  cursor: pointer; color: rgba(255,255,255,.9);
  font: 700 .72rem var(--font); letter-spacing: .8px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.lang-toggle:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ── Theme Toggle ─────────────────────────────────────────── */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: none; cursor: pointer;
  color: #fff; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.theme-toggle:hover { background: rgba(255,255,255,.2); }

/* ── Notification Toggle Switch ──────────────────────────── */
.notify-switch {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.85); font-size: .8rem; font-weight: 500;
  transition: background var(--transition); user-select: none;
}
.notify-switch:hover { background: rgba(255,255,255,.12); }
.notify-switch.blocked { cursor: not-allowed; opacity: .45; pointer-events: none; }
.notify-switch-label { white-space: nowrap; }
.notify-track {
  width: 36px; height: 20px; border-radius: 10px;
  background: rgba(255,255,255,.25); position: relative; flex-shrink: 0;
  transition: background var(--transition);
}
.notify-switch.on .notify-track { background: #4CAF50; }
.notify-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  position: absolute; top: 2px; left: 2px;
  transition: transform var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.notify-switch.on .notify-thumb { transform: translateX(16px); }
@media (max-width: 768px) { .notify-switch-label { display: none; } }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border: none; border-radius: var(--radius-sm);
  font: 600 .875rem var(--font); cursor: pointer;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--surface-border);
}
.btn-secondary:hover { border-color: var(--primary); background: var(--surface-hover); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: transparent; border: none; color: var(--text-sec);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-alt); color: var(--primary); }

/* ── Forms & Inputs ───────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-weight: 500; font-size: .85rem;
  color: var(--text-sec); margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg); border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm); color: var(--text);
  font: 400 .9rem var(--font); transition: border var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25,118,210,.15);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-select { cursor: pointer; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--surface-border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

/* ── Login Page ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0A2342 0%, #0D47A1 50%, #1565C0 100%);
  position: relative; overflow: hidden;
}
[data-theme="dark"] .auth-page {
  background: linear-gradient(135deg, #030810 0%, #0A1628 50%, #0D2137 100%);
}
.auth-page::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 120px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120'%3E%3Cpath fill='%23ffffff' fill-opacity='0.08' d='M0,64L48,58.7C96,53,192,43,288,48C384,53,480,75,576,80C672,85,768,75,864,64C960,53,1056,43,1152,48C1248,53,1344,75,1392,85.3L1440,96L1440,120L0,120Z'/%3E%3C/svg%3E") no-repeat bottom;
  background-size: cover;
}
.auth-card {
  width: 100%; max-width: 420px; padding: 40px;
  background: var(--surface); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  position: relative; z-index: 1;
  animation: fadeUp .5s ease;
}
.auth-card .logo { text-align: center; margin-bottom: 28px; }
.auth-card .logo .icon { font-size: 2.5rem; margin-bottom: 8px; }
.auth-card .logo h1 { font-size: 1.5rem; color: var(--text); }
.auth-card .logo p { color: var(--text-sec); font-size: .9rem; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .85rem; color: var(--text-sec); }
.auth-footer a { font-weight: 600; }
.alert {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: .85rem;
  margin-bottom: 16px; display: none;
}
.alert-error { background: #FFEBEE; color: var(--error); border: 1px solid #EF9A9A; }
[data-theme="dark"] .alert-error { background: rgba(198,40,40,.15); border-color: rgba(198,40,40,.3); }
.alert-success { background: #E8F5E9; color: var(--success); border: 1px solid #A5D6A7; }
[data-theme="dark"] .alert-success { background: rgba(46,125,50,.15); border-color: rgba(46,125,50,.3); }

/* ── Main Layout ──────────────────────────────────────────── */
.main-content {
  max-width: var(--feed-w); margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ── Map Section ──────────────────────────────────────────── */
.map-section {
  margin-bottom: 24px;
}
.map-container {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--surface-border);
  overflow: hidden;
}
.map-header {
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--surface-border);
}
.map-header h2 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
#map {
  width: 100%; height: 350px; background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-ter); font-size: .9rem;
}
.map-placeholder {
  text-align: center; padding: 40px;
}
.map-placeholder .icon { font-size: 3rem; margin-bottom: 12px; opacity: .5; }
.map-placeholder p { color: var(--text-sec); font-size: .85rem; max-width: 300px; margin: 0 auto; }
.map-toggle-btn {
  font-size: .8rem; padding: 6px 12px; border-radius: var(--radius-full);
  background: var(--bg); border: 1px solid var(--surface-border);
  color: var(--text-sec); cursor: pointer; transition: all var(--transition);
}
.map-toggle-btn:hover { border-color: var(--primary); color: var(--primary); }
.map-style-select {
  font-size: .78rem; padding: 5px 10px; border-radius: var(--radius-full);
  background: var(--bg); border: 1px solid var(--surface-border);
  color: var(--text-sec); cursor: pointer; transition: all var(--transition);
  font-family: var(--font);
}
.map-style-select:hover { border-color: var(--primary); color: var(--primary); }
.map-style-select:focus { outline: none; border-color: var(--primary); }
/* Custom expand — fills the viewport below the navbar (top menu stays visible) */
.map-section.map-expanded {
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
  margin: 0; z-index: 90;
}
.map-section.map-expanded .map-container {
  height: 100%; border-radius: 0; border: none;
  display: flex; flex-direction: column;
}
.map-section.map-expanded #map { flex: 1 1 auto; height: auto; }
body.map-locked { overflow: hidden; }

/* ── Create Post ──────────────────────────────────────────── */
.create-post {
  padding: 20px; margin-bottom: 20px;
}
/* Collapsed entry trigger (opens the entry modal) */
.create-entry-trigger {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 18px 22px; margin-bottom: 20px; cursor: pointer; text-align: left;
  font-family: var(--font); font-size: 1.05rem; font-weight: 600; color: inherit;
}
.create-entry-trigger:hover { border-color: var(--primary); }
.create-entry-trigger .create-entry-plus {
  margin-left: auto; font-size: 1.5rem; line-height: 1; color: var(--primary); font-weight: 700;
}
.create-post-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.create-post-header h2 { font-size: 1.05rem; font-family: var(--font); font-weight: 600; }
.location-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}
.location-detect {
  grid-column: 1 / -1;
  display: flex; gap: 8px; align-items: center; margin-bottom: 4px;
}
.file-upload {
  position: relative; display: flex; align-items: center; gap: 10px;
}
.file-upload input[type="file"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.file-upload-label {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--surface-border);
  color: var(--text-sec); font-size: .85rem; cursor: pointer;
  transition: all var(--transition);
}
.file-upload-label:hover { border-color: var(--primary); color: var(--primary); }
.file-upload .file-name { font-size: .8rem; color: var(--text-sec); }
.create-post-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px;
}

/* ── Post Cards ───────────────────────────────────────────── */
.post-card { margin-bottom: 20px; overflow: hidden; }
/* Discreet GPS "jump to marker" button on a post */
.post-gps-btn {
  margin-left: auto;            /* sits quietly at the far right of the action bar */
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: none; border: none; cursor: pointer; color: var(--text-ter);
  transition: background var(--transition), color var(--transition);
}
.post-gps-btn:hover { background: var(--bg-alt); color: var(--primary); }
.post-card-header {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 0;
}
.post-author-info { flex: 1; }
.post-author-name { font-weight: 600; font-size: .9rem; }
.post-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; color: var(--text-ter); margin-top: 2px;
}
.post-meta .dot { width: 3px; height: 3px; background: var(--text-ter); border-radius: 50%; }
.post-location { display: flex; align-items: center; gap: 3px; }
.post-body { padding: 12px 18px; }
.post-title { font-family: var(--font); font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.post-content { font-size: .9rem; color: var(--text-sec); white-space: pre-wrap; }
.post-image {
  margin: 8px 18px 0; border-radius: var(--radius-sm); overflow: hidden;
  max-height: 450px;
}
.post-image img, .post-image video { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px; margin: 8px 18px 0; border-radius: var(--radius-sm); overflow: hidden;
}
.post-media-grid img, .post-media-grid video {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  display: block; border-radius: 4px;
}
.post-actions-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 18px; border-top: 1px solid var(--surface-border);
  margin-top: 12px;
}
.post-action-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--text-sec);
  font: 500 .82rem var(--font); cursor: pointer;
  padding: 8px 14px; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.post-action-btn:hover { background: var(--bg-alt); color: var(--primary); }
.post-action-btn .count { font-weight: 600; }
.delete-post-btn { margin-left: auto; color: var(--text-ter); }
.delete-post-btn:hover { color: var(--error) !important; background: rgba(198,40,40,.08) !important; }
.post-like-btn { color: var(--text-ter); font-size: .82rem; }
.post-like-btn:hover { background: rgba(220,50,80,.08) !important; color: #e05070 !important; }
.post-like-btn.liked { color: #e0304a; }
.post-like-btn .heart { font-style: normal; transition: transform .15s; display: inline-block; }
.post-like-btn:active .heart { transform: scale(1.35); }

/* ── Comments ─────────────────────────────────────────────── */
.comments-section { border-top: 1px solid var(--surface-border); }
.comments-list { padding: 12px 18px 4px; }
.comment-item {
  display: flex; gap: 10px; padding: 8px 0;
}
.comment-bubble {
  flex: 1; background: var(--bg); border-radius: 14px; padding: 8px 14px;
}
.comment-author { font-weight: 600; font-size: .8rem; }
.comment-text { font-size: .85rem; color: var(--text-sec); margin-top: 2px; }
.comment-time { font-size: .72rem; color: var(--text-ter); margin-top: 4px; padding-left: 14px; }
.comment-form {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-top: 1px solid var(--surface-border);
}
.comment-form input {
  flex: 1; padding: 9px 16px; border-radius: var(--radius-full);
  background: var(--bg); border: 1.5px solid transparent;
  color: var(--text); font: 400 .85rem var(--font);
  transition: border var(--transition);
}
.comment-form input:focus { outline: none; border-color: var(--primary); }
.comment-form button {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); border: none; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
.comment-form button:hover { background: var(--primary-light); }

/* ── Admin Page ───────────────────────────────────────────── */
.admin-layout {
  max-width: 900px; margin: 0 auto; padding: 24px 16px 80px;
}
.admin-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; }
.user-list { list-style: none; }
.user-list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--surface-border);
  transition: background var(--transition);
}
.user-list-item:last-child { border-bottom: none; }
.user-list-item:hover { background: var(--surface-hover); }
.user-info { flex: 1; }
.user-info .name { font-weight: 600; font-size: .9rem; }
.user-info .meta { font-size: .78rem; color: var(--text-ter); }
.role-badge {
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
}
.role-editor { background: rgba(25,118,210,.12); color: var(--primary); }
.role-reader { background: rgba(0,131,143,.12); color: var(--accent); }

/* ── Notif settings cog ───────────────────────────────────── */
.notif-settings-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: none; cursor: pointer;
  color: rgba(255,255,255,.8); font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.notif-settings-btn:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  animation: fadeUp .25s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--surface-border);
}
.modal-header h3 { font-family: var(--font); font-size: 1rem; font-weight: 600; }
.modal-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--surface-border);
}
.modal-section:last-child { border-bottom: none; }
.modal-section-label {
  font-size: .78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-ter); margin-bottom: 12px;
}
.modal-hint {
  font-size: .78rem; color: var(--text-ter);
  font-family: monospace; margin-bottom: 12px;
  background: var(--bg); padding: 6px 10px; border-radius: var(--radius-sm);
}
.modal-pref-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; font-size: .9rem; color: var(--text-sec);
}
.modal-pref-row + .modal-pref-row { border-top: 1px solid var(--surface-border); }
.pref-switch {
  cursor: pointer; display: flex; align-items: center;
}
.pref-switch .notify-track {
  width: 36px; height: 20px; border-radius: 10px;
  background: rgba(0,0,0,.15); position: relative; flex-shrink: 0;
  transition: background var(--transition);
}
[data-theme="dark"] .pref-switch .notify-track { background: rgba(255,255,255,.15); }
.pref-switch.on .notify-track { background: #4CAF50; }
.pref-switch .notify-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  position: absolute; top: 2px; left: 2px;
  transition: transform var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.pref-switch.on .notify-thumb { transform: translateX(16px); }
.modal-tmpl-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center;
}
.modal-tmpl-grid label {
  font-size: .8rem; color: var(--text-sec); white-space: nowrap;
}
.modal-tmpl-grid .form-input { padding: 7px 10px; font-size: .85rem; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 80px; right: 20px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg); font-size: .85rem;
  animation: slideIn .3s ease;
  border-left: 4px solid var(--primary);
}
.toast.error { border-left-color: var(--error); }
.toast.success { border-left-color: var(--success); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-ter);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { color: var(--text-sec); margin-bottom: 6px; font-family: var(--font); }
.empty-state p { font-size: .9rem; }

/* ── Loading ──────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--surface-border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 1s linear infinite; margin: 40px auto;
}

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox-thumb { cursor: zoom-in; }
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img-wrap {
  max-width: 92vw; max-height: 90vh;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
}
.lightbox-img-wrap img {
  max-width: 92vw; max-height: 90vh;
  object-fit: contain; border-radius: 6px;
  animation: fadeUp .2s ease;
  user-select: none;
}
.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 1.2rem; width: 42px; height: 42px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,.28); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 2rem; width: 52px; height: 52px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s; user-select: none;
}
.lightbox-nav:hover { background: rgba(255,255,255,.28); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.75); font-size: .85rem;
  background: rgba(0,0,0,.4); padding: 4px 14px; border-radius: 20px;
  pointer-events: none;
}
@media (max-width: 600px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 1.5rem; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeUp .4s ease; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-grid { grid-template-columns: 1fr; }
  .location-row { grid-template-columns: 1fr; }
  .navbar { padding: 0 14px; }
  #map { height: 250px; }

  /* Map header: title on its own line, controls in a tidy row beneath it */
  .map-header { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .map-header h2 { font-size: .98rem; white-space: nowrap; }
  .map-header > div { width: 100%; gap: 8px; }
  .map-header .map-style-select { flex: 1; min-width: 0; }

  /* Hamburger replaces the cramped inline control row */
  .nav-toggle { display: flex; }

  /* Nav items drop into a vertical list below the bar, opened by the hamburger */
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--primary-dark); padding: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,.4);
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
    display: none;
  }
  [data-theme="dark"] .nav-links { background: #0A1929; }
  .navbar.nav-open .nav-links { display: flex; }

  /* uniform full-width rows; labels line up via a fixed icon column */
  .nav-links > a,
  .nav-links > button,
  .nav-links > .user-badge {
    width: 100%; box-sizing: border-box;
    justify-content: flex-start; align-items: center; gap: 14px;
    padding: 13px 16px; border-radius: var(--radius-sm);
  }
  .nav-links .nav-ico { width: 22px; flex-shrink: 0; display: inline-flex; justify-content: center; font-size: 1.05rem; }
  .nav-links > .lang-toggle { height: auto; border-radius: var(--radius-sm); }
  .nav-links .user-badge { background: transparent; }       /* align like the rest */
  .nav-links .user-badge .avatar { width: 22px; height: 22px; font-size: .65rem; }
}
@media (max-width: 480px) {
  .auth-card { margin: 16px; padding: 28px 22px; }
}
