/* ============================================================
   MARINE WORLD — COMPLETE STYLESHEET
   ============================================================ */


/* ── RESET & TOKENS ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:        #060d18;
  --bg2:       #0c1624;
  --bg3:       #111e30;
  --bg4:       #172438;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.13);
  --text:      #e8edf4;
  --text2:     #7e97b4;
  --text3:     #4a607a;
  --cyan:      #22d3ee;
  --cyan2:     #0891b2;
  --green:     #34d399;
  --amber:     #fbbf24;
  --red:       #f87171;
  --purple:    #a78bfa;
  --r:         10px;
  --r2:        14px;
  --r3:        20px;
  font-size: 15px;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }

.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.ml-auto { margin-left: auto; }

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(34,211,238,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  top: -30%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(8,145,178,0.12) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── LOGIN ───────────────────────────────────── */
#login-screen {
  position: relative; z-index: 10;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem;
}
.login-card {
  background: var(--bg2);
  border: 0.5px solid var(--border2);
  border-radius: var(--r3);
  padding: 2.5rem 2.5rem 2rem;
  width: 100%; max-width: 400px;
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo .fish { font-size: 3.5rem; display: block; margin-bottom: 0.75rem; filter: drop-shadow(0 0 20px rgba(34,211,238,0.5)); }
.login-logo h1 { font-family: 'Instrument Serif', serif; font-size: 2.2rem; letter-spacing: -0.02em; }
.login-logo p { font-size: 0.8rem; color: var(--text3); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 2px; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.75rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg3); border: 0.5px solid var(--border2);
  border-radius: var(--r); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--cyan2);
  box-shadow: 0 0 0 3px rgba(8,145,178,0.15);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text3); }
.field select option { background: var(--bg3); }
.field textarea { resize: vertical; min-height: 70px; }
.btn-primary {
  width: 100%; padding: 0.7rem;
  background: var(--cyan2); border: none; border-radius: var(--r);
  color: #fff; font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem; font-weight: 500;
  cursor: pointer; transition: background 0.2s, transform 0.1s;
  margin-top: 0.5rem;
}
.btn-primary:hover { background: var(--cyan); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  padding: 0.5rem 1rem; background: transparent;
  border: 0.5px solid var(--border2); border-radius: var(--r);
  color: var(--text2); font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-danger {
  padding: 0.5rem 1rem; background: rgba(248,113,113,0.1);
  border: 0.5px solid rgba(248,113,113,0.3); border-radius: var(--r);
  color: var(--red); font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.login-error {
  background: rgba(248,113,113,0.1); border: 0.5px solid rgba(248,113,113,0.3);
  border-radius: var(--r); color: var(--red);
  font-size: 0.82rem; padding: 0.6rem 0.9rem;
  margin-bottom: 1rem; display: none;
}

/* ── APP SHELL ───────────────────────────────── */
#app-shell { display: none; position: relative; z-index: 10; min-height: 100vh; }

/* ── MOBILE HEADER ───────────────────────────── */
#mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg2);
  border-bottom: 0.5px solid var(--border);
  z-index: 110;
  padding: 0 1rem;
  align-items: center; gap: 12px;
}
#mobile-header .fish-sm { font-size: 1.2rem; }
#mobile-header .mob-title { font-family: 'Instrument Serif', serif; font-size: 1rem; flex: 1; }
#menu-toggle {
  background: none; border: none; color: var(--text2);
  cursor: pointer; padding: 6px; border-radius: 8px;
  display: flex; align-items: center;
}
#menu-toggle:hover { background: var(--bg3); }
#sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ── SIDEBAR ─────────────────────────────────── */
#sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 220px;
  background: var(--bg2);
  border-right: 0.5px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
.sidebar-logo {
  padding: 1.25rem;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 0.5px solid var(--border);
}
.sidebar-logo .fish-sm { font-size: 1.4rem; filter: drop-shadow(0 0 8px rgba(34,211,238,0.5)); }
.sidebar-logo span { font-family: 'Instrument Serif', serif; font-size: 1.1rem; letter-spacing: -0.01em; }
.nav-items { flex: 1; padding: 0.5rem 0.75rem; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0.6rem 0.75rem; border-radius: var(--r);
  cursor: pointer; color: var(--text2); font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
  user-select: none; margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(8,145,178,0.15); color: var(--cyan); }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 1.5; }
