/* =====================================================================
   GEFAMILY · Sistema de diseño
   ===================================================================== */

:root {
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFB;
  --surface-3: #EEF2F4;
  --border: #E3E8EC;
  --border-strong: #CFD7DE;
  --text: #0F1B24;
  --text-2: #4A5866;
  --muted: #84909C;

  --primary: #0E7C6B;
  --primary-600: #0A6658;
  --primary-50: #E6F3F0;
  --primary-100: #CDE8E2;
  --accent: #F2765A;
  --accent-50: #FDEDE8;

  --success: #059669; --success-50: #E7F6EF;
  --warning: #C77700; --warning-50: #FDF3E1;
  --danger:  #DC2F2F; --danger-50:  #FCEAEA;
  --info:    #2563EB; --info-50:    #E9F0FE;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-xs: 0 1px 2px rgba(15, 27, 36, .05);
  --shadow-sm: 0 1px 3px rgba(15, 27, 36, .06), 0 1px 2px rgba(15, 27, 36, .04);
  --shadow-lg: 0 18px 50px -12px rgba(15, 27, 36, .25);
  --ring: 0 0 0 4px rgba(14, 124, 107, .16);

  --sidebar-w: 264px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0D1216; --surface: #141B21; --surface-2: #19222A; --surface-3: #202B34;
  --border: #26323C; --border-strong: #34434F;
  --text: #E8EEF2; --text-2: #A9B6C1; --muted: #73828E;
  --primary: #2FB59D; --primary-600: #45C6AE; --primary-50: rgba(47,181,157,.12); --primary-100: rgba(47,181,157,.22);
  --accent: #F58A72; --accent-50: rgba(245,138,114,.14);
  --success: #34C38F; --success-50: rgba(52,195,143,.13);
  --warning: #F0A93B; --warning-50: rgba(240,169,59,.13);
  --danger: #F26B6B;  --danger-50: rgba(242,107,107,.13);
  --info: #6C9CFF;    --info-50: rgba(108,156,255,.13);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 20px 60px -10px rgba(0,0,0,.6);
  --ring: 0 0 0 4px rgba(47,181,157,.22);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1216; --surface: #141B21; --surface-2: #19222A; --surface-3: #202B34;
    --border: #26323C; --border-strong: #34434F;
    --text: #E8EEF2; --text-2: #A9B6C1; --muted: #73828E;
    --primary: #2FB59D; --primary-600: #45C6AE; --primary-50: rgba(47,181,157,.12); --primary-100: rgba(47,181,157,.22);
    --accent: #F58A72; --accent-50: rgba(245,138,114,.14);
    --success: #34C38F; --success-50: rgba(52,195,143,.13);
    --warning: #F0A93B; --warning-50: rgba(240,169,59,.13);
    --danger: #F26B6B;  --danger-50: rgba(242,107,107,.13);
    --info: #6C9CFF;    --info-50: rgba(108,156,255,.13);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow-lg: 0 20px 60px -10px rgba(0,0,0,.6);
    --ring: 0 0 0 4px rgba(47,181,157,.22);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
button { font: inherit; color: inherit; }
[data-lucide], svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger) !important; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand-mark { display: inline-flex; filter: drop-shadow(0 4px 10px rgba(14,124,107,.28)); }
.brand-light, .brand-light:hover { color: #fff; }

/* =====================================================================
   AUTENTICACIÓN
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; }
.auth-aside {
  position: relative; overflow: hidden; color: #fff;
  padding: 40px 48px; display: flex; flex-direction: column; gap: 40px;
  background:
    radial-gradient(900px 500px at 110% -10%, rgba(242,118,90,.35), transparent 60%),
    radial-gradient(700px 500px at -20% 110%, rgba(47,181,157,.45), transparent 60%),
    linear-gradient(160deg, #0B5F52 0%, #0A4A41 55%, #08332D 100%);
}
.auth-aside::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
}
.auth-pitch { position: relative; z-index: 1; margin-top: auto; max-width: 460px; }
.auth-pitch h2 { font-size: clamp(28px, 3vw, 38px); font-weight: 800; letter-spacing: -.03em; }
.auth-pitch p { margin-top: 14px; color: rgba(255,255,255,.78); font-size: 16px; }
.auth-preview {
  position: relative; z-index: 1; max-width: 420px; padding: 18px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px; backdrop-filter: blur(10px); display: grid; gap: 10px;
}
.ap-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; padding: 0 4px 4px; }
.ap-date { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.65); }
.ap-item {
  display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center;
  background: rgba(255,255,255,.95); color: #0F1B24; border-radius: 12px; padding: 10px 12px;
  border-left: 4px solid var(--c);
}
.ap-item b { font-size: 13px; color: #4A5866; }
.ap-item strong { display: block; font-size: 14px; }
.ap-item small { color: #84909C; font-size: 12px; }
.ap-chip { display: inline-flex; gap: 8px; align-items: center; justify-self: start; font-size: 13px; padding: 8px 12px; border-radius: 999px; background: rgba(242,118,90,.22); color: #FFE3DB; }
.ap-chip [data-lucide], .ap-chip svg { width: 15px; height: 15px; }
.auth-foot { position: relative; z-index: 1; font-size: 13px; color: rgba(255,255,255,.55); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-mobile-brand { display: none; margin-bottom: 28px; }
.auth-title { margin-bottom: 26px; }
.auth-title h1 { font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.auth-title p { color: var(--text-2); margin-top: 6px; }
.auth-switch { text-align: center; margin-top: 22px; color: var(--text-2); font-size: 14px; }
.auth-switch a { font-weight: 600; }

/* =====================================================================
   LAYOUT APP
   ===================================================================== */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 18px; overflow-y: auto;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.sidebar-top .sidebar-close { display: none; }
.household { margin: 0 4px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.household-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.household-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.household-name [data-lucide], .household-name svg { color: var(--primary); width: 16px; height: 16px; }
.household-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.household-sa { background: var(--primary-50); border-color: var(--primary-100); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link.is-active { background: var(--primary-50); color: var(--primary); }
.nav-link.is-disabled { opacity: .55; cursor: not-allowed; }
.nav-link.is-disabled:hover { background: none; color: var(--text-2); }
.soon { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 16px 32px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid transparent;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 22px; font-weight: 800; letter-spacing: -.025em; }
.topbar-title p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar .menu-btn { display: none; }
.content { padding: 8px 32px 48px; display: flex; flex-direction: column; gap: 22px; max-width: 1320px; width: 100%; }

.user-btn { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.user-btn:hover { border-color: var(--border-strong); }
.user-btn-text { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.user-btn-text strong { font-size: 13.5px; }
.user-btn-text small { font-size: 11.5px; color: var(--muted); }
.user-btn .chev { width: 16px; height: 16px; color: var(--muted); }
.theme-light-icon { display: none; }
:root[data-theme="dark"] .theme-dark-icon { display: none; }
:root[data-theme="dark"] .theme-light-icon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-dark-icon { display: none; }
  :root:not([data-theme="light"]) .theme-light-icon { display: inline; }
}

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.dropdown.open .dropdown-menu { display: block; animation: pop .14s ease-out; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none;
  border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); }
.dropdown-menu form { margin: 0; }
.dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; }
.dropdown-head small { color: var(--muted); font-size: 12.5px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* =====================================================================
   COMPONENTES
   ===================================================================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-xs); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.card-head h2 { font-size: 17px; font-weight: 700; }
.card-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card-tint { background: linear-gradient(160deg, var(--primary-50), var(--surface) 70%); }
.h-sm { font-size: 15px; font-weight: 700; display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.h-sm [data-lucide], .h-sm svg { color: var(--primary); }
.stack { display: flex; flex-direction: column; gap: 22px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.grid-2-even { grid-template-columns: 1fr 1fr; }
.divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 650; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn [data-lucide], .btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(14,124,107,.3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #06231E; }
.btn-soft { background: var(--primary-50); color: var(--primary); }
.btn-soft:hover { background: var(--primary-100); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 48px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: auto; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* Formularios */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: 13.5px; color: var(--text); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input.is-invalid { border-color: var(--danger); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2384909C' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; width: auto; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > [data-lucide], .input-icon > svg { position: absolute; left: 13px; color: var(--muted); pointer-events: none; width: 17px; height: 17px; }
.input-icon .input { padding-left: 40px; }
.input-action { position: absolute; right: 6px; border: 0; background: none; color: var(--muted); padding: 8px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.input-action:hover { color: var(--text); background: var(--surface-3); }
.field-error { color: var(--danger); font-size: 12.5px; font-weight: 500; }
.hint { color: var(--muted); font-size: 12.5px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.grow { flex: 1; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--primary); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 11px;
  border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; color: var(--text-2); text-align: center; transition: .15s;
}
.segmented input:checked + span { border-color: var(--primary); background: var(--primary-50); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.segmented input:focus-visible + span { box-shadow: var(--ring); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); transition: transform .12s; }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); transform: scale(1.04); }
.swatch:hover span { transform: scale(1.08); }

.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { flex-shrink: 0; width: 40px; height: 23px; border-radius: 999px; background: var(--border-strong); position: relative; transition: .2s; margin-top: 1px; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .2s; }
.switch input:checked + .switch-ui { background: var(--primary); }
.switch input:checked + .switch-ui::after { transform: translateX(17px); }
.switch strong { display: block; font-size: 14px; }
.switch small { color: var(--muted); font-size: 12.5px; }
.access-fields { display: flex; flex-direction: column; gap: 16px; }
.access-fields[hidden] { display: none; }

/* Alertas y banners */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; border: 1px solid; margin-bottom: 4px; }
.alert > [data-lucide], .alert > svg { margin-top: 1px; }
.alert span { flex: 1; }
.alert-success { background: var(--success-50); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error   { background: var(--danger-50);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: var(--warning-50); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-info    { background: var(--info-50);    color: var(--info);    border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-close { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 0; display: grid; }
.alert-close:hover { opacity: 1; }
.alert-close [data-lucide], .alert-close svg { width: 16px; height: 16px; }
.banner { display: flex; gap: 10px; align-items: center; padding: 11px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; }
.banner-info { background: var(--primary-50); color: var(--primary); }
.banner-warning { background: var(--warning-50); color: var(--warning); }

/* Badges y etiquetas */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-accent  { background: var(--accent-50); color: var(--accent); }
.badge-neutral { background: var(--surface-3); color: var(--text-2); }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger  { background: var(--danger-50);  color: var(--danger); }
.badge-info    { background: var(--info-50);    color: var(--info); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 2px 8px; border-radius: 6px; }
.tag [data-lucide], .tag svg { width: 13px; height: 13px; }

/* Avatares */
.avatar {
  --c: var(--primary); width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center; font-weight: 700; font-size: 13.5px; letter-spacing: .02em;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, var(--surface));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 35%, transparent);
}
.avatar-xs { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.avatar-xl { width: 68px; height: 68px; font-size: 22px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1.5px color-mix(in srgb, var(--c) 35%, transparent); }
.avatar-stack .avatar + .avatar { margin-left: -5px; }

/* Estadísticas */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-xs); }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); flex-shrink: 0; }
.stat-icon [data-lucide], .stat-icon svg { width: 22px; height: 22px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-value { font-size: 25px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-foot { color: var(--muted); font-size: 12px; }

/* Estado vacío */
.empty { text-align: center; padding: 38px 20px 30px; }
.empty-art { width: 70px; height: 70px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.empty-art [data-lucide], .empty-art svg { width: 32px; height: 32px; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--muted); font-size: 14px; max-width: 360px; margin: 6px auto 0; }

/* Línea de tiempo (agenda de hoy) */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tl-item { display: grid; grid-template-columns: 78px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); position: relative; }
.tl-item::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.tl-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.tl-time strong { font-size: 14px; white-space: nowrap; }
.tl-time small, .tl-time span { color: var(--muted); font-size: 12px; }
.tl-title { font-weight: 650; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; color: var(--muted); font-size: 12.5px; align-items: center; }
.tl-meta > span:not(.tag) { display: inline-flex; gap: 4px; align-items: center; }
.tl-meta svg, .tl-meta [data-lucide] { width: 13px; height: 13px; }

/* Lista de miembros */
.member-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.member-list li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; }
.member-list li:hover { background: var(--surface-2); }
.ml-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ml-text strong { font-size: 14px; }
.ml-text small { color: var(--muted); font-size: 12.5px; }
.points { display: inline-flex; gap: 4px; align-items: center; font-weight: 700; font-size: 13px; color: var(--accent); background: var(--accent-50); padding: 3px 9px; border-radius: 999px; }
.points [data-lucide], .points svg { width: 14px; height: 14px; fill: currentColor; }

.roadmap { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.roadmap li { display: flex; gap: 10px; align-items: flex-start; }
.roadmap [data-lucide], .roadmap svg { color: var(--primary); width: 16px; height: 16px; margin-top: 2px; }

/* Página Familia */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.usage { min-width: 260px; }
.usage-text { font-size: 14px; color: var(--text-2); }
.usage-bar { height: 6px; background: var(--surface-3); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.member-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; position: relative; overflow: hidden; box-shadow: var(--shadow-xs); transition: box-shadow .2s, transform .2s; }
.member-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); }
.member-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.member-card.is-inactive { opacity: .6; }
.member-card .dropdown-menu { right: 0; }
.mc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.member-card h3 { font-size: 16px; }
.you { color: var(--muted); font-weight: 500; font-size: 13px; }
.mc-badges { display: flex; gap: 6px; margin: 8px 0 14px; flex-wrap: wrap; }
.mc-info { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-2); }
.mc-info li { display: flex; gap: 8px; align-items: center; min-width: 0; word-break: break-all; }
.mc-info svg, .mc-info [data-lucide] { width: 15px; height: 15px; color: var(--muted); }

/* Perfil */
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.profile-head h2 { font-size: 19px; }

/* Modal */
.modal { border: 0; padding: 0; background: transparent; max-width: 520px; width: calc(100% - 24px); color: var(--text); }
.modal::backdrop { background: rgba(9, 18, 22, .5); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .18s ease-out; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-size: 19px; font-weight: 750; }
.modal-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }

