/* ═══════════════════════════════════════════════════════════════
   Medi-Especial — Estilos completos
   Sem dependência de CDN — 100% offline
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & Variables ────────────────────────────────────── */
:root {
  --teal: #1B5DAE;
  --teal-dark: #14478A;
  --teal-light: #E8F0FE;
  --coral: #F5A623;
  --coral-hover: #E09015;
  --navy: #0E2240;
  --sage: #5A7FA0;
  --bg: #F4F7FB;
  --white: #FFFFFF;
  --g50: #F7F9FC;
  --g100: #ECF0F5;
  --g200: #D5DCE5;
  --g400: #8494A7;
  --g600: #4A5968;
  --g800: #1E2D3D;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
  --font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-display: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--g800);
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  background: var(--teal-dark);
  color: #fff;
  font-size: 12px;
  padding: 6px 0;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.topbar a { color: #cde8e2; }
.topbar a:hover { color: #fff; }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--g100);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-img {
  height: 38px;
  width: auto;
}
.logo span.coral { color: var(--coral); }
.logo-pill {
  background: var(--teal);
  color: #fff;
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
}
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--g600);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--teal);
  background: var(--teal-light);
}

.nav-auth { display: flex; gap: 8px; align-items: center; }
.nav-user-name { font-size: 13px; color: var(--g400); }

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--g800);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 900px) {
  .hamburger { display: flex; }
  .nav-links, .nav-auth {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }
  .nav-links.open, .nav-auth.open { display: flex; }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: inherit;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { background: var(--coral-hover); }
.btn-outline { background: transparent; border: 1.5px solid var(--teal); color: var(--teal); }
.btn-outline:hover { background: var(--teal-light); }
.btn-ghost { background: transparent; color: var(--g600); }
.btn-ghost:hover { background: var(--g100); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-danger { background: #DC3545; color: #fff; }
.btn-danger:hover { background: #B52D3A; }
.btn-success { background: #25D366; color: #fff; }
.btn-success:hover { background: #1DA851; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 60%, #0A2F5C 100%);
  color: #fff;
  padding: 72px 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(232,116,90,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
}
.hero h1 em { font-style: normal; color: var(--coral); }
.hero p {
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.9;
  margin-bottom: 28px;
  max-width: 500px;
}
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin-top: 36px; }
.hero-stat { text-align: center; }
.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
}
.hero-stat span { font-size: 13px; opacity: 0.7; }

.hero-visual { display: flex; justify-content: center; align-items: center; }
.hero-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 360px;
}
.hero-card h3 { font-size: 17px; margin-bottom: 14px; }
.hero-card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.hero-card-item:last-child { border: none; }
.hero-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero-card-icon svg { width: 20px; height: 20px; }
.hero-card-item strong { font-size: 14px; }
.hero-card-item small { font-size: 12px; opacity: 0.7; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero h1 { font-size: 30px; }
  .hero p { margin: 0 auto 28px; }
  .hero-buttons { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { display: none; }
}

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: 64px 24px; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 44px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.section-header p { color: var(--g400); font-size: 16px; max-width: 600px; margin: 0 auto; }
.section-white { background: var(--white); }
.section-teal { background: var(--teal); color: #fff; }
.section-teal .section-header h2 { color: #fff; }
.section-teal .section-header p { color: rgba(255,255,255,0.7); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--g100);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--g200); }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { padding: 28px; text-align: center; }
.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.feature-icon svg { width: 22px; height: 22px; color: var(--teal); }
.feature-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--navy); }
.feature-card p { font-size: 14px; color: var(--g400); line-height: 1.6; }

@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ── Medication Cards ─────────────────────────────────────── */
.med-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.search-box {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border: 1.5px solid var(--g200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.search-box:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,107,94,0.1); }

.cat-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--g200);
  background: var(--white);
  color: var(--g600);
  transition: var(--transition);
  font-family: inherit;
}
.cat-pill:hover { border-color: var(--teal); color: var(--teal); }
.cat-pill.active { background: var(--teal); color: #fff; border-color: var(--teal); }

.med-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.med-card { display: flex; flex-direction: column; }
.med-img {
  height: 170px;
  background: var(--g50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.med-img img { max-height: 130px; object-fit: contain; }
.med-img svg { width: 90px; height: 90px; }
.med-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.med-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--teal);
  margin-bottom: 6px;
}
.med-name { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.med-generic { font-size: 13px; color: var(--g400); margin-bottom: 12px; }
.med-price {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 4px;
}
.med-rx { font-size: 11px; color: var(--coral); font-weight: 600; margin-bottom: 12px; }
.med-avail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}
.med-avail::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.med-avail.yes { color: #25D366; }
.med-avail.yes::before { background: #25D366; }
.med-avail.no { color: #DC3545; }
.med-avail.no::before { background: #DC3545; }
.med-actions { margin-top: auto; display: flex; gap: 8px; }
.med-actions .btn { flex: 1; }

/* ── Med Detail ───────────────────────────────────────────── */
.med-detail { max-width: 1000px; margin: 0 auto; }
.med-detail-top { display: grid; grid-template-columns: 1fr 1.4fr; gap: 36px; margin-bottom: 36px; }
.med-detail-img {
  background: var(--g50);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 280px;
}
.med-detail-img svg { width: 160px; height: 160px; }
.med-detail-img img { max-height: 220px; object-fit: contain; }
.med-detail-info h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.med-detail-info .generic { font-size: 15px; color: var(--g400); margin-bottom: 16px; }
.med-detail-price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--teal);
  margin-bottom: 20px;
}
.med-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.med-meta-item {
  padding: 12px 14px;
  background: var(--g50);
  border-radius: var(--radius-sm);
}
.med-meta-item label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--g400);
  margin-bottom: 2px;
}
.med-meta-item span { font-size: 14px; font-weight: 500; color: var(--navy); }

.med-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--g100); }
.med-tab {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--g400);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  font-family: inherit;
  transition: var(--transition);
}
.med-tab:hover { color: var(--teal); }
.med-tab.active { color: var(--teal); border-bottom-color: var(--teal); }