.nav-badge {
  margin-left: auto; font-size: 0.7rem;
  background: var(--red); color: #fff;
  padding: 1px 6px; border-radius: 10px; font-weight: 500;
}
.user-card {
  margin: 0.75rem; padding: 0.85rem 1rem;
  background: var(--bg3); border: 0.5px solid var(--border);
  border-radius: var(--r2); cursor: pointer; transition: background 0.15s;
}
.user-card:hover { background: var(--bg4); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 500; color: #fff; flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.07em; }
.sign-out-btn {
  background: none; border: none; color: var(--text3);
  cursor: pointer; padding: 4px; border-radius: 6px;
  display: flex; transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.sign-out-btn:hover { color: var(--red); background: rgba(248,113,113,0.1); }

/* ── MAIN ────────────────────────────────────── */
#main { margin-left: 220px; min-height: 100vh; padding: 2rem; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 2rem; flex-wrap: wrap; }
.page-title { font-family: 'Instrument Serif', serif; font-size: 1.6rem; letter-spacing: -0.02em; }
.topbar-greeting { font-size: 0.8rem; color: var(--text3); }

/* ── PAGE PANELS ─────────────────────────────── */
.page-panel { display: none; }
.page-panel.active { display: block; }

/* ── STAT GRID ───────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 2rem; }
.stat-card {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: var(--r2); padding: 1.1rem 1.25rem;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--accent, var(--cyan2));
  border-radius: 2px 2px 0 0;
}
.stat-label { font-size: 0.72rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 0.4rem; }
.stat-val { font-size: 1.7rem; font-weight: 500; letter-spacing: -0.03em; }
.stat-sub { font-size: 0.75rem; color: var(--text3); margin-top: 2px; }

/* ── SECTION CARD ────────────────────────────── */
.section-card { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r2); margin-bottom: 1.25rem; }
.section-card-header {
  padding: 1rem 1.25rem; border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.section-card-header h3 { font-size: 0.875rem; font-weight: 500; flex: 1; }
.section-card-body { padding: 1rem 1.25rem; }

/* ── WELCOME BANNER ──────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
  border: 0.5px solid var(--border2); border-radius: var(--r2);
  padding: 1.5rem 1.75rem; margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.welcome-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 500; color: #fff; flex-shrink: 0;
}
.welcome-text h2 { font-family: 'Instrument Serif', serif; font-size: 1.35rem; letter-spacing: -0.01em; margin-bottom: 2px; }
.welcome-text p { font-size: 0.82rem; color: var(--text2); }
.role-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.role-owner { background: rgba(167,139,250,0.15); color: var(--purple); border: 0.5px solid rgba(167,139,250,0.3); }
.role-devit  { background: rgba(34,211,238,0.1);  color: var(--cyan);   border: 0.5px solid rgba(34,211,238,0.2); }
.role-admin  { background: rgba(52,211,153,0.1);  color: var(--green);  border: 0.5px solid rgba(52,211,153,0.2); }

/* ── FEED ────────────────────────────────────── */
.feed-item { display: flex; align-items: flex-start; gap: 12px; padding: 0.75rem 0; border-bottom: 0.5px solid var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.feed-content { flex: 1; }
.feed-msg { font-size: 0.85rem; line-height: 1.4; }
.feed-time { font-size: 0.72rem; color: var(--text3); margin-top: 2px; }
.feed-empty { font-size: 0.85rem; color: var(--text3); text-align: center; padding: 2rem 0; }

/* ── INVENTORY ───────────────────────────────── */
.inv-toolbar {
  display: flex; gap: 10px; margin-bottom: 1.25rem;
  flex-wrap: wrap; align-items: center;
}
.inv-search {
  flex: 1; min-width: 200px;
  background: var(--bg2); border: 0.5px solid var(--border2);
  border-radius: var(--r); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 0.875rem;
  padding: 0.55rem 0.9rem; outline: none;
  transition: border-color 0.2s;
}
.inv-search:focus { border-color: var(--cyan2); }
.inv-search::placeholder { color: var(--text3); }
.stock-type-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.stt-btn {
  padding: 0.4rem 1rem; border-radius: 20px;
  border: 0.5px solid var(--border2); background: transparent;
  color: var(--text2); font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem; cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.stt-btn:hover { border-color: var(--cyan2); color: var(--cyan); }
.stt-btn.active { background: var(--cyan2); border-color: var(--cyan2); color: #fff; }
.stt-btn.type-livestock.active { background: #059669; border-color: #059669; }
.stt-btn.type-food.active      { background: #d97706; border-color: #d97706; }
.stt-btn.type-equipment.active { background: #7c3aed; border-color: #7c3aed; }

/* ── PRODUCT GRID ────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: var(--r2); overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
}
.product-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.product-card.expiring { border-color: rgba(251,191,36,0.4); }
.product-card.expired  { border-color: rgba(248,113,113,0.5); }
.card-img {
  height: 160px; overflow: hidden;
  background: var(--bg3); position: relative;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; color: var(--text3); font-size: 1.8rem;
}
.card-img-placeholder span { font-size: 0.72rem; }
.card-type-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.04em;
}
.type-livestock { background: rgba(5,150,105,0.25); color: #34d399; }
.type-food      { background: rgba(217,119,6,0.25);  color: #fbbf24; }
.type-equipment { background: rgba(124,58,237,0.25); color: #a78bfa; }
.expiry-chip {
  position: absolute; top: 8px; right: 8px;
  padding: 2px 8px; border-radius: 20px; font-size: 0.68rem; font-weight: 500;
}
.expiry-chip.warn { background: rgba(251,191,36,0.2); color: var(--amber); border: 0.5px solid rgba(251,191,36,0.4); }
.expiry-chip.danger { background: rgba(248,113,113,0.2); color: var(--red); border: 0.5px solid rgba(248,113,113,0.4); }
.card-body { padding: 0.9rem 1rem; flex: 1; }
.card-brand { font-size: 0.68rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.card-name { font-size: 0.92rem; font-weight: 500; line-height: 1.35; margin-bottom: 3px; }
.card-desc { font-size: 0.78rem; color: var(--text2); line-height: 1.5; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer {
  padding: 0.65rem 1rem; border-top: 0.5px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.card-footer-top {
  display: flex; align-items: center; gap: 8px;
}
.card-footer-actions {
  display: flex; align-items: center; gap: 4px;
  justify-content: space-between;
}
.card-price { font-size: 1rem; font-weight: 500; color: var(--cyan); }
.card-price.hidden-price { color: var(--text3); font-size: 0.75rem; font-weight: 400; }
.price-up   { font-size: 0.68rem; color: var(--red); }
.price-down { font-size: 0.68rem; color: var(--green); }
.stock-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 500;
  padding: 2px 8px; border-radius: 20px;
}
.stock-in  { background: rgba(52,211,153,0.12); color: var(--green); border: 0.5px solid rgba(52,211,153,0.3); }
.stock-low { background: rgba(251,191,36,0.12);  color: var(--amber); border: 0.5px solid rgba(251,191,36,0.3); }
.stock-out { background: rgba(248,113,113,0.12); color: var(--red);   border: 0.5px solid rgba(248,113,113,0.3); }
.stock-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.card-action-btn {
  background: none; border: none; color: var(--text3);
  cursor: pointer; padding: 4px; border-radius: 6px;
  display: flex; font-size: 0.8rem;
  transition: color 0.15s, background 0.15s;
}
.card-action-btn:hover { color: var(--text); background: var(--bg3); }
.card-action-btn.del:hover { color: var(--red); background: rgba(248,113,113,0.1); }

/* ── ALERTS BANNER ───────────────────────────── */
.alert-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 0.75rem 1rem; border-radius: var(--r);
  font-size: 0.82rem; margin-bottom: 1rem;
}
.alert-banner.warn { background: rgba(251,191,36,0.1); border: 0.5px solid rgba(251,191,36,0.3); color: var(--amber); }
.alert-banner.danger { background: rgba(248,113,113,0.1); border: 0.5px solid rgba(248,113,113,0.3); color: var(--red); }

/* ── PRICE TOGGLE ────────────────────────────── */
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle {
  width: 36px; height: 20px; background: var(--bg4);
  border-radius: 10px; position: relative; cursor: pointer;
  border: 0.5px solid var(--border2); transition: background 0.2s; flex-shrink: 0;
}
.toggle.on { background: var(--cyan2); }
.toggle::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: #fff; border-radius: 50%;
  transition: left 0.2s;
}
.toggle.on::after { left: 19px; }
.toggle-label { font-size: 0.82rem; color: var(--text2); }

/* ── MODAL ───────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 500; display: none;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 0.5px solid var(--border2);
  border-radius: var(--r3); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: modal-in 0.22s ease;
}
@keyframes modal-in { from{opacity:0;transform:scale(.96) translateY(8px)} to{opacity:1;transform:none} }
@keyframes pulse-dot-ot { 0%,100%{opacity:1} 50%{opacity:.4} }
.modal-header {
  padding: 1.25rem 1.5rem; border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.modal-header h2 { font-family: 'Instrument Serif', serif; font-size: 1.2rem; flex: 1; }
.modal-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 1.1rem; padding: 4px; border-radius: 6px; transition: color 0.15s; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 0.5px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-divider { border: none; border-top: 0.5px solid var(--border); margin: 1rem 0; }

/* ── QR MODAL ────────────────────────────────── */
.qr-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 1rem; padding: 1rem 0;
}
.qr-wrap canvas { border-radius: 8px; border: 4px solid #fff; }
.qr-product-name { font-size: 0.875rem; font-weight: 500; text-align: center; }
.qr-product-id { font-size: 0.72rem; color: var(--text3); font-family: monospace; }

/* ── MORTALITY LOG ───────────────────────────── */
.mortality-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 0.6rem 0; border-bottom: 0.5px solid var(--border); font-size: 0.85rem;
}
.mortality-entry:last-child { border-bottom: none; }

/* ── BRAND PILLS (below search bar) ─────────── */
.brand-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 1rem;
}
.brand-pill {
  padding: 3px 12px; border-radius: 20px;
  border: 0.5px solid var(--border2);
  background: transparent; color: var(--text2);
  font-family: 'DM Sans', sans-serif; font-size: 0.78rem;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.brand-pill:hover { border-color: var(--cyan2); color: var(--cyan); background: rgba(8,145,178,0.08); }
.brand-pill.active { background: rgba(8,145,178,0.15); border-color: var(--cyan2); color: var(--cyan); }

/* ── BRAND MANAGER (devit/owner only) ────────── */
.brand-manager {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: var(--r2); margin-bottom: 1.25rem;
}
.brand-manager-header {
  padding: 0.75rem 1.25rem; border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.brand-manager-header h3 { font-size: 0.82rem; font-weight: 500; flex: 1; color: var(--text2); }
.brand-manager-body { padding: 0.75rem 1.25rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.brand-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--bg3); border: 0.5px solid var(--border2);
  font-size: 0.78rem; color: var(--text);
}
.brand-tag-del {
  background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 0.8rem; padding: 0; line-height: 1;
  transition: color 0.15s;
}
.brand-tag-del:hover { color: var(--red); }
.brand-add-row { display: flex; gap: 6px; margin-top: 4px; }
.brand-add-input {
  background: var(--bg3); border: 0.5px solid var(--border2);
  border-radius: var(--r); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 0.82rem;
  padding: 0.4rem 0.75rem; outline: none; width: 160px;
  transition: border-color 0.2s;
}
.brand-add-input:focus { border-color: var(--cyan2); }
.brand-add-input::placeholder { color: var(--text3); }
.btn-sm {
  padding: 0.4rem 0.85rem; border-radius: var(--r);
  background: var(--cyan2); border: none; color: #fff;
  font-family: 'DM Sans', sans-serif; font-size: 0.78rem;
  font-weight: 500; cursor: pointer; transition: background 0.15s;
  white-space: nowrap;
}
.btn-sm:hover { background: var(--cyan); }

/* ── SEARCH HIGHLIGHT ────────────────────────── */
.search-highlight {
  background: rgba(251,191,36,0.35);
  color: var(--text);
  border-radius: 2px;
  padding: 0 1px;
}

/* ── STOCK HISTORY MODAL ─────────────────────── */
.history-timeline { padding: 0.5rem 0; }
.history-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 1.5rem; border-bottom: 0.5px solid var(--border);
  position: relative;
}
.history-item:last-child { border-bottom: none; }
.history-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
  box-shadow: 0 0 6px currentColor;
}
.history-line {
  position: absolute; left: calc(1.5rem + 4px);
  top: 24px; bottom: -10px; width: 1px;
  background: var(--border); z-index: 0;
}
.history-item:last-child .history-line { display: none; }
.history-content { flex: 1; }
.history-action { font-size: 0.83rem; color: var(--text); line-height: 1.4; }
.history-action strong { font-weight: 500; }
.history-meta { font-size: 0.72rem; color: var(--text3); margin-top: 2px; }
.history-badge {
  font-size: 0.7rem; padding: 1px 7px; border-radius: 10px;
  font-weight: 500; flex-shrink: 0; margin-top: 3px;
}

/* ── CATEGORY AUTOCOMPLETE ───────────────────── */
.cat-datalist-wrap { position: relative; }
.cat-suggestions {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg3); border: 0.5px solid var(--border2);
  border-top: none; border-radius: 0 0 var(--r) var(--r);
  z-index: 200; max-height: 160px; overflow-y: auto;
  display: none;
}
.cat-suggestions.open { display: block; }
.cat-suggestion {
  padding: 7px 10px; font-size: 0.85rem; color: var(--text2);
  cursor: pointer; transition: background 0.1s;
}
.cat-suggestion:hover, .cat-suggestion.focused {
  background: var(--bg4); color: var(--text);
}

/* ── RECEIVE STOCK (+) BUTTON ────────────────── */
.receive-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(52,211,153,0.15);
  border: 0.5px solid rgba(52,211,153,0.4);
  color: var(--green); font-size: 1rem; font-weight: 600;
  cursor: pointer; line-height: 1; flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  font-family: monospace;
}
.receive-btn:hover { background: rgba(52,211,153,0.28); transform: scale(1.1); }

/* ── SUPPLIER PAGE ───────────────────────────── */
.supplier-card {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: var(--r2); padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: 14px;
  transition: border-color 0.15s;
  cursor: pointer;
}
.supplier-card:hover { border-color: var(--border2); }
.supplier-icon {
  width: 42px; height: 42px; border-radius: var(--r);
  background: rgba(8,145,178,0.12);
  border: 0.5px solid rgba(8,145,178,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.supplier-info { flex: 1; min-width: 0; }
.supplier-name { font-size: 0.95rem; font-weight: 500; color: var(--text); }
.supplier-meta { font-size: 0.75rem; color: var(--text3); margin-top: 2px; }
.supplier-stats {
  display: flex; gap: 16px; flex-shrink: 0;
}
.supplier-stat { text-align: right; }
.supplier-stat-val { font-size: 1.1rem; font-weight: 500; color: var(--cyan); }
.supplier-stat-label { font-size: 0.68rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.07em; }

/* Supplier shipment history table */
.shipment-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.shipment-table th {
  text-align: left; padding: 7px 10px;
  font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text3);
  border-bottom: 0.5px solid var(--border);
  font-weight: 500;
}
.shipment-table td {
  padding: 8px 10px; border-bottom: 0.5px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.shipment-table tr:last-child td { border-bottom: none; }
.shipment-table tr:hover td { background: rgba(255,255,255,0.02); }
.shipment-table .td-secondary { color: var(--text3); font-size: 0.75rem; }

/* Supplier PDF button */
.supplier-pdf-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r);
  background: rgba(167,139,250,0.1);
  border: 0.5px solid rgba(167,139,250,0.35);
  color: var(--purple); font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem; font-weight: 500;
  cursor: pointer; transition: background 0.15s; white-space: nowrap;
}
.supplier-pdf-btn:hover { background: rgba(167,139,250,0.2); }

/* ── STAT CARD LINK ──────────────────────────── */
.stat-link {
  font-size: 0.7rem; color: var(--text3);
  margin-top: 6px; letter-spacing: 0.02em;
  transition: color 0.15s;
}
.stat-card:hover .stat-link { color: var(--cyan); }
.stat-card[onclick]:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.2); }

