/* Corona Golf Club — estilos */
:root {
  --red: #d3121b;
  --red-600: #b30e16;
  --red-50: #fdf1f1;
  --red-100: #fbdcdd;
  --ink: #012d19;
  --ink-2: #0b3f27;
  --brand: #0f5a35;
  --brand-600: #0b4529;
  --gold: #9a7425;
  --gold-2: #d9b35c;
  --gold-50: #f7f0de;
  --text: #1d2026;
  --muted: #6b7080;
  --line: #e7e4dd;
  --line-2: #f0ede7;
  --bg: #f6f4ef;
  --card: #ffffff;
  --green: #12805c;
  --green-50: #e8f5ef;
  --amber: #b26a00;
  --amber-50: #fdf3e2;
  --shadow-sm: 0 1px 2px rgba(20, 22, 28, .05);
  --shadow: 0 1px 2px rgba(20, 22, 28, .04), 0 8px 24px -12px rgba(20, 22, 28, .12);
  --shadow-lg: 0 24px 60px -20px rgba(20, 22, 28, .35);
  --radius: 14px;
  --radius-sm: 9px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Splash / Login ---------- */
.splash { min-height: 100vh; display: grid; place-items: center; }
.splash img { width: 120px; border-radius: 26px; box-shadow: var(--shadow-lg); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .6; } }

.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
}
.auth-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(700px 520px at 50% 42%, #0a4a2b, transparent 72%),
    var(--ink);
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center;
}
.auth-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(217,179,92,.07) 1px, transparent 1px); background-size: 22px 22px;
  pointer-events: none;
}
.auth-hero .brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-hero .brand img { width: 52px; height: 52px; border-radius: 50%; background: #fff; padding: 3px; }
.auth-hero .brand b { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: .01em; }
.auth-hero .brand small { display: block; color: rgba(255,255,255,.6); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.auth-hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 4vw, 52px); line-height: 1.08; max-width: 12ch; position: relative; z-index: 1; }
.auth-hero h1 em { font-style: italic; color: var(--gold-2); }
.auth-hero .hero-logo { width: min(400px, 82%); position: relative; z-index: 1; filter: drop-shadow(0 18px 40px rgba(0,0,0,.35)); }
.auth-hero .tag { font-family: var(--display); letter-spacing: .28em; text-transform: uppercase; font-size: 11.5px; color: var(--gold-2); position: relative; z-index: 1; }
.auth-hero p { color: rgba(255,255,255,.65); max-width: 40ch; position: relative; z-index: 1; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card img.logo { width: 128px; display: none; margin: 0 auto 22px; border-radius: 28px; box-shadow: 0 18px 40px -16px rgba(1,45,25,.55); }
.auth-card h2 { font-family: var(--serif); font-size: 30px; font-weight: 500; }
.auth-card .sub { color: var(--muted); margin: 6px 0 28px; }
.auth-card .btn { width: 100%; justify-content: center; height: 46px; margin-top: 8px; }
.auth-card .foot { margin-top: 28px; color: var(--muted); font-size: 12px; text-align: center; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--ink); color: #cddbd2;
  display: flex; flex-direction: column; padding: 22px 14px; z-index: 40;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: 14px; }
