/* Voluntariado Olocau · estilos personalizados
   Sistema visual: moderno, compacto, con acento rojo Olocau. */

:root {
  --olocau: #c8102e;
  --olocau-600: #a80d26;
  --olocau-100: #fde7eb;
  --ink: #1b1f23;
  --muted: #6b7280;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e6e8ec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 6px 16px rgba(16,24,40,.08);
  --shadow-lg: 0 18px 40px rgba(16,24,40,.12);
}

html, body { height: 100%; }
body {
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Solo añade espacio inferior cuando la bottom-nav está presente */
body:has(.bottom-nav) { padding-bottom: 72px; }

@media (min-width: 992px) {
  body:has(.bottom-nav) { padding-bottom: 0; }
}

/* ---------- Navbar ---------- */
.navbar.app-nav {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding-top: .6rem;
  padding-bottom: .6rem;
}
.navbar.app-nav .navbar-brand {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -.01em;
}
.navbar.app-nav .navbar-brand span { color: var(--olocau); }
.navbar.app-nav .nav-link {
  color: #4b5563 !important;
  padding: .45rem .8rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: .92rem;
  display: inline-flex; align-items: center; gap: .4rem;
}
.navbar.app-nav .nav-link:hover { background: #f1f2f5; color: var(--ink) !important; }
.navbar.app-nav .nav-link.active {
  background: var(--olocau-100);
  color: var(--olocau) !important;
}
.navbar.app-nav .nav-link .bi { font-size: 1rem; }
.navbar.app-nav .user-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .7rem .3rem .35rem;
  background: #f1f2f5;
  border-radius: 999px;
  color: var(--ink);
  font-size: .88rem;
}
.navbar.app-nav .user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--olocau);
  color: #fff; font-weight: 600; font-size: .78rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.navbar.app-nav .btn-logout {
  border-radius: 999px; padding: .35rem .8rem;
  color: var(--muted); border: 1px solid var(--border);
  background: #fff;
}
.navbar.app-nav .btn-logout:hover { color: var(--olocau); border-color: var(--olocau); }

