/* SailingScore - tema náutico */
:root {
  --navy: #0b2545; --sea: #13315c; --ocean: #1f5f99; --teal: #00a6a6; --sand: #f4efe6; --foam: #eef5fb; --coral: #e4572e;
  --bs-primary: #13315c; --bs-primary-rgb: 19,49,92; --bs-link-color: #1f5f99; --bs-link-hover-color: #0b2545;
}
body { font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--foam); color: #1d2b3a; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }
h1, h2, h3, .navbar-brand { font-family: 'Montserrat', sans-serif; font-weight: 700; letter-spacing: .01em; }
.btn-primary { --bs-btn-bg: var(--sea); --bs-btn-border-color: var(--sea); --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy); --bs-btn-active-bg: var(--navy); }
.btn-outline-primary { --bs-btn-color: var(--sea); --bs-btn-border-color: var(--sea); --bs-btn-hover-bg: var(--sea); --bs-btn-hover-border-color: var(--sea); }
.btn-teal { background: var(--teal); color: #fff; border: 0; } .btn-teal:hover { background: #008c8c; color: #fff; }
.text-navy { color: var(--navy) !important; } .bg-navy { background: var(--navy) !important; } .bg-sea { background: var(--sea) !important; }

.navbar-nautic { background: linear-gradient(90deg, var(--navy), var(--sea)); box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.navbar-nautic .navbar-brand { color: #fff; } .navbar-nautic .nav-link { color: rgba(255,255,255,.85); } .navbar-nautic .nav-link:hover, .navbar-nautic .nav-link.active { color: #fff; }
.brand-sail { display: inline-block; width: 28px; height: 28px; margin-right: 6px; vertical-align: -6px; }
.navbar-brand { display: inline-flex; align-items: center; }
.brand-logo { display: inline-flex; align-items: center; background: #fff; border-radius: 8px; padding: 3px 7px; margin-right: 10px; height: 38px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.brand-logo img { height: 32px; width: auto; max-width: 110px; object-fit: contain; display: block; }
@media (max-width: 400px) { .brand-logo { height: 34px; } .brand-logo img { height: 28px; max-width: 80px; } }

/* Hero */
.hero { position: relative; min-height: 420px; color: #fff; background: var(--sea) center/cover no-repeat; display: flex; align-items: flex-end; overflow: hidden; }
.hero.hero-sm { min-height: 300px; }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,37,69,.15) 0%, rgba(11,37,69,.55) 55%, rgba(11,37,69,.85) 100%); }
.hero .container { position: relative; z-index: 2; padding-bottom: 70px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 3.2rem); text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.hero .lead { text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.hero-credit { position: absolute; right: 12px; bottom: 58px; z-index: 3; font-size: .72rem; color: rgba(255,255,255,.85); background: rgba(0,0,0,.35); padding: 2px 8px; border-radius: 10px; }
.wave { position: absolute; bottom: -1px; left: 0; width: 100%; height: 60px; z-index: 2; }
.wave path { fill: var(--foam); }

/* Cabecera de logos */
.logo-band { background: #fff; border-radius: 14px; box-shadow: 0 4px 18px rgba(11,37,69,.08); padding: 12px 18px; display: flex; flex-wrap: wrap; gap: 22px; align-items: center; justify-content: center; }
.logo-band img { max-width: 180px; object-fit: contain; }
.logo-band.overlap { margin-top: -40px; position: relative; z-index: 5; }

.card-regatta { border: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 22px rgba(11,37,69,.10); transition: transform .15s, box-shadow .15s; height: 100%; }
.card-regatta:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(11,37,69,.18); }
.card-regatta .thumb { height: 170px; background: var(--sea) center/cover; position: relative; }
.card-regatta .thumb .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.section-title { font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: .5rem; }
.section-title::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, var(--teal), transparent); margin-left: .5rem; }

.nav-regatta { background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 3px 12px rgba(11,37,69,.08); }
.nav-regatta .nav-link { color: var(--sea); border-radius: 10px; font-weight: 600; }
.nav-regatta .nav-link.active { background: var(--sea); color: #fff; }
.panel { background: #fff; border-radius: 16px; box-shadow: 0 4px 16px rgba(11,37,69,.07); padding: 1.25rem; }

.table-results { font-size: .9rem; background: #fff; }
.table-results thead th { background: var(--sea); color: #fff; font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
.table-results td.race, .table-results th.race { text-align: center; white-space: nowrap; }
.table-results td.disc { color: #8a94a3; }
.table-results td.code { color: #b21f2d; font-weight: 600; }
.table-results td.disc.code { color: #b88; }
.table-results .pos { font-weight: 700; text-align: center; width: 48px; }
.table-results tr.podium-1 .pos { background: #f7d774; } .table-results tr.podium-2 .pos { background: #dfe3e8; } .table-results tr.podium-3 .pos { background: #e7b98a; }
.table-results .net { font-weight: 700; color: var(--navy); }
.status-badge { font-size: .8rem; letter-spacing: .05em; }
.poster-img { width: 100%; border-radius: 12px; box-shadow: 0 6px 22px rgba(0,0,0,.15); }

.notice { border-left: 5px solid var(--ocean); background: #fff; border-radius: 10px; padding: 1rem 1.1rem; box-shadow: 0 2px 10px rgba(11,37,69,.06); margin-bottom: 1rem; }
.notice.important { border-left-color: var(--coral); background: #fff7f4; }
.notice .meta { font-size: .8rem; color: #5b6b7d; }
.notice-type-rc { border-left-color: var(--ocean); } .notice-type-hearing { border-left-color: #8e44ad; } .notice-type-decision { border-left-color: #198754; } .notice-type-si { border-left-color: #e0a800; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: var(--sea); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption { position: absolute; right: 6px; bottom: 6px; font-size: .68rem; color: #fff; background: rgba(0,0,0,.4); padding: 1px 7px; border-radius: 8px; }

footer.site-footer { background: var(--navy); color: rgba(255,255,255,.8); padding: 2rem 0 1.2rem; margin-top: 3rem; }
footer.site-footer a { color: #9fd3ff; }
footer .footer-logos { background: #fff; border-radius: 12px; padding: 10px 16px; display: inline-flex; gap: 18px; align-items: center; flex-wrap: wrap; }
footer .footer-logos img { height: 42px; }

/* Admin */
.admin-body { background: #f1f5f9; }
.admin-sidebar .list-group-item.active { background: var(--sea); border-color: var(--sea); }
.results-grid input { width: 72px; text-align: center; padding: 2px 4px; font-weight: 600; text-transform: uppercase; }
.results-grid input.dup { background: #ffe1e1; border-color: #dc3545; }
.results-grid input.code { color: #b21f2d; }
.results-grid td, .results-grid th { vertical-align: middle; white-space: nowrap; }
.header-preview { background: #fff; border: 2px dashed #b7c7da; border-radius: 12px; padding: 12px; min-height: 80px; display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; }
.logo-thumb { height: 48px; max-width: 140px; object-fit: contain; background: #fff; border: 1px solid #e3e8ef; border-radius: 6px; padding: 3px; }
.stat-card { border: 0; border-radius: 14px; box-shadow: 0 3px 12px rgba(11,37,69,.08); }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 576px) {
  .logo-band { gap: 12px; padding: 8px 10px; }
  .logo-band img { height: auto !important; max-height: 40px; max-width: 110px; }
  .hero .lead { font-size: 1rem; }
  .hero { min-height: 340px; } .hero.hero-sm { min-height: 260px; }
}
@media print {
  .navbar, footer, .no-print, .nav-regatta, .hero .wave { display: none !important; }
  .hero { min-height: 0; color: #000; background: none !important; } .hero::before { display: none; }
  body { background: #fff; }
}
.navbar-brand small { margin-left: .45rem; font-size: .8em; }

/* Selector de idioma CA | ES */
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.45); border-radius: 6px; overflow: hidden; font-size: .78rem; font-weight: 700; }
.lang-switch a { padding: .15rem .5rem; color: rgba(255,255,255,.85); text-decoration: none; letter-spacing: .03em; }
.lang-switch a + a { border-left: 1px solid rgba(255,255,255,.45); }
.lang-switch a.active { background: #fff; color: var(--navy, #13315c); }
.lang-switch a:hover:not(.active) { background: rgba(255,255,255,.15); color: #fff; }
.lang-switch-light { border-color: #c9d3e0; } .lang-switch-light a { color: #13315c; } .lang-switch-light a + a { border-left-color: #c9d3e0; }
.lang-switch-light a.active { background: #13315c; color: #fff; } .lang-switch-light a:hover:not(.active) { background: #eef3f8; color: #13315c; }

/* Logos de clase (Patí Sènior / Patí Júnior) */
.class-logo { height: 1.4em; width: auto; max-width: 3.2em; object-fit: contain; vertical-align: -.35em; margin-right: .15em; }

/* Regata por flotas */
.fleet-dot { display:inline-block; width:.7rem; height:.7rem; border-radius:50%; vertical-align:middle; border:1px solid rgba(0,0,0,.15); }
.fleet-badge { font-weight:600; }
.fleet-col h3 { border-bottom:4px solid; padding-bottom:.25rem; }
.fleet-col .list-group-item { padding:.2rem .5rem; font-size:.85rem; }
.bg-teal { background: var(--teal) !important; color:#fff; }

/* Autocompletado del cens de patinaires */
.census-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 1050; max-height: 300px; overflow-y: auto; min-width: 280px; }
.census-suggest .list-group-item.active { color: #fff; }
.census-badge { font-weight: 500; }
.census-issues { font-size: .75rem; line-height: 1.2; }