/* ── ALERT FILTER BUTTONS ────────────────────── */
.alert-filter-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 1rem; align-items: center;
}
.alert-filter-btn {
  padding: 4px 14px; border-radius: 20px;
  border: 0.5px solid var(--border2);
  background: transparent;
  font-family: 'DM Sans', sans-serif; font-size: 0.78rem;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  color: var(--text2);
}
.alert-filter-btn:hover { border-color: var(--amber); color: var(--amber); }
.alert-filter-btn.active-expiring {
  background: rgba(251,191,36,0.15);
  border-color: var(--amber); color: var(--amber);
}
.alert-filter-btn.active-lowstock {
  background: rgba(248,113,113,0.12);
  border-color: var(--red); color: var(--red);
}
.alert-filter-btn.active-both {
  background: rgba(248,113,113,0.18);
  border-color: var(--red); color: var(--red);
}
.alert-filter-clear {
  margin-left: 4px;
  border-color: var(--text3); color: var(--text3);
}
.alert-filter-clear:hover { border-color: var(--red); color: var(--red); }

/* ── FEED COLLAPSE ───────────────────────────── */
.feed-card-header { transition: background 0.15s; }
.feed-card-header:hover { background: rgba(255,255,255,0.02); }
#feed-card.collapsed #feed-body { display: none; }
#feed-card.collapsed #feed-chevron { transform: rotate(-90deg); }

