:root {
  color-scheme: dark;
  /* base colours replaced for premium dark theme */
  --bg: #11140f;
  --surface: rgba(17,20,15,0.85);
  --surface-soft: rgba(17,20,15,0.65);
  --text: #f0f0e0;
  --muted: #a3a3a3;
  --primary: #0a1f10;
  --primary-strong: #08180c;
  --whatsapp: #0d3f1f;
  --line: rgba(255,255,255,0.15);
  --line-strong: rgba(255,255,255,0.25);
  --focus: rgba(212,175,55,0.22);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.5);
  --shadow-strong: 0 20px 36px rgba(0, 0, 0, 0.6);
  --gold: #d4af37;
  --font-ui: 'Inter', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --home-hero-image: url('../images/home-hero/IMG-20260227-WA0031.jpg');
}

* {
  box-sizing: border-box;
}

html {
  /* Imagen de fondo completamente visible */
  background: url('../images/background/image-2.jpg') center / cover no-repeat fixed;
}

body {
  margin: 0;
  padding: 0.5rem 0.6rem 1.5rem;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  /* Scrim sutil para mejorar legibilidad sin ocultar el fondo */
  background: rgba(10, 25, 15, 0.35);
}

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
}

.app-shell {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Módulos (vistas con formularios) — tarjeta blanca sobre el fondo */
.view.glass {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.app-shell {
  /* Solo limita el ancho — sin fondo ni tarjeta envolvente */
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.view {
  display: none;
  padding: 0.9rem;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-radius: 1rem;
}

.view.is-active {
  display: block;
}

/* La vista home es transparente — los elementos flotan directamente sobre el fondo */
.view--home {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.home-greeting {
  color: #ffffff;
  font-size: clamp(1.22rem, 1.08rem + 1.1vw, 1.56rem);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
  margin: 0 0 1.2rem 0.2rem;
  letter-spacing: 0.01em;
}

.home-hero {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 1.15rem;
  padding: 1.4rem 1.2rem 1.1rem;
  background:
    var(--home-hero-image) center / cover no-repeat;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  margin-bottom: 0.9rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.22;
  font-family: var(--font-serif);
}

h1 {
  font-size: clamp(1.08rem, 0.96rem + 0.8vw, 1.36rem);
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(1rem, 0.95rem + 0.45vw, 1.2rem);
  margin-bottom: 0.2rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.view--home h2 {
  border-bottom: none;
  padding-bottom: 0;
}

h3 {
  font-size: 0.9rem;
  color: #334155;
}

.view > p {
  margin: 0.35rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.system-view {
  background: linear-gradient(180deg, #f8fffb 0%, #eef6ff 100%);
  color: #0f172a;
}

.system-view h2 {
  border-bottom-color: rgba(15, 23, 42, 0.15);
}

.system-header p {
  margin: 0.35rem 0 0.85rem;
  color: #334155;
  font-size: 0.86rem;
}

/* ─── SISTEMA AGROMILCH — REDISEÑO MODERNO ─────────────────────────── */
.system-view--agromilch {
  background:
    radial-gradient(circle at 0% 0%, rgba(16, 185, 129, 0.10) 0%, transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, #f6fbf8 0%, #eef4fb 100%);
  color: #0f172a;
  padding: 1rem 0.95rem 1.1rem;
}

.system-header--agromilch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.85rem;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 60%, #ecfeff 100%);
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 1rem;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.10);
}

.system-header--agromilch .system-header__badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.28);
}

.system-header--agromilch .system-header__text {
  flex: 1 1 auto;
  min-width: 0;
}

.system-header--agromilch .section-gallery-title {
  margin: 0;
  font-size: clamp(1.02rem, 0.95rem + 0.5vw, 1.18rem);
  color: #064e3b;
  border: none;
  padding: 0;
  letter-spacing: 0.01em;
}

.system-header--agromilch p {
  margin: 0.15rem 0 0;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.35;
}

/* Indicador de conexión Firebase */
.firebase-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.7rem;
  margin: 0 0 0.85rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  background: #fff;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.firebase-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.firebase-status--checking {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.firebase-status--checking .firebase-status__dot {
  animation: fb-pulse 1.4s ease-in-out infinite;
}

@keyframes fb-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.firebase-status--ok {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.firebase-status--error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.firebase-pending {
  margin: 0.1rem 0 0.85rem;
  padding: 0.58rem 0.7rem;
  border-radius: 0.7rem;
  border: 1px dashed rgba(15, 23, 42, 0.25);
  background: rgba(255, 255, 255, 0.72);
  color: #1e293b;
  font-size: 0.78rem;
}

.system-grid {
  display: grid;
  gap: 0.72rem;
  grid-template-columns: 1fr;
}

.system-grid--single {
  grid-template-columns: 1fr;
}

.system-grid--agromilch {
  gap: 0.85rem;
}

.panel-card {
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 0.86rem;
  background: rgba(255, 255, 255, 0.88);
  padding: 0.72rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.panel-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 0.96rem;
}

.panel-card > p {
  margin: 0.38rem 0 0.6rem;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Panel-card rediseñado para Sistema Agromilch */
.system-view--agromilch .panel-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: #ffffff;
  padding: 0.95rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.system-view--agromilch .panel-card:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
  transform: translateY(-1px);
}

.panel-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.panel-card__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #ecfdf5 0%, #e0f2fe 100%);
  color: #047857;
}

.panel-card--feed .panel-card__icon {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #047857;
}

.panel-card--invoice .panel-card__icon {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
}

.panel-card--report .panel-card__icon {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #b45309;
}

.panel-card__head h3 {
  margin: 0;
  font-size: 0.98rem;
  color: #0f172a;
  line-height: 1.25;
}

.panel-card__head p {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #64748b;
}

.system-form {
  display: grid;
  gap: 0.5rem;
}

.system-form label {
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
}

.system-form input,
.system-form select,
.panel-card select {
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 0.58rem;
  background: #fff;
  color: #0f172a;
  padding: 0.52rem 0.56rem;
  font-size: 0.85rem;
}

.system-view--agromilch .system-form input,
.system-view--agromilch .system-form select {
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  background: #f8fafc;
  padding: 0.6rem 0.7rem;
  font-size: 0.88rem;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.system-view--agromilch .system-form input:focus,
.system-view--agromilch .system-form select:focus {
  outline: none;
  background: #fff;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.btn-system {
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 0.62rem;
  background: linear-gradient(135deg, #0b2d1a 0%, #1f7a3f 100%);
  color: #f8fafc;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.58rem 0.7rem;
}

.btn-system:hover {
  filter: brightness(1.06);
}

.system-view--agromilch .btn-system {
  margin-top: 0.2rem;
  border: none;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  color: #ffffff;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.system-view--agromilch .btn-system:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(14, 165, 233, 0.34);
  filter: brightness(1.04);
}

.system-view--agromilch .btn-system:active {
  transform: translateY(0);
}

.system-result {
  min-height: 1.2rem;
  margin: 0.45rem 0 0;
  color: #1d4ed8;
  font-size: 0.8rem;
}

.system-view--agromilch .system-result {
  color: #047857;
  font-weight: 600;
}

.system-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.72rem;
}

.system-metrics--agromilch {
  gap: 0.6rem;
  margin-bottom: 0.95rem;
}

.metric-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.54rem;
}

.metric-card__label {
  display: block;
  color: #475569;
  font-size: 0.7rem;
}

.metric-card__value {
  color: #0b2d1a;
  font-size: 0.95rem;
}

/* Tarjetas de métrica modernas */
.metric-card--accent {
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 0.95rem;
  background: #ffffff;
  padding: 0.7rem 0.65rem 0.75rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.metric-card--accent::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #34d399);
}

.metric-card--accent.metric-card--green::before {
  background: linear-gradient(90deg, #059669, #84cc16);
}

.metric-card--accent.metric-card--blue::before {
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
}

.metric-card--accent .metric-card__icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #f1f5f9;
  margin-bottom: 0.35rem;
}

.metric-card--accent .metric-card__label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card--accent .metric-card__value {
  display: block;
  margin-top: 0.18rem;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  word-break: break-word;
}

/* Feed de ventas */
.sales-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.sales-feed__empty {
  margin: 0;
  padding: 0.85rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.7rem;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.82rem;
  text-align: center;
}

.sales-feed__item {
  position: relative;
  padding: 0.65rem 0.75rem 0.7rem;
  border-radius: 0.78rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #cbd5e1;
  display: grid;
  gap: 0.18rem;
}

.sales-feed__item--pending {
  border-left-color: #f59e0b;
  background: linear-gradient(180deg, #fffdf6 0%, #fef9ec 100%);
}

.sales-feed__item--invoiced {
  border-left-color: #10b981;
  background: linear-gradient(180deg, #f6fefa 0%, #ecfdf5 100%);
}

.sales-feed__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sales-feed__franchise {
  color: #0f172a;
  font-weight: 700;
  font-size: 0.85rem;
}

.sales-feed__status {
  display: inline-block;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sales-feed__status--pending {
  background: #fef3c7;
  color: #92400e;
}

.sales-feed__status--invoiced {
  background: #d1fae5;
  color: #065f46;
}

.sales-feed__product {
  margin: 0;
  color: #1e293b;
  font-size: 0.82rem;
  font-weight: 600;
}

.sales-feed__meta {
  margin: 0;
  color: #64748b;
  font-size: 0.74rem;
}

.sales-feed__amount {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Reporte por franquicia */
.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.report-list__empty {
  margin: 0;
  padding: 0.85rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.7rem;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.82rem;
  text-align: center;
}

.report-list__item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.25rem 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
}

.report-list__name {
  color: #0f172a;
  font-weight: 700;
  font-size: 0.85rem;
}

.report-list__total {
  color: #047857;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: right;
}

.report-list__units {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 0.74rem;
}

.info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.42rem;
}

.info-list li {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.55rem;
  background: #fff;
  padding: 0.5rem 0.56rem;
  color: #1e293b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.info-list li strong {
  color: #0b2d1a;
}

.info-list .info-list__group {
  background: linear-gradient(135deg, #ecfdf5 0%, #e0f2fe 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #0f172a;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ── Form actions (CRUD franquicias / inventario) ──────────────────── */
.form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.btn-system--ghost {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-shadow: none;
}

.btn-system--ghost:hover {
  background: #eef2f7;
  filter: none;
}

/* ── Selector de franquicia activa ─────────────────────────────────── */
.active-franchise {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
  display: grid;
  gap: 0.4rem;
}

.active-franchise__label {
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
}

.active-franchise select {
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 0.58rem;
  background: #fff;
  color: #0f172a;
  padding: 0.52rem 0.56rem;
  font-size: 0.85rem;
}

.active-franchise__info {
  margin: 0;
  color: #047857;
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 1rem;
}

/* ── Sesión activa (rol + correo + cerrar sesión) ───────────────────── */
.franchise-session {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.85rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.7rem;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.franchise-session__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.franchise-session__email {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 500;
  word-break: break-all;
}

.franchise-session .btn-system {
  margin-top: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.role-badge--admin {
  background: #0b2d1a;
  color: #f4f1e4;
  border-color: #d4af37;
}

.role-badge--user {
  background: #ecfdf5;
  color: #047857;
  border-color: rgba(4, 120, 87, 0.35);
}

.field-hint {
  display: block;
  margin-top: -0.2rem;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.35;
}

/* ── Listas tipo CRUD (franquicias / productos) ────────────────────── */
.data-list {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.data-list__empty {
  border: 1px dashed rgba(15, 23, 42, 0.18);
  background: #f8fafc;
  border-radius: 0.6rem;
  padding: 0.6rem 0.7rem;
  color: #64748b;
  font-size: 0.78rem;
  text-align: center;
}

.data-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.7rem;
  background: #ffffff;
  padding: 0.6rem 0.7rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.data-list__info {
  display: grid;
  gap: 0.18rem;
  flex: 1 1 60%;
  min-width: 0;
}

.data-list__title {
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 700;
}

.data-list__meta {
  color: #475569;
  font-size: 0.76rem;
  line-height: 1.35;
  word-break: break-word;
}

.data-list__actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.data-list__btn {
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.38rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.data-list__btn:hover {
  background: #eef2f7;
}

.data-list__btn--danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.22);
}

.data-list__btn--danger:hover {
  background: #fee2e2;
}

.panel-card--disabled {
  opacity: 0.85;
}

.panel-card--disabled .system-form input,
.panel-card--disabled .system-form button {
  background: #f1f5f9;
  cursor: not-allowed;
}

.menu-grid {
  margin-top: 0.72rem;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}

.menu-item {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-radius: 0.9rem;
  padding: 1rem 1.05rem;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  touch-action: manipulation;
}

.menu-item:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.menu-item:active {
  transform: translateY(0);
}

.menu-item::after {
  content: '›';
  margin-left: auto;
  color: #9ca3af;
  font-size: 1rem;
  line-height: 1.2;
}

.menu-item__index {
  width: 42px;
  height: 42px;
  border-radius: 0.65rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--primary);
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}

.menu-item__content {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.menu-item__title {
  font-family: var(--font-serif);
  font-size: 1.13rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.menu-item__meta {
  font-size: 0.84rem;
  line-height: 1.35;
  color: #64748b;
}

.flow-block {
  margin-top: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  padding: 0.68rem;
  background: var(--surface-soft);
}

.flow-block h3 {
  margin-bottom: 0.45rem;
}

.module-visual {
  margin: 0.55rem 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  overflow: hidden;
  background: #fff;
}

.module-visual img {
  display: block;
  width: 100%;
  max-height: 184px;
  object-fit: cover;
}

.option-group,
.form-grid,
.action-row {
  display: grid;
  gap: 0.42rem;
}

.equipos-view .action-row {
  padding: 0 0 1rem;
  gap: 0.6rem;
}

.option-group label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.58rem;
  padding: 0.48rem 0.54rem;
  background: #fff;
  color: #334155;
  font-size: 0.84rem;
}

.option-group label:has(input:checked) {
  border-color: #86efac;
  background: #f0fdf4;
}

label {
  display: grid;
  gap: 0.24rem;
  font-size: 0.82rem;
  color: #475569;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0.54rem;
  background: #fff;
  color: var(--text);
  padding: 0.5rem 0.56rem;
  font: inherit;
  font-size: 0.86rem;
}

input:focus,
select:focus,
textarea:focus,
.menu-item:focus-visible,
.btn:focus-visible,
.home-fab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
  border-color: #86efac;
}

/* Equipos Hero Section */
.equipos-view {
  padding: 0 !important;
  overflow: visible !important;
  /* dark forest gradient background */
  background: linear-gradient(180deg, #0c100a 0%, #101713 70%, #122216 100%);
  color: var(--text);
  max-width: 360px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: 1.2rem !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  position: relative;
}

/* notch and status bar simulation */
.equipos-view::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 28px;
  background: #11140f;
  border-radius: 0 0 12px 12px;
  z-index: 5;
}
.equipos-view::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.15);
  z-index: 4;
}

.equipos-hero {
  display: none !important;
}

.equipos-hero__bg {
  position: absolute;
  inset: 0;
  background: url('../images/equipos-ordeno/background/image-3.jpg') center / contain no-repeat;
  opacity: 0.24;
  z-index: 0;
}

.equipos-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11, 45, 26, 0.82) 0%, rgba(22, 101, 52, 0.78) 100%);
  z-index: 1;
}

.equipos-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.equipos-hero__title {
  color: #fff;
  font-size: clamp(0.95rem, 0.8rem + 0.8vw, 1.3rem);
  font-weight: 700;
  margin: 0 0 0.2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.02em;
}

.equipos-hero__subtitle {
  color: #bbf7d0;
  font-size: clamp(0.7rem, 0.6rem + 0.4vw, 0.85rem);
  margin: 0;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.equipos-configurator {
  padding: 1.2rem;
  border-radius: 1.2rem;
  margin-top: 0.9rem; /* bajar el bloque para respirar sobre el fondo */
  display: flex;
  flex-direction: column;
  align-items: center; /* centrar las tarjetas */
  /* contenedor transparente para dejar el fondo libre */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
}

.configurator-step {
  /* premium frosted card with gold border */
  background: rgba(17,20,15,0.65);
  border: 1px solid var(--gold);
  border-radius: 1.1rem;
  padding: 1rem 1.2rem;
  margin: 1.1rem auto;
  width: calc(100% - 2.4rem);
  max-width: 340px;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s, background 0.28s;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Tarjeta principal del configurador: efecto 'caso transparente' */
.configurator-main {
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.08) 100%);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 18px 40px rgba(4,10,6,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-radius: 1.05rem;
  transition: transform 0.36s cubic-bezier(.2,.9,.2,1), box-shadow 0.36s;
  position: relative;
  overflow: visible;
}

.configurator-main::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 1.2rem;
  background: linear-gradient(90deg, rgba(134,239,172,0.06), rgba(22,101,52,0.04));
  z-index: -1;
  filter: blur(8px);
  opacity: 0.9;
}

.configurator-main:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 28px 60px rgba(4,10,6,0.34), inset 0 1px 0 rgba(255,255,255,0.08);
}


.configurator-step:hover {
  border-color: var(--gold) !important;
  background: rgba(17,20,15,0.75);
  box-shadow: 0 16px 44px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-6px) scale(1.02);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 1.03rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: #11140f;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.6);
}

.configurator-step h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  font-family: 'Playfair Display', serif;
}

