/* ═══════════════════════════════════
   BARUBOATS PWA — Estilos
═══════════════════════════════════ */

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

:root {
  --navy:      #0B1E3C;
  --navy-mid:  #122548;
  --turquoise: #00C2D4;
  --turq-dark: #009aaa;
  --white:     #FFFFFF;
  --gray-bg:   #F4F6FA;
  --gray-text: #6B7280;
  --red:       #EF4444;
  --green:     #22C55E;
  --radius:    14px;
  --shadow:    0 2px 12px rgba(11,30,60,0.10);
}

html, body {
  height: 100%; font-family: -apple-system, 'Inter', sans-serif;
  background: var(--gray-bg); color: var(--navy);
  -webkit-font-smoothing: antialiased;
}

/* ─── LANDING ───────────────────── */
#view-landing {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--navy); padding: 40px 24px; text-align: center;
}
.landing-logo {
  width: 200px; height: 200px; object-fit: contain;
  filter: brightness(0) invert(1); margin-bottom: 20px;
}
.landing-title { font-size: 30px; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.landing-sub   { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 48px;
  letter-spacing: 1px; text-transform: uppercase; }
.landing-btns  { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 320px; }
.btn-landing-primary {
  width: 100%; padding: 16px; background: var(--turquoise);
  color: var(--white); font-size: 16px; font-weight: 700;
  border: none; border-radius: 14px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,194,212,0.4); transition: background .2s;
}
.btn-landing-primary:hover { background: var(--turq-dark); }
.btn-landing-secondary {
  width: 100%; padding: 16px; background: rgba(255,255,255,0.1);
  color: var(--white); font-size: 16px; font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.25); border-radius: 14px; cursor: pointer;
  transition: background .2s;
}
.btn-landing-secondary:hover { background: rgba(255,255,255,0.18); }

.btn-back {
  align-self: flex-start; margin: 16px 0 4px 0;
  background: none; border: none; color: rgba(255,255,255,0.65);
  font-size: 14px; cursor: pointer; padding: 4px 0;
}

/* ─── LOGIN ─────────────────────── */
#view-login {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--navy); padding: 32px 24px;
}
.login-logo { width: 80px; height: 80px; object-fit: contain;
  filter: brightness(0) invert(1); margin-bottom: 16px; }
.login-title { font-size: 26px; font-weight: 700; color: var(--white); margin-bottom: 4px; }
.login-sub   { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 40px; letter-spacing: 1px; text-transform: uppercase; }

