/* Liga — diseño claro y amigable. Primero celular; barra lateral en computadora. */
:root {
  color-scheme: light;
  --brand: #16a34a;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, #fff);
  --brand-mid: color-mix(in srgb, var(--brand) 28%, #fff);
  --bg: #f3f6fb; --card: #fff; --ink: #17233b; --muted: #62708a; --line: #e3e9f3;
  --sky: #2f80ed; --sun: #f59e0b; --grape: #8b5cf6; --rose: #ec4899; --mint: #10b981; --coral: #f4623a;
  --ok: #0f8a4f; --ok-bg: #dcf7e8; --warn: #9a5b00; --warn-bg: #fff1cc; --bad: #c0262d; --bad-bg: #fde4e4;
  --radius: 20px; --nav-h: 62px;
  --shadow: 0 1px 2px rgba(23,35,59,.05), 0 6px 20px rgba(23,35,59,.06);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--font); -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 1.65rem; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; margin: 1.6rem 0 .7rem; display: flex; align-items: center; gap: 8px; }
h2 .ico { color: var(--brand); }
small, .muted { color: var(--muted); }
img { max-width: 100%; }
.ico { width: 22px; height: 22px; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, #fff); outline-offset: 2px; border-radius: 10px; }

/* ===== Estructura ===== */
.shell { min-height: 100vh; }
.main { min-width: 0; overflow-x: clip; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); }
.top { background: #fff; border-bottom: 1px solid var(--line); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 15; }
.top a.brandlink { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; flex: 1; }
.logo { width: 42px; height: 42px; border-radius: 12px; object-fit: contain; background: var(--brand-soft); flex: none; }
.logo.ph { display: grid; place-items: center; color: var(--brand); }
.brandtxt { min-width: 0; line-height: 1.15; }
.brandtxt b { display: block; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brandtxt span { font-size: .8rem; color: var(--muted); }
.wrap { max-width: 1000px; margin: 0 auto; padding: 18px 16px; }

/* Menú: abajo en celular */
.side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 24px rgba(23,35,59,.06); }
.brandbox { display: none; }
.menu { display: flex; }
.mi { flex: 1 1 0; min-width: 0; padding: 0 2px; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted);
  font-size: .68rem; font-weight: 600; background: none; border: 0; font-family: inherit; cursor: pointer; }
.mi-ico { display: grid; place-items: center; width: 46px; height: 28px; border-radius: 999px; transition: background .15s; }
.mi.on { color: var(--brand); }
.mi.on .mi-ico { background: var(--brand-soft); }
.menu-sep { display: none; }
.shell.guest .main { padding-bottom: 28px; }
.shell.guest .side { display: none; }