.step-description {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.35;
}

.motor-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  align-items: stretch;
  width: 100%;
}

.option-card {
  display: flex !important;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0.78rem !important;
  border-radius: 0.72rem !important;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease !important;
  position: relative;
  overflow: hidden;
  background: rgba(17,20,15,0.5) !important;
  border: 1px solid var(--gold) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1) !important;
}

.option-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(22, 101, 52, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.option-card input[type="radio"] {
  width: auto;
  margin: 0;
  cursor: pointer;
  accent-color: #166534;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.option-card:has(input:checked) {
  border-color: #a4f0c8 !important;
  background: rgba(212,175,55,0.2) !important;
  box-shadow: 0 10px 26px rgba(212,175,55,0.15) !important;
  transform: translateY(-4px) !important;
}

.option-card:has(input:checked)::before {
  opacity: 1;
}

.option-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  color: var(--gold);
}

.option-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
  color: #0f172a;
}

.option-label strong {
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  color: var(--gold);
}

.option-hint {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.input-label {
  display: grid;
  gap: 0.5rem !important;
}

.label-text {
  color: #334155;
  font-weight: 500;
  font-size: 0.85rem;
}

.select-enhanced {
  border-color: var(--gold) !important;
  border-radius: 0.8rem !important;
  padding: 0.6rem 0.9rem !important;
  background: rgba(17,20,15,0.6) !important;
  color: var(--text);
  font-weight: 400;
  font-size: 0.9rem !important;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5) !important;
}