/* Tablas */
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 22px; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 22px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.cell-main { display: flex; align-items: center; gap: 10px; }
.cell-stack { display: flex; flex-direction: column; line-height: 1.3; }
.cell-stack small { color: var(--muted); font-size: 12.5px; }
.cell-actions { text-align: right; }
.cell-actions form { margin: 0; }
.filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; justify-content: center; padding-top: 34px; }
.pager a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: 14px; }
.pager a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Gráfico de barras CSS */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; height: 210px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.bar-val { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.bar { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.bar span { width: 100%; min-height: 4px; background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000)); border-radius: 10px; }
.bar-lbl { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.status-list li { display: grid; grid-template-columns: 100px 1fr 34px; gap: 12px; align-items: center; }
.status-list strong { text-align: right; font-variant-numeric: tabular-nums; }
.status-bar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.status-bar span { display: block; height: 100%; border-radius: inherit; }
.status-bar .badge-success { background: var(--success); }
.status-bar .badge-info { background: var(--info); }
.status-bar .badge-warning { background: var(--warning); }
.status-bar .badge-danger { background: var(--danger); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: inline-flex; }

  .sidebar { transform: translateX(-100%); transition: transform .25s ease, visibility .25s; visibility: hidden; }
  .sidebar-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  .sidebar-top .sidebar-close, .topbar .menu-btn { display: inline-grid; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(9,18,22,.45); }
  .sidebar-open .sidebar-backdrop { display: block; }
  .main { margin-left: 0; }
  .topbar { padding: 12px 16px; }
  .content { padding: 4px 16px 40px; }
  .user-btn-text, .user-btn .chev { display: none; }
  .user-btn { padding: 3px; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .stat-value { font-size: 22px; }
  .grid-2-even, .field-row { grid-template-columns: 1fr; }
  .topbar-title h1 { font-size: 18px; }
  .card { padding: 18px; }
  .table-wrap { margin: 0 -18px -18px; }
  .tl-item { grid-template-columns: 64px 1fr; }
  .tl-item .avatar-stack { grid-column: 2; }
  .toolbar .btn { width: 100%; }
  .segmented span { font-size: 12px; }

  /* Tabla como tarjetas en móvil */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 18px; border-bottom: 1px solid var(--border); }
  .table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; white-space: normal; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; }
  .table td.cell-actions { justify-content: flex-end; padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* =====================================================================
   ETAPA 2 · CALENDARIO
   ===================================================================== */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); color: #fff; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font-weight: 600; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.textarea { height: auto; padding: 10px 14px; resize: vertical; min-height: 44px; line-height: 1.5; }