.med-content {
  padding: 24px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--g100);
  line-height: 1.8;
  font-size: 15px;
  color: var(--g600);
}

.med-warning {
  margin-top: 28px;
  padding: 18px;
  background: #FFF3E0;
  border-radius: var(--radius);
  font-size: 13px;
  color: #B45309;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .med-detail-top { grid-template-columns: 1fr; }
  .med-meta { grid-template-columns: 1fr; }
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  padding: 44px 24px;
  text-align: center;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 8px;
}
.page-header p { opacity: 0.8; font-size: 16px; }

/* ── Content Page ─────────────────────────────────────────── */
.content-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 36px 24px;
  line-height: 1.8;
  font-size: 15px;
  color: var(--g600);
}
.content-page h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--navy);
  margin: 28px 0 10px;
}
.content-page h3 { font-size: 17px; color: var(--navy); margin: 20px 0 8px; }
.content-page p { margin-bottom: 14px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--g600);
  margin-bottom: 5px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--g200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  background: var(--white);
}
.form-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,107,94,0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
textarea.form-input { min-height: 100px; resize: vertical; }
select.form-input { appearance: auto; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 500;
}
.alert-error { background: #FDECEA; color: #DC3545; }
.alert-success { background: #E6F9EE; color: #0A8A3D; }
.alert-warning { background: #FFF3E0; color: #B45309; }
.alert-info { background: #E8F0FE; color: #1A73E8; }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Contact ──────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  max-width: 1000px;
  margin: 0 auto;
}
.contact-info-cards { display: flex; flex-direction: column; gap: 14px; }
.contact-info-card {
  padding: 18px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--g100);
}
.contact-info-card h4 { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.contact-info-card p { font-size: 14px; color: var(--g400); }
.contact-info-card .icon { color: var(--teal); margin-bottom: 8px; }
.contact-info-card .icon svg { width: 22px; height: 22px; }
.contact-cta {
  padding: 20px;
  background: var(--teal-light);
  border-radius: var(--radius);
  text-align: center;
}
.contact-cta p { font-size: 14px; color: var(--teal-dark); margin-bottom: 12px; font-weight: 500; }

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.modal .sub { color: var(--g400); font-size: 14px; margin-bottom: 20px; }
.modal-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--g100);
}
.modal-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--g400);
  background: none;
  font-family: inherit;
  transition: var(--transition);
}
.modal-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.modal-hint {
  margin-top: 16px;
  padding: 12px;
  background: var(--g50);
  border-radius: 8px;
  font-size: 12px;
  color: var(--g400);
}

/* ── Chat ─────────────────────────────────────────────────── */
.chat-fab {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 150;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}
.chat-fab:hover { background: var(--teal-dark); transform: scale(1.05); }
.chat-fab svg { width: 22px; height: 22px; }