.select-enhanced:focus {
  border-color: #86efac !important;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.1), 0 4px 12px rgba(22, 101, 52, 0.12) !important;
}

.equipos-result {
  margin-top: 0.55rem;
  padding: 0.85rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.95) 0%, rgba(220, 252, 231, 0.92) 100%);
  border: 1.4px solid rgba(134, 239, 172, 0.7);
  display: none;
  box-shadow: 0 6px 16px rgba(22, 101, 52, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.equipos-result:has(.selection-output:not(:empty)) {
  display: block;
}

.selection-output {
  margin: 0;
  border: none;
  border-radius: 0.6rem;
  padding: 0.7rem;
  background: #fff;
  color: #0b2d1a;
  font-size: 0.81rem;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.1);
}

.selection-output:empty {
  display: none;
}

.equipos-view .btn {
  border-radius: 1rem;
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  background: rgba(0,0,0,0.4);
  color: var(--text);
  border: 1px solid var(--gold);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

.btn {
  padding: 0.56rem 0.68rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  touch-action: manipulation;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
  background: rgba(0,0,0,0.5);
}

.btn--primary {
  background: linear-gradient(135deg, #1c3d23, #0a1f10);
  color: var(--text);
  border: 1px solid rgba(74, 222, 128, 0.18);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.18);
}

.btn--primary:hover {
  background: linear-gradient(135deg, #22472a, #102616);
  box-shadow: 0 8px 22px rgba(22, 163, 74, 0.28);
}

.btn--whatsapp {
  background: linear-gradient(140deg, #22c55e, var(--whatsapp));
  box-shadow: 0 8px 16px rgba(22, 163, 74, 0.24);
}

.btn--ghost {
  color: #0f172a;
  background: #fff;
  border-color: var(--line-strong);
}

.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
}

.feedback {
  margin: 0.55rem 0 0;
  min-height: 1rem;
  text-align: center;
  font-size: 0.78rem;
  color: #166534;
}

.ios-tip {
  margin-top: 0.65rem;
  font-size: 0.76rem;
  color: #64748b;
}

.home-fab {
  position: fixed;
  right: 0.72rem;
  bottom: 0.72rem;
  z-index: 10;
  border: none;
  border-radius: 999px;
  padding: 0.56rem 0.76rem;
  background: #111827;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(17, 24, 39, 0.22);
}

.home-fab:hover {
  filter: brightness(1.05);
}

@media (min-width: 720px) {
  body {
    padding-top: 1.5rem;
  }

  .view {
    padding: 1rem;
  }

  .menu-grid,
  .form-grid,
  .action-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.58rem;
  }

  .menu-item {
    min-height: 90px;
  }

  .menu-item--calendario {
    grid-column: span 2;
    min-height: 110px;
  }

  .action-row .btn:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 500px) {
  .equipos-view {
    margin: 0 -0.5rem;
    max-width: calc(100% - 1rem) !important;
  }

  .equipos-hero {
    height: 150px;
    padding: 0.95rem 1rem;
  }

  .equipos-hero__title {
    font-size: 0.95rem;
  }

  .equipos-hero__subtitle {
    font-size: 0.65rem;
  }

  .equipos-configurator {
    padding: 0.75rem;
  }

  .configurator-step {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .step-number {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .configurator-step h3 {
    font-size: 0.88rem;
  }

  .option-card {
    padding: 0.7rem 0.75rem !important;
    gap: 0.6rem;
  }

  .option-icon {
    font-size: 1rem;
  }

  .option-label strong {
    font-size: 0.78rem;
  }

  .option-hint {
    font-size: 0.62rem;
  }

  .home-hero {
    min-height: 260px;
  }

  .equipos-view .action-row {
    padding: 0 0.75rem 0.75rem;
  }
}

@media (max-width: 420px) {
  body {
    padding: 0.4rem 0.5rem 1.2rem;
  }

  .view {
    padding: 0.7rem;
  }

  .home-hero {
    padding: 0.7rem;
    min-height: 240px;
  }

  .menu-item {
    padding: 0.58rem 0.62rem;
  }

  .menu-item__meta {
    font-size: 0.72rem;
  }

  .module-visual img {
    max-height: 160px;
  }

  .equipos-view {
    max-width: calc(100% - 1rem) !important;
    margin: 0 -0.5rem;
  }

  .equipos-hero {
    height: 130px;
    padding: 0.85rem 0.95rem;
  }

  .equipos-hero__title {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
  }

  .equipos-hero__subtitle {
    font-size: 0.55rem;
  }

  .equipos-configurator {
    padding: 0.7rem;
  }

  .configurator-step {
    padding: 0.65rem;
    margin-bottom: 0.45rem;
  }

  .step-header {
    gap: 0.55rem;
  }

  .step-number {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
  }

  .configurator-step h3 {
    font-size: 0.85rem;
  }

  .option-card {
    padding: 0.6rem 0.65rem !important;
    gap: 0.6rem;
  }

  .option-icon {
    font-size: 0.95rem;
  }

  .option-label strong {
    font-size: 0.76rem;
  }

  .select-enhanced {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
  }

  .equipos-view .action-row {
    padding: 0 0.7rem 0.7rem;
  }

  .equipos-view .btn {
    padding: 0.6rem 0.65rem;
    font-size: 0.8rem;
  }
}

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

/* ═══════════════════════════════════════════════════════════════
   CALENDARIO BOVINO — Styles
   ═══════════════════════════════════════════════════════════════ */

/* Menu item special accent for calendar button */
.menu-item__index--cal {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #86efac;
  color: var(--primary);
  font-size: 1.9rem;
  width: 52px;
  height: 52px;
  border-radius: 0.8rem;
  box-shadow: 0 2px 8px rgba(10, 31, 16, 0.12);
}

.menu-item--calendario {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  padding: 1.35rem 1.15rem;
  align-items: center;
}

.menu-item--calendario .menu-item__title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0.03em;
  line-height: 1.2;
  background: none;
  -webkit-text-fill-color: initial;
}

.menu-item--calendario:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ── Install App Button ─────────────────────────────────────── */
.menu-item--install {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.85), rgba(224, 231, 255, 0.75));
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}