@media (min-width: 960px) {
  .shell.guest .side { display: block; }
  .shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
  .top { display: none; }
  .main { padding-bottom: 40px; }
  .side { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-top: 0; border-right: 1px solid var(--line); box-shadow: none; padding: 18px 14px; }
  .brandbox { display: flex; align-items: center; gap: 12px; padding: 6px 8px 20px; color: var(--ink); }
  .menu { flex-direction: column; gap: 4px; }
  .mi { flex: none; min-height: 48px; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 1rem; padding: 0 10px; border-radius: 14px; }
  .mi-ico { width: 34px; height: 34px; border-radius: 11px; }
  .mi:hover { background: var(--bg); }
  .mi.on { background: var(--brand-soft); }
  .mi.on .mi-ico { background: #fff; }
  .menu-sep { display: block; height: 1px; background: var(--line); margin: 10px 8px; }
  .wrap { padding: 28px 28px; }
}

/* ===== Encabezados de página ===== */
.ph { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.ph .grow { flex: 1; min-width: 200px; }
.ph p { margin: 4px 0 0; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.hero { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 62%, #fff)); color: #fff; border-radius: 26px; padding: 20px;
  display: flex; gap: 16px; align-items: center; margin-bottom: 16px; box-shadow: var(--shadow); }
.hero img.hl { width: 72px; height: 72px; border-radius: 18px; background: #fff; object-fit: contain; padding: 4px; flex: none; }
.hero .hl.ph { width: 72px; height: 72px; border-radius: 18px; background: rgba(255,255,255,.25); display: grid; place-items: center; flex: none; }
.hero h1 { color: #fff; }
.hero p { margin: 4px 0 0; opacity: .92; }

/* ===== Tarjetas ===== */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.grid.c2m { grid-template-columns: 1fr 1fr; } .grid.c3m { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 560px) { .grid.c2 { grid-template-columns: 1fr 1fr; } .grid.c3 { grid-template-columns: repeat(3, 1fr); } .grid.c4 { grid-template-columns: repeat(4, 1fr); } }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: inherit; }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
a.row { cursor: pointer; }

/* Mosaico de accesos con ícono de color */
.tile { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); color: var(--ink);
  font: inherit; border: 0; text-align: left; cursor: pointer; min-width: 0; }
.tile b { display: block; line-height: 1.2; }
.tile small { display: block; }
.tile .t-ico { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.tile .t-ico .ico { width: 26px; height: 26px; }
.tile .t-n { margin-left: auto; font-weight: 800; font-size: 1.3rem; }
.c-sky .t-ico { background: #e3efff; color: var(--sky); } .c-sun .t-ico { background: #fff1d6; color: #d97706; }
.c-grape .t-ico { background: #eee8ff; color: var(--grape); } .c-rose .t-ico { background: #ffe4f1; color: var(--rose); }
.c-mint .t-ico { background: #d9f7ec; color: var(--mint); } .c-coral .t-ico { background: #ffe6de; color: var(--coral); }
.tile.vert { flex-direction: column; align-items: flex-start; gap: 10px; }
.tile.vert .t-n { margin-left: 0; font-size: 1.8rem; line-height: 1; }

.badge-logo { width: 54px; height: 54px; border-radius: 16px; background: var(--brand-soft); object-fit: contain; flex: none; display: grid; place-items: center; font-weight: 800; color: var(--brand); }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-soft); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 800; color: var(--brand); }
.num { min-width: 36px; height: 36px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; }
.num.none { background: var(--line); color: var(--muted); }
.tb { border-radius: 50%; object-fit: contain; background: var(--brand-soft); display: grid; place-items: center; font-weight: 800; color: var(--brand); flex: none; overflow: hidden; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 11px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--bg); color: var(--muted); }
.chip .ico { width: 14px; height: 14px; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.brand { background: var(--brand-soft); color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ===== Botones ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 16px; border: 0;
  background: var(--brand-soft); color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; text-align: center; transition: transform .08s; }
.btn:active { transform: scale(.98); }
.btn .ico { width: 20px; height: 20px; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn.plain { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: .92rem; border-radius: 12px; }
.btn.sm .ico { width: 18px; height: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.iconbtn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); border: 0; cursor: pointer; flex: none; }

/* ===== Pestañas ===== */
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin: 0 0 14px; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; padding: 6px 2px; border-radius: 16px;
  background: #fff; color: var(--muted); font-weight: 700; font-size: .72rem; line-height: 1.1; text-align: center; box-shadow: var(--shadow); min-width: 0; }
.tab .ico { width: 22px; height: 22px; }
.tab.on { background: var(--brand); color: #fff; }
.tab .n { background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 7px; font-size: .72rem; }
.tab.on .n { background: rgba(255,255,255,.28); }
@media (min-width: 640px) {
  .tabs { display: flex; flex-wrap: wrap; gap: 8px; }
  .tab { flex-direction: row; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: .95rem; }
  .tab .ico { width: 19px; height: 19px; }
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pill { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); color: var(--ink); font-weight: 700; font-size: .9rem; }
.pill.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.off { background: #eef1f6; border-color: transparent; color: #9aa5ba; }
.seg { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 12px; }
.seg a { padding: 7px 16px; border-radius: 999px; font-weight: 700; color: var(--muted); font-size: .9rem; display: inline-flex; gap: 6px; align-items: center; }
.seg a.on { background: var(--brand); color: #fff; }
.seg .ico { width: 17px; height: 17px; }

/* ===== Formularios ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .req { color: var(--bad); }
.field small { display: block; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 52px; padding: 11px 15px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); font: inherit; appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%2362708a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px; }
textarea { min-height: 96px; }
input[type=color] { width: 76px; height: 52px; padding: 5px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; }
input[type=file] { width: 100%; padding: 10px 0; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.err { color: var(--bad); font-size: .92rem; margin-top: 5px; font-weight: 700; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--brand); flex: none; }
.preview { width: 100px; height: 100px; border-radius: 20px; object-fit: cover; background: var(--brand-soft); display: block; margin-bottom: 8px; }
.two { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .two { grid-template-columns: 1fr 1fr; } }
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.search input { flex: 1; }
.search-ico { position: relative; flex: 1; }
.search-ico .ico { position: absolute; left: 14px; top: 15px; color: var(--muted); }
.search-ico input { padding-left: 46px; }

/* ===== Avisos ===== */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 16px; margin-bottom: 12px; font-weight: 600; }
.flash .ico { margin-top: 1px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); } .flash.warn { background: var(--warn-bg); color: var(--warn); } .flash.bad { background: var(--bad-bg); color: var(--bad); }
.flash ul { margin: 0; padding-left: 18px; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .ico { width: 44px; height: 44px; color: var(--brand-mid); margin-bottom: 6px; }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }

/* ===== Partidos (lo más importante) ===== */
.day { margin: 18px 0 8px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.day .ico { color: var(--brand); width: 20px; height: 20px; }
.game { background: #fff; border-radius: var(--radius); padding: 14px 14px 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.g-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); font-size: .86rem; font-weight: 600; margin-bottom: 10px; }
.g-meta span { display: inline-flex; align-items: center; gap: 4px; }
.g-meta .ico { width: 15px; height: 15px; }
.g-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.g-team { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; font-weight: 700; line-height: 1.2; }
.g-team span { overflow-wrap: anywhere; font-size: .95rem; }
.g-center { text-align: center; min-width: 76px; }
.g-score { font-size: 2rem; font-weight: 900; letter-spacing: .02em; line-height: 1; display: inline-flex; gap: 8px; align-items: center; }
.g-score i { font-style: normal; color: var(--line); font-weight: 700; }
.g-score .w { color: var(--brand); }
.g-time { font-size: 1.5rem; font-weight: 900; line-height: 1; }
.g-vs { font-size: .8rem; color: var(--muted); font-weight: 700; margin-top: 4px; }
.g-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.g-note { margin-top: 8px; color: var(--warn); font-size: .85rem; font-weight: 600; white-space: pre-line; }

/* ===== Tablas ===== */
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: center; color: var(--muted); font-weight: 700; font-size: .8rem; padding: 8px 4px; }
.tbl td { text-align: center; padding: 11px 4px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl th.l, .tbl td.l { text-align: left; }
.tbl td.pts { font-weight: 900; font-size: 1.05rem; }
.tbl tr.q td:first-child { box-shadow: inset 4px 0 0 var(--brand); }
.tbl .tn { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; }
.tbl .tn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
@media (max-width: 520px) { .hide-sm { display: none; } }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; margin-top: 10px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--brand); display: inline-block; }
.rank { width: 30px; height: 30px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex: none; }
.rank.top { background: var(--brand); color: #fff; }
.cardmark { display: inline-block; width: 13px; height: 18px; border-radius: 3px; vertical-align: -3px; }
.cardmark.y { background: #fbbf24; } .cardmark.r { background: #ef4444; }

/* ===== Captura de resultado ===== */
.scorebox { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; }
.scorebox input { text-align: center; font-size: 2.2rem; font-weight: 900; min-height: 68px; padding: 6px; }
.scorebox .tn2 { font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.scorebox .dash { font-size: 1.6rem; color: var(--muted); font-weight: 800; }
.rp { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.rp:first-of-type { border-top: 0; }
.rp-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rp-name .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.rp-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.played { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 14px; background: var(--bg); font-weight: 700; cursor: pointer; }
.played input { width: 22px; height: 22px; accent-color: var(--brand); }
.stepper { display: inline-flex; align-items: center; background: var(--bg); border-radius: 14px; }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 1.4rem; font-weight: 800; color: var(--brand); cursor: pointer; border-radius: 14px; }
.stepper output { min-width: 26px; text-align: center; font-weight: 900; font-size: 1.1rem; }
.stepper .ico { width: 18px; height: 18px; color: var(--muted); margin-left: 8px; }
.cardbtn { height: 44px; min-width: 52px; border-radius: 14px; border: 2px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font: inherit; font-weight: 800; padding: 0 12px; }
.cardbtn.y.on { background: #fef3c7; border-color: #fbbf24; } .cardbtn.r.on { background: #fee2e2; border-color: #ef4444; }

.install { display: none; }
details > summary { cursor: pointer; font-weight: 700; min-height: 46px; display: flex; align-items: center; gap: 8px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .ico:last-child { transform: rotate(90deg); }
.sheet { background: #fff; color: #000; padding: 18px; border-radius: 16px; margin-bottom: 16px; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet th, .sheet td { border: 1px solid #999; padding: 6px 8px; text-align: left; }
.sheet th { background: #eee; }
.sheet .head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.sheet .head img { width: 64px; height: 64px; object-fit: contain; }
.sheet .head h1 { font-size: 1.3rem; }

@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .side, .top, .no-print, .flash { display: none !important; }
  .shell { display: block; } .main { padding: 0; } .wrap { max-width: none; padding: 0; }
  .sheet { padding: 0; border-radius: 0; margin: 0; }
  .page-break { page-break-after: always; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.wrap > h1 { margin-bottom: 14px; }

.mini { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .85rem; white-space: nowrap; flex: none; }
.mini .ico { width: 18px; height: 18px; }
.mini .short { display: none; }
@media (max-width: 400px) { .mini .long { display: none; } .mini .short { display: inline; } }
.side-login { margin: 14px 8px 0; }

/* ===== Portada: cuadros de torneo ===== */
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
@media (min-width: 900px) { .tgrid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.tcard { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 176px; padding: 16px; border-radius: 26px; color: #fff;
  background: linear-gradient(150deg, var(--tc), color-mix(in srgb, var(--tc) 58%, #fff)); box-shadow: 0 10px 24px color-mix(in srgb, var(--tc) 30%, transparent); min-width: 0; }
.tcard .tc-ico { width: 56px; height: 56px; border-radius: 18px; background: rgba(255,255,255,.26); display: grid; place-items: center; object-fit: contain; }
.tcard img.tc-ico { background: #fff; padding: 4px; }
.tcard .tc-ico .ico { width: 30px; height: 30px; }
.tcard b { display: block; font-size: 1.15rem; line-height: 1.15; overflow-wrap: anywhere; }
.tcard small { color: rgba(255,255,255,.92); display: block; margin-top: 3px; font-weight: 600; }
.tcard .cc { display: inline-block; margin: 8px 4px 0 0; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.28); font-size: .74rem; font-weight: 700; }
.tcard .cc.off { opacity: .55; }
.tcard.off { background: #e8ecf3; color: #8a96ad; box-shadow: none; }
.tcard.off .tc-ico { background: #d8dfeb; }
.tcard.off small, .tcard.off b { color: #8a96ad; }
.tcard.off .cc { background: #d8dfeb; }

/* ===== Calendario de mes (empieza en domingo) ===== */
.mhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mhead b { font-size: 1.1rem; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month .dow { text-align: center; font-size: .74rem; font-weight: 800; color: var(--muted); padding: 4px 0; }
.month .d { aspect-ratio: 1 / 1.05; border-radius: 12px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding-top: 6px; color: var(--ink); font-weight: 700; font-size: .9rem; position: relative; }
.month .d.blank { background: transparent; }
.month .d.has { background: var(--brand-soft); color: var(--brand); }
.month .d.today { box-shadow: inset 0 0 0 2px var(--brand); }
.month .d.sel { background: var(--brand); color: #fff; }
.month .dots { display: flex; gap: 3px; }
.month .dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: block; }

/* ===== Selector de fecha propio (domingo primero) ===== */
.dp-btn { width: 100%; min-height: 52px; padding: 11px 15px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); font: inherit; text-align: left; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.dp-btn .ico { color: var(--brand); width: 20px; height: 20px; }
.dp-btn.empty-v { color: var(--muted); }
.dp-pop { margin-top: 8px; padding: 12px; border-radius: 18px; background: #fff; box-shadow: var(--shadow), 0 0 0 1.5px var(--line); }
.dp-pop[hidden] { display: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head b { text-transform: capitalize; }
.dp-head button { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--brand-soft); color: var(--brand); cursor: pointer; display: grid; place-items: center; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-grid .dow { text-align: center; font-size: .72rem; font-weight: 800; color: var(--muted); padding: 3px 0; }
.dp-grid button { aspect-ratio: 1; border: 0; border-radius: 12px; background: none; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.dp-grid button:hover { background: var(--brand-soft); }
.dp-grid button.today { box-shadow: inset 0 0 0 2px var(--brand-mid); }
.dp-grid button.sel { background: var(--brand); color: #fff; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.dp-foot button { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; min-height: 40px; }

/* ===== Confirmación escribiendo la palabra ===== */
dialog.danger { border: 0; border-radius: 24px; padding: 22px; width: min(92vw, 420px); box-shadow: 0 20px 60px rgba(23,35,59,.35); color: var(--ink); font-family: var(--font); }
dialog.danger::backdrop { background: rgba(23,35,59,.45); }
dialog.danger h3 { margin: 0 0 6px; font-size: 1.2rem; display: flex; gap: 8px; align-items: center; color: var(--bad); }
dialog.danger p { margin: 0 0 14px; color: var(--muted); }
dialog.danger input { text-transform: uppercase; text-align: center; font-weight: 800; letter-spacing: .1em; }
dialog.danger .acts { display: flex; gap: 10px; margin-top: 14px; }
dialog.danger .acts .btn { flex: 1; }
dialog.danger .btn[disabled] { opacity: .45; cursor: not-allowed; }
