/* =====================================================================
   MGC Club · sistema de diseño compartido del panel del personal
   (portal, caja, comandas y tee times). Mismos colores que la app.
   Cada pantalla solo agrega los estilos propios de su contenido.
   ===================================================================== */

:root {
  /* Paleta del club */
  --deep: #0E3B2A;        /* cabecera: verde de fairway en sombra */
  --deep-2: #14513A;
  --brand: #006952;       /* verde institucional: acciones */
  --brand-dark: #00503F;
  --brand-soft: #D6EAE3;
  --brass: #B8913A;       /* latón: solo sección activa y firma del club */
  --brass-soft: #F3E8CF;
  --sage: #EEF1EC;        /* fondo */
  --paper: #FFFFFF;
  --ink: #16242A;
  --ink-2: #4A5A60;
  --line: #D3DDD6;
  --line-strong: #B9CCC3;
  --danger: #B4432F;
  --danger-soft: #F8E3DE;
  --ok: #1F8A4C;
  --ok-soft: #DDF1E5;
  --warn: #8A6A10;
  --warn-soft: #F7EDD2;
  --gold: #B8913A;

  /* Alias de nombres anteriores (cada pantalla usaba los suyos) */
  --soft: var(--brand-soft);
  --mist: var(--sage);
  --fairway: var(--brand);

  /* Forma: la jerarquía también se expresa con el radio */
  --r-control: 9px;
  --r-card: 12px;
  --radius: var(--r-card);
  --shadow-pop: 0 1px 2px rgba(14, 59, 42, .08), 0 18px 44px -16px rgba(14, 59, 42, .35);

  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--sage);
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.45; min-height: 100vh; background: var(--sage); padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

h1 { font-size: 23px; line-height: 1.2; margin: 0; letter-spacing: -0.015em; font-weight: 800; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 700; }
.muted { color: var(--ink-2); font-size: 14px; margin: 0; }
.grow { flex: 1; min-width: 160px; }

/* ── Cabecera ─────────────────────────────────────────────────────────── */
header {
  background: var(--deep); color: #fff;
  padding: 10px 18px; padding-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
/* El primer bloque es el título de la pantalla; encima va la firma del club */
header > :first-child { flex: 1; min-width: 180px; font-weight: 800; font-size: 18px; line-height: 1.25; }
header > :first-child::before {
  content: var(--club-name, ""); display: block; color: var(--brass); min-height: 1em;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; margin-bottom: 1px;
}
header > :first-child > :first-child { font-weight: 800; font-size: 18px; }
header > :first-child > :not(:first-child),
header > :first-child small { display: block; font-weight: 500; font-size: 12.5px; color: #B9CFC4; }
.hbtn {
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--r-control); padding: 7px 12px; cursor: pointer; font-size: 14px; font-weight: 600;
  text-decoration: none; line-height: 1.2;
}
.hbtn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); }
.hbtn[aria-current="page"] { background: var(--brass); border-color: var(--brass); color: var(--deep); }

@media (max-width: 560px) {
  header { padding-left: 14px; padding-right: 14px; gap: 6px; }
  .hbtn { padding: 6px 10px; font-size: 13px; }
}

main { max-width: 1200px; margin: 0 auto; padding: 18px; display: grid; gap: 16px; }

/* ── Botones ──────────────────────────────────────────────────────────── */
.btn {
  border: 1px solid transparent; border-radius: var(--r-control); padding: 9px 15px;
  font-weight: 700; font-size: 14.5px; cursor: pointer; background: var(--brand); color: #fff;
  line-height: 1.2; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary, .btn.sec { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover, .btn.sec:hover { background: var(--sage); }
.btn.danger { background: var(--paper); color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small, .btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.big { padding: 14px 20px; font-size: 17px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Campos ───────────────────────────────────────────────────────────── */
label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=search], input[type=number], input[type=date],
input[type=time], input[type=tel], input[type=password], input[type=url], input[inputmode], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-control);
  background: var(--paper); font-size: 15px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 0; border-color: var(--brand); }
textarea { min-height: 110px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ── Contenedores ─────────────────────────────────────────────────────── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.card h2 { font-size: 16px; }
.center { max-width: 420px; margin: 40px auto; display: grid; gap: 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }

/* ── Avisos ───────────────────────────────────────────────────────────── */
.alert { border-radius: var(--r-control); padding: 10px 12px; font-size: 14px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: #135E33; }
.alert.warn, .warn { background: var(--warn-soft); color: var(--warn); }

/* ── Etiquetas y fichas ───────────────────────────────────────────────── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 13px; }
.chip b { font-size: 15px; }
.pill, .badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px;
  background: var(--sage); color: var(--ink-2); line-height: 1.6; white-space: nowrap;
}

/* ── Selector segmentado ──────────────────────────────────────────────── */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-control); overflow: hidden; background: var(--paper); }
.seg button { border: none; background: transparent; padding: 7px 13px; cursor: pointer; font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }

/* ── Tablas ───────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-2); font-weight: 700; font-size: 12.5px; }
td.num, th.num { text-align: right; }

/* ── Variante táctil: caja (se usa de pie, con prisa y a veces con guantes) ── */
body.touch { font-size: 16px; }
body.touch .btn { padding: 12px 18px; font-size: 16px; border-radius: 10px; }
body.touch .btn.small, body.touch .btn.sm { padding: 8px 12px; font-size: 14px; }
body.touch input[type=text], body.touch input[type=email], body.touch input[type=password], body.touch input[type=url], body.touch input[type=tel], body.touch input[type=number], body.touch input[inputmode] {
  padding: 12px 14px; font-size: 18px; border-radius: 10px;
}
body.touch label { font-size: 14px; }