.login-card {
  background: var(--white); border-radius: 20px;
  padding: 32px 28px; width: 100%; max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card label { font-size: 12px; font-weight: 600; color: var(--gray-text);
  text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 6px; }
.login-card input {
  width: 100%; padding: 12px 16px; border: 1.5px solid #E5E7EB;
  border-radius: 10px; font-size: 15px; color: var(--navy);
  outline: none; transition: border-color .2s; margin-bottom: 16px;
}
.login-card input:focus { border-color: var(--turquoise); }
.login-error { color: var(--red); font-size: 13px; margin-bottom: 12px; display: none; }
.btn-login {
  width: 100%; padding: 14px; background: var(--turquoise);
  color: var(--white); font-size: 15px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer;
  transition: background .2s; margin-top: 4px;
}
.btn-login:hover { background: var(--turq-dark); }
.btn-login:disabled { opacity: 0.6; cursor: default; }

/* ─── APP SHELL ─────────────────── */
#view-app { display: none; flex-direction: column; height: 100vh; }

.app-header {
  background: var(--navy); padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { width: 36px; height: 36px; object-fit: contain; filter: brightness(0) invert(1); }
.header-brand { color: var(--white); }
.header-brand-name { font-size: 16px; font-weight: 700; line-height: 1.1; }
.header-brand-user { font-size: 11px; color: rgba(255,255,255,0.55); }
.btn-logout { background: rgba(255,255,255,0.1); border: none; color: rgba(255,255,255,0.7);
  padding: 8px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all .2s; }
.btn-logout:hover { background: rgba(255,255,255,0.2); color: var(--white); }

.app-main { flex: 1; overflow-y: auto; padding: 20px 16px 90px; }

/* ─── BOTTOM NAV ────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); display: flex; align-items: center;
  border-top: 1px solid #E5E7EB; z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 10px 8px 14px; background: none; border: none; cursor: pointer;
  color: var(--gray-text); font-size: 11px; gap: 4px; transition: color .2s;
}
.nav-btn .nav-icon { font-size: 22px; }
.nav-btn.active { color: var(--turquoise); }
.nav-btn-add {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--turquoise); color: var(--white);
  border: none; font-size: 28px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,194,212,0.5);
  display: flex; align-items: center; justify-content: center;
  margin: 0 12px; flex-shrink: 0; transition: transform .2s, background .2s;
  margin-bottom: 8px;
}
.nav-btn-add:hover { background: var(--turq-dark); transform: scale(1.05); }

/* ─── SECTION HEADER ────────────── */
.section-header { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.section-title { font-size: 20px; font-weight: 700; color: var(--navy); }
.section-sub { font-size: 13px; color: var(--gray-text); margin-top: 2px; }
.btn-exportar {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 14px; background: var(--white); border: 1.5px solid #E5E7EB;
  border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--navy);
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.btn-exportar:hover { border-color: var(--turquoise); color: var(--turquoise); }

/* ─── FILTROS ───────────────────── */
.filtros-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.btn-filtros {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; background: var(--white); border: 1.5px solid #E5E7EB;
  border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--navy);
  cursor: pointer; transition: all .2s;
}
.btn-filtros:hover { border-color: var(--turquoise); color: var(--turquoise); }
.btn-filtros.activo { background: var(--turquoise); border-color: var(--turquoise); color: var(--white); }
.filtros-activos-label { font-size: 12px; color: var(--turquoise); font-weight: 600; flex: 1; }
.btn-limpiar-inline {
  font-size: 12px; color: var(--gray-text); background: none; border: none;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all .2s;
  white-space: nowrap;
}
.btn-limpiar-inline:hover { color: var(--red); }

/* ─── RESERVAS LIST ─────────────── */
.reservas-list { display: flex; flex-direction: column; gap: 10px; }

.reserva-card {
  background: var(--white); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
}
.reserva-dot {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.dot-seahub   { background: #E0F2FE; }
.dot-sofia    { background: #F0FDF4; }
.dot-arrecife { background: #FEF9C3; }

.reserva-info { flex: 1; min-width: 0; }
.reserva-fecha { font-size: 12px; color: var(--gray-text); margin-bottom: 2px; }
.reserva-cliente { font-size: 15px; font-weight: 600; color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reserva-meta { font-size: 12px; color: var(--gray-text); margin-top: 3px; }
.reserva-tour { display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; }
.tour-islas { background: #E0F2FE; color: #0369A1; }
.tour-bahia { background: #EDE9FE; color: #6D28D9; }

.reserva-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.btn-edit, .btn-del {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.btn-edit { background: #F0FDFA; color: #0369A1; }
.btn-edit:hover { background: #CCFBF1; }
.btn-del  { background: #FEF2F2; color: var(--red); }
.btn-del:hover  { background: #FEE2E2; }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--gray-text);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 15px; }

/* ─── DISPONIBILIDAD ────────────── */
.disp-date-wrap { margin-bottom: 20px; }
.disp-date-wrap label { font-size: 12px; font-weight: 600; color: var(--gray-text);
  text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 6px; }
.disp-date-wrap input {
  width: 100%; padding: 12px 16px; border: 1.5px solid #E5E7EB;
  border-radius: 10px; font-size: 15px; color: var(--navy); outline: none;
  background: var(--white); transition: border-color .2s;
}
.disp-date-wrap input:focus { border-color: var(--turquoise); }

.disp-boats { display: flex; flex-direction: column; gap: 12px; }
.disp-card {
  background: var(--white); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
}
.disp-icon { font-size: 28px; width: 48px; text-align: center; }
.disp-info { flex: 1; }
.disp-name { font-size: 16px; font-weight: 700; color: var(--navy); }
.disp-cap  { font-size: 12px; color: var(--gray-text); }
.disp-status { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 20px; }
.status-libre { background: #F0FDF4; color: #15803D; }
.status-ocupado { background: #FEF2F2; color: #DC2626; }

/* ─── MODAL ─────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(11,30,60,0.6);
  backdrop-filter: blur(4px); z-index: 200; display: flex;
  align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-sheet {
  background: var(--white); border-radius: 20px 20px 0 0;
  padding: 24px 20px 40px; width: 100%; max-width: 500px;
  transform: translateY(100%); transition: transform .3s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle { width: 40px; height: 4px; background: #E5E7EB;
  border-radius: 2px; margin: 0 auto 20px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--gray-text);
  text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%; padding: 12px 16px; border: 1.5px solid #E5E7EB;
  border-radius: 10px; font-size: 15px; color: var(--navy);
  background: var(--white); outline: none; transition: border-color .2s;
  appearance: none; -webkit-appearance: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--turquoise); }

.form-who { background: var(--gray-bg) !important; color: var(--gray-text) !important; }

.modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.btn-cancel {
  flex: 1; padding: 14px; background: var(--gray-bg); color: var(--navy);
  font-size: 15px; font-weight: 600; border: none; border-radius: 10px; cursor: pointer;
}
.btn-save {
  flex: 2; padding: 14px; background: var(--turquoise); color: var(--white);
  font-size: 15px; font-weight: 600; border: none; border-radius: 10px; cursor: pointer;
  transition: background .2s;
}
.btn-save:hover { background: var(--turq-dark); }
.btn-save:disabled { opacity: 0.6; cursor: default; }

/* ─── TOAST ─────────────────────── */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: var(--white); padding: 12px 24px;
  border-radius: 50px; font-size: 14px; font-weight: 500; z-index: 300;
  opacity: 0; transition: all .3s; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.green { background: var(--green); }
.toast.red   { background: var(--red); }

/* ─── CONFIRM DIALOG ────────────── */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(11,30,60,0.6);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }
.confirm-box {
  background: var(--white); border-radius: 16px; padding: 28px 24px;
  width: 100%; max-width: 320px; text-align: center;
}
.confirm-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.confirm-sub   { font-size: 14px; color: var(--gray-text); margin-bottom: 24px; }
.confirm-btns  { display: flex; gap: 10px; }
.btn-confirm-cancel { flex: 1; padding: 12px; background: var(--gray-bg); border: none;
  border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-confirm-ok { flex: 1; padding: 12px; background: var(--red); color: var(--white);
  border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }

/* ─── CALENDARIO PÚBLICO ────────── */
#view-calendar { background: var(--gray-bg); }

.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month-label { font-size: 18px; font-weight: 700; color: var(--navy); text-transform: capitalize; }
.cal-arrow {
  background: var(--white); border: 1.5px solid #E5E7EB; border-radius: 10px;
  width: 38px; height: 38px; font-size: 20px; cursor: pointer; color: var(--navy);
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.cal-arrow:hover { background: var(--turquoise); border-color: var(--turquoise); color: var(--white); }

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px; text-align: center;
}
.cal-weekdays span { font-size: 11px; font-weight: 600; color: var(--gray-text);
  padding: 4px 0; text-transform: uppercase; letter-spacing: 0.3px; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin-bottom: 20px;
}

.cal-day {
  height: 46px; border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer;
  font-size: 14px; font-weight: 600; transition: transform .15s;
  position: relative; gap: 2px; width: 100%;
}
.cal-day:active { transform: scale(0.92); }
.cal-day.empty  { background: transparent; cursor: default; }
.cal-day.pasado { background: var(--white); color: #C4C9D4; cursor: default; }
.cal-day.libre  { background: #F0FDF4; color: #15803D; }
.cal-day.libre:hover { background: #DCFCE7; }
.cal-day.parcial { background: #FFFBEB; color: #B45309; }
.cal-day.parcial:hover { background: #FEF3C7; }
.cal-day.lleno  { background: #FEF2F2; color: #DC2626; }
.cal-day.lleno:hover { background: #FEE2E2; }
.cal-day.hoy    { box-shadow: 0 0 0 2px var(--turquoise); }
.cal-day.selected { box-shadow: 0 0 0 2.5px var(--navy); }

.cal-boats-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-dot.s { background: #0284C7; }
.cal-dot.f { background: #16A34A; }
.cal-dot.a { background: #CA8A04; }

.cal-detail {
  background: var(--white); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.cal-detail-title { font-size: 15px; font-weight: 700; color: var(--navy);
  margin-bottom: 12px; text-transform: capitalize; }
.cal-detail-boats { display: flex; flex-direction: column; gap: 8px; }
.cal-detail-boat {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--gray-bg);
}
.cal-detail-boat-icon { font-size: 20px; }
.cal-detail-boat-name { font-size: 14px; font-weight: 600; color: var(--navy); flex: 1; }
.cal-detail-boat-tour { font-size: 12px; color: var(--gray-text); }
.cal-detail-libre { opacity: 0.5; }

.cal-legend {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  font-size: 12px; color: var(--gray-text); padding: 4px 0 8px;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-libre  { background: #22C55E; }
.dot-parcial { background: #F59E0B; }
.dot-ocupado { background: #EF4444; }