/* ---------- Bottom nav (móvil) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(1.2) blur(8px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1; text-align: center; text-decoration: none;
  color: var(--muted); font-size: .7rem; font-weight: 500;
  padding: .35rem .2rem; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bottom-nav a .bi { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--olocau); }
.bottom-nav a.active .bi { transform: translateY(-1px); }
@media (min-width: 992px) { .bottom-nav { display: none; } }

/* ---------- Saludo / hero dashboard ---------- */
.hero-greet {
  background: linear-gradient(135deg, var(--olocau) 0%, #e23a52 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.1rem;
  position: relative; overflow: hidden;
}
.hero-greet::after {
  content: ""; position: absolute; inset: auto -40px -60px auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero-greet h1 { font-size: 1.2rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.hero-greet p  { margin: .15rem 0 0; opacity: .9; font-size: .9rem; }
.hero-greet .badge-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  background: rgba(255,255,255,.18); color: #fff;
  padding: .25rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 500; margin-top: .55rem;
}

/* ---------- Tiles del dashboard ---------- */
.tile-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (min-width: 768px) { .tile-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1200px) { .tile-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }

.tile {
  position: relative;
  display: flex; flex-direction: column;
  gap: .5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  min-height: 118px;
  overflow: hidden;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #d6d9df;
  color: var(--ink);
}
.tile .tile-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  background: var(--olocau-100);
  color: var(--olocau);
}
.tile .tile-title { font-weight: 600; font-size: 1rem; margin: 0; letter-spacing: -.01em; }
.tile .tile-desc  { font-size: .82rem; color: var(--muted); margin: 0; line-height: 1.3; }
.tile .tile-arrow {
  position: absolute; top: 1rem; right: 1rem;
  color: #cbd0d8; transition: transform .18s ease, color .18s ease;
}
.tile:hover .tile-arrow { transform: translateX(3px); color: var(--olocau); }

/* Variantes de color de tile */
.tile--red    .tile-icon { background: #fde7eb; color: #c8102e; }
.tile--green  .tile-icon { background: #e6f5ec; color: #0f7a3a; }
.tile--blue   .tile-icon { background: #e6effd; color: #1a5fd0; }
.tile--amber  .tile-icon { background: #fff4e0; color: #b7791f; }
.tile--slate  .tile-icon { background: #eef0f3; color: #475569; }
.tile--teal   .tile-icon { background: #e0f5f3; color: #117a6b; }
.tile--violet .tile-icon { background: #efe9fb; color: #6b3fd4; }

/* Tile destacado (firma pendiente, informes admin...) */
.tile--featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #fff 0%, #fff 60%, #fde7eb 100%);
  border-color: #f4c7cf;
}
.tile--featured .tile-title { color: var(--olocau); }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem 1rem;
  background:
    radial-gradient(1200px 600px at 10% -10%, #fde7eb 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 110%, #fff4e0 0%, transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem 1.5rem;
}
.login-card .brand {
  text-align: center; margin-bottom: 1.25rem;
}
.login-card .brand img {
  height: 72px; filter: drop-shadow(0 6px 16px rgba(200,16,46,.18));
}
.login-card .brand h1 {
  font-size: 1.15rem; font-weight: 600; margin: .75rem 0 .15rem;
  letter-spacing: -.01em;
}
.login-card .brand p { color: var(--muted); font-size: .85rem; margin: 0; }
.login-card .form-label {
  font-size: .8rem; font-weight: 500;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: .3rem;
}
.login-card .input-wrap { position: relative; }
.login-card .input-wrap .bi {
  position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
  color: #9aa0a6;
}
.login-card .input-wrap .form-control {
  padding-left: 2.4rem;
  height: 46px;
  border-radius: 12px;
  border-color: var(--border);
  background: #fafbfc;
}
.login-card .input-wrap .form-control:focus {
  background: #fff;
  border-color: var(--olocau);
  box-shadow: 0 0 0 4px rgba(200,16,46,.12);
}
.btn-olocau {
  background: var(--olocau); color: #fff;
  border: 0; border-radius: 12px;
  height: 46px; font-weight: 600; letter-spacing: .01em;
  transition: background .15s ease, transform .1s ease;
}
.btn-olocau:hover { background: var(--olocau-600); color: #fff; }
.btn-olocau:active { transform: translateY(1px); }

.login-links {
  display: flex; justify-content: space-between;
  margin-top: 1rem; font-size: .82rem;
}
.login-links a { color: var(--muted); text-decoration: none; }
.login-links a:hover { color: var(--olocau); }

/* ---------- Utilidades heredadas ---------- */
.card-action { transition: transform .15s ease, box-shadow .15s ease; }
.card-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.route-color-dot {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  margin-right: .35rem;
  vertical-align: middle;
  border: 1px solid rgba(0,0,0,.1);
}

.table-routes th { white-space: nowrap; }

.signature-pad {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  width: 100%;
  touch-action: none;
}

.iban-inputs input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.duration-ok   { color: #198754; }
.duration-bad  { color: #dc3545; }
.duration-warn { color: #fd7e14; }

/* Ajustes finos de cards / botones genéricos */
.card { border-radius: var(--radius); border-color: var(--border); }
.card.shadow-sm, .card { box-shadow: var(--shadow-sm); }
.btn { border-radius: 10px; }
.form-control, .form-select { border-radius: 10px; }

/* ---------- Page header (título + acciones) ---------- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: 1.1rem; flex-wrap: wrap;
}
.page-header h1 {
  font-size: 1.25rem; font-weight: 600; margin: 0;
  letter-spacing: -.01em; display: inline-flex; align-items: center; gap: .55rem;
}
.page-header h1 .bi {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--olocau-100); color: var(--olocau);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.page-header .actions { display: inline-flex; gap: .5rem; flex-wrap: wrap; }
.btn-ghost {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); border-radius: 10px; padding: .45rem .75rem;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-ghost:hover { color: var(--olocau); border-color: var(--olocau); }

/* ---------- Section card (sustituye a card+header) ---------- */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}
.section-card > .section-head {
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
}
.section-card > .section-head h2 {
  font-size: .95rem; font-weight: 600; margin: 0;
  letter-spacing: -.005em; display: inline-flex; align-items: center; gap: .5rem;
}
.section-card > .section-head h2 .bi { color: var(--olocau); }
.section-card > .section-body { padding: 1.1rem; }
.section-card > .section-body.p-0 { padding: 0; }

/* ---------- Route card (book / my-routes) ---------- */
.route-card {
  display: flex; align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: .7rem;
  transition: box-shadow .15s ease, transform .15s ease;
}
.route-card:hover { box-shadow: var(--shadow-md); }
.route-card .route-stripe {
  width: 8px; flex-shrink: 0;
  background: var(--route-color, #6c757d);
}
.route-card .route-body {
  flex: 1; padding: .85rem 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
}
@media (min-width: 768px) {
  .route-card .route-body { grid-template-columns: 1.2fr 1fr 1fr; align-items: center; }
}
.route-card .route-title {
  font-weight: 600; font-size: 1rem; margin: 0; display: flex; align-items: center; gap: .5rem;
}
.route-card .route-title .dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--route-color, #6c757d);
  border: 1px solid rgba(0,0,0,.08);
}
.route-card .route-sub { font-size: .82rem; color: var(--muted); margin: .15rem 0 0; }

.slot {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .7rem; background: #fafbfc; border: 1px solid var(--border);
  border-radius: 10px; gap: .5rem;
}
.slot .slot-label { font-size: .78rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.slot .slot-meta  { font-size: .85rem; font-weight: 600; }
.slot .slot-actions { display: flex; gap: .3rem; flex-wrap: wrap; }

/* ---------- KPI / stat cards (reports) ---------- */
.stat-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (min-width: 768px)  { .stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1200px) { .stat-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: .8rem;
}
.stat .stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.stat .stat-value { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat .stat-label { font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.stat--green  .stat-icon { background: #e6f5ec; color: #0f7a3a; }
.stat--slate  .stat-icon { background: #eef0f3; color: #475569; }
.stat--blue   .stat-icon { background: #e6effd; color: #1a5fd0; }
.stat--teal   .stat-icon { background: #e0f5f3; color: #117a6b; }
.stat--amber  .stat-icon { background: #fff4e0; color: #b7791f; }
.stat--red    .stat-icon { background: #fde7eb; color: #c8102e; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center; padding: 2rem 1rem; color: var(--muted);
}
.empty-state .bi { font-size: 2rem; opacity: .45; display: block; margin-bottom: .4rem; }
.empty-state p { margin: 0; font-size: .9rem; }

/* ---------- Chips / badges custom ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  background: #eef0f3; color: #475569;
}
button.chip { cursor: pointer; transition: filter .15s ease, transform .1s ease; }
button.chip:hover { filter: brightness(.95); }
button.chip:active { transform: translateY(1px); }
.chip--ok    { background: #e6f5ec; color: #0f7a3a; }
.chip--warn  { background: #fff4e0; color: #b7791f; }
.chip--red   { background: #fde7eb; color: #c8102e; }
.chip--blue  { background: #e6effd; color: #1a5fd0; }

/* ---------- Tablas modernas ---------- */
.table-modern {
  margin-bottom: 0;
}
.table-modern thead th {
  background: #fafbfc;
  font-size: .75rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.table-modern tbody td { vertical-align: middle; }
.table-modern tbody tr:hover { background: #fafbfc; }

/* ---------- Perfil ---------- */
.avatar-xl {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; border: 3px solid #fff;
  box-shadow: var(--shadow-md);
}
.avatar-xl-fallback {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--olocau-100); color: var(--olocau);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* ---------- Botones pill compactos ---------- */
.btn-pill { border-radius: 999px; padding: .35rem .85rem; font-weight: 500; font-size: .85rem; }

/* ---------- Ajustes móvil (<576px) ---------- */
@media (max-width: 575.98px) {
  main.container { padding-left: .85rem; padding-right: .85rem; padding-top: 1rem; padding-bottom: 1rem; }

  /* Navbar más compacta, el brand ocupa lo justo */
  .navbar.app-nav { padding-top: .45rem; padding-bottom: .45rem; }
  .navbar.app-nav .navbar-brand img { height: 26px; }
  .navbar.app-nav .navbar-brand span { font-size: .95rem; }
  .navbar.app-nav .user-chip { padding: .2rem .5rem .2rem .25rem; font-size: .8rem; }
  .navbar.app-nav .user-chip .avatar { width: 24px; height: 24px; font-size: .7rem; }

  /* Page header: título menor, acciones en su sitio sin romper */
  .page-header { margin-bottom: .85rem; gap: .5rem; }
  .page-header h1 { font-size: 1.05rem; }
  .page-header h1 .bi { width: 30px; height: 30px; font-size: .9rem; border-radius: 8px; }
  .page-header .actions .btn-ghost,
  .page-header .actions .btn { padding: .35rem .6rem; font-size: .82rem; }

  /* Hero del dashboard más compacto */
  .hero-greet { padding: .9rem 1rem; border-radius: 12px; margin-bottom: .85rem; }
  .hero-greet h1 { font-size: 1.05rem; }
  .hero-greet p  { font-size: .82rem; }
  .hero-greet .badge-pill { font-size: .72rem; padding: .2rem .55rem; }

  /* Tiles del dashboard */
  .tile-grid { gap: .6rem; }
  .tile { padding: .8rem; min-height: 98px; border-radius: 12px; }
  .tile .tile-icon { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 10px; }
  .tile .tile-title { font-size: .92rem; }
  .tile .tile-desc  { font-size: .75rem; }
  .tile .tile-arrow { top: .7rem; right: .7rem; font-size: .85rem; }
  .tile--featured .tile-title { font-size: 1rem; }

  /* Section cards con menos padding */
  .section-card { border-radius: 12px; margin-bottom: .75rem; }
  .section-card > .section-head { padding: .7rem .85rem; }
  .section-card > .section-head h2 { font-size: .88rem; }
  .section-card > .section-body { padding: .85rem; }

  /* Route cards: apilar, acciones al 100% */
  .route-card { margin-bottom: .6rem; border-radius: 12px; }
  .route-card .route-body { padding: .7rem .85rem; gap: .5rem; }
  .route-card .route-title { font-size: .95rem; }
  .route-card .route-sub { font-size: .78rem; }
  .route-card .route-body > div:last-child { display: flex; flex-wrap: wrap; gap: .35rem; }
  .route-card .btn-pill { flex: 1 1 auto; justify-content: center; }

  /* Slot: compacto y texto ajustado */
  .slot { padding: .45rem .6rem; gap: .4rem; flex-wrap: wrap; }
  .slot .slot-label { font-size: .7rem; }
  .slot .slot-actions .btn-pill { padding: .3rem .7rem; font-size: .78rem; }

  /* Stat widgets */
  .stat-grid { gap: .6rem; }
  .stat { padding: .75rem; border-radius: 12px; gap: .6rem; }
  .stat .stat-icon { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 10px; }
  .stat .stat-value { font-size: 1.15rem; }
  .stat .stat-label { font-size: .72rem; }

  /* Tablas: tipografía y padding reducidos, scroll horizontal */
  .table-modern thead th { font-size: .68rem; padding: .5rem .55rem; }
  .table-modern tbody td { font-size: .82rem; padding: .55rem; }

  /* Login / register card ocupa bien */
  .login-wrap { padding: 1rem .75rem; }
  .login-card { padding: 1.4rem 1.15rem 1.15rem; border-radius: 16px; }
  .login-card .brand img { height: 56px; }
  .login-card .brand h1 { font-size: 1rem; }
  .login-card .brand p  { font-size: .78rem; }
  .login-card .input-wrap .form-control { height: 44px; }

  /* Inputs y botones toque-friendly */
  .form-control, .form-select { font-size: .95rem; }
  .btn { font-size: .9rem; }
  .btn-olocau { height: 44px; }

  /* Profile avatar centrado y más pequeño */
  .avatar-xl, .avatar-xl-fallback { width: 96px; height: 96px; }
  .avatar-xl-fallback { font-size: 2.3rem; }

  /* Hero firma (display) reducido */
  .signature-pad { min-height: 160px; }
  .display-6 { font-size: 1.5rem; }
}

/* ---------- Countdown ---------- */
.countdown {
  display: inline-block;
  padding: .45rem .7rem;
  background: #fff4e0;
  border: 1px solid #f5d9a8;
  border-radius: 10px;
  color: #b7791f;
  min-width: 170px;
  max-width: 100%;
}
@media (max-width: 575.98px) {
  .countdown { min-width: 0; width: 100%; }
}
.countdown .countdown-label { font-size: .7rem; }
.countdown .countdown-value { font-size: 1.15rem; letter-spacing: .02em; line-height: 1.1; }
.countdown.countdown--done {
  background: #e6f5ec;
  border-color: #b5dfc4;
  color: #0f7a3a;
}