.menu-item--install:hover {
  border-color: rgba(99, 102, 241, 0.6);
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.95), rgba(199, 210, 254, 0.85));
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.22);
}

.menu-item--install .menu-item__title {
  color: #3730a3;
}

.menu-item--install .menu-item__meta {
  color: #6366f1;
}

.menu-item__index--install {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border-color: #a5b4fc;
  color: #4f46e5;
}

/* ── Botón pequeño "Descargar app" (APK Android) ────────────── */
.download-app-btn {
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #065f46;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #6ee7b7;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.download-app-btn:hover,
.download-app-btn:focus-visible {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
  outline: none;
}
.download-app-btn:active {
  transform: translateY(0);
}

/* ── iOS Install Modal ──────────────────────────────────────── */
.ios-install-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ios-install-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ios-install-modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 1.4rem 1.4rem 0 0;
  padding: 1.6rem 1.5rem 2.2rem;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
  text-align: center;
  animation: slideUp 0.28s cubic-bezier(0.34, 1.06, 0.64, 1) both;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.ios-install-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
  font: inherit;
}

.ios-install-modal__close:hover {
  background: #e2e8f0;
}

.ios-install-modal__icon {
  font-size: 2.8rem;
  margin: 0 0 0.4rem;
  line-height: 1;
}

.ios-install-modal__title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1.1rem;
}

.ios-install-steps {
  list-style: none;
  counter-reset: steps;
  padding: 0;
  margin: 0 0 1.1rem;
  text-align: left;
  display: grid;
  gap: 0.65rem;
}

.ios-install-steps li {
  counter-increment: steps;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.45;
}

.ios-install-steps li::before {
  content: counter(steps);
  flex: 0 0 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4f46e5;
  font-weight: 700;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
}

.ios-share-icon {
  font-style: normal;
  font-weight: 700;
  color: #3b82f6;
}

.ios-install-modal__footer {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
}

[hidden] {
  display: none !important;
}

/* ── Calendar View ─────────────────────────────────────────── */
.view--calendario {
  background: transparent;
  padding: 0;
  border-radius: 0;
  min-height: 60vh;
}

/* Panel is a centered content area */
.cal-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0.8rem;
  position: relative;
  overflow: hidden;
  min-height: 70vh;
}

/* ── Floating Decorative Background ───────────────────────── */
.cal-auth-bg-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.cal-float-icon {
  position: absolute;
  left: var(--fi-x, 50%);
  top: var(--fi-y, 50%);
  font-size: 1.6rem;
  opacity: 0.18;
  filter: blur(0.5px);
  animation: calFloat var(--fi-d, 6s) ease-in-out infinite alternate;
}

@keyframes calFloat {
  0%   { transform: translateY(0) scale(1); }
  100% { transform: translateY(-18px) scale(1.1); }
}

/* ── Auth Card ─────────────────────────────────────────────── */
.cal-auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: rgba(17, 20, 15, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 1.6rem;
  padding: 2.2rem 1.8rem;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(212, 175, 55, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  animation: calCardIn 0.5s cubic-bezier(.2,.9,.2,1) both;
}

.cal-auth-card--wall { gap: 0.7rem; text-align: center; }
.cal-auth-card--form { gap: 0.85rem; }

@keyframes calCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo ring */
.cal-auth-logo-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(212,175,55,0.18), rgba(212,175,55,0.04));
  border: 2px solid rgba(212, 175, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.12);
  animation: calRingPulse 3s ease-in-out infinite;
}

.cal-auth-logo-ring--sm {
  width: 56px;
  height: 56px;
}

.cal-auth-logo-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.cal-auth-logo-ring--sm .cal-auth-logo-emoji {
  font-size: 1.6rem;
}

@keyframes calRingPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.1); }
  50%      { box-shadow: 0 0 36px rgba(212, 175, 55, 0.2); }
}

.cal-auth-title {
  margin: 0;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.65rem);
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-serif);
  text-align: center;
  letter-spacing: 0.01em;
}

.cal-auth-subtitle {
  margin: -0.3rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.7;
  text-align: center;
}

.cal-auth-desc {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

/* Feature chips */
.cal-auth-features {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.15rem 0;
}

.cal-feature-chip {
  font-size: 0.8rem;
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--gold);
  white-space: nowrap;
}

.cal-auth-secure-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.7;
  text-align: center;
}

.cal-auth-access-note {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--gold);
  text-align: center;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  padding: 0.6rem 1rem;
}

.politicas-link {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  opacity: 0.45;
  text-align: center;
  text-decoration: none;
  padding: 0.55rem 0.5rem;
  line-height: 1.4;
  border-radius: 4px;
  transition: opacity 0.2s, text-decoration-color 0.2s;
}
.politicas-link:hover,
.politicas-link:focus {
  opacity: 0.85;
  text-decoration: underline;
}
.politicas-link:focus:not(:focus-visible) {
  outline: none;
}
.politicas-link:focus-visible {
  outline: 2px solid var(--accent, #4caf50);
  outline-offset: 2px;
}

.site-footer {
  text-align: center;
  padding: 0.5rem 1rem;
}

.cal-back-btn {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem 0;
  text-align: left;
  transition: color 0.16s;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.cal-back-btn:hover { color: var(--text); }

/* ── Auth Form ─────────────────────────────────────────────── */
.cal-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.cal-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.cal-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cal-input-icon {
  position: absolute;
  left: 0.65rem;
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0.55;
  z-index: 1;
}

.cal-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 0.68rem 0.8rem;
  font: inherit;
  font-size: 1rem;
  min-height: 44px;
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
}

.cal-input--icon {
  padding-left: 2.2rem;
}

.cal-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

.cal-input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cal-input::placeholder { color: rgba(255, 255, 255, 0.28); }

/* Password toggle */
.cal-pass-toggle {
  position: absolute;
  right: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.3rem;
  opacity: 0.5;
  transition: opacity 0.16s;
  z-index: 1;
  line-height: 1;
}
.cal-pass-toggle:hover { opacity: 0.85; }

/* Password strength bar */
.cal-strength-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.cal-strength-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.cal-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.35s ease, background 0.35s ease;
}

