/* ============================================================
   style.css — Dragon Boat Plasentina
   Mobile-first responsive design
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ── Variables ──────────────────────────────────────────── */
:root {
  --verde:       #0F6E56;
  --verde-light: #E1F5EE;
  --verde-mid:   #1D9E75;
  --crema:       #F5F0E8;
  --crema-dark:  #EAE4D8;
  --dark:        #1A1A18;
  --dark-mid:    #3A3A36;
  --text-muted:  #7A7A72;
  --amber:       #EF9F27;
  --danger:      #E24B4A;
  --info:        #378ADD;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 2px 16px rgba(0,0,0,.08);
  --nav-h:       56px;        /* altura navbar top */
  --bottom-h:    64px;        /* altura barra nav inferior móvil */
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--crema);
  color: var(--dark);
  min-height: 100vh;
  /* espacio para nav inferior en móvil */
  padding-bottom: var(--bottom-h);
}
@media (min-width: 768px) { body { padding-bottom: 0; } }

/* ── NAVBAR TOP ─────────────────────────────────────────── */
.navbar {
  background: var(--dark);
  height: var(--nav-h);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  position: sticky;
  top: 0;
  z-index: 200;
}
.navbar .brand {
  font-size: .95rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  flex: 1;
}
.navbar .brand-icon {
  width: 30px; height: 30px;
  background: var(--verde);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
/* Links — desktop only */
.navbar .nav-links {
  display: none;
  gap: .15rem;
  margin-left: auto;
}
@media (min-width: 768px) {
  .navbar .nav-links { display: flex; }
  body { padding-bottom: 0; }
}
.navbar a.nav-link {
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .82rem;
  padding: .38rem .65rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.navbar a.nav-link:hover,
.navbar a.nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.notif-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); color: #fff;
  font-size: .65rem; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 3px;
  margin-left: .25rem;
}

/* ── BARRA DE NAVEGACIÓN INFERIOR ───────────────────────────
   Oculta por defecto (escritorio). Solo visible en móvil.    */
.bottom-nav {
  display: none;          /* oculta en escritorio */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-h);
  background: var(--dark);
  border-top: 1px solid rgba(255,255,255,.08);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (max-width: 767px) { .bottom-nav { display: flex; } }

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: rgba(255,255,255,.5);
  font-size: .62rem;
  font-weight: 500;
  padding: .5rem .25rem;
  transition: color .15s;
  position: relative;
}
.bottom-nav a.active { color: var(--verde-mid); }
/* Fijar tamaño SVG explícitamente — no heredar del flex */
.bottom-nav a svg { width: 22px !important; height: 22px !important; flex-shrink: 0; }
.bottom-nav .bnav-badge {
  position: absolute;
  top: 6px; right: calc(50% - 18px);
  background: var(--danger); color: #fff;
  font-size: .58rem; font-weight: 700;
  min-width: 14px; height: 14px;
  border-radius: 7px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Brand nombre responsive ────────────────────────────── */
.brand-nombre { font-size: .88rem; }
@media (max-width: 480px) {
  .brand-nombre { display: none; }
}

/* ── MENÚ ADMIN (desplegable móvil) ─────────────────────── */
.admin-menu-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  padding: .4rem;
  cursor: pointer;
  border-radius: 6px;
}
@media (max-width: 767px) {
  .admin-menu-btn { display: flex; align-items: center; }
}
.admin-drawer {
  display: none;
  position: fixed;
  bottom: var(--bottom-h); left: 0; right: 0;
  background: var(--dark-mid);
  border-top: 1px solid rgba(255,255,255,.1);
  z-index: 300;
  padding: .5rem;
  gap: .25rem;
  flex-direction: column;
}
.admin-drawer.open { display: flex; }
.admin-drawer a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  display: flex; align-items: center; gap: .6rem;
}
.admin-drawer a svg { width: 20px !important; height: 20px !important; flex-shrink: 0; }
.admin-drawer a:hover, .admin-drawer a.active { background: rgba(255,255,255,.1); }
.admin-drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 299;
}
.admin-drawer-overlay.open { display: block; }

/* ── CONTAINER ──────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem .875rem 1.5rem;
}
@media (min-width: 768px) {
  .container { padding: 1.5rem 1.25rem; }
}

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
@media (min-width: 768px) { .card { padding: 1.25rem; } }
.card-title {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark);
}

/* ── GRIDS ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: .875rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .grid-3 { grid-template-columns: repeat(3,1fr); gap: 1rem; }
}

/* ── STAT CARDS ─────────────────────────────────────────── */
.stat-card {
  background: var(--crema);
  border-radius: var(--radius);
  padding: .875rem 1rem;
}
.stat-label { font-size: .72rem; color: var(--text-muted); margin-bottom: .2rem; }
.stat-value { font-size: 1.6rem; font-weight: 600; line-height: 1; }
.stat-sub   { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }

/* ── SCHEDULE GRID ──────────────────────────────────────── */
.schedule-wrapper {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: .35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: .25rem;
}
.day-col {
  background: var(--crema);
  border-radius: var(--radius-sm);
  padding: .5rem .35rem;
  min-width: 72px;
}
@media (min-width: 768px) {
  .day-col { min-width: 90px; padding: .6rem .5rem; }
}
.day-name {
  font-size: .62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: .4rem;
  text-align: center;
  letter-spacing: .03em;
}
.slot-pill {
  border-radius: var(--radius-sm);
  padding: .32rem .4rem;
  margin-bottom: .3rem;
  font-size: .72rem;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.slot-pill:active { opacity: .75; }
.slot-ok      { background: #C0DD97; color: #27500A; }
.slot-partial { background: #FAC775; color: #633806; }
.slot-full    { background: #F7C1C1; color: #791F1F; }
.slot-time    { font-weight: 600; }
.slot-count   { font-size: .6rem; margin-top: .05rem; }

/* ── BOAT TABLE ─────────────────────────────────────────── */
.boat-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.boat-table th {
  padding: .45rem .6rem;
  text-align: left;
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--crema-dark);
  white-space: nowrap;
}
.boat-table td {
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--crema-dark);
  vertical-align: middle;
}
.boat-table tr:last-child td { border-bottom: none; }
@media (min-width: 768px) {
  .boat-table { font-size: .875rem; }
  .boat-table th { padding: .5rem .75rem; }
  .boat-table td { padding: .65rem .75rem; }
  .boat-table tr:hover td { background: var(--crema); }
}
.badge-lado {
  display: inline-block;
  padding: .12rem .45rem;
  border-radius: 4px;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.badge-izq   { background: #B5D4F4; color: #0C447C; }
.badge-der   { background: #CECBF6; color: #3C3489; }
.badge-timon { background: #E1F5EE; color: #085041; }
.fila-num {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--crema); border-radius: 50%;
  font-size: .75rem; font-weight: 600; color: var(--dark-mid);
}
.fila-num.asignado { background: var(--verde-light); color: var(--verde); }

/* ── BALANCE BAR ────────────────────────────────────────── */
.balance-bar {
  height: 9px; border-radius: 5px;
  background: var(--crema-dark); overflow: hidden; margin: .25rem 0;
}
.balance-fill { height: 100%; border-radius: 5px; background: var(--verde-mid); transition: width .4s; }
.balance-fill.warn   { background: var(--amber); }
.balance-fill.danger { background: var(--danger); }

/* ── FORMS ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--dark-mid);
  display: block;
  margin-bottom: .35rem;
}
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], select, textarea {
  width: 100%;
  /* altura mínima táctil recomendada: 44px */
  padding: .65rem .85rem;
  border: 1.5px solid var(--crema-dark);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;          /* evita zoom en iOS */
  background: #fff;
  color: var(--dark);
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(15,110,86,.12);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A7A72' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
}
input[type=checkbox] {
  width: 18px; height: 18px;
  cursor: pointer;
  accent-color: var(--verde);
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
  min-height: 44px;          /* área táctil mínima */
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); opacity: .88; }
.btn-primary   { background: var(--verde); color: #fff; }
.btn-primary:hover { opacity: .92; }
.btn-secondary { background: var(--crema-dark); color: var(--dark-mid); }
.btn-secondary:hover { background: #D8D2C4; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-sm        { padding: .38rem .75rem; font-size: .78rem; min-height: 36px; }
.btn-full      { width: 100%; }

/* ── NOTIFICACIONES ─────────────────────────────────────── */
.notif-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .875rem 0;
  border-bottom: 1px solid var(--crema-dark);
}
.notif-item:last-child { border-bottom: none; }
.notif-dot {
  width: 9px; height: 9px; border-radius: 50%;
  flex-shrink: 0; margin-top: 6px;
}
.dot-asignacion     { background: var(--verde-mid); }
.dot-lista_espera   { background: var(--amber); }
.dot-cambio_horario { background: var(--info); }
.dot-recordatorio   { background: var(--amber); }
.dot-general        { background: var(--text-muted); }
.notif-texto { font-size: .875rem; color: var(--dark); line-height: 1.55; }
.notif-meta  { font-size: .72rem; color: var(--text-muted); margin-top: .25rem; }
.notif-item.unread .notif-texto { font-weight: 500; }

/* ── ALERTS ─────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.alert-success { background: var(--verde-light); color: #085041; }
.alert-danger  { background: #FCEBEB; color: #A32D2D; }
.alert-warning { background: #FAEEDA; color: #633806; }
.alert-info    { background: #E6F1FB; color: #185FA5; }

/* ── LOGIN ───────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--dark);
  padding: 1rem;
}
.login-box {
  background: #fff;
  border-radius: 18px;
  padding: 1.75rem 1.5rem;
  width: 100%;
  max-width: 400px;
}
@media (min-width: 480px) { .login-box { padding: 2rem; } }
.login-logo { text-align: center; margin-bottom: 1.5rem; }
.login-logo .icon {
  width: 56px; height: 56px;
  background: var(--verde); border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: .75rem;
}
.login-logo h1 { font-size: 1.1rem; font-weight: 600; }
.login-logo p  { font-size: .8rem; color: var(--text-muted); }

/* ── TABS ────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: .25rem;
  margin-bottom: 1.25rem;
  background: var(--crema-dark);
  padding: 4px;
  border-radius: var(--radius);
}
.tab-btn {
  flex: 1; padding: .5rem .25rem;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: .85rem;
  cursor: pointer; color: var(--text-muted);
  min-height: 40px;
}
.tab-btn.active { background: #fff; color: var(--dark); font-weight: 600; box-shadow: var(--shadow); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── FLEX HELPERS ────────────────────────────────────────── */
.flex          { display: flex; }
.flex-between  { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.gap-1         { gap: .5rem; }

/* ── SPACING ─────────────────────────────────────────────── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); font-size: .85rem; }
.text-right  { text-align: right; }

/* ── PAGE TITLE (mobile friendly) ───────────────────────── */
.page-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
}

/* ── SCROLL TABLES EN MÓVIL ──────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

/* ── TOUCH FEEDBACK ──────────────────────────────────────── */
a, button { -webkit-tap-highlight-color: transparent; }

/* ── ADMIN GRID (1 col móvil, 2 col escritorio) ─────────── */
@media (max-width: 767px) {
  .admin-grid { display: block !important; }
  .admin-grid > * + * { margin-top: 1rem; }
}