/* ── DAY GROUP ───────────────────────────────── */
.feed-day-group { border-bottom: 0.5px solid var(--border); }
.feed-day-group:last-child { border-bottom: none; }
.feed-day-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 1.25rem;
  background: rgba(255,255,255,0.015);
  cursor: pointer; user-select: none;
  transition: background 0.15s;
  border-bottom: 0.5px solid var(--border);
}
.feed-day-header:hover { background: rgba(255,255,255,0.03); }
.feed-day-label {
  font-size: 0.72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text2);
}
.feed-day-label.today { color: var(--cyan); }
.feed-day-count {
  font-size: 0.68rem; color: var(--text3);
  background: var(--bg3); border-radius: 10px;
  padding: 1px 7px;
}
.feed-day-chevron {
  margin-left: auto; transition: transform 0.2s; flex-shrink: 0;
}
.feed-day-group.collapsed .feed-day-chevron { transform: rotate(-90deg); }
.feed-day-entries { }
.feed-day-group.collapsed .feed-day-entries { display: none; }
.feed-entry.day-hidden { display: none; }

/* Show-more within a day */
.feed-show-more {
  padding: 6px 1.25rem;
  font-size: 0.75rem; color: var(--text3);
  cursor: pointer; border-top: 0.5px solid var(--border);
  transition: color 0.15s; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.feed-show-more:hover { color: var(--cyan); }

/* ── TAB COUNTS ──────────────────────────────── */
.tab-count {
  font-size: 0.68rem; font-weight: 400;
  opacity: 0.7; margin-left: 3px;
}
.stt-btn.active .tab-count { opacity: 0.9; }

/* ── BRAND PILLS — wrap to multiple rows ─────── */
.brand-pills {
  display: flex; flex-wrap: wrap;
  gap: 6px; margin-bottom: 1rem;
}

/* ── CARD EXPIRY LINE ────────────────────────── */
.card-expiry {
  font-size: 0.7rem; color: var(--amber);
  margin-top: 3px;
}
.card-expiry.expired { color: var(--red); }

/* ── LOW STOCK THRESHOLD TOOLTIP ─────────────── */
.stock-badge-wrap { position: relative; display: inline-flex; align-items: center; }
.threshold-tip {
  font-size: 0.65rem; color: var(--text3);
  margin-left: 5px; white-space: nowrap;
}

/* ── DELETED PRODUCT CARD ────────────────────── */
.product-card-deleted {
  opacity: 0.45;
  filter: grayscale(60%);
  position: relative;
}
.product-card-deleted::after {
  content: 'DELETED';
  position: absolute; top: 10px; right: 10px;
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: .1em; color: var(--red);
  background: rgba(248,113,113,0.12);
  border: 0.5px solid rgba(248,113,113,0.3);
  border-radius: 4px; padding: 2px 6px;
}

/* ── INTERNAL NOTES ON CARD ──────────────────── */
.card-notes {
  font-size: 0.71rem; color: var(--amber);
  margin-top: 4px; padding: 4px 8px;
  background: rgba(251,191,36,0.06);
  border-left: 2px solid rgba(251,191,36,0.3);
  border-radius: 0 4px 4px 0;
  line-height: 1.4;
}

/* ── STOCKTAKE ───────────────────────────────── */
.st-qty-input:focus { border-color: var(--cyan2) !important; outline: none; }
.st-changed { border-color: var(--cyan2) !important; color: var(--cyan) !important; font-weight: 500; }

/* ── INVENTORY SORT SELECT ───────────────────── */
.inv-sort-select {
  background: var(--bg3); border: 0.5px solid var(--border2);
  border-radius: var(--r); color: var(--text2);
  font-family: 'DM Sans', sans-serif; font-size: 0.78rem;
  padding: 5px 8px; outline: none; cursor: pointer;
  transition: border-color 0.2s;
}
.inv-sort-select:focus { border-color: var(--cyan2); }

/* ── LAST RESTOCK LINE ON CARD ───────────────── */
.card-last-restock {
  font-size: 0.68rem; color: var(--text3);
  margin-top: 3px; letter-spacing: 0.01em;
}
.card-last-restock strong { color: var(--text2); }

/* ── ON ORDER BADGE ──────────────────────────── */
.on-order-badge {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(251,191,36,0.2);
  border: 0.5px solid rgba(251,191,36,0.5);
  color: var(--amber); font-size: 0.65rem;
  padding: 2px 7px; border-radius: 10px;
  font-weight: 500; letter-spacing: 0.04em;
  pointer-events: none;
}
.card-action-btn.on-order-active {
  color: var(--amber);
  background: rgba(251,191,36,0.12);
  border-color: rgba(251,191,36,0.3);
}

/* ── SCROLL TO TOP ───────────────────────────── */
#scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg3);
  border: 0.5px solid var(--border2);
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s, background 0.15s;
  z-index: 900;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
#scroll-top-btn.visible {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
#scroll-top-btn:hover {
  background: var(--bg4); color: var(--cyan);
  border-color: var(--cyan2);
}
.feed-preset {
  padding: 3px 10px; border-radius: 20px;
  border: 0.5px solid var(--border2);
  background: transparent; color: var(--text2);
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.feed-preset:hover { border-color: var(--cyan2); color: var(--cyan); }
.feed-preset.active { background: rgba(8,145,178,0.15); border-color: var(--cyan2); color: var(--cyan); }
.feed-date-input {
  background: var(--bg3); border: 0.5px solid var(--border2);
  border-radius: var(--r); color: var(--text2);
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem;
  padding: 4px 8px; outline: none; cursor: pointer;
  transition: border-color 0.2s;
}
.feed-date-input:focus { border-color: var(--cyan2); }
.feed-filter-select {
  background: var(--bg3); border: 0.5px solid var(--border2);
  border-radius: var(--r); color: var(--text2);
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem;
  padding: 4px 8px; outline: none; cursor: pointer;
  transition: border-color 0.2s;
}
.feed-filter-select:focus { border-color: var(--cyan2); }
.feed-filter-select option { background: var(--bg3); }

/* Feed entries */
.feed-entry {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 1.25rem; border-bottom: 0.5px solid var(--border);
  transition: background 0.15s;
}
.feed-entry:hover { background: rgba(255,255,255,0.02); }
.feed-entry:last-child { border-bottom: none; }

/* Mini avatar — photo or initials */
.feed-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 0.68rem; font-weight: 600;
  color: #fff; overflow: hidden; margin-top: 1px;
  border: 1.5px solid rgba(255,255,255,0.08);
}
.feed-avatar img { width: 100%; height: 100%; object-fit: cover; }