.cal-strength-fill[data-level="weak"]   { width: 33%; background: #f87171; }
.cal-strength-fill[data-level="medium"] { width: 66%; background: #facc15; }
.cal-strength-fill[data-level="strong"] { width: 100%; background: #4ade80; }

.cal-strength-label {
  font-size: 0.68rem;
  font-weight: 600;
  min-width: 3.8rem;
  text-align: right;
}

.cal-strength-label[data-level="weak"]   { color: #f87171; }
.cal-strength-label[data-level="medium"] { color: #facc15; }
.cal-strength-label[data-level="strong"] { color: #4ade80; }

.cal-select,
.cal-textarea {
  background: rgba(17, 20, 15, 0.7);
  color: var(--text);
}

.cal-select option {
  background: #1a1f18;
  color: var(--text);
}

.cal-textarea {
  resize: vertical;
  min-height: 72px;
}

.cal-error {
  margin: 0;
  font-size: 0.8rem;
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 0.5rem;
  padding: 0.42rem 0.6rem;
  animation: calShake 0.35s ease;
}

@keyframes calShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(2px); }
}

.cal-auth-toggle-text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cal-link-btn {
  background: none;
  border: none;
  color: var(--gold);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.16s;
}
.cal-link-btn:hover { opacity: 0.8; }

/* ── Buttons (calendar-specific) ──────────────────────────── */
.cal-btn-full {
  width: 100%;
  padding: 0.76rem 1rem;
  border-radius: 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}

.cal-btn-full:active {
  transform: scale(0.97);
}

.cal-btn-accent {
  background: linear-gradient(135deg, #d4af37, #b8912a);
  color: #11140f;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.3);
}
.cal-btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(212, 175, 55, 0.4);
}
.cal-btn-accent:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.cal-btn-glow {
  position: relative;
  overflow: hidden;
}

.cal-btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.cal-btn-glow:hover::after {
  opacity: 1;
}

.cal-btn-ghost-light {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.cal-btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.cal-btn-ghost-modal {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.26);
  padding: 0.62rem 1rem;
  border-radius: 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 44px;
}
.cal-btn-ghost-modal:hover { background: rgba(255, 255, 255, 0.12); }
.cal-btn-ghost-modal:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cal-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.62rem 1rem;
  border-radius: 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 44px;
}
.cal-btn-danger:hover { background: rgba(239, 68, 68, 0.28); border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }
.cal-btn-danger:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

.cal-btn-new {
  background: linear-gradient(135deg, #d4af37, #b8912a);
  color: #11140f;
  padding: 0.58rem 1rem;
  border-radius: 0.7rem;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
  transition: transform 0.16s, box-shadow 0.16s;
}
.cal-btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.35);
}
.cal-btn-new:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── Calendar App Panel ───────────────────────────────────── */
#cal-app {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Calendar Header ──────────────────────────────────────── */
.cal-header {
  background: rgba(17, 20, 15, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 1.1rem 1.1rem 0 0;
  padding: 0.9rem 1rem 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cal-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cal-main-title {
  margin: 0;
  font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.3rem);
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-serif);
  border-bottom: none;
  padding-bottom: 0;
}

.cal-user-badge {
  font-size: 0.78rem;
  color: var(--gold);
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

/* ── Header action buttons (Exportar & Protocolos) ──────────── */
.cal-action-btn {
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.5rem 1.05rem;
  cursor: pointer;
  white-space: nowrap;
  min-height: 38px;
  border-radius: 0.75rem;
  border: none;
  color: #fff;
  transition: transform 0.14s, box-shadow 0.16s, filter 0.16s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.cal-action-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
.cal-action-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cal-action-btn--export {
  background: linear-gradient(135deg, #1a8fe3 0%, #0e6bb7 100%);
  box-shadow: 0 4px 14px rgba(14, 107, 183, 0.45), inset 0 1px 0 rgba(255,255,255,0.18);
}


.cal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cal-view-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.7rem;
  padding: 0.22rem;
  gap: 0.18rem;
}

.cal-tab {
  background: none;
  border: none;
  border-radius: 0.5rem;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.18s, color 0.18s;
  touch-action: manipulation;
}

.cal-tab.is-active {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold);
}

.cal-tab:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.1rem 0 0.65rem;
}

/* ── Month nav center block (label + today btn) ─────────── */
.cal-month-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.cal-nav-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.55rem;
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.45rem 0.85rem;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  transition: background 0.16s;
  touch-action: manipulation;
}
.cal-nav-btn:hover { background: rgba(255, 255, 255, 0.13); }
.cal-nav-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cal-nav-btn--today {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  min-height: 30px;
  min-width: auto;
  color: var(--gold);
  border-color: rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.08);
}
.cal-nav-btn--today:hover {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(212, 175, 55, 0.5);
}

.cal-month-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.cal-filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0.9rem 0 0.2rem;
}

/* ── Filter group (label + control) ─────────────────────── */
.cal-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.cal-filter-notice {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  font-family: var(--font-serif);
  font-size: 0.97rem;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.02em;
  text-align: center;
}

.cal-filter-group--clear {
  grid-column: 1 / -1;
}

.cal-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  opacity: 0.85;
  letter-spacing: 0.01em;
}


/* ── Month Grid ────────────────────────────────────────────── */
.cal-panel-view {
  background: rgba(17, 20, 15, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.14);
  border-top: none;
  border-radius: 0 0 1.1rem 1.1rem;
  padding: 0.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: pan-y;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.22rem;
  margin-bottom: 0.3rem;
}

.cal-weekdays span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.22rem;
}

.cal-day {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.6rem;
  min-height: 56px;
  padding: 0.35rem 0.2rem 0.28rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  transition: background 0.16s, border-color 0.16s, transform 0.14s;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.cal-day:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cal-day:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.cal-day--empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}
.cal-day--empty:hover {
  background: transparent;
  border-color: transparent;
  transform: none;
}

.cal-day--today {
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.2), 0 4px 14px rgba(212, 175, 55, 0.15);
}

.cal-day--overdue {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.09);
}

.cal-day--due {
  border-color: rgba(250, 204, 21, 0.45);
}

.cal-day--today .cal-day-num {
  background: var(--gold);
  color: #11140f;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.cal-day-num {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.cal-day-dots {
  display: flex;
  gap: 0.15rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-dot-more {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.cal-day-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.92);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 7px rgba(248, 113, 113, 0.6);
}

.cal-day--due .cal-day-badge {
  background: rgba(250, 204, 21, 0.95);
  color: #11140f;
  box-shadow: 0 0 7px rgba(250, 204, 21, 0.55);
}

/* ── Agenda View ───────────────────────────────────────────── */
.cal-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.agenda-group { display: flex; flex-direction: column; gap: 0.35rem; }

@keyframes agendaFadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .agenda-group {
    animation: agendaFadeSlide 0.26s ease both;
  }
  .agenda-group:nth-child(2) { animation-delay: 50ms; }
  .agenda-group:nth-child(3) { animation-delay: 100ms; }
  .agenda-group:nth-child(4) { animation-delay: 150ms; }
  .agenda-group:nth-child(n+5) { animation-delay: 200ms; }
}

.agenda-date-header {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}

.agenda-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid;
  border-radius: 0.7rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: background 0.16s, transform 0.14s;
}
.agenda-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.agenda-item-main {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.agenda-item-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.agenda-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  flex: 1;
  min-width: 0;
}

.agenda-item-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.agenda-cow {
  font-size: 0.85rem;
  color: #86efac;
}

.agenda-obs {
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.agenda-status-chip {
  --chip-color: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--chip-color) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-color) 46%, transparent);
  color: var(--text);
}