.sidebar .brand img { width: 46px; height: 46px; object-fit: contain; }
.sidebar .brand b { display: block; font-family: var(--display); color: #f4ecd6; font-size: 13.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; line-height: 1.2; }
.sidebar .brand small { color: #9db5a6; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav .group { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #7f9a8a; padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  text-decoration: none; font-weight: 500; font-size: 14px; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(217,179,92,.2), rgba(217,179,92,.04)); color: #fff; box-shadow: inset 2px 0 0 var(--gold-2); }
.nav a.active svg { color: var(--gold-2); }
.me { margin-top: 12px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.04); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-2); color: var(--ink); font-weight: 700; font-size: 13px; flex: none; }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { color: #9db5a6; font-size: 11.5px; }
.me button { background: none; border: 0; color: #9db5a6; cursor: pointer; padding: 6px; border-radius: 8px; }
.me button:hover { color: #fff; background: rgba(255,255,255,.06); }

.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 32px clamp(16px, 3vw, 40px) 64px; max-width: 1400px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .eyebrow { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.page-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 500; font-size: 14px;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: #d5d1c8; background: #fbfaf7; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(15,90,53,.7); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.gold { background: linear-gradient(180deg, #e2c06e, #c79a3c); border-color: #b98c33; color: #2a1f05; font-weight: 600; }
.btn.gold:hover { background: linear-gradient(180deg, #e8c97b, #cfa346); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: var(--ink-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-50); border-color: var(--red-100); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 32px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  height: 40px; width: 100%; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,90,53,.14); }
select.input { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7080' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input.sm { height: 34px; font-size: 13.5px; border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search .input { padding-left: 36px; }

.seg { display: inline-flex; background: #ece9e2; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 0 12px; height: 32px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

.year-pick { display: inline-flex; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.year-pick button { border: 0; background: none; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.year-pick button:hover { background: var(--bg); color: var(--text); }
.year-pick b { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 15px; }
.card-head .muted { font-size: 13px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .lbl { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .lbl .dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.kpi .lbl .dot svg { width: 15px; height: 15px; }
.kpi .val { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 10px; }
.kpi .foot { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.hero { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(217,179,92,.38), transparent 70%); }
.kpi.hero .lbl, .kpi.hero .foot { color: rgba(255,255,255,.6); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-red { background: var(--red-50); color: var(--red); }
.tone-amber { background: var(--amber-50); color: var(--amber); }
.tone-ink { background: #eceae4; color: var(--ink); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.dash-grid { grid-template-columns: 1.6fr 1fr; }

.chart { padding: 8px 16px 16px; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.list { list-style: none; margin: 0; padding: 4px 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.list li + li { border-top: 1px solid var(--line-2); }
.list .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.list .ic svg { width: 16px; height: 16px; }
.list .t { flex: 1; min-width: 0; }
.list .t b { display: block; font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .t small { color: var(--muted); font-size: 12px; }

.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--green); border-radius: 99px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 11px 14px; background: #faf9f6; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .1s; }
table.t tbody tr:hover { background: #fcfbf8; }
table.t .r { text-align: right; }
table.t .c { text-align: center; }
table.t tfoot td { font-weight: 600; background: #faf9f6; border-top: 1px solid var(--line); border-bottom: 0; }
table.t tr.clickable { cursor: pointer; }
table.t tr.off td { color: var(--muted); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.gray { background: #eeece6; color: var(--muted); }
.badge.amber { background: var(--amber-50); color: var(--amber); }
.badge.ink { background: var(--ink); color: #fff; }

/* ---------- Planilla (cuotas / handicap) ---------- */
.sheet { overflow: auto; max-height: calc(100vh - 260px); border-radius: var(--radius); }
.sheet table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.sheet th, .sheet td { border-bottom: 1px solid var(--line-2); padding: 0; height: 44px; }
.sheet thead th { position: sticky; top: 0; z-index: 3; background: #faf9f6; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 0 6px; }
.sheet thead th.now { color: var(--gold); }
.sheet .socio { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 210px; max-width: 240px; padding: 0 14px; text-align: left; border-right: 1px solid var(--line); }
.sheet thead .socio { z-index: 4; background: #faf9f6; }
.sheet .socio b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.sheet .socio small { color: var(--muted); font-size: 11.5px; }
.sheet td.hcp { min-width: 74px; text-align: center; border-right: 1px solid var(--line); }
.sheet td.hcp input { width: 56px; height: 30px; text-align: center; border: 1px solid transparent; border-radius: 7px; background: transparent; font-weight: 600; }
.sheet td.hcp input:hover { border-color: var(--line); }
.sheet td.hcp input:focus { border-color: var(--brand); outline: none; background: #fff; }
.sheet td.m { min-width: 74px; text-align: center; padding: 3px; }
.sheet td.tot { min-width: 104px; text-align: right; padding: 0 14px; font-weight: 600; background: #fcfbf8; border-left: 1px solid var(--line); }
.sheet tfoot td { position: sticky; bottom: 0; background: #f4f2ec; font-weight: 600; z-index: 2; border-top: 1px solid var(--line); text-align: center; font-size: 12px; }
.sheet tfoot td.socio { z-index: 3; background: #f4f2ec; }
.sheet tfoot td.tot { background: var(--ink); color: #fff; }
.cell {
  width: 100%; height: 36px; border-radius: 8px; border: 1px dashed transparent; background: none; cursor: pointer;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; transition: background .12s, border-color .12s;
}
.cell.empty { color: #c5c1b8; }
.cell.empty:hover { border-color: #d6d2c9; background: #faf9f6; color: var(--muted); }
.cell.paid { background: var(--green-50); color: var(--green); }
.cell.paid:hover { background: #d6efe4; }
.cell.due { background: repeating-linear-gradient(135deg, var(--red-50) 0 6px, #fff 6px 12px); color: var(--red); }
.cell.due:hover { border-color: var(--red-100); }
.cell.na { cursor: default; color: #ddd9d0; }
.cell[disabled] { cursor: default; }
.sheet-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.sheet-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sheet-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

.month-chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.month-chips label { position: relative; }
.month-chips input { position: absolute; opacity: 0; }
.month-chips span { display: grid; place-items: center; height: 34px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; cursor: pointer; user-select: none; }
.month-chips input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.month-chips input:disabled + span { background: var(--green-50); border-color: transparent; color: var(--green); cursor: default; }
.month-chips label.na input:disabled + span { background: #f3f1ec; color: #c5c1b8; text-decoration: line-through; }
.month-chips input:focus-visible + span { box-shadow: 0 0 0 3px rgba(15,90,53,.2); }

/* ---------- Modal / Toast ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 16, 20, .45); backdrop-filter: blur(3px); z-index: 100;
  display: grid; place-items: center; padding: 16px; animation: fade .15s ease;
}
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise .2s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { max-width: 720px; }
.modal header { padding: 20px 22px 6px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal header h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.modal header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal .body { padding: 14px 22px; overflow-y: auto; }
.modal footer { padding: 14px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal footer .spacer { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; font-size: 13.5px; animation: rise .2s ease; max-width: 360px; }
.toast.err { background: var(--red); }
.toast svg { width: 16px; height: 16px; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; stroke-width: 1.3; color: #c9c5bc; margin-bottom: 8px; }
.empty-state b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }
.alert.amber { background: var(--amber-50); color: #7a4a00; }
.alert.ink { background: #eceae4; }

.stack > * + * { margin-top: 16px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Reportes ---------- */
.report-picker { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 20px; }
.report-opt { padding: 16px; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s; }
.report-opt:hover { transform: translateY(-2px); }
.report-opt.on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,90,53,.12), var(--shadow); }
.report-opt .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.report-opt b { display: block; font-size: 14px; }
.report-opt small { color: var(--muted); font-size: 12.5px; }

.paper { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 40px; }
.doc-head { display: flex; align-items: center; gap: 18px; padding-bottom: 18px; border-bottom: 2px solid var(--ink); margin-bottom: 22px; }
.doc-head img { width: 64px; height: 64px; }
.doc-head .t { flex: 1; }
.doc-head .t b { font-family: var(--serif); font-size: 20px; font-weight: 600; display: block; }
.doc-head .t small { color: var(--muted); }
.doc-head .meta { text-align: right; font-size: 12px; color: var(--muted); }
.doc-title { font-family: var(--serif); font-weight: 500; font-size: 24px; margin-bottom: 4px; }
.doc-sub { color: var(--muted); margin-bottom: 20px; }
.doc table.t th { background: #f4f2ec; }
.doc table.t td, .doc table.t th { padding: 8px 10px; }
.doc h4 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 22px 0 8px; color: var(--ink-2); }
.doc-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 8px; }
.doc-summary div { padding: 12px 14px; }
.doc-summary div + div { border-left: 1px solid var(--line); }
.doc-summary small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.doc-summary b { font-size: 17px; }
.doc-summary .fin { background: var(--ink); color: #fff; }
.doc-summary .fin small { color: rgba(255,255,255,.65); }
.signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 64px; }
.signs div { border-top: 1px solid var(--ink); padding-top: 6px; text-align: center; font-size: 12px; color: var(--muted); }
.doc-foot { margin-top: 28px; font-size: 11px; color: var(--muted); text-align: center; }
.mini-sheet td, .mini-sheet th { padding: 5px 4px !important; text-align: center; font-size: 11.5px; }
.mini-sheet td:first-child, .mini-sheet th:first-child { text-align: left; }
.ok-mark { color: var(--green); font-weight: 700; }
.no-mark { color: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card img.logo { display: block; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(15,16,20,.4); z-index: 30; }
  .app.nav-open .scrim { display: block; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20;
    padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
    background: rgba(246,244,239,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .topbar img { width: 30px; height: 30px; }
  .topbar b { font-family: var(--serif); font-weight: 600; font-size: 16px; flex: 1; }
  .content { padding: 20px 16px 48px; }
  .split { grid-template-columns: 1fr; }
  .sheet { max-height: calc(100vh - 230px); }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .val { font-size: 19px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .page-head .actions { width: 100%; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; align-self: end; }
  .overlay { padding: 0; place-items: end stretch; }
  .sheet .socio { min-width: 150px; max-width: 160px; padding: 0 10px; }
  .hide-sm { display: none !important; }
  .paper { padding: 20px 16px; }
  .doc-summary { grid-template-columns: 1fr 1fr; }
  .doc-summary div:nth-child(3) { border-left: 0; }
  .doc-summary div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .signs { gap: 16px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .month-chips { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Impresión ---------- */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 11.5px; }
  .sidebar, .topbar, .scrim, .page-head, .no-print, .toasts, .report-picker, .toolbar { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .paper { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  table.t th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-summary .fin, .badge, .doc-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr { break-inside: avoid; }
  .doc-summary { grid-template-columns: repeat(4, 1fr) !important; }
}

/* Tablas anchas en pantallas medianas */
table.t.compact td, table.t.compact th { padding-left: 10px; padding-right: 10px; }
@media (max-width: 1500px) { .hide-md { display: none !important; } }
@media print { .hide-md { display: table-cell !important; } }

@media (max-width: 600px) {
  .kpi.hero { grid-column: 1 / -1; }
  .kpi.hero .val { font-size: 26px; }
  .kpi .val { overflow-wrap: anywhere; }
  .card-head { flex-wrap: wrap; padding: 14px 16px; }
  .list li { padding: 10px 16px; }
}

/* Crédito del desarrollador */
.credit { text-align: center; font-size: 12.5px; color: var(--muted); padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin-top: auto; }
.credit a { color: var(--gold); font-weight: 700; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.main { min-height: 100vh; }
.auth-form { grid-template-rows: 1fr auto; }
.auth-form .auth-card { align-self: center; }
.auth-form .credit { border-top: 0; width: 100%; }
@media print { .credit { display: none !important; } }

/* Marca: tipografía del logo */
.topbar b { font-family: var(--display); letter-spacing: .03em; }
.doc-head .t b { font-family: var(--display); letter-spacing: .03em; }

/* Instalación de la app */
.install-btn { display: none; }
.can-install .install-btn { display: inline-flex; }
.sidebar .install-btn { margin: 10px 4px 0; justify-content: center; }
.auth-card .install-btn { margin-top: 12px; }
.ios-steps { margin: 0; padding-left: 20px; }
.ios-steps li { margin-bottom: 10px; }
.ios-steps svg { width: 16px; height: 16px; vertical-align: -3px; }

/* Celulares: evitar zoom automático de iOS al escribir y respetar la muesca */
@media (max-width: 900px) {
  .input, select.input, textarea.input { font-size: 16px; }
  .auth-form { padding-top: max(32px, env(safe-area-inset-top)); }
  .auth-card img.logo { display: block; }
}

/* Login en celular: franja verde con el logo grande */
@media (max-width: 900px) {
  .auth { grid-template-rows: auto 1fr; }
  .auth-hero { display: flex; padding: max(28px, env(safe-area-inset-top)) 20px 26px; border-radius: 0 0 28px 28px; gap: 6px; }
  .auth-hero .hero-logo { width: min(250px, 72vw); }
  .auth-hero .tag { font-size: 10px; }
  .auth-hero p { display: none; }
  .auth-card img.logo { display: none; }
  .auth-form { padding-top: 26px; }
  .auth-card h2 { font-size: 26px; }
  .auth-card .sub { margin-bottom: 20px; }
}