.feed-action-icon {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; flex-shrink: 0; margin-top: 4px;
}
.feed-main { flex: 1; min-width: 0; }
.feed-headline { font-size: 0.83rem; color: var(--text); line-height: 1.4; }
.feed-headline strong { font-weight: 500; }
.feed-meta { font-size: 0.72rem; color: var(--text3); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.feed-qty-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.7rem; font-weight: 500; padding: 1px 6px;
  border-radius: 10px; margin-left: 4px; vertical-align: middle;
}
.feed-qty-in  { background: rgba(52,211,153,0.12); color: var(--green); }
.feed-qty-out { background: rgba(248,113,113,0.12); color: var(--red); }
.feed-qty-neu { background: rgba(126,151,180,0.1);  color: var(--text2); }

/* Action type colours */
.act-product-add  { background: rgba(34,211,238,0.12); }
.act-product-edit { background: rgba(126,151,180,0.1); }
.act-stock-in     { background: rgba(52,211,153,0.12); }
.act-stock-out    { background: rgba(248,113,113,0.12); }
.act-price        { background: rgba(251,191,36,0.12); }
.act-mortality    { background: rgba(248,113,113,0.15); }
.act-sign-in      { background: rgba(167,139,250,0.12); }

/* ── PDF EXPORT BUTTON ───────────────────────── */
.pdf-export-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r);
  background: rgba(248,113,113,0.1);
  border: 0.5px solid rgba(248,113,113,0.35);
  color: var(--red); font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
  white-space: nowrap;
}
.pdf-export-btn:hover { background: rgba(248,113,113,0.2); }