.agenda-status-chip--pending { --chip-color: #facc15; }
.agenda-status-chip--done { --chip-color: #4ade80; }

.agenda-item--overdue {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.05);
}

.agenda-item--due {
  border-color: rgba(250, 204, 21, 0.28);
  background: rgba(250, 204, 21, 0.05);
}

.agenda-status {
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.status--done    { color: #4ade80; }
.status--pending { color: #facc15; }

/* ── Manage cows bar ─────────────────────────────────────── */
.cal-manage-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.55rem 0 1.1rem;
}

.cal-manage-btn {
  background: linear-gradient(135deg, #f4cd5d, #d4af37 58%, #b8841f);
  border: 1px solid rgba(255, 233, 164, 0.7);
  border-radius: 1.1rem;
  color: #142016;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0.82rem 1.55rem;
  cursor: pointer;
  box-shadow:
    0 10px 26px rgba(212, 175, 55, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.14s, box-shadow 0.16s, filter 0.16s;
  touch-action: manipulation;
}
.cal-manage-btn:hover {
  filter: brightness(1.05);
  box-shadow:
    0 14px 30px rgba(212, 175, 55, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transform: translateY(-2px);
}

.cal-signout-btn {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border: 1px solid rgba(255, 160, 160, 0.35);
  border-radius: 1.1rem;
  color: #fff;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.72rem 1.55rem;
  cursor: pointer;
  box-shadow:
    0 8px 22px rgba(185, 28, 28, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.14s, box-shadow 0.16s, filter 0.16s;
}
.cal-signout-btn:hover {
  filter: brightness(1.1);
  box-shadow:
    0 12px 28px rgba(185, 28, 28, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}
.cal-signout-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── Modals ────────────────────────────────────────────────── */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  padding:
    max(0.5rem, env(safe-area-inset-top, 0))
    max(0.5rem, env(safe-area-inset-right, 0))
    max(0.5rem, env(safe-area-inset-bottom, 0))
    max(0.5rem, env(safe-area-inset-left, 0));
}

@media (min-width: 500px) {
  .cal-modal-overlay {
    align-items: center;
    padding: 1.5rem;
  }
}

.cal-modal-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 20, 15, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 1.4rem 1.4rem 0 0;
  overflow: hidden;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  max-height: min(90vh, calc(100dvh - 1rem));
  display: flex;
  flex-direction: column;
}

@media (min-width: 500px) {
  .cal-modal-card {
    border-radius: 1.4rem;
    max-height: 88vh;
  }
}

.cal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cal-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.cal-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 0.5rem;
  color: var(--muted);
  font-size: 1rem;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
  touch-action: manipulation;
}
.cal-modal-close:hover { background: rgba(255, 255, 255, 0.16); color: var(--text); }
.cal-modal-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cal-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cal-modal-footer {
  padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.cal-modal-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.cal-modal-actions--end {
  justify-content: flex-end;
}

.cal-modal-actions .cal-btn-accent {
  padding: 0.62rem 1.2rem;
  border-radius: 0.7rem;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  min-height: 44px;
}

/* ── Radio group ─────────────────────────────────────────── */
.cal-radio-group {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.cal-radio-opt {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.55rem;
  padding: 0.52rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
  transition: background 0.16s, border-color 0.16s;
}
.cal-radio-opt:has(input:checked) {
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.45);
  color: var(--gold);
}

.cal-radio-opt input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold);
  flex-shrink: 0;
}

/* ── Cow list ────────────────────────────────────────────── */
.cow-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cow-item {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
}

.cow-item.is-archived {
  opacity: 0.78;
  border-style: dashed;
}

.cow-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  flex: 1 1 0%;
}

.cow-item-main-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.cow-status-badge {
  border-radius: 999px;
  padding: 0.18rem 0.46rem;
  font-size: 0.66rem;
  background: color-mix(in srgb, var(--cow-status) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--cow-status) 42%, transparent);
  color: var(--text);
}

.cow-meta-grid,
.cow-stat-row,
.cow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.cow-actions {
  width: 100%;
  margin-top: 0.15rem;
}
.cow-item-info strong {
  font-size: 0.93rem;
  color: var(--text);
  font-weight: 700;
}
.cow-breed { font-size: 0.8rem; color: #86efac; }
.cow-notes { font-size: 0.78rem; color: var(--muted); }

/* ── Cow photo upload (form) ──────────────────────────────── */
.cow-photo-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.cow-photo-preview {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.cow-photo-select-btn {
  cursor: pointer;
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s;
}
.cow-photo-select-btn:hover { background: rgba(255, 255, 255, 0.14); }
.cow-photo-remove-btn {
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  font-size: 0.76rem;
  border-radius: 0.5rem;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  transition: background 0.2s;
}
.cow-photo-remove-btn:hover { background: rgba(239, 68, 68, 0.28); }

/* ── Cow photo thumbnail (list card) ──────────────────────── */
.cow-item-photo {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.cow-proto-row {
  margin-top: 0.25rem;
}
.cow-proto-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent, #818cf8);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.2rem;
}
.cow-proto-custom-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(129, 140, 248, 0.18);
  color: var(--accent, #818cf8);
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
}
.cow-proto-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.cow-proto-chip {
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.64rem;
  color: var(--muted);
  white-space: nowrap;
}
.cow-proto-chip.is-custom {
  background: rgba(129, 140, 248, 0.13);
  color: var(--accent, #818cf8);
  font-weight: 600;
}

.cow-stat-chip {
  border-radius: 999px;
  padding: 0.16rem 0.44rem;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.66rem;
  color: var(--text);
}

.cow-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.45rem;
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.38rem 0.55rem;
  cursor: pointer;
  min-height: 36px;
}

.cow-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cow-archived-note {
  font-size: 0.7rem;
  color: #facc15;
}

.cow-delete-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 0.45rem;
  color: #f87171;
  font-size: 0.78rem;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.cow-delete-btn:hover { background: rgba(239, 68, 68, 0.25); }

.cal-settings-reminders {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.cow-reminder-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  margin-bottom: 0.25rem;
}

/* ── Per-cow protocol button ─────────────────────────── */
.cal-btn-proto {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 14px rgba(91, 33, 182, 0.45), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: opacity 0.15s, transform 0.1s;
}
.cal-btn-proto:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.cal-btn-proto:active {
  transform: translateY(0);
}

/* ── Dividers & helpers ───────────────────────────────────── */
.cal-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0.1rem 0;
}

.cal-subtitle {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--gold);
}

.cal-info-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.cal-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem 0;
}

/* ── Suggestions Modal ─────────────────────────────────────── */
.sug-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sug-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.72rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sug-check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.sug-check-label input[type="checkbox"] {
  width: auto;
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
  margin: 0;
}

.sug-icon { font-size: 1.1rem; }
.sug-type-label { flex: 1; }

.sug-date-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-left: 1.7rem;
}

.sug-days-hint {
  font-size: 0.73rem;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
  min-width: 55px;
}

.sug-date-input {
  flex: 1;
  max-width: 180px;
}

/* ── Export modal options ──────────────────────────────────── */
.export-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.export-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1.1rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, transform 0.12s;
  min-height: 96px;
  text-align: center;
}