.whatsapp-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}
.whatsapp-fab:hover { background: #1DA851; transform: scale(1.05); }
.whatsapp-fab svg { width: 24px; height: 24px; }

.chat-window {
  position: fixed;
  bottom: 155px;
  right: 24px;
  z-index: 160;
  width: 350px;
  max-height: 460px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-window.hidden { display: none; }
.chat-head {
  background: var(--teal);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-head h4 { font-size: 15px; font-weight: 600; }
.chat-head small { font-size: 12px; opacity: 0.7; }
.chat-head button { background: none; border: none; color: #fff; cursor: pointer; }
.chat-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 240px;
  max-height: 300px;
  background: var(--g50);
}
.chat-msg {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 85%;
}
.chat-msg.bot {
  background: var(--white);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--g100);
}
.chat-msg.user {
  background: var(--teal);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-input-row { display: flex; border-top: 1px solid var(--g100); }
.chat-input-row input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
}
.chat-input-row button {
  padding: 12px 16px;
  background: var(--teal);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

@media (max-width: 600px) {
  .chat-window { right: 8px; left: 8px; width: auto; bottom: 140px; }
}

/* ── LGPD Banner ──────────────────────────────────────────── */
.lgpd-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy);
  color: #fff;
  padding: 18px 24px;
  z-index: 300;
}
.lgpd-banner.hidden { display: none; }
.lgpd-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.lgpd-inner p { font-size: 13px; line-height: 1.6; flex: 1; }
.lgpd-inner a { color: var(--coral); cursor: pointer; }
.lgpd-buttons { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 600px) {
  .lgpd-inner { flex-direction: column; text-align: center; }
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 52px 24px 24px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.footer h4 { color: #fff; font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.footer p, .footer a { font-size: 14px; line-height: 1.7; }
.footer a { color: rgba(255,255,255,0.7); display: block; margin-bottom: 6px; transition: var(--transition); }
.footer a:hover { color: var(--coral); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ── Admin ────────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 64px);
}
.admin-sidebar {
  background: var(--navy);
  padding: 24px 14px;
  color: #fff;
}
.admin-sidebar h3 {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 18px;
  opacity: 0.4;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  transition: var(--transition);
  margin-bottom: 2px;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.admin-nav-item svg { width: 18px; height: 18px; }
.admin-content { padding: 28px; overflow-y: auto; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--g100);
}
.stat-card .label { font-size: 13px; color: var(--g400); margin-bottom: 4px; }
.stat-card .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--g100);
}
.data-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--g400);
  background: var(--g50);
  border-bottom: 1px solid var(--g100);
}
.data-table td {
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--g100);
}
.data-table tr:last-child td { border: none; }
.data-table tr:hover td { background: var(--g50); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green { background: #E6F9EE; color: #0A8A3D; }
.badge-red { background: #FDECEA; color: #DC3545; }
.badge-blue { background: #E8F0FE; color: #1A73E8; }
.badge-orange { background: #FFF3E0; color: #F5A623; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 76px;
  right: 24px;
  background: var(--teal);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}
.toast.hidden { display: none; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Misc ─────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 20px;
}
.back-link:hover { text-decoration: underline; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--g400);
}
.empty-state p { font-size: 16px; margin-bottom: 8px; }
.empty-state small { font-size: 14px; }

.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }

/* ── Med placeholder icon (inline SVG) ────────────────────── */
.med-placeholder {
  width: 90px;
  height: 90px;
}

/* ── Gallery / Lightbox ───────────────────────────────────── */
.img-gallery-wrap { position: relative; cursor: pointer; }
.img-gallery-wrap:hover { opacity: 0.95; }
.img-badge-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.85;
}
.img-badge-count svg { width: 14px; height: 14px; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox-overlay.hidden { display: none; }
.lightbox-content {
  position: relative;
  max-width: 800px;
  width: 100%;
  text-align: center;
}
.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
  object-fit: contain;
  background: #fff;
}
.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}
.lightbox-close:hover { opacity: 0.7; }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }
.lightbox-counter {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  margin-top: 12px;
}

.upload-area {
  border: 2px dashed var(--g200);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.upload-area:hover { border-color: var(--teal); background: var(--teal-light); }
.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-area img {
  max-height: 80px;
  border-radius: 4px;
}
.upload-area .upload-label { font-size: 13px; color: var(--g400); }

@media (max-width: 768px) {
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