.input-lg { height: 50px; font-size: 16.5px; font-weight: 600; }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix .input { width: 74px !important; }
.input-suffix span { color: var(--text-2); font-size: 14px; }
.segmented-sm { grid-template-columns: 1fr 1fr; }
.segmented-sm span { flex-direction: row; justify-content: center; padding: 8px; }
.modal-lg { max-width: 640px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toasts */
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; max-width: 380px; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #fff; background: #10231F; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: .25s; border-left: 4px solid var(--primary); }
.toast.show { opacity: 1; transform: none; }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: #F0A93B; }
:root[data-theme="dark"] .toast { background: #26323C; }

/* Layout del calendario */
.cal-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.cal-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 22px; padding: 18px; }
.cal-side h3 { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.cal-side-head { display: flex; justify-content: space-between; align-items: baseline; }
.cal-side-head h3 { margin-bottom: 10px; }
.person-filter { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.person-check { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 600; }
.person-check:hover { background: var(--surface-2); }
.person-check input { position: absolute; opacity: 0; }
.pc-box { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--c); display: grid; place-items: center; color: #fff; flex-shrink: 0; transition: .15s; }
.pc-box svg, .pc-box [data-lucide] { width: 12px; height: 12px; stroke-width: 3.5; opacity: 0; }
.person-check input:checked + .pc-box { background: var(--c); }
.person-check input:checked + .pc-box svg { opacity: 1; }
.person-check input:focus-visible + .pc-box { box-shadow: var(--ring); }
.person-check input:not(:checked) ~ .pc-name { color: var(--muted); }
.pc-name small { color: var(--muted); font-weight: 500; }
.cal-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; color: var(--text-2); }
.cal-legend li { display: flex; align-items: center; gap: 8px; }
.cal-legend svg, .cal-legend [data-lucide] { width: 14px; height: 14px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex-shrink: 0; }

.cal-main { padding: 18px; min-width: 0; }
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-title { font-size: 19px; font-weight: 750; margin-left: 6px; }
.view-switch { display: inline-flex; background: var(--surface-3); padding: 4px; border-radius: 11px; gap: 2px; }
.view-switch button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 650; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.view-switch button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.cal-wrap { height: calc(100vh - 230px); min-height: 560px; }

/* Tema de FullCalendar */
.fc {
  --fc-border-color: var(--border);
  --fc-page-bg-color: var(--surface);
  --fc-neutral-bg-color: var(--surface-2);
  --fc-today-bg-color: color-mix(in srgb, var(--primary) 6%, transparent);
  --fc-now-indicator-color: var(--accent);
  --fc-highlight-color: color-mix(in srgb, var(--primary) 14%, transparent);
  --fc-list-event-hover-bg-color: var(--surface-2);
  --fc-event-border-color: transparent;
  --fc-event-text-color: var(--text);
  --fc-event-bg-color: var(--surface-3);
  font-size: 13px;
}
.fc .fc-scrollgrid { border-radius: 12px; overflow: hidden; }
.fc .fc-col-header-cell-cushion { padding: 10px 4px; font-weight: 700; color: var(--text-2); text-transform: capitalize; font-size: 12.5px; }
.fc .fc-daygrid-day-number { font-weight: 600; color: var(--text-2); padding: 6px 8px; font-size: 13px; }
.fc .fc-day-today .fc-daygrid-day-number { background: var(--primary); color: #fff; border-radius: 999px; min-width: 26px; height: 26px; display: inline-grid; place-items: center; padding: 0 6px; margin: 4px; }
.fc .fc-day-other .fc-daygrid-day-number { opacity: .45; }
.fc .fc-timegrid-slot { height: 3em; }
.fc .fc-timegrid-slot-label-cushion { font-size: 11.5px; color: var(--muted); text-transform: lowercase; }
.fc .fc-timegrid-axis-cushion { font-size: 11px; color: var(--muted); }
.fc a { color: inherit; }
.fc .fc-daygrid-more-link { font-weight: 700; color: var(--primary); font-size: 12px; }
.fc .fc-popover { background: var(--surface); border-color: var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.fc .fc-popover-header { background: var(--surface-2); padding: 8px 10px; font-weight: 700; }

.fc .gef-ev { cursor: pointer; }
.fc-timegrid-event.gef-ev, .fc-daygrid-block-event.gef-ev {
  background: color-mix(in srgb, var(--ev) 15%, var(--surface)); border: 0; border-left: 3px solid var(--ev);
  border-radius: 7px; color: var(--text); box-shadow: none;
}
.fc-timegrid-event.gef-ev:hover, .fc-daygrid-block-event.gef-ev:hover { background: color-mix(in srgb, var(--ev) 24%, var(--surface)); }
.fc-timegrid-event-harness-inset .fc-timegrid-event { box-shadow: 0 0 0 1.5px var(--surface); }
.fc-daygrid-dot-event.gef-ev { border-radius: 6px; padding: 1px 3px; }
.fc-daygrid-dot-event.gef-ev:hover { background: var(--surface-3); }
.ev-dg { display: flex; align-items: center; gap: 5px; overflow: hidden; width: 100%; color: var(--text); }
.ev-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ev); flex-shrink: 0; }
.ev-dg .ev-time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.ev-dg .ev-title, .ev-ad .ev-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-ad { display: flex; gap: 6px; align-items: center; padding: 1px 4px; overflow: hidden; }
.ev-tg { padding: 3px 5px; display: flex; flex-direction: column; gap: 1px; height: 100%; overflow: hidden; }
.ev-tg .ev-title { font-weight: 700; line-height: 1.25; font-size: 12.5px; }
.ev-tg .ev-time { font-size: 11px; color: var(--text-2); }
.ev-foot { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.ev-avs { display: inline-flex; }
.ev-av { width: 19px; height: 19px; border-radius: 50%; font-size: 8.5px; font-weight: 800; display: inline-grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 18%, var(--surface)); box-shadow: 0 0 0 1.5px var(--surface); }
.ev-av + .ev-av { margin-left: -4px; }
.ev-av-more { --c: var(--muted); }
.ev-flag { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--text-2); }
.ev-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.ev-list .ev-title { font-weight: 700; font-size: 14px; }
.ev-cat { font-size: 12px; font-weight: 600; color: var(--ev); background: color-mix(in srgb, var(--ev) 12%, transparent); padding: 1px 8px; border-radius: 6px; }
.ev-loc { color: var(--muted); font-size: 12.5px; }
.fc .fc-list { border-radius: 12px; overflow: hidden; }
.fc .fc-list-day-cushion { background: var(--surface-2); font-weight: 700; padding: 10px 14px; }
.fc .fc-list-day-text { display: inline-block; }
.fc .fc-list-day-text::first-letter { text-transform: uppercase; }
.fc .fc-list-event td { padding: 11px 14px; }
.fc .fc-list-event-dot { border-color: var(--ev); }
.fc .fc-list-event-time { color: var(--text-2); font-weight: 600; white-space: nowrap; }
.fc .fc-list-empty { background: var(--surface); color: var(--muted); }

/* Formulario de actividad */
.cat-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.cat-opt input, .people-opt input, .day-picker input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: .15s; }
.cat-opt span svg, .cat-opt span [data-lucide] { width: 15px; height: 15px; color: var(--c); }
.cat-opt input:checked + span { background: color-mix(in srgb, var(--c) 13%, transparent); border-color: var(--c); color: var(--text); box-shadow: inset 0 0 0 1px var(--c); }
.cat-opt input:focus-visible + span, .people-opt input:focus-visible + span, .day-picker input:focus-visible + span { box-shadow: var(--ring); }
.people-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.people-opt > span { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 5px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .15s; color: var(--text-2); }
.people-opt input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px var(--c); }
.when-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.when-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px 12px; }
.when-grid .input, .repeat-row .input { min-width: 0; width: 100%; }
.when-grid [hidden] { display: none; }
.repeat-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; align-items: end; }
.repeat-row [hidden], [data-rec-days][hidden] { display: none; }
.day-picker { display: flex; gap: 6px; }
.day-picker span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); font-weight: 700; font-size: 13px; color: var(--text-2); cursor: pointer; background: var(--surface); }
.day-picker input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.switch-sm .switch-ui { width: 36px; height: 21px; }
.switch-sm .switch-ui::after { width: 15px; height: 15px; }
.switch-sm input:checked + .switch-ui::after { transform: translateX(15px); }
.more { border: 1px solid var(--border); border-radius: 14px; }
.more summary { list-style: none; cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 14px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { border-bottom: 1px solid var(--border); color: var(--text); }
.more-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.conflict-box { border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); background: var(--warning-50); color: var(--text); border-radius: 14px; padding: 14px 16px; font-size: 13.5px; }
.conflict-box[hidden] { display: none; }
.conflict-head { display: flex; gap: 8px; align-items: center; color: var(--warning); margin-bottom: 6px; }
.conflict-box ul { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 4px; }
.conflict-box p { color: var(--text-2); font-size: 12.5px; }