.export-option-btn:hover {
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.export-option-btn:active { transform: scale(0.96); }

.export-option-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.export-option-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.export-option-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.export-option-format {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Toast ────────────────────────────────────────────────── */
.cal-toast {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  z-index: 200;
  background: rgba(17, 20, 15, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
  font-size: 0.83rem;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.28s cubic-bezier(.2,.9,.2,1), opacity 0.28s;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.cal-toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.cal-toast--success { border-color: rgba(74, 222, 128, 0.4); color: #bbf7d0; }
.cal-toast--error   { border-color: rgba(248, 113, 113, 0.4); color: #fca5a5; }

/* ── Focus-visible: global calendar interactive elements ──── */
.cal-btn-accent:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cal-manage-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cal-back-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cal-link-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.agenda-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Custom Scrollbars ─────────────────────────────────────── */
.cal-modal-body::-webkit-scrollbar,
.cal-agenda-list::-webkit-scrollbar {
  width: 5px;
}
.cal-modal-body::-webkit-scrollbar-track,
.cal-agenda-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}
.cal-modal-body::-webkit-scrollbar-thumb,
.cal-agenda-list::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 999px;
}
.cal-modal-body::-webkit-scrollbar-thumb:hover,
.cal-agenda-list::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.55);
}

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 420px) {
  .cal-day { min-height: 48px; padding: 0.28rem 0.15rem; }
  .cal-day-num { font-size: 0.8rem; }
  .cal-dot { width: 6px; height: 6px; }
  .cal-auth-card { padding: 1.5rem 1.1rem; }
  .cal-auth-logo-ring { width: 58px; height: 58px; }
  .cal-auth-logo-emoji { font-size: 1.8rem; }
  .cal-float-icon { font-size: 1.2rem; }
  .cal-weekdays span { font-size: 0.68rem; }
  .cal-tab { font-size: 0.82rem; padding: 0.42rem 0.6rem; }
  .cal-header-actions { width: 100%; justify-content: flex-end; }
  .cow-actions { width: 100%; }
  .cal-filter-bar { grid-template-columns: 1fr 1fr; }
}

/* ── Larger screens: filter bar can use more columns ───────── */
@media (min-width: 600px) {
  .cal-filter-bar {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .cal-filter-group--search {
    grid-column: 1 / -1;
  }
  .cal-filter-group--clear {
    grid-column: auto;
    justify-content: flex-end;
  }
  .cal-filter-group--clear .cal-filter-label {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet & Desktop
   ═══════════════════════════════════════════════════════════════ */

/* ── Tablet: 768px+ — expand shell slightly ─────────────────── */
@media (min-width: 768px) {
  .app-shell {
    max-width: 720px;
  }

  body {
    padding: 1rem 1.5rem 2rem;
  }

  .home-hero {
    min-height: 340px;
  }

  .menu-item {
    min-height: 95px;
  }
}

/* ── Desktop: 1024px+ ───────────────────────────────────────── */
@media (min-width: 1024px) {
  body {
    padding: 2rem 3rem 3rem;
  }

  .app-shell {
    max-width: 1100px;
  }

  /* ── Home: hero on the left, greeting + menu on the right ── */
  .view--home {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "hero greeting"
      "hero menu"
      "hero tip";
    gap: 1.6rem;
    align-items: start;
  }

  .home-greeting {
    grid-area: greeting;
    font-size: clamp(1.6rem, 1rem + 2vw, 2.1rem);
    margin-bottom: 0;
    align-self: end;
  }

  .home-hero {
    grid-area: hero;
    min-height: 500px;
    margin-bottom: 0;
    border-radius: 1.5rem;
    background-position: center top;
  }

  .menu-grid {
    grid-area: menu;
    margin-top: 0;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }

  .menu-item {
    min-height: 98px;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
  }

  .menu-item__title {
    font-size: 1.02rem;
  }

  .menu-item__meta {
    font-size: 0.86rem;
  }

  #ios-tip {
    grid-area: tip;
  }

  /* ── Product views ── */
  .view.glass {
    padding: 1.6rem 2rem;
    border-radius: 1.3rem;
  }

  h2 {
    font-size: clamp(1.18rem, 1rem + 0.7vw, 1.5rem);
    padding-bottom: 0.75rem;
    margin-bottom: 0.4rem;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .option-group {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .module-visual img {
    max-height: 300px;
  }

  /* ── Equipos: phone mockup centered inside wide shell ── */
  .equipos-view {
    max-width: 420px !important;
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }

  .configurator-step {
    max-width: 380px;
  }

  /* ── Calendar ── */
  .cal-panel {
    padding: 2rem 1.5rem;
    min-height: 75vh;
  }

  .cal-auth-card {
    max-width: 480px;
    padding: 2.5rem 2.4rem;
  }

  .cal-modal-card {
    max-width: 600px;
    border-radius: 1.4rem;
    max-height: 86vh;
  }

  .cal-day {
    min-height: 82px;
    padding: 0.42rem 0.28rem;
  }

  .cal-day-num {
    font-size: 0.95rem;
  }

  .cal-header {
    padding: 1.1rem 1.4rem 0;
    border-radius: 1.3rem 1.3rem 0 0;
  }

  .cal-panel-view {
    padding: 1rem 1.2rem;
    border-radius: 0 0 1.3rem 1.3rem;
  }

  .cal-action-btn {
    font-size: 0.88rem;
    padding: 0.5rem 0.9rem;
    min-height: 40px;
  }

  .cal-filter-bar {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 0.65rem;
  }

  .cal-filter-group--search {
    grid-column: auto;
  }

  .cal-filter-group--clear {
    grid-column: auto;
    justify-content: flex-end;
  }

  .cal-filter-group--clear .cal-filter-label {
    display: none;
  }
}

/* ── Large Desktop: 1400px+ ─────────────────────────────────── */
@media (min-width: 1400px) {
  .app-shell {
    max-width: 1280px;
  }

  .view--home {
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
  }

  .home-hero {
    min-height: 560px;
  }

  .home-greeting {
    font-size: clamp(1.8rem, 1.2rem + 2vw, 2.4rem);
  }

  .menu-grid {
    gap: 1rem;
  }

  .menu-item {
    min-height: 108px;
    padding: 1.1rem 1.2rem;
  }

  .menu-item__title {
    font-size: 1.06rem;
  }

  .view.glass {
    padding: 2rem 2.6rem;
  }

  .cal-day {
    min-height: 96px;
  }

  .cal-modal-card {
    max-width: 660px;
  }
}

/* ── Mobile: prevent horizontal overflow on narrow screens ──── */
@media (max-width: 360px) {
  .cal-header-actions {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .cal-action-btn {
    font-size: 0.76rem;
    padding: 0.38rem 0.52rem;
    min-height: 34px;
  }

  .cal-view-tabs {
    gap: 0.3rem;
  }

  .cal-tab {
    font-size: 0.78rem;
    padding: 0.38rem 0.5rem;
  }

  .home-hero {
    min-height: 220px;
  }

  .menu-item {
    padding: 0.52rem 0.6rem;
  }

  .menu-item__title {
    font-size: 0.9rem;
  }

  .menu-item__meta {
    font-size: 0.76rem;
  }
}

/* ═══════════════ GALLERY CAROUSEL ═══════════════ */

.section-gallery-title {
  text-align: center;
  font-family: var(--font-serif, 'Playfair Display', serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 1rem 0 0.75rem;
}

.gallery-carousel {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.gallery-track {
  display: flex;
  will-change: transform;
  cursor: grab;
}

.gallery-track:active {
  cursor: grabbing;
}

.gallery-slide {
  min-width: 100%;
  flex-shrink: 0;
}

.gallery-slide img {
  display: block;
  width: 100%;
  height: 42vh;
  object-fit: cover;
  pointer-events: none;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  opacity: 0.7;
  z-index: 2;
}

.gallery-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
  opacity: 1;
}

.gallery-arrow--prev {
  left: 10px;
}

.gallery-arrow--next {
  right: 10px;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
}

.gallery-dot--active {
  background: #fff;
  border-color: #fff;
}

.gallery-dot:hover {
  border-color: #fff;
}

@media (max-width: 480px) {
  .section-gallery-title {
    font-size: 1.3rem;
    margin: 0.75rem 0 0.5rem;
  }

  .gallery-slide img {
    height: 38vh;
  }

  .gallery-arrow {
    width: 34px;
    height: 34px;
    font-size: 1.3rem;
  }

  .gallery-arrow--prev {
    left: 6px;
  }

  .gallery-arrow--next {
    right: 6px;
  }
}


/* ═══════════════ FREYBOT WIDGET ═══════════════ */

.freybot-widget {
  --freybot-widget-gap: 18px;
  --freybot-widget-margin-top: 36px;
  --freybot-widget-padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--freybot-widget-gap);
  margin-top: var(--freybot-widget-margin-top);
  padding: 10px 0 var(--freybot-widget-padding-bottom);
  position: relative;
  isolation: isolate;
}

.freybot-widget::before {
  content: '';
  position: absolute;
  inset: 18px auto auto 50%;
  width: min(88vw, 420px);
  height: 180px;
  transform: translateX(-50%);
  border-radius: 36px;
  background:
    radial-gradient(circle at top, rgba(212,175,55,0.24), transparent 55%),
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.01));
  border: 1px solid rgba(212,175,55,0.16);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.38);
  opacity: 0.85;
  z-index: -1;
}

/* Speech bubble above bot */
.freybot-bubble {
  position: relative;
  max-width: 410px;
  padding: 18px 26px;
  background:
    linear-gradient(145deg, rgba(250,248,242,0.96) 0%, rgba(232,223,198,0.94) 100%);
  border: 1px solid rgba(212,175,55,0.44);
  border-radius: 28px 28px 28px 10px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255,255,255,0.65);
  animation: freybot-float 3s ease-in-out infinite;
}

.freybot-bubble::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid rgba(234, 226, 205, 0.95);
}

.freybot-bubble__text {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.02rem;
  font-weight: 700;
  color: #05070a;
  text-align: center;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

/* Bot avatar button */
.freybot-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 240px;
  padding: 22px 24px 18px;
  background:
    radial-gradient(circle at top, rgba(212,175,55,0.28), transparent 58%),
    linear-gradient(180deg, rgba(15,19,24,0.98) 0%, rgba(4,5,8,0.98) 100%);
  border: 1px solid rgba(212,175,55,0.3);
  cursor: pointer;
  border-radius: 30px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.freybot-avatar::before,
.freybot-avatar::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.freybot-avatar::before {
  inset: 12px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.06);
}

.freybot-avatar::after {
  inset: auto -30px -48px;
  height: 120px;
  background: radial-gradient(circle, rgba(212,175,55,0.38) 0%, transparent 70%);
  opacity: 0.85;
}

.freybot-avatar:hover {
  transform: translateY(-6px) scale(1.03);
  filter: none;
  box-shadow: 0 34px 60px rgba(0, 0, 0, 0.54), 0 0 34px rgba(212,175,55,0.26);
  border-color: rgba(212,175,55,0.46);
}

.freybot-avatar:active {
  transform: translateY(-2px) scale(0.99);
}

.freybot-svg {
  width: 138px;
  height: 138px;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 24px rgba(212,175,55,0.28));
  position: relative;
  z-index: 1;
}