/* ── VIEW TOGGLE (grid / list) ───────────────── */
.view-toggle-group { display: flex; border: 0.5px solid var(--border2); border-radius: var(--r); overflow: hidden; }
.view-toggle-btn {
  padding: 6px 10px; background: transparent; border: none;
  color: var(--text3); cursor: pointer; display: flex;
  align-items: center; transition: background 0.15s, color 0.15s;
}
.view-toggle-btn:hover { background: var(--bg3); color: var(--text2); }
.view-toggle-btn.active { background: var(--bg3); color: var(--cyan); }

/* ── LIST VIEW ───────────────────────────────── */
.product-list { display: flex; flex-direction: column; gap: 6px; }
.product-list-row {
  display: grid;
  grid-template-columns: 56px 1fr 120px 110px 90px 80px auto;
  align-items: center; gap: 12px;
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: var(--r); padding: 10px 14px;
  transition: border-color 0.15s;
}
.product-list-row > * { min-width: 0; }
.product-list-row:hover { border-color: var(--border2); }
.product-list-row.expiring { border-color: rgba(251,191,36,0.4); }
.product-list-row.expired  { border-color: rgba(248,113,113,0.5); }
.list-thumb {
  width: 48px; height: 48px; border-radius: 8px;
  object-fit: cover; background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0; overflow: hidden;
}
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-name { font-size: 0.85rem; font-weight: 500; line-height: 1.3; }
.list-brand { font-size: 0.72rem; color: var(--cyan); text-transform: uppercase; letter-spacing: .08em; }
.list-desc { font-size: 0.75rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-actions { display: flex; gap: 4px; justify-content: flex-end; }
.list-header {
  display: grid;
  grid-template-columns: 56px 1fr 120px 110px 90px 80px auto;
  gap: 12px; padding: 6px 14px;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text3); border-bottom: 0.5px solid var(--border);
  margin-bottom: 4px;
}