/* Detalle */
.det { display: flex; flex-direction: column; gap: 14px; }
.det-loading { min-height: 200px; display: grid; place-items: center; }
.det-top { display: flex; justify-content: space-between; align-items: center; margin: -24px -24px 0; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%); border-radius: 20px 20px 0 0; }
.det-cat { display: inline-flex; gap: 7px; align-items: center; font-weight: 700; font-size: 13px; color: var(--c); }
.det-cat svg, .det-cat [data-lucide] { width: 16px; height: 16px; }
.det-tools { display: flex; gap: 6px; }
.det-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.det-info { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.det-info li { display: flex; gap: 10px; align-items: flex-start; }
.det-info li > svg, .det-info li > [data-lucide] { color: var(--muted); margin-top: 2px; }
.det-info a { font-weight: 600; margin-left: 4px; }
.chip-people { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-person { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.det-desc { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--text-2); }
.det-confirm { background: var(--danger-50); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.det-confirm[hidden] { display: none; }
.det-confirm-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.comments { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.comments h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.comments h3 svg, .comments h3 [data-lucide] { color: var(--primary); }
.c-count { background: var(--primary-50); color: var(--primary); font-size: 12px; padding: 1px 8px; border-radius: 999px; }
.c-count:empty { display: none; }
.c-list { list-style: none; margin: 0 0 12px; padding: 2px; display: flex; flex-direction: column; gap: 12px; max-height: 280px; overflow-y: auto; }
.c-empty { color: var(--muted); font-size: 13.5px; background: var(--surface-2); padding: 12px 14px; border-radius: 12px; }
.c-item { display: flex; gap: 10px; }
.c-body { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 8px 12px; }
.c-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.c-meta span { color: var(--muted); }
.c-body p { font-size: 14px; margin-top: 2px; word-wrap: break-word; }
.c-del { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1; padding: 0 2px; }
.c-del:hover { color: var(--danger); }
.c-form { display: flex; gap: 8px; align-items: flex-end; }
.c-form .textarea { resize: none; min-height: 42px; max-height: 140px; }
.c-form .btn { height: 42px; width: 46px; padding: 0; flex-shrink: 0; }

/* Vista Hoy: próximos días */
.upcoming { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.upcoming li a { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 10px; color: var(--text); }
.upcoming li a:hover { background: var(--surface-2); }
.up-date { text-align: center; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 0; line-height: 1.15; }
.up-date small { display: block; font-size: 10.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .05em; }
.up-date strong { font-size: 17px; }
.up-text strong { display: block; font-size: 14px; }
.up-text small { color: var(--muted); font-size: 12.5px; }
.tl-link { color: inherit; }
.tl-item:hover { border-color: var(--border-strong); }
.tl-comments { display: inline-flex; gap: 4px; align-items: center; }

@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-side { position: static; display: grid; grid-template-columns: auto 1fr; gap: 16px 22px; align-items: start; }
  .cal-side > .btn { grid-column: 1 / -1; }
  .cal-legend { display: none; }
  .person-filter { flex-direction: row; flex-wrap: wrap; gap: 4px; }
}
@media (max-width: 640px) {
  .cal-side { grid-template-columns: 1fr; padding: 14px; }
  .cal-main { padding: 12px; }
  .cal-toolbar { flex-direction: column; align-items: stretch; }
  .view-switch { justify-content: space-between; }
  .view-switch button { flex: 1; padding: 7px 6px; }
  .cal-title { font-size: 16px; }
  .cal-wrap { height: calc(100vh - 200px); min-height: 480px; }
  .repeat-row { grid-template-columns: 1fr 1fr; }
  .repeat-row > .field:first-child { grid-column: 1 / -1; }
  .day-picker span { width: 34px; height: 34px; }
  .fc .fc-list-event-time { white-space: normal; width: 84px; font-size: 12px; }
  .fc .fc-list-event td { padding: 10px 8px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .det-title { font-size: 19px; }
  .modal-box { padding: 20px; }
  .det-top { margin: -20px -20px 0; padding-left: 20px; }
}

/* =====================================================================
   ETAPA 3 · TAREAS, PUNTOS Y RECOMPENSAS
   ===================================================================== */
.nav-badge { margin-left: auto; font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.text-accent { color: var(--accent); }
.avatar-any { --c: var(--muted); }
.avatar-any svg, .avatar-any [data-lucide] { width: 55%; height: 55%; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.is-active { background: var(--primary-50); border-color: var(--primary); color: var(--primary); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.points-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.points-picker .input { width: 96px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 18px; font-weight: 750; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.head-actions .select { height: 34px; font-size: 13px; }

/* Pestañas */
.tabs { display: inline-flex; gap: 2px; background: var(--surface-3); padding: 4px; border-radius: 12px; }
.tabs a { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 9px; font-weight: 650; font-size: 14px; color: var(--text-2); }
.tabs a span { font-size: 11.5px; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface); display: inline-grid; place-items: center; color: var(--muted); }
.tabs a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs a.is-active span { background: var(--surface-3); }
.tabs a .tab-alert { background: var(--accent) !important; color: #fff !important; }
.person-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.person-tabs a { --c: var(--primary); display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13.5px; }
.person-tabs a:hover { border-color: var(--border-strong); color: var(--text); }
.person-tabs a.is-active { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface)); color: var(--text); box-shadow: inset 0 0 0 1px var(--c); }

/* Lista de tareas */
.task-group { display: flex; flex-direction: column; gap: 10px; }
.group-title { font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.group-title span { font-size: 11.5px; background: var(--surface-3); color: var(--text-2); padding: 1px 8px; border-radius: 999px; }
.group-vencidas { color: var(--danger); }
.group-hoy { color: var(--warning); }
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-xs); transition: border-color .15s; }
.task:hover { border-color: var(--border-strong); }
.task.is-mine { border-left: 3px solid var(--primary); }
.task-check-form { margin: 0; }
.task-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; flex-shrink: 0; transition: .15s; padding: 0; }
.task-check svg, .task-check [data-lucide] { width: 16px; height: 16px; stroke-width: 3; }
.task-check:not(:disabled):hover { border-color: var(--success); color: var(--success); background: var(--success-50); }
.task-check:disabled { opacity: .45; cursor: not-allowed; }
.task-check.is-done { background: var(--success); border-color: var(--success); color: #fff; cursor: default; }
.task-hecha .task-check.is-done { background: var(--info); border-color: var(--info); }
.task-check-sm { width: 24px; height: 24px; }
.task-check-sm svg { width: 13px; height: 13px; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 650; font-size: 15px; }
.task-aprobada .task-title { color: var(--text-2); }
.task-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 7px; align-items: center; }
.task-meta .badge svg, .task-meta .badge [data-lucide] { width: 12px; height: 12px; }
.meta-txt { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); font-size: 12.5px; }
.meta-txt svg, .meta-txt [data-lucide] { width: 13px; height: 13px; }
.task-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.task-who { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); min-width: 104px; }
.task-actions { display: flex; gap: 6px; align-items: center; }
.task-actions form { margin: 0; }

/* Mini tareas (vista Hoy) */
.mini-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-tasks li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; }
.mini-tasks li:hover { background: var(--surface-2); }
.mini-tasks form { margin: 0; }
.mt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mt-text strong { font-size: 14px; }
.mt-text small { color: var(--muted); font-size: 12.5px; }
.mini-alert { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--accent-50); color: var(--accent); font-weight: 650; font-size: 13.5px; margin-bottom: 10px; }
.mini-alert svg:last-child { margin-left: auto; }
.mini-alert:hover { color: var(--accent); filter: brightness(.97); }

/* Marcador de puntos */
.scoreboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.score { position: relative; display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); overflow: hidden; }
.score::after { content: ""; position: absolute; inset: auto -30px -40px auto; width: 120px; height: 120px; border-radius: 50%; background: color-mix(in srgb, var(--c) 10%, transparent); }
.score.is-top { border-color: color-mix(in srgb, #F59E0B 55%, var(--border)); background: linear-gradient(140deg, color-mix(in srgb, #F59E0B 10%, var(--surface)), var(--surface) 60%); }
.score.is-me { box-shadow: inset 0 0 0 1.5px var(--c); }
.score-crown { position: absolute; top: 10px; right: 12px; color: #F59E0B; }
.score-crown svg { width: 20px; height: 20px; fill: color-mix(in srgb, #F59E0B 35%, transparent); }
.score-text { display: flex; flex-direction: column; line-height: 1.25; position: relative; z-index: 1; }
.score-text strong { font-size: 15px; }
.score-text strong small { color: var(--muted); font-weight: 500; }
.score-pts { display: inline-flex; gap: 5px; align-items: center; font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 2px 0; font-variant-numeric: tabular-nums; }
.score-pts svg { width: 20px; height: 20px; color: var(--accent); fill: var(--accent); }
.score-pts small { font-size: 13px; color: var(--muted); font-weight: 600; }
.score-week { color: var(--muted); font-size: 12.5px; }

/* Canjes por entregar */
.card-alert { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(160deg, var(--accent-50), var(--surface) 55%); }
.card-alert h2 { display: flex; gap: 8px; align-items: center; }
.card-alert h2 svg { color: var(--accent); }
.claims { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.claims li { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.claims form { margin: 0; }
.claim-text { flex: 1; min-width: 0; font-size: 14px; }
.claim-text small { display: block; color: var(--muted); font-size: 12.5px; }

/* Recompensas */
.rewards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.reward { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-xs); transition: transform .15s, box-shadow .15s; }
.reward:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.reward.is-ready { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.reward.is-archived { opacity: .55; }
.reward-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.reward-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(140deg, var(--accent-50), color-mix(in srgb, #F59E0B 14%, transparent)); color: var(--accent); flex-shrink: 0; }
.reward-icon svg { width: 24px; height: 24px; }
.reward-icon-sm { width: 34px; height: 34px; border-radius: 11px; }
.reward-icon-sm svg { width: 17px; height: 17px; }
.reward h3 { font-size: 15.5px; }
.reward-desc { color: var(--muted); font-size: 13px; }
.reward-cost { display: inline-flex; gap: 5px; align-items: center; font-weight: 750; font-size: 14px; margin-top: auto; padding-top: 4px; }
.reward-cost svg { width: 15px; height: 15px; color: var(--accent); fill: var(--accent); }
.reward-progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.reward-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #F59E0B); }
.reward form { margin: 0; }
.icon-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.icon-picker input { position: absolute; opacity: 0; pointer-events: none; }
.icon-picker span { height: 44px; border-radius: 12px; border: 1px solid var(--border-strong); display: grid; place-items: center; color: var(--text-2); cursor: pointer; transition: .15s; }
.icon-picker input:checked + span { background: var(--accent-50); border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.icon-picker input:focus-visible + span { box-shadow: var(--ring); }

/* Historial */
.ledger { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ledger li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ledger li:last-child { border-bottom: 0; }
.ledger-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ledger-text strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-text small { color: var(--muted); font-size: 12.5px; }
.ledger-pts { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; }
.ledger-pts.is-pos { color: var(--success); }
.ledger-pts.is-neg { color: var(--danger); }

@media (max-width: 760px) {
  .task { flex-wrap: wrap; align-items: flex-start; padding: 14px; }
  .task-body { flex-basis: calc(100% - 48px); }
  .task-side { width: 100%; padding-left: 44px; justify-content: space-between; flex-wrap: wrap; }
  .task-who { min-width: 0; }
  .tabs { width: 100%; }
  .tabs a { flex: 1; justify-content: center; padding: 8px 6px; font-size: 13px; }
  .claims li { flex-wrap: wrap; }
  .claim-text { flex-basis: calc(100% - 50px); }
  .icon-picker { grid-template-columns: repeat(4, 1fr); }
  .scoreboard { grid-template-columns: 1fr 1fr; gap: 10px; }
  .score { flex-direction: column; align-items: flex-start; padding: 14px; gap: 8px; }
  .score-pts { font-size: 20px; }
}
.howto { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); }
.howto a { font-weight: 600; }
.tabs a { white-space: nowrap; }
@media (max-width: 760px) { .tabs a { font-size: 12.5px; gap: 5px; } }

/* =====================================================================
   ETAPA 4 · SUSCRIPCIONES Y PAGOS
   ===================================================================== */
.banner a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }

.sub-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; background: linear-gradient(120deg, var(--primary-50), var(--surface) 60%); }
.sub-main { display: flex; gap: 16px; align-items: center; }
.sub-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--primary); color: #fff; flex-shrink: 0; box-shadow: 0 8px 20px -8px var(--primary); }
.sub-icon svg { width: 26px; height: 26px; }
.sub-plan { font-size: 20px; font-weight: 800; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; letter-spacing: -.02em; }
.sub-text { color: var(--text-2); margin-top: 4px; max-width: 620px; }
.sub-usage { min-width: 220px; font-size: 14px; color: var(--text-2); }

.pending-card { display: flex; gap: 16px; align-items: center; border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); background: linear-gradient(120deg, var(--warning-50), var(--surface) 60%); flex-wrap: wrap; }
.pending-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--warning-50); color: var(--warning); display: grid; place-items: center; flex-shrink: 0; }
.pending-text { flex: 1; min-width: 240px; }
.pending-text h2 { font-size: 16px; }
.pending-text p { color: var(--text-2); font-size: 14px; margin-top: 2px; }

.period-switch { display: inline-flex; background: var(--surface-3); padding: 4px; border-radius: 12px; }
.period-switch input { position: absolute; opacity: 0; }
.period-switch span { display: inline-flex; gap: 6px; align-items: center; padding: 7px 16px; border-radius: 9px; font-weight: 650; font-size: 14px; color: var(--text-2); cursor: pointer; }
.period-switch em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--success); background: var(--success-50); padding: 1px 6px; border-radius: 999px; }
.period-switch input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.period-switch input:focus-visible + span { box-shadow: var(--ring); }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-xs); }
.plan.is-featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 18px 40px -22px var(--primary); }
.plan.is-current::before { content: "Tu plan"; position: absolute; top: 14px; right: 16px; font-size: 11px; font-weight: 800; color: var(--primary); background: var(--primary-50); padding: 3px 9px; border-radius: 999px; }
.plan.is-archived { opacity: .55; }
.plan-flag { position: absolute; top: -11px; left: 22px; background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 800; padding: 3px 11px; border-radius: 999px; letter-spacing: .02em; }
:root[data-theme="dark"] .plan-flag { color: #06231E; }
.plan h3 { font-size: 18px; font-weight: 800; }
.plan-desc { color: var(--muted); font-size: 13.5px; min-height: 40px; }
.plan-price { margin: 4px 0 2px; }
.plan-price strong { font-size: 32px; font-weight: 800; letter-spacing: -.035em; color: var(--text); }
.plan-price span { color: var(--muted); font-size: 14px; font-weight: 600; }
.plan-price em { font-style: normal; font-size: 12px; color: var(--success); background: var(--success-50); padding: 2px 7px; border-radius: 999px; font-weight: 800; vertical-align: middle; }
.plans .pp-a { display: none; }
.plans[data-period="anual"] .pp-a { display: inline; }
.plans[data-period="anual"] .pp-m { display: none; }
.plan-members { display: flex; gap: 8px; align-items: center; font-weight: 650; font-size: 14px; }
.plan-members svg { color: var(--primary); width: 17px; height: 17px; }
.plan-feat { list-style: none; margin: 0 0 8px; padding: 12px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); flex: 1; align-content: start; }
.plan-feat li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feat svg { width: 16px; height: 16px; color: var(--success); margin-top: 2px; stroke-width: 2.6; }
.plan-current-tag { text-align: center; font-weight: 700; color: var(--primary); font-size: 14px; padding: 8px; }
.plan-admin-head { display: flex; justify-content: space-between; align-items: flex-start; }
.plan-stats { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }
.plan-stats strong { color: var(--text); }