.freybot-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f4d77c 0%, #d4af37 58%, #9d7711 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 8px 18px rgba(0,0,0,0.34);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 800;
  color: #05070a;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.freybot-name__main,
.freybot-name__sub {
  display: block;
}

.freybot-name__sub {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(5,7,10,0.18);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

@keyframes freybot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ═══════════════ FREYBOT CHAT OVERLAY ═══════════════ */

.freybot-chat {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.freybot-chat[hidden] {
  display: none;
}

.freybot-chat__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(212,175,55,0.12), transparent 40%),
    rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.freybot-chat__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  max-height: 86vh;
  border-radius: 32px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(18,22,28,0.98) 0%, rgba(5,7,10,0.99) 100%);
  border: 1px solid rgba(212,175,55,0.22);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(212,175,55,0.08), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: freybot-panel-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.freybot-chat__panel::before,
.freybot-chat__panel::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.freybot-chat__panel::before {
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06), transparent 24%, transparent 72%, rgba(212,175,55,0.08)),
    radial-gradient(circle at top right, rgba(212,175,55,0.12), transparent 30%);
}

.freybot-chat__panel::after {
  inset: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 24px;
}

@keyframes freybot-panel-in {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Chat header */
.freybot-chat__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px 20px;
  background:
    linear-gradient(135deg, rgba(212,175,55,0.16) 0%, rgba(212,175,55,0.04) 48%, rgba(255,255,255,0.02) 100%);
  border-bottom: 1px solid rgba(212,175,55,0.18);
  position: relative;
  z-index: 1;
}

.freybot-chat__header-icon {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.3));
}

.freybot-chat__header-info {
  flex: 1;
  min-width: 0;
}

.freybot-chat__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.freybot-chat__status {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: #d6f6e4;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.freybot-chat__status::before {
  content: '';
  width: 9px;
  height: 9px;
  background: #6fcf97;
  border-radius: 50%;
  animation: freybot-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 6px rgba(111,207,151,0.12);
}

@keyframes freybot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.freybot-chat__close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.7rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.freybot-chat__close:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* Messages area */
.freybot-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 260px;
  max-height: 54vh;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,0.2) transparent;
  position: relative;
  z-index: 1;
}

.freybot-chat__messages::-webkit-scrollbar {
  width: 4px;
}

.freybot-chat__messages::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,0.25);
  border-radius: 4px;
}

/* Message bubbles */
.freybot-msg {
  max-width: min(88%, 390px);
  padding: 16px 18px;
  border-radius: 22px;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}

.freybot-msg p {
  margin: 0;
}

.freybot-msg--bot {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(212,175,55,0.16) 0%, rgba(212,175,55,0.06) 100%);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 22px 22px 22px 8px;
}

.freybot-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(20,26,34,0.96) 0%, rgba(10,13,18,0.96) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px 22px 8px 22px;
  color: #f4f1e7;
}

.freybot-msg--typing {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(212,175,55,0.12) 0%, rgba(212,175,55,0.03) 100%);
  border: 1px solid rgba(212,175,55,0.16);
  border-radius: 22px 22px 22px 8px;
  display: flex;
  gap: 8px;
  padding: 16px 22px;
}

.freybot-msg--typing span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
  animation: freybot-dot 1.4s infinite;
}

.freybot-msg--typing span:nth-child(2) { animation-delay: 0.2s; }
.freybot-msg--typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes freybot-dot {
  0%, 60%, 100% { opacity: 0.4; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.2); }
}

/* Input form */
.freybot-chat__form {
  display: flex;
  gap: 10px;
  padding: 18px 22px 22px;
  border-top: 1px solid rgba(212,175,55,0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(0,0,0,0.28));
  position: relative;
  z-index: 1;
}

.freybot-chat__input {
  flex: 1;
  min-height: 56px;
  padding: 15px 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  color: #f8f5ed;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.freybot-chat__input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.freybot-chat__input:focus {
  border-color: rgba(212,175,55,0.4);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}

.freybot-chat__send {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d4af37 0%, #b8941e 100%);
  border: none;
  border-radius: 16px;
  color: #11140f;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 12px 26px rgba(212,175,55,0.28);
}

.freybot-chat__send svg {
  width: 22px;
  height: 22px;
}

.freybot-chat__send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(212,175,55,0.4);
}

.freybot-chat__send:active {
  transform: scale(0.95);
}

.freybot-chat__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Responsive */
@media (max-width: 480px) {
  .freybot-chat {
    padding: 10px;
  }

  .freybot-chat__panel {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 24px;
  }

  .freybot-chat__messages {
    max-height: 58vh;
  }

  .freybot-bubble {
    max-width: 300px;
    padding: 16px 18px;
  }

  .freybot-bubble__text {
    font-size: 0.94rem;
  }

  .freybot-avatar {
    min-width: 220px;
    padding: 18px 18px 16px;
  }

  .freybot-svg {
    width: 110px;
    height: 110px;
  }

  .freybot-name {
    font-size: 1rem;
    letter-spacing: 0.1em;
  }

  .freybot-name__sub {
    font-size: 0.64rem;
    letter-spacing: 0.14em;
  }

  .freybot-chat__header {
    padding: 18px 18px 16px;
  }

  .freybot-chat__header-icon {
    width: 54px;
    height: 54px;
  }

  .freybot-chat__title {
    font-size: 1.38rem;
  }

  .freybot-chat__status {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
  }

  .freybot-chat__messages,
  .freybot-chat__form {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Quick-reply suggestion chips */
.freybot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 6px;
  align-self: flex-start;
  max-width: 100%;
}

.freybot-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.28);
  color: #f4d77c;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.freybot-chip:hover {
  background: rgba(212,175,55,0.2);
  transform: translateY(-1px);
}

.freybot-chip:active {
  transform: translateY(0);
}

/* WhatsApp CTA button rendered inside bot messages */
.freybot-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #25d366 0%, #1da851 100%);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(37,211,102,0.2);
  transition: transform 0.15s, box-shadow 0.2s;
}

.freybot-wa-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(37,211,102,0.35);
  color: #fff;
}

@media (max-width: 480px) {
  .freybot-chip {
    font-size: 0.82rem;
    padding: 7px 12px;
  }
}

/* ── Bot iframe full-screen overlay ── */
.bot-iframe-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #05070a;
}

.bot-iframe-overlay[hidden] {
  display: none;
}

.bot-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.bot-iframe-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10001;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.35);
  background: rgba(5,7,10,0.82);
  color: #d4af37;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.18s, transform 0.12s;
}

.bot-iframe-close:hover {
  background: rgba(212,175,55,0.18);
  transform: scale(1.08);
}