/* ── PDF MODAL ───────────────────────────────── */
.pdf-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--r);
  background: var(--bg3); border: 0.5px solid var(--border2);
  cursor: pointer; transition: border-color 0.15s;
  margin-bottom: 8px;
}
.pdf-option:hover { border-color: var(--cyan2); }
.pdf-option input[type=checkbox] {
  width: 16px; height: 16px; accent-color: var(--cyan2);
  cursor: pointer; flex-shrink: 0;
}
.pdf-option-label { flex: 1; }
.pdf-option-label strong { display: block; font-size: 0.85rem; color: var(--text); }
.pdf-option-label span  { font-size: 0.75rem; color: var(--text3); }

/* ── FORM VALIDATION ─────────────────────────── */
.field input.error,
.field select.error,
.field textarea.error {
  border-color: rgba(248,113,113,0.6) !important;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.12) !important;
}
.field-error {
  font-size: 0.72rem;
  color: var(--red);
  margin-top: 4px;
  display: none;
}
.field-error.show { display: block; }
.field-hint {
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 3px;
}

/* ── MORTALITY INLINE BUTTON (on card) ───────── */
.mort-inline-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(248,113,113,0.12);
  border: 0.5px solid rgba(248,113,113,0.35);
  color: var(--red); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; line-height: 1; flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  font-family: monospace;
}
.mort-inline-btn:hover { background: rgba(248,113,113,0.25); transform: scale(1.1); }

/* ── SIDEBAR LOGO (logo image + name + social links) ─ */
.sidebar-logo {
  padding: 1.1rem 0.75rem 0.85rem;
  display: flex; flex-direction: column;
  align-items: center; gap: 0;
  border-bottom: 0.5px solid var(--border);
}
.sidebar-logo-img {
  width: 52px; height: 52px; border-radius: 10px;
  object-fit: contain;
  /* LOGO: replace src on the <img id="sidebar-logo-img"> element below */
}
.sidebar-logo-fish {
  font-size: 2.6rem;
  filter: drop-shadow(0 0 12px rgba(34,211,238,0.55));
  line-height: 1;
}
.sidebar-brand-name {
  font-family: 'Instrument Serif', serif;
  font-size: 1.1rem; letter-spacing: -0.01em;
  color: var(--text); margin-top: 6px; text-align: center;
}
.sidebar-social {
  display: flex; gap: 5px; margin-top: 8px;
}
.sidebar-social a {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--bg3);
  border: 0.5px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar-social a:hover { background: var(--bg4); color: var(--cyan); border-color: var(--cyan2); }
.sidebar-social svg { width: 13px; height: 13px; }

/* ── PHOTO AVATAR ────────────────────────────── */
.user-avatar-photo {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1.5px solid var(--border2);
}
.welcome-avatar-photo {
  width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.1);
}