/* Modal de pago */
.pay-summary { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.pay-summary small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.pay-summary strong { font-size: 16px; }
.pay-total { text-align: right; }
.pay-total strong { font-size: 20px; color: var(--primary); }
.pay-period { min-width: 190px; }
.method-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.method-tabs input { position: absolute; opacity: 0; }
.method-tabs span { display: flex; gap: 8px; justify-content: center; align-items: center; padding: 11px; border-radius: 12px; border: 1px solid var(--border-strong); font-weight: 650; cursor: pointer; color: var(--text-2); }
.method-tabs input:checked + span { border-color: var(--primary); background: var(--primary-50); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.account { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--border-strong); margin-top: 6px; }
.account small { display: block; color: var(--muted); font-size: 12px; }
.account strong { font-size: 15px; }
.copyable { display: inline-flex; gap: 6px; align-items: center; }
.copy-btn { border: 0; background: var(--surface-3); color: var(--text-2); width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; cursor: pointer; }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn.is-copied { background: var(--success); color: #fff; }
.dropzone { position: relative; display: block; border: 2px dashed var(--border-strong); border-radius: 16px; padding: 22px; text-align: center; cursor: pointer; transition: .15s; background: var(--surface-2); }
.dropzone:hover { border-color: var(--primary); background: var(--primary-50); }
.dropzone.has-file { border-style: solid; border-color: var(--success); background: var(--success-50); }
.dropzone.is-error { border-color: var(--danger); background: var(--danger-50); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone > span { display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.dropzone svg { width: 28px; height: 28px; color: var(--primary); margin-bottom: 4px; }
.dropzone.has-file svg { color: var(--success); }
.dropzone small { color: var(--muted); font-size: 12.5px; }

/* Revisión de pagos (super admin) */
.review-list { display: flex; flex-direction: column; gap: 14px; }
.review { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 18px; }
.review-proof { position: relative; display: grid; place-items: center; border-radius: 14px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); aspect-ratio: 3 / 4; color: var(--text-2); }
.review-proof img { width: 100%; height: 100%; object-fit: cover; }
.proof-pdf, .proof-none { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.proof-pdf svg, .proof-none svg { width: 36px; height: 36px; color: var(--danger); }
.proof-open { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 9px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; opacity: 0; transition: .15s; }
.review-proof:hover .proof-open { opacity: 1; }
.review-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.review-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.review-top h3 { font-size: 17px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.review-top p { font-size: 13px; margin-top: 2px; }
.review-amount { font-size: 26px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.review-amount small { font-size: 12px; color: var(--muted); margin-left: 4px; font-weight: 700; }
.review-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); }
.review-data dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.review-data dd { margin: 2px 0 0; font-weight: 650; font-size: 14px; }
.review-warn, .review-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; padding: 10px 12px; border-radius: 10px; }
.review-warn { background: var(--warning-50); color: var(--warning); }
.review-note { background: var(--info-50); color: var(--info); }
.review-warn svg, .review-note svg { width: 16px; height: 16px; margin-top: 2px; }
.review-actions { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-top: auto; }
.review-actions form { margin: 0; }
.reject summary { list-style: none; }
.reject summary::-webkit-details-marker { display: none; }
.reject[open] summary { display: none; }
.reject-form { display: flex; gap: 8px; align-items: center; min-width: 320px; }
.reject-form .input { height: 38px; }

.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.config-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

@media (max-width: 760px) {
  .review { grid-template-columns: 1fr; }
  .review-proof { aspect-ratio: 16 / 9; }
  .reject-form { min-width: 0; flex-direction: column; align-items: stretch; width: 100%; }
  .reject { width: 100%; }
  .pay-summary { grid-template-columns: 1fr 1fr; }
  .pay-period { grid-column: 1 / -1; grid-row: 2; }
  .config-grid { grid-template-columns: 1fr; }
  .toolbar .head-actions { width: 100%; flex-wrap: wrap; }
  .toolbar .head-actions form { flex: 1; }
}
.table-fluid td { white-space: normal; }
.link-sm { font-size: 13px; font-weight: 600; }

/* =====================================================================
   ETAPA 5 · AVISOS, CALENDARIO EXTERNO Y TABLERO
   ===================================================================== */
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-size: 13px; color: var(--text-2); background: var(--surface-2); }
.ical-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.howto-box p { font-size: 13.5px; color: var(--text-2); }
.howto-box p + p { margin-top: 8px; }
.grid-2-even + .grid-2-even { margin-top: 0; }

/* ---------- Modo tablero ---------- */
.board-body { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%), var(--bg); }
.board { display: flex; flex-direction: column; gap: 18px; padding: 22px 26px; min-height: 100vh; }
.board-top { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 22px; align-items: center; }
.board-brand { display: flex; gap: 12px; align-items: center; }
.board-brand .brand-mark svg { width: 40px; height: 40px; }
.board-brand strong { display: block; font-size: 19px; font-weight: 800; }
.board-brand span { color: var(--muted); font-size: 14px; }
.board-clock { font-size: clamp(42px, 6vw, 72px); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.board-clock small { font-size: .32em; font-weight: 700; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.board-next { justify-self: end; text-align: right; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 18px; max-width: 360px; }
.board-next small { display: block; color: var(--accent); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.board-next strong { display: block; font-size: 18px; margin: 2px 0; }
.board-next span { color: var(--muted); font-size: 13.5px; }
.board-actions { display: flex; gap: 8px; }
.board-cols { flex: 1; display: grid; grid-template-columns: repeat(var(--n), minmax(220px, 1fr)); gap: 16px; overflow-x: auto; align-items: stretch; }
.board-col { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 14px; border-top: 5px solid var(--c); min-width: 0; }
.bc-head { display: flex; gap: 12px; align-items: center; }
.bc-head strong { display: block; font-size: 20px; font-weight: 800; }
.bc-points { display: inline-flex; gap: 4px; align-items: center; font-weight: 800; color: var(--accent); font-size: 14px; }
.bc-points svg { width: 15px; height: 15px; fill: var(--accent); }
.bc-sub { color: var(--muted); font-size: 13.5px; }
.bc-events, .bc-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bc-ev { position: relative; padding: 10px 12px 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ev) 12%, var(--surface)); border-left: 4px solid var(--ev); display: flex; flex-direction: column; }
.bc-ev.is-past { opacity: .45; }
.bc-ev.is-now { box-shadow: 0 0 0 2px var(--ev); }
.bc-time { font-size: 13px; font-weight: 700; color: var(--text-2); }
.bc-title { font-size: 17px; font-weight: 750; line-height: 1.25; }
.bc-loc { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.bc-loc svg { width: 13px; height: 13px; }
.bc-live { position: absolute; top: 9px; right: 10px; font-style: normal; font-size: 11px; font-weight: 800; color: #fff; background: var(--accent); padding: 2px 8px; border-radius: 999px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.bc-free { display: flex; gap: 8px; align-items: center; color: var(--muted); font-weight: 600; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; }
.bc-tasks { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.bc-tasks li { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 15px; }
.bc-tasks li em { margin-left: auto; font-style: normal; color: var(--accent); font-weight: 800; font-size: 13px; }
.bc-tasks li.is-done { color: var(--muted); text-decoration: line-through; }
.bc-box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong); display: grid; place-items: center; flex-shrink: 0; }
.is-done .bc-box { background: var(--info); border-color: var(--info); color: #fff; }
.bc-box svg { width: 13px; height: 13px; stroke-width: 3.5; }
.board-bottom { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.bb-block { flex: 1; min-width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 18px; }
.bb-block h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.bb-block h3 svg { width: 16px; height: 16px; color: var(--primary); }
.bb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.bb-list li { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; padding-left: 10px; border-left: 3px solid var(--ev, var(--primary)); }
.bb-list b { color: var(--text-2); font-size: 13.5px; }
.bb-list em { font-style: normal; color: var(--accent); font-weight: 800; font-size: 13px; }
.bb-avs { display: inline-flex; }
.bb-avs .avatar + .avatar { margin-left: -5px; }
.bb-empty { color: var(--muted); }
.board-updated { width: 100%; text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .board { padding: 14px; }
  .board-top { grid-template-columns: 1fr auto; }
  .board-next { grid-column: 1 / -1; justify-self: stretch; text-align: left; max-width: none; }
  .board-clock { grid-row: 1; grid-column: 2; }
  .board-actions { grid-column: 1 / -1; grid-row: 3; justify-content: flex-end; }
  .board-cols { grid-template-columns: 1fr; }
}

/* ---------- Pago con llave Bre-B ---------- */
.breb { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.breb-key { padding: 16px; background: linear-gradient(135deg, var(--primary-50), var(--surface) 75%); display: flex; flex-direction: column; gap: 8px; }
.breb-badge { display: inline-flex; gap: 6px; align-items: center; align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--primary); background: var(--surface); border: 1px solid var(--primary-100); padding: 3px 10px; border-radius: 999px; }
.breb-badge svg { width: 14px; height: 14px; }
.breb-value { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.breb-value strong { font-size: 22px; font-weight: 800; letter-spacing: -.01em; word-break: break-all; }
.breb-value .btn.is-copied { background: var(--success); color: #fff; }
.breb-holder { font-size: 13.5px; color: var(--text-2); }
.breb-steps { margin: 0; padding: 14px 16px 14px 36px; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); border-top: 1px solid var(--border); }
.segmented-4 { grid-template-columns: repeat(4, 1fr); }
.segmented-4 span { flex-direction: row; justify-content: center; padding: 9px 6px; font-size: 12.5px; }

/* ---------- Categorías ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cat-tile { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 14px; padding: 12px 12px 12px 14px; box-shadow: var(--shadow-xs); min-width: 0; }
.cat-tile-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.cat-tile-icon svg { width: 21px; height: 21px; }
.cat-tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cat-tile-text strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-tile-text small { color: var(--muted); font-size: 12.5px; }
.cat-tile-actions { display: flex; gap: 4px; }
.cat-tile-actions .icon-btn { width: 34px; height: 34px; }
.cat-preview { --c: #3B82F6; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--border-strong); border-left: 4px solid var(--c); background: var(--surface-2); }
.cat-preview strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatches-sm { gap: 8px; }
.swatches-sm .swatch span { width: 28px; height: 28px; }
.input-sm { height: 34px; font-size: 13px; padding: 0 10px; max-width: 180px; }
.icon-library { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.icon-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.icon-grid input { position: absolute; opacity: 0; pointer-events: none; }
.icon-grid span { height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; transition: .12s; }
.icon-grid span:hover { border-color: var(--primary); color: var(--primary); }
.icon-grid input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.icon-grid input:focus-visible + span { box-shadow: var(--ring); }

/* =====================================================================
   AJUSTES RESPONSIVE (celular y tablet primero)
   Estas reglas van al final a propósito: corrigen y refinan las anteriores.
   ===================================================================== */
html, body { overflow-x: hidden; }
img, svg, video { max-width: 100%; }
.modal:focus, .modal:focus-visible, .modal-box:focus { outline: none; }
.content > *, .grid-2 > *, .stack > * { min-width: 0; }
.grid-2 { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.grid-2-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.input { min-width: 0; max-width: 100%; }
.table td, .table th { vertical-align: middle; }

/* Pestañas y selectores desplazables cuando no caben */
.tabs, .view-switch, .person-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar, .view-switch::-webkit-scrollbar, .person-tabs::-webkit-scrollbar { display: none; }
.person-tabs { flex-wrap: nowrap; padding-bottom: 2px; }
.person-tabs a { flex-shrink: 0; }

/* Calendario: altura natural en Mes/Agenda, fija solo en Semana/Día */
.cal-wrap { height: auto; min-height: 0; }
.cal-wrap.is-fixed { height: calc(100vh - 230px); min-height: 520px; }
.cal-filters { display: contents; }
.cal-filters-sum { display: none; }
.cal-filters-body { display: flex; flex-direction: column; gap: 22px; }
.fab { display: none; }
@media (max-width: 900px) { .ev-dg .ev-time { display: none; } .fc .fc-daygrid-day-number { font-size: 12px; } }

/* Tablas: se convierten en tarjetas en tablet y celular */
@media (max-width: 1100px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 18px; border-bottom: 1px solid var(--border); }
  .table tbody tr:hover { background: transparent; }
  .table td { border: 0; padding: 5px 0; text-align: right; white-space: normal; overflow: hidden; display: block; }
  .table td[data-label]::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; }
  .table td .cell-main, .table td .cell-stack { display: inline-flex; vertical-align: middle; }
  .table td .cell-stack { text-align: right; align-items: flex-end; }
  .table td.cell-actions { text-align: right; padding-top: 8px; }
  .row-actions { flex-wrap: wrap; }
  .table-wrap { margin: 0 -22px -22px; }
}

/* Vista Hoy: en una sola columna, las tareas van justo después de la agenda */
@media (max-width: 1180px) {
  .dash { display: flex; flex-direction: column; }
  .dash > .stack { display: contents; }
  .dash-agenda { order: 1; } .dash-tareas { order: 2; } .dash-proximos { order: 3; } .dash-familia { order: 4; } .dash-tips { order: 5; }
}

/* Tablero: 2 columnas en tablet vertical, 1 en celular */
@media (max-width: 1100px) {
  .board-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
}
@media (max-width: 900px) {
  .board-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand clock" "next actions"; gap: 12px 16px; }
  .board-brand { grid-area: brand; } .board-clock { grid-area: clock; grid-row: auto; grid-column: auto; }
  .board-next { grid-area: next; grid-column: auto; justify-self: stretch; text-align: left; max-width: none; }
  .board-actions { grid-area: actions; grid-column: auto; grid-row: auto; align-self: center; flex-direction: column; }
}
@media (max-width: 600px) {
  .board-cols { grid-template-columns: minmax(0, 1fr); }
  .board-brand span { display: none; }
  .board-actions { flex-direction: row; grid-area: auto; grid-column: 1 / -1; justify-content: flex-end; }
  .board-top { grid-template-areas: "brand clock" "next next"; }
}

/* Navegación inferior para la familia (celular y tablet vertical) */
.bottom-nav { display: none; }
@media (max-width: 960px) {
  .has-bottom-nav .main { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px; border: 0; background: none;
    color: var(--muted); font-size: 11px; font-weight: 650; cursor: pointer;
  }
  .bn-icon { position: relative; width: 44px; height: 28px; border-radius: 999px; display: grid; place-items: center; transition: background .15s; }
  .bn-icon svg { width: 21px; height: 21px; }
  .bn-icon em { position: absolute; top: -3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-style: normal; font-size: 10px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
  .bottom-nav .is-active { color: var(--primary); }
  .bottom-nav .is-active .bn-icon { background: var(--primary-50); }
  .has-bottom-nav .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .sidebar { z-index: 45; }
  .sidebar-backdrop { z-index: 40; }

  /* Calendario en tablet/celular */
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 31; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--primary); color: #fff; box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--primary) 70%, transparent); cursor: pointer; }
  .fab svg { width: 26px; height: 26px; }
  :root[data-theme="dark"] .fab { color: #06231E; }
  .has-bottom-nav .cal-wrap.is-fixed { height: calc(100vh - 290px); min-height: 440px; }
}
@media (max-width: 1100px) {
  .cal-new { display: none; }
  .cal-side { display: block; padding: 0; position: static; }
  .cal-filters { display: block; }
  .cal-filters-sum { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 12px 16px; font-weight: 700; font-size: 14px; }
  .cal-filters-sum::-webkit-details-marker { display: none; }
  .cal-filters-sum span { color: var(--muted); font-weight: 600; }
  .cal-filters-sum .chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
  .cal-filters[open] .cal-filters-sum .chev { transform: rotate(180deg); }
  .cal-filters-body { padding: 4px 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 16px 22px; }
  .cal-legend { display: none; }
}
@media (min-width: 961px) and (max-width: 1100px) { .cal-new { display: flex; margin-bottom: 0; } .fab { display: none; } }

/* Celular */
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar-title p { display: none; }
  .topbar-title h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .content { padding: 4px 14px 28px; gap: 16px; }
  .banner { font-size: 13px; padding: 9px 12px; }
  .card { padding: 16px; border-radius: 16px; }
  .table-wrap { margin: 0 -16px -16px; }
  .table tr { padding: 12px 16px; }
  .card-head { flex-wrap: wrap; margin-bottom: 14px; }
  .card-head > div:first-child { flex: 1 1 180px; min-width: 0; }
  .head-actions { flex-wrap: wrap; }
  .section-head { align-items: stretch; }
  .section-head > .btn { width: 100%; }
  .toolbar > .btn, .toolbar > .head-actions { width: 100%; }
  .toolbar .head-actions .btn { flex: 1; }
  .stats { gap: 10px; }
  .stat-icon { width: 38px; height: 38px; border-radius: 11px; }
  .stat-icon svg { width: 19px; height: 19px; }
  .cal-filters-body { grid-template-columns: minmax(0, 1fr); }
  .when-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .segmented-4 { grid-template-columns: 1fr 1fr; }
  .config-grid { grid-template-columns: minmax(0, 1fr); }
  .rewards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .reward { padding: 14px; }
  .reward-icon { width: 40px; height: 40px; border-radius: 12px; }
  .reward h3 { font-size: 14px; }
  .reward .btn { font-size: 12px; padding: 0 8px; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan { padding: 20px; }
  .period-switch { width: 100%; }
  .period-switch label { flex: 1; }
  .period-switch span { justify-content: center; }
  .members-grid { grid-template-columns: minmax(0, 1fr); }
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .review { padding: 14px; gap: 14px; }
  .review-top { flex-direction: column; }
  .review-actions > * { flex: 1; }
  .review-actions .btn { width: 100%; }
  .copy-field { flex-direction: column; }
  .ical-buttons .btn { flex: 1; }
  .profile-head { gap: 12px; }
  .profile-head .avatar-xl { width: 56px; height: 56px; font-size: 18px; }
  .tl-item { padding: 12px; gap: 10px; }
  .upcoming li a { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; }
  .task-who span { display: none; }
  .task-side { padding-left: 44px; }
  .bars { gap: 8px; height: 180px; }
  .status-list li { grid-template-columns: 92px minmax(0, 1fr) 28px; }
  .breb-value strong { font-size: 19px; }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
  .input-sm { max-width: 140px; }

  /* Ventanas como hoja inferior, más fáciles de usar con el pulgar */
  .modal { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 94vh; }
  .modal-box { border-radius: 22px 22px 0 0; max-height: 94vh; padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); border-bottom: 0; }
  .modal[open] { animation: sheet .22s ease-out; }
  .modal-foot { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: var(--surface); margin: 0 -16px calc(-18px - env(safe-area-inset-bottom)); padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
  .modal-foot .btn { flex: 1; }
  .det-top { margin: -20px -16px 0; padding-left: 16px; border-radius: 22px 22px 0 0; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* Pantallas muy angostas (≤ 380 px) */
@media (max-width: 380px) {
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat-value { font-size: 20px; }
  .rewards { grid-template-columns: minmax(0, 1fr); }
  .segmented span { font-size: 11.5px; padding: 10px 4px; }
  .day-picker { gap: 4px; }
  .day-picker span { width: 32px; height: 32px; }
  .scoreboard { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Re-aplicar los colapsos de columnas después de los ajustes base anteriores */
@media (max-width: 1180px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .grid-2-even, .config-grid, .field-row { grid-template-columns: minmax(0, 1fr); } }
.table td { white-space: normal; }
.table td.cell-actions, .table td .badge { white-space: nowrap; }
.ical-buttons .btn { white-space: normal; height: auto; min-height: 38px; padding: 8px 12px; text-align: center; }
.form-actions { flex-wrap: wrap; }
.btn { max-width: 100%; }
@media (max-width: 1180px) { .dash { align-items: stretch; } .dash > .stack > * { width: 100%; } }
@media (max-width: 600px) {
  .board-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  .board-brand { flex: 1 1 auto; min-width: 0; }
  .board-clock { flex: 0 0 auto; }
  .board-next { flex: 1 1 100%; order: 3; }
  .board-actions { flex: 1 1 100%; order: 4; flex-direction: row; justify-content: flex-end; }
}
.review-actions { width: 100%; }
.reject { flex: 1 1 260px; min-width: 0; }
.reject-form { min-width: 0; flex-wrap: wrap; }
.reject-form .input { flex: 1 1 200px; }