/* ── CLIENT TYPE TABS ────────────────────────── */
.client-type-tabs {
  display: flex; gap: 10px; margin-bottom: 1.5rem;
}
.client-type-btn {
  flex: 1; padding: 0.7rem 1rem;
  border-radius: var(--r2);
  border: 0.5px solid var(--border2);
  background: var(--bg2);
  color: var(--text2);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.client-type-btn:hover { border-color: var(--cyan2); color: var(--text); background: var(--bg3); }
.client-type-btn.active-general {
  background: rgba(8,145,178,0.15);
  border-color: var(--cyan2); color: var(--cyan);
}
.client-type-btn.active-commercial {
  background: rgba(167,139,250,0.12);
  border-color: var(--purple); color: var(--purple);
}
.client-type-btn svg { width: 18px; height: 18px; stroke-width: 1.5; }

/* ── COMING SOON ─────────────────────────────── */
.coming-soon {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 5rem 2rem;
  color: var(--text3); text-align: center;
}
.coming-soon .cs-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.3; }
.coming-soon h3 { font-size: 1rem; color: var(--text2); margin-bottom: 0.5rem; }
.coming-soon p { font-size: 0.85rem; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 768px) {
  #mobile-header { display: flex; }
  #sidebar {
    transform: translateX(-100%);
    top: 0; /* full height on mobile */
    z-index: 101;
  }
  #sidebar.mobile-open { transform: translateX(0); }
  #sidebar-overlay.show { display: block; }
  #main { margin-left: 0; padding: 1rem; padding-top: calc(56px + 1rem); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
  .form-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .welcome-banner { padding: 1.25rem; }
  .welcome-text h2 { font-size: 1.1rem; }
  .role-badge { display: none; }
  .modal { max-width: 100%; border-radius: var(--r2); }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card-img { height: 120px; }
}

/* ── REEF DIARY — mobile ─────────────────────── */
@media (max-width: 768px) {
  /* Action buttons (Check Parameters / Water Change / Excel / PDF) wrap and go full-ish width */
  #reef-diary-content .topbar-actions,
  #reef-actions-row { flex-wrap: wrap; gap: 8px; }
  #reef-actions-row button { flex: 1 1 auto; min-width: 130px; }
  /* Graph header: stack the title, tabs, and compare control */
  #reef-graph-header { flex-direction: column; align-items: stretch !important; gap: 8px; }
  #reef-graph-header .reef-graph-tabs { justify-content: stretch; }
  #reef-graph-header .reef-graph-tabs button { flex: 1; }
  #reef-graph-compare { margin-left: 0 !important; justify-content: space-between; }
  /* Share link row stacks */
  #reef-share-row { flex-direction: column; align-items: stretch !important; }
  #reef-share-row input { width: 100%; }
  /* Water-change summary cards stack */
  #reef-timeline .reef-wc-summary { flex-direction: column; }
  /* Bigger tap targets in the parameter modal */
  #check-params-modal input,
  #water-change-modal input,
  #water-change-modal select { font-size: 16px; padding: .7rem; } /* 16px prevents iOS zoom */
}

@keyframes fadeUp { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
.fadein { animation: fadeUp 0.35s ease both; }

/* ── BUBBLE GAME NAV BUTTON ──────────────────── */
.nav-game {
  margin-top: 8px;
  border-top: 0.5px solid var(--border);
  padding-top: 12px !important;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-game:hover { color: #22d3ee !important; }
.nav-game.played { opacity: 0.45; cursor: default; }
.nav-game.available { animation: gamePulse 2.5s ease-in-out infinite; }
@keyframes gamePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* ── REPORTS ─────────────────────────────────── */
.report-panel { padding: 1.25rem; }
.report-panel.hidden { display: none; }

.reports-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.report-stat-row {
  grid-column: span 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.report-stat-card {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--r2);
  padding: 1.1rem 1.25rem;
  text-align: center;
}
.report-stat-val {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  line-height: 1.1;
}
.report-stat-label {
  font-size: 0.72rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 4px;
}

.report-chart-card {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--r2);
  padding: 1.1rem 1.25rem;
}
.report-chart-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chart-area {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: .82rem;
}
.chart-area svg { overflow: visible; }

/* Report tab active state */
#report-tabs .client-type-btn.active-general {
  background: rgba(8,145,178,0.15);
  border-color: var(--cyan2);
  color: var(--cyan);
}

/* Report tables */
.report-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
.report-table th {
  text-align: left; padding: 6px 10px;
  font-size: .68rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text3);
  border-bottom: 0.5px solid var(--border);
  font-weight: 500; position: sticky; top: 0;
  background: var(--bg2);
}
.report-table td {
  padding: 7px 10px; border-bottom: 0.5px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.report-table tr:last-child td { border-bottom: none; }
.report-table tr:hover td { background: rgba(255,255,255,0.02); }

@media (max-width: 768px) {
  .reports-grid { grid-template-columns: 1fr; }
  .reports-grid [style*="span 2"],
  .reports-grid [style*="span 3"] { grid-column: span 1 !important; }
  .report-stat-row { grid-template-columns: 1fr 1fr; }
}
