/* sistema.css — extraído de <style> inline de sistema.html */
/* ═══════════════════════════════════════
   SOMA GESTIÓN — Design System v9
═══════════════════════════════════════ */
:root {
  /* Brand */
  --accent:  #c8b89a;
  --accent-d:#8a7a62;
  /* Greens */
  --sage:    #7a9e7a;
  --sage-l:  #b5c7b5;
  --sage-d:  #4d7a4d;
  /* Surface */
  --cream:   #f5f0e8;
  --warm:    #faf8f4;
  --bg:      #EAE3D8;
  /* Text */
  --char:    #1a1a18;
  --text:    #2a2a25;
  --muted:   #7a7a7a;
  /* Sidebar */
  --sb-bg:   #141412;
  --sb-w:    240px;
  /* States */
  --ok:      #5d9e5d;
  --warn:    #c4962a;
  --err:     #c46a5a;
  --blue:    #5a7aaa;
  /* Misc */
  --border:  #e0d8cc;
  --cr:      12px;
  --sh:      0 2px 12px rgba(42,42,37,.07);
  --shh:     0 8px 32px rgba(42,42,37,.13);
  --serif:   'Cormorant Garamond', Georgia, serif;
  --sans:    'DM Sans', system-ui, sans-serif;
  --tr:      0.2s cubic-bezier(.4,0,.2,1);
  --clay:    #b07d5a;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; overflow-x: hidden; }
body { font-family: var(--sans); background: var(--cream); color: var(--text); min-height: 100vh; display: flex; overflow-x: hidden; }

/* ── LOADING ── */
.loading-screen {
  position: fixed; inset: 0; background: var(--char);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9999; transition: opacity .4s;
}
.loading-screen.hide { opacity: 0; pointer-events: none; }
.ls-logo { font-family: var(--serif); font-size: 44px; font-weight: 400; color: var(--accent); letter-spacing: 6px; margin-bottom: 8px; }
.ls-sub { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,.25); margin-bottom: 36px; }
.spinner { width: 28px; height: 28px; border: 2px solid rgba(255,255,255,.08); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.ls-status { font-size: 11px; color: rgba(255,255,255,.25); margin-top: 14px; letter-spacing: .3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOGIN ── */
.login-screen {
  position: fixed; inset: 0; background: var(--char);
  display: flex; align-items: stretch; z-index: 998;
}
.login-brand {
  flex: 0 0 380px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px; position: relative; overflow: hidden;
}
.login-brand::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 50% at 20% 60%, rgba(200,184,154,.06), transparent);
}
.login-brand-mark { font-family: var(--serif); font-size: 64px; font-weight: 400; color: var(--accent); letter-spacing: 10px; position: relative; }
.login-brand-sub { font-size: 9px; letter-spacing: 3px; text-transform: uppercase; color: rgba(200,184,154,.35); margin-top: 8px; position: relative; }
.login-brand-tagline { font-family: var(--serif); font-size: 1rem; font-style: italic; color: rgba(200,184,154,.45); line-height: 1.7; text-align: center; margin-top: 40px; max-width: 240px; position: relative; }
@media(max-width:640px) { .login-brand { display: none; } }
.login-card {
  flex: 1; background: var(--warm); display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
}
.login-inner { width: 100%; max-width: 360px; }
.login-logo-mobile { display: none; text-align: center; margin-bottom: 32px; }
@media(max-width:640px) { .login-logo-mobile { display: block; } }
.login-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; margin-bottom: 6px; }
.login-sub { font-size: .8rem; color: var(--muted); margin-bottom: 28px; }
.ll { font-size: 10.5px; font-weight: 500; color: var(--muted); display: block; margin-bottom: 5px; letter-spacing: .5px; text-transform: uppercase; }
.li { width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: 9px; font-family: var(--sans); font-size: 13.5px; background: var(--cream); outline: none; transition: border-color var(--tr); margin-bottom: 14px; color: var(--text); }
.li:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(77,122,77,.1); }
.lb { width: 100%; padding: 12px; background: var(--char); color: #fff; border: none; border-radius: 100px; font-family: var(--sans); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all var(--tr); letter-spacing: .04em; }
.lb:hover { background: var(--sage-d); }
.login-err { font-size: 12px; color: var(--err); text-align: center; margin-top: 10px; min-height: 18px; }

/* ── TOPBAR MOBILE ── */
@media(max-width: 768px){
  .chip { display: none !important; }
  .tb-sede-badge-wrap { display: none !important; }
  #tb-sede-badge { font-size: 9px; padding: 2px 7px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tb-title { font-size: 16px; }
}
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); display: inline-block; margin-right: 5px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.sync-err { background: var(--err); animation: none; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sb-w); background: var(--sb-bg); height: 100vh; min-height: 100vh;
  position: fixed; left: 0; top: 0; display: flex; flex-direction: column; z-index: 100;
  border-right: 1px solid rgba(255,255,255,.04);
}
.sb-logo {
  padding: 20px 16px 14px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.sb-logo-mark { font-family: var(--serif); font-size: 22px; color: var(--accent); letter-spacing: 3px; }
.sb-logo-label { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.22); margin-top: 2px; }
.up {
  margin: 12px 10px 0; background: rgba(255,255,255,.05); border-radius: 10px;
  padding: 10px 11px; display: flex; align-items: center; gap: 9px;
}
.up-av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.up-name { font-size: 12px; color: #fff; font-weight: 500; line-height: 1.3; }
.up-role { font-size: 9px; color: rgba(255,255,255,.35); margin-top: 1px; }
.up-out { margin-left: auto; font-size: 9px; color: rgba(255,255,255,.25); cursor: pointer; padding: 3px 7px; border-radius: 5px; border: 1px solid rgba(255,255,255,.1); transition: all var(--tr); white-space: nowrap; }
.up-out:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.sede-sel { margin: 10px 10px 0; }
.sede-sel select { width: 100%; background: #1e1e1c !important; border: 1px solid rgba(255,255,255,.18); color: #fff !important; border-radius: 8px; padding: 8px 11px; font-family: var(--sans); font-size: 12px; outline: none; cursor: pointer; -webkit-appearance: none; appearance: none; color-scheme: dark; }
.sede-sel select option { background: #1a1a18; }
nav { padding: 8px 0; flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
nav::-webkit-scrollbar { display: none; }
.nav-sec { padding: 14px 16px 4px; font-size: 8.5px; letter-spacing: 2.5px; text-transform: uppercase; color: rgba(255,255,255,.18); }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 16px;
  cursor: pointer; color: rgba(255,255,255,.45); font-size: 12px; font-weight: 400;
  transition: all var(--tr); border-left: 2px solid transparent; margin: 1px 0;
  position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-item:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.04); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(200,184,154,.07); font-weight: 500; }
.nav-ico { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }
.nav-badge, .nav-bad { margin-left: auto; background: var(--err); color: #fff; font-size: 9px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }
.sb-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.05); font-size: 10px; color: rgba(255,255,255,.15); display: flex; align-items: center; gap: 6px; }
/* Admin-only items */
.ao { } /* visible por defecto — JS oculta si no es admin */

/* ── MAIN ── */
.main { margin-left: var(--sb-w); flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* ── TOPBAR ── */
.topbar {
  background: rgba(245,240,232,.95); backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border); padding: 0 24px; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.tb-left { display: flex; align-items: center; gap: 12px; }
.tb-title { font-family: var(--serif); font-size: 20px; font-weight: 400; line-height: 1; }
.tb-right { display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: var(--cream); border: 1px solid var(--border); border-radius: 20px; font-size: 10.5px; color: var(--muted); }
.sede-badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 10px; font-weight: 600; }
.sede-amarras { background: rgba(77,122,77,.12); color: #3a6a3a; }
.sede-centro  { background: rgba(176,125,90,.12); color: #7a4d2a; }
.sede-faro    { background: rgba(90,122,170,.12); color: #3a5a8a; }
.sede-todas   { background: rgba(122,122,122,.1); color: var(--muted); }

/* ── CONTENT ── */
.content { padding: 24px; flex: 1; min-width: 0; }
.view { display: none; animation: fadeIn .2s ease; min-width: 0; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 15px; border-radius: 8px; font-size: 12px; font-weight: 500; font-family: var(--sans); cursor: pointer; border: none; transition: all var(--tr); white-space: nowrap; }
.btn-p { background: var(--sage-d); color: #fff; }
.btn-p:hover { background: var(--sage); transform: translateY(-1px); }
.btn-o { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-o:hover { border-color: var(--sage); color: var(--sage-d); }
.btn-g { background: transparent; color: var(--muted); padding: 6px 10px; }
.btn-g:hover { background: var(--cream); color: var(--text); }
.btn-sm { padding: 5px 11px; font-size: 11px; }
.btn-danger { background: var(--err); color: #fff; }
.btn-accent { background: var(--accent); color: var(--char); }
.btn-accent:hover { background: var(--accent-d); color: #fff; }

/* ── STAT GRID ── */
.sg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.sc {
  background: var(--warm); border-radius: var(--cr); padding: 18px 20px;
  box-shadow: var(--sh); position: relative; overflow: hidden;
  transition: transform var(--tr), box-shadow var(--tr);
  border: 1px solid rgba(224,216,204,.6);
}
.sc:hover { transform: translateY(-2px); box-shadow: var(--shh); }
.sc::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.sc-g::before { background: linear-gradient(90deg, var(--sage), var(--sage-l)); }
.sc-c::before { background: linear-gradient(90deg, var(--clay), #d4a07a); }
.sc-b::before { background: linear-gradient(90deg, var(--blue), #8aaad0); }
.sc-w::before { background: linear-gradient(90deg, var(--warn), #e8bc64); }
.sc-m::before { background: linear-gradient(90deg, #5a8a5a, #8ab88a); }
.sl { font-size: 9.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.sv { font-family: var(--serif); font-size: 32px; font-weight: 300; line-height: 1; margin-bottom: 4px; }
.ss { font-size: 11px; color: var(--muted); line-height: 1.4; }
.sc-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 100px; margin-top: 6px; }
.sc-trend.up { background: rgba(93,158,93,.12); color: var(--ok); }
.sc-trend.down { background: rgba(196,106,90,.1); color: var(--err); }
.sc-trend.flat { background: rgba(122,122,122,.1); color: var(--muted); }

/* ── CLIENTES DASHBOARD (cards) ── */
.cl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
@media(max-width: 1024px){ .cl-grid { grid-template-columns: repeat(2, 1fr); } }
@media(max-width: 540px){ .cl-grid { grid-template-columns: 1fr 1fr; } }
.sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sc-titrow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sc-head .sl { margin-bottom: 0; }
.sc-help { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border); color: var(--muted); font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; cursor: help; line-height: 1; flex-shrink: 0; }
.sc-help:hover { border-color: var(--sage); color: var(--sage-d); }
.sc-det { font-size: 10.5px; font-weight: 600; color: var(--sage-d); cursor: pointer; white-space: nowrap; opacity: .82; flex-shrink: 0; }
.sc-det:hover { opacity: 1; text-decoration: underline; }
.sc-wide { grid-column: 1 / -1; }
.sc-wide .sc-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
/* Fila 50/50 del dashboard: Tiempo de vida promedio + Cumpleaños */
.dash-half-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.dash-half-row .sc-wide { grid-column: auto; }
@media(max-width: 900px){ .dash-half-row { grid-template-columns: 1fr; } }
.sc-clk { cursor: pointer; }
/* seg filter chip on Clientes list */
.cl-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 5px 4px 12px; background: rgba(122,158,122,.1); border: 1px solid var(--sage-l); border-radius: 20px; font-size: 11.5px; color: var(--sage-d); font-weight: 600; }
.cl-chip .x { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(77,122,77,.12); font-size: 10px; }
.cl-chip .x:hover { background: rgba(77,122,77,.26); }
/* accesos line chart */
.acc-legend { display: flex; gap: 16px; align-items: center; }
.acc-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); }
.acc-leg i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }

/* ── DASHBOARD TABS (Clientes / Ventas) ── */
.dash-tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dash-tabs { display: flex; gap: 4px; }
.dash-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 4px; margin-bottom: -1px; font-family: var(--serif); font-size: 17px; font-weight: 400; color: var(--muted); cursor: pointer; transition: color var(--tr), border-color var(--tr); }
.dash-tab:hover { color: var(--text); }
.dash-tab.active { color: var(--sage-d); border-bottom-color: var(--sage-d); }
.dash-row-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-date { position: relative; display: inline-flex; align-items: center; }
.dash-date-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--warm); border: 1px solid var(--border); border-radius: 10px; font-family: var(--sans); font-size: 12.5px; color: var(--text); cursor: pointer; box-shadow: var(--sh); transition: border-color var(--tr); }
.dash-date-btn:hover { border-color: var(--sage-l); }
.dash-date-btn .ico { font-size: 14px; line-height: 1; }
.dash-date-btn .lbl-k { color: var(--muted); font-size: 11px; }
.dash-date-btn .lbl-v { font-weight: 600; }
.dash-date-btn.is-past { border-color: var(--sage-d); background: rgba(74,103,65,.06); }
.dash-date-btn .cv { color: var(--muted); font-size: 11px; transition: transform var(--tr); }
.dash-date.open .cv { transform: rotate(180deg); }
.dash-date-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; background: var(--warm); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(26,26,24,.16); padding: 14px; width: 232px; display: none; }
.dash-date.open .dash-date-pop { display: block; }
.dash-date-pop input[type=date] { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--sans); font-size: 13px; color: var(--text); background: var(--cream); margin-bottom: 10px; }
.dash-date-presets { display: flex; flex-direction: column; gap: 4px; }
.dash-date-preset { text-align: left; background: none; border: none; border-radius: 7px; padding: 7px 9px; font-family: var(--sans); font-size: 12.5px; color: var(--text); cursor: pointer; transition: background var(--tr); }
.dash-date-preset:hover { background: var(--cream); }
.dash-date-preset.active { color: var(--sage-d); font-weight: 600; }
.dash-date-hint { font-size: 10.5px; color: var(--muted); line-height: 1.4; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
@media(max-width: 768px){ .dash-date-btn .lbl-k { display: none; } }
.dash-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; margin-bottom: 6px; }
.dash-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.dash-switch-track { width: 36px; height: 20px; border-radius: 100px; background: var(--border); position: relative; transition: background var(--tr); flex-shrink: 0; }
.dash-switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--tr); }
.dash-switch input:checked + .dash-switch-track { background: var(--sage-d); }
.dash-switch input:checked + .dash-switch-track .dash-switch-thumb { transform: translateX(16px); }
.dash-switch-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.ventas-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.vseg-btn { background: none; border: none; padding: 5px 12px; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: var(--sans); transition: all var(--tr); }
.vseg-btn.active { background: var(--sage-d); color: #fff; }

/* ── CARDS ── */
.card { background: var(--warm); border-radius: var(--cr); padding: 20px 22px; box-shadow: var(--sh); border: 1px solid rgba(224,216,204,.6); }
.ch { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.ct { font-family: var(--serif); font-size: 16px; font-weight: 400; }
.dg { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── TABLE WIDGET ── */
.tw { background: var(--warm); border-radius: var(--cr); box-shadow: var(--sh); overflow: hidden; border: 1px solid rgba(224,216,204,.6); }
.ttb { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); gap: 10px; flex-wrap: wrap; }
.srch { display: flex; align-items: center; gap: 7px; background: var(--cream); border: 1.5px solid var(--border); border-radius: 8px; padding: 7px 11px; min-width: 200px; transition: border-color var(--tr); }
.srch:focus-within { border-color: var(--sage); }
.srch input { border: none; background: transparent; font-family: var(--sans); font-size: 12px; color: var(--text); outline: none; width: 100%; }
.srch input::placeholder { color: var(--muted); }
.fsel { padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-family: var(--sans); font-size: 11px; background: var(--cream); color: var(--text); outline: none; cursor: pointer; }
.fsel:focus { border-color: var(--sage); }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 9px 14px; text-align: left; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); background: var(--cream); font-weight: 600; border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--tr); cursor: pointer; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(122,158,122,.04); }
tbody td { padding: 11px 14px; font-size: 12px; color: var(--text); vertical-align: middle; }
.av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.sc2 { display: flex; align-items: center; gap: 8px; }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.b-ok   { background: rgba(93,158,93,.12); color: var(--ok); }
.b-warn { background: rgba(196,150,42,.12); color: var(--warn); }
.b-err  { background: rgba(196,106,90,.12); color: var(--err); }
.b-blue { background: rgba(90,122,170,.12); color: var(--blue); }
.b-neu  { background: rgba(122,122,122,.1); color: var(--muted); }
.pgr { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--cream); }
.pgr-i { font-size: 11px; color: var(--muted); }
.pgr-b { display: flex; gap: 3px; }
.pb2 { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1.5px solid var(--border); background: transparent; font-size: 12px; color: var(--muted); transition: all var(--tr); font-family: var(--sans); }
.pb2:hover, .pb2.act { background: var(--sage-d); color: #fff; border-color: var(--sage-d); }
.ibt { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; background: transparent; color: var(--muted); font-size: 13px; transition: all var(--tr); }
.ibt:hover { background: var(--cream); color: var(--text); }
.ibt.ed:hover { color: var(--sage-d); }
.ibt.dl:hover { color: var(--err); background: rgba(196,106,90,.07); }
.tact { display: flex; gap: 3px; align-items: center; }

/* ── MODALS ── */
.ov { position: fixed; inset: 0; background: rgba(26,26,24,.5); backdrop-filter: blur(5px); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.ov.open { opacity: 1; pointer-events: all; }
.modal { background: var(--warm); border-radius: 18px; width: 680px; max-width: 96vw; max-height: 92vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(26,26,24,.2); transform: translateY(20px) scale(.98); transition: transform .25s; padding: 28px; }
.ov.open .modal { transform: translateY(0) scale(1); }
.mhd { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.mt { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.ms { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cbtn { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1.5px solid var(--border); background: transparent; font-size: 13px; color: var(--muted); transition: all var(--tr); }
.cbtn:hover, .ibt.cl:hover { background: var(--cream); color: var(--text); }
.ibt.cl { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1.5px solid var(--border); background: transparent; font-size: 13px; color: var(--muted); transition: all var(--tr); }

/* ── FORM ── */
.fsec { margin-bottom: 18px; }
.fst { font-size: 8.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--sage-d); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); font-weight: 600; }
.fg  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fg3 { grid-template-columns: 1fr 1fr 1fr; }
.fg1 { grid-template-columns: 1fr; }
.fgrp { display: flex; flex-direction: column; gap: 4px; }
.fgrp.full { grid-column: 1/-1; }
label { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }
input, select, textarea { font-family: var(--sans); font-size: 12.5px; padding: 8px 11px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--cream); color: var(--text); outline: none; transition: border-color var(--tr); width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(77,122,77,.08); background: #fff; }
/* Accesibilidad: ring de foco visible SOLO para navegación por teclado (no afecta
   el uso con mouse/touch). Cubre botones, items de nav e íconos accionables. */
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-radius: 4px; }
button:focus-visible, .nav-item:focus-visible, .btn:focus-visible, .ibt:focus-visible,
[onclick]:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
/* Respetar preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after { animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; scroll-behavior:auto!important; }
}
.finput { font-family: var(--sans); font-size: 12.5px; padding: 8px 11px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--cream); color: var(--text); outline: none; transition: border-color var(--tr); width: 100%; }
.finput:focus { border-color: var(--sage); background: #fff; }
textarea { resize: vertical; min-height: 64px; }
.mft { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ── SLOT GRID ── */
.hs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.hs-slot { padding: 7px 8px; border: 1.5px solid var(--border); border-radius: 7px; cursor: pointer; transition: all var(--tr); font-size: 11px; }
.hs-slot:hover:not(.hs-full):not(.hs-sel) { border-color: var(--sage); background: rgba(122,158,122,.06); }
.hs-slot.hs-sel { border-color: var(--sage-d); background: rgba(77,122,77,.12); color: var(--sage-d); font-weight: 600; }
.hs-slot.hs-full { border-color: rgba(196,106,90,.3); background: rgba(196,106,90,.04); color: var(--err); cursor: not-allowed; opacity: .7; }
.hs-day-title { font-size: 8.5px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 10px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }

/* ── SCHEDULE ── */
.sch-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 20px; }
.sch-day { background: var(--warm); border-radius: 12px; padding: 14px 12px; box-shadow: var(--sh); border: 1px solid rgba(224,216,204,.5); }
.sd-name { font-size: 8.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; text-align: center; font-weight: 600; }
.sd-slot { padding: 7px 8px; border-radius: 7px; margin-bottom: 5px; cursor: pointer; transition: all var(--tr); border-left: 3px solid var(--sage); background: rgba(122,158,122,.05); }
.sd-slot:hover { transform: translateX(2px); }
.sd-slot.full-slot { border-left-color: var(--err); background: rgba(196,106,90,.04); }
.sd-time { font-size: 11px; font-weight: 500; }
.sd-cnt { font-size: 9.5px; color: var(--muted); margin-top: 1px; }

/* ── CHECK-IN ── */
.ci-card { background: var(--warm); border-radius: 12px; padding: 14px 18px; box-shadow: var(--sh); margin-bottom: 10px; cursor: pointer; transition: all var(--tr); border: 1.5px solid transparent; }
.ci-card:hover { border-color: var(--sage-l); transform: translateY(-1px); }
.ci-hdr { display: flex; align-items: center; justify-content: space-between; }
.ci-time { font-family: var(--serif); font-size: 17px; font-weight: 400; }
.ci-info { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ci-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ci-row:last-child { border-bottom: none; }
.ci-chk { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--tr); flex-shrink: 0; font-size: 11px; }
.ci-chk.checked { background: var(--sage-d); border-color: var(--sage-d); color: #fff; }
.ci-chk:hover:not(.checked) { border-color: var(--sage); }

/* ── WEEK GRID ── */
.wk-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 20px; }
.wk-day { background: var(--warm); border-radius: 10px; padding: 12px 8px; text-align: center; box-shadow: var(--sh); cursor: pointer; transition: all var(--tr); border: 1.5px solid transparent; }
.wk-day:hover { transform: translateY(-2px); border-color: var(--sage-l); }
.wk-day.today { border-color: var(--sage-d); }
.wkdn { font-size: 8.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.wknum { font-family: var(--serif); font-size: 22px; font-weight: 300; }
.wkcnt { font-size: 10px; color: var(--sage-d); margin-top: 2px; font-weight: 600; }

/* ── DETAIL PANEL ── */
.dp { position: fixed; right: 0; top: 0; bottom: 0; width: 360px; background: var(--warm); box-shadow: -8px 0 40px rgba(26,26,24,.1); z-index: 150; padding: 24px; overflow-y: auto; transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); border-left: 1px solid var(--border); }
.dp.open { transform: translateX(0); }
.dp-av { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; margin: 0 auto 10px; font-family: var(--serif); }
.dp-name { font-family: var(--serif); font-size: 20px; font-weight: 400; text-align: center; margin-bottom: 3px; }
.dp-sub { text-align: center; font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.dp-sec { margin-bottom: 14px; }
.dp-st { font-size: 8px; letter-spacing: 2px; text-transform: uppercase; color: var(--sage-d); margin-bottom: 7px; font-weight: 600; }
.dp-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.dp-row:last-child { border-bottom: none; }
.dp-k { color: var(--muted); }
.dp-v { font-weight: 500; text-align: right; max-width: 190px; font-size: 12px; }
.divr { height: 1px; background: var(--border); margin: 12px 0; }

/* ── CLIENT PROFILE (full page) ── */
.clp-back { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--muted); cursor:pointer; background:none; border:none; padding:4px 0; margin-bottom:14px; font-family:var(--sans); transition:color var(--tr); }
.clp-back:hover { color:var(--sage-d); }
.clp-hero { background:var(--warm); border:1px solid var(--border); border-radius:16px; box-shadow:var(--sh); padding:22px 24px; display:flex; align-items:center; gap:20px; flex-wrap:wrap; margin-bottom:4px; }
.clp-av { width:74px; height:74px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:26px; font-weight:600; font-family:var(--serif); flex-shrink:0; }
.clp-id { flex:1; min-width:200px; }
.clp-name { font-family:var(--serif); font-size:28px; font-weight:400; line-height:1.1; letter-spacing:-.3px; }
.clp-meta { display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-top:9px; }
.clp-actions { display:flex; gap:8px; flex-wrap:wrap; }
.clp-tabs { display:flex; gap:2px; margin:18px 0 22px; border-bottom:1px solid var(--border); overflow-x:auto; -webkit-overflow-scrolling:touch; }
.clp-tab { appearance:none; background:none; border:none; font-family:var(--sans); font-size:13.5px; color:var(--muted); padding:11px 16px; cursor:pointer; white-space:nowrap; border-bottom:2px solid transparent; margin-bottom:-1px; transition:color var(--tr); font-weight:500; }
.clp-tab:hover { color:var(--text); }
.clp-tab.active { color:var(--sage-d); border-bottom-color:var(--sage-d); }
.clp-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; align-items:start; }
.clp-card { background:var(--warm); border:1px solid var(--border); border-radius:14px; box-shadow:var(--sh); padding:18px 20px; }
.clp-card.span2 { grid-column:1 / -1; }
.clp-ct { font-size:10px; letter-spacing:1.6px; text-transform:uppercase; color:var(--sage-d); font-weight:700; margin-bottom:14px; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.clp-row { display:flex; justify-content:space-between; gap:14px; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px; }
.clp-row:last-child { border-bottom:none; }
.clp-k { color:var(--muted); flex-shrink:0; }
.clp-v { font-weight:500; text-align:right; }
.clp-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:14px; }
.clp-stat { background:var(--cream); border-radius:12px; padding:14px 16px; }
.clp-stat-v { font-family:var(--serif); font-size:26px; font-weight:400; line-height:1; }
.clp-stat-l { font-size:11px; color:var(--muted); margin-top:5px; }
.clp-pill { display:inline-flex; align-items:center; gap:5px; border-radius:20px; padding:4px 11px; font-size:12px; font-weight:600; }
.clp-note { font-size:12.5px; line-height:1.5; padding:12px 14px; border-radius:10px; }
.clp-empty { text-align:center; padding:26px; color:var(--muted); font-size:12.5px; }
.clp-wk { display:flex; align-items:center; gap:10px; padding:7px 0; border-bottom:1px solid var(--border); }
.clp-wk:last-child { border-bottom:none; }
.clp-wk-dots { display:flex; gap:4px; }
.clp-dot { width:15px; height:15px; border-radius:4px; background:var(--border); }
.clp-dot.on { background:var(--sage-d); }
@media(max-width:640px){
  .clp-name { font-size:23px; }
  .clp-av { width:60px; height:60px; font-size:21px; }
  .clp-hero { padding:18px; gap:14px; }
  .clp-actions { width:100%; }
  .clp-actions .btn { flex:1; justify-content:center; }
}

/* ── REPORT CARDS ── */
.rg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.rc { background: var(--warm); border-radius: var(--cr); padding: 18px; box-shadow: var(--sh); cursor: pointer; transition: all var(--tr); border: 1.5px solid transparent; }
.rc:hover { border-color: var(--sage-l); transform: translateY(-2px); }
.ri { font-size: 26px; margin-bottom: 10px; }
.rep-sec-h { font-size:11px; font-weight:600; letter-spacing:1.5px; color:var(--sage-d); text-transform:uppercase; margin:24px 0 12px; }
.rep-sec-h:first-child { margin-top:8px; }
.rep-rng { display:inline-block; color:var(--sage-d); font-weight:600; white-space:nowrap; }

/* ── BAR CHART ── */
.bch { display: flex; align-items: flex-end; gap: 4px; height: 80px; padding-top: 8px; }
.bch-bar { flex: 1; border-radius: 4px 4px 0 0; background: var(--sage); transition: height .4s, opacity .2s; }
.bch-bar:hover { opacity: .8; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--char); color: #fff; padding: 10px 22px; border-radius: 100px; font-size: 12.5px; z-index: 999; white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,.2); display: none; animation: toastIn .25s ease; }
@keyframes toastIn { from { opacity:0; transform:translateX(-50%) translateY(10px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ── MISC ── */
.sort-arrow { font-size: 9px; color: var(--muted); }
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--sage-d); }
.mobile-cards { display: none; }
.m-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--tr);
  background: var(--warm); width: 100%; box-sizing: border-box;
}
.m-card:last-child { border-bottom: none; }
.m-card:active { background: rgba(122,158,122,.06); }
.m-card-body { flex: 1; min-width: 0; }
.m-card-name { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card-detail { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.asgn-ov { position: fixed; inset: 0; background: rgba(26,26,24,.5); backdrop-filter: blur(5px); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.asgn-ov.open { opacity: 1; pointer-events: all; }

/* ── ANALYTICS EXTRAS ── */
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi-card { background: var(--warm); border-radius: var(--cr); padding: 16px 18px; box-shadow: var(--sh); border: 1px solid rgba(224,216,204,.5); }
.kpi-label { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.kpi-val { font-family: var(--serif); font-size: 26px; font-weight: 300; line-height: 1; }
.kpi-sub { font-size: 10.5px; color: var(--muted); margin-top: 4px; }

/* ── HAMBURGER & OVERLAY ── */
.sb-hamburger {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  background: none; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 8px 10px; transition: all var(--tr);
}
.sb-hamburger span { display: block; width: 18px; height: 1.5px; background: var(--text); transition: all var(--tr); }
.sb-hamburger:hover { background: var(--cream); }
.sb-overlay {
  display: none; position: fixed; inset: 0; background: rgba(26,26,24,.45);
  z-index: 99; backdrop-filter: blur(2px);
}
.sb-overlay.open { display: block; }
@media(max-width: 768px) { .sb-hamburger { display: flex; } }


@media(max-width: 768px){
  .sidebar { transform: translateX(-100%); transition: transform var(--tr); }
  .sidebar.open { transform: translateX(0); z-index: 200; }
  .main { margin-left: 0; }
  .sg { grid-template-columns: repeat(2, 1fr); }
  .dg { grid-template-columns: 1fr; }
  .rg, .kpi-row { grid-template-columns: 1fr 1fr; }
  .sch-grid, .wk-grid { grid-template-columns: repeat(3, 1fr); }
  .content { padding: 12px; }
  .topbar { padding: 0 12px; height: 50px; }
  .tb-title { font-size: 17px; }
  .tb-right .chip { display: none !important; }
  #tb-sede-badge { font-size: 9px; padding: 2px 8px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ao { display: none !important; }
  /* Excepción: items marcados mob-show SÍ se ven en móvil, pero solo para admin
     (el sidebar lleva la clase role-admin). Los instructores siguen sin verlos. */
  .sidebar.role-admin .ao.mob-show { display: flex !important; }
  .sidebar.role-admin .nav-sec.ao.mob-show { display: block !important; }
  .mobile-cards { display: block !important; }
  table { display: none; }
  .pgr { display: none; }
  .ttb { gap: 8px; }
  .ttb > div { flex-wrap: wrap; gap: 6px; }
  .fsel { font-size: 13px !important; padding: 7px 10px !important; }
  .srch { width: 100%; }
  .srch input { font-size: 13px; }
}
@media(max-width: 480px){
  .sg, .rg, .kpi-row { grid-template-columns: 1fr; }
}

/* ── FINANCIERO ── */
.fin-tabs { display:flex; gap:8px; margin-bottom:20px; flex-wrap:wrap; }
.fin-tab { padding:7px 18px; border-radius:20px; font-size:12px; font-weight:500; cursor:pointer; border:1.5px solid var(--border); background:transparent; color:var(--muted); transition:all var(--tr); font-family:var(--sans); }
.fin-tab.active { background:var(--sage-d); color:#fff; border-color:var(--sage-d); }
.fin-tab:hover:not(.active) { border-color:var(--sage); color:var(--sage-d); }
.fin-summary { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:24px; }
.fin-item { background:var(--warm); border-radius:var(--cr); padding:18px 20px; box-shadow:var(--sh); border:1px solid rgba(224,216,204,.5); }
.fin-label { font-size:10px; letter-spacing:1.5px; text-transform:uppercase; color:var(--muted); margin-bottom:6px; font-weight:600; }
.fin-value { font-family: var(--serif), 'Cormorant Garamond', Georgia, serif; font-size:28px; font-weight:300; color:var(--sage-d); }
.fin-sub { font-size:11px; color:var(--muted); margin-top:3px; }
.fin-action-row { display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap; overflow-x:auto; }

/* ── TRANSACTIONS ── */
.tx-row { display:flex; align-items:center; padding:12px 16px; border-bottom:1px solid var(--border); transition:background var(--tr); gap:10px; }
.tx-row:last-child { border-bottom:none; }
.tx-row:hover { background:rgba(122,158,122,.04); }
.tx-ico { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.tx-name { font-weight:500; font-size:13px; }
.tx-detail { font-size:11px; color:var(--muted); margin-top:1px; }
.tx-amount { font-weight:600; font-size:14px; color:var(--ok); }
.tx-date { font-size:10.5px; color:var(--muted); text-align:right; margin-top:2px; }

/* ── PLANES ── */
.plan-card { background:var(--warm); border-radius:12px; padding:16px 20px; box-shadow:var(--sh); margin-bottom:10px; display:flex; align-items:center; justify-content:space-between; transition:all var(--tr); border:1px solid rgba(224,216,204,.5); }
.plan-card:hover { transform:translateY(-1px); box-shadow:var(--shh); }
.plan-name { font-weight:500; font-size:14px; }
.plan-detail { font-size:11.5px; color:var(--muted); margin-top:2px; }
.plan-price { font-family:var(--serif); font-size:22px; font-weight:300; color:var(--sage-d); }
.plan-edit-row { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; background:var(--warm); border-radius:10px; box-shadow:var(--sh); margin-bottom:8px; gap:10px; flex-wrap:wrap; border:1px solid rgba(224,216,204,.5); }
.plan-edit-name { font-weight:500; font-size:13px; min-width:160px; }
.plan-edit-detail { font-size:11px; color:var(--muted); }
.plan-edit-price { display:flex; align-items:center; gap:8px; }
.plan-price-input { width:120px; font-family:var(--sans); font-size:13px; padding:6px 10px; border:1.5px solid var(--border); border-radius:7px; background:var(--cream); color:var(--sage-d); font-weight:600; outline:none; text-align:right; }
.plan-price-input:focus { border-color:var(--sage); background:#fff; }

/* ── DISCOUNT CARDS ── */
.disc-card { background:rgba(122,158,122,.06); border:1.5px solid var(--sage-l); border-radius:10px; padding:14px 16px; margin-bottom:8px; }
.disc-name { font-weight:600; font-size:13px; color:var(--sage-d); }
.disc-desc { font-size:11.5px; color:var(--muted); margin-top:3px; line-height:1.5; }

/* ── MISC VIEW STYLES ── */
.rn { font-family:var(--serif); font-size:15px; font-weight:400; margin-bottom:4px; }
.rd { font-size:11px; color:var(--muted); line-height:1.5; }
.pb-w { background:var(--border); border-radius:4px; height:5px; overflow:hidden; margin-top:4px; }
.pb-f { height:100%; border-radius:4px; transition:width .8s cubic-bezier(.4,0,.2,1); }
.alert-box { display:flex; align-items:flex-start; gap:9px; padding:11px 14px; border-radius:8px; font-size:12px; margin-bottom:12px; }
.al-warn { background:rgba(196,150,42,.1); border-left:3px solid var(--warn); color:#7a5e1a; }
.al-blue { background:rgba(26,115,232,.1); border-left:3px solid #1a73e8; color:#1a3e6e; }
.al-ok   { background:rgba(93,158,93,.1); border-left:3px solid var(--ok); color:#2a5e2a; }
.cred-pill { display:inline-flex; align-items:center; gap:4px; background:rgba(122,158,122,.12); color:var(--sage-d); border-radius:20px; padding:2px 9px; font-size:11px; font-weight:500; white-space:nowrap; }
.vhd { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.slot-popup { position:absolute; background:var(--warm); border-radius:12px; box-shadow:0 8px 32px rgba(44,44,44,.15); padding:16px; z-index:100; min-width:220px; border:1px solid var(--border); }
.slot-popup-name { font-size:12px; font-weight:500; margin-bottom:4px; }
.slot-popup-detail { font-size:11px; color:var(--muted); }

@media(max-width:900px) {
  .fin-summary { grid-template-columns:repeat(3,1fr); gap:10px; }
  .fin-item { padding:14px 16px; }
  .fin-value { font-size:22px; }
  .tx-row { padding:10px 12px; }
  .plan-edit-row { flex-direction:column; align-items:flex-start; }
  .plan-edit-price { width:100%; }
}
@media(max-width:480px) {
  .fin-summary { grid-template-columns:1fr 1fr; }
  .v9-kpi-grid { grid-template-columns:1fr 1fr; }
}

/* ── V9 KPI DASHBOARD ── */
.v9-kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 18px; }
.v9-kpi { background: var(--warm); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: box-shadow var(--tr), transform var(--tr); }
.v9-kpi:hover { box-shadow: 0 4px 14px rgba(74,103,65,.12); transform: translateY(-1px); }
.v9-kpi-green { border-left: 3px solid var(--sage-d); }
.v9-kpi-warn  { border-left: 3px solid #d97706; }
.v9-kpi-alert { border-left: 3px solid var(--err); }
.v9-kpi-label { font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v9-kpi-val   { font-family: var(--serif); font-size: 24px; font-weight: 300; line-height: 1; margin-bottom: 3px; }
.v9-kpi-sub   { font-size: 10px; color: var(--muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── BAR CHART ── */
.bw  { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--sage-l); min-height: 3px; transition: height .6s cubic-bezier(.4,0,.2,1); }
.bar:hover { background: var(--sage-d); }
.bl  { font-size: 9px; color: var(--muted); }

@media(max-width: 1024px) { .v9-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media(max-width: 480px)  { .v9-kpi-grid { grid-template-columns: 1fr 1fr; } .v9-kpi-sub { white-space: normal; } }

/* ═══════════════════════════════════════════
   MOBILE OPTIMIZATIONS (overrides)
   ═══════════════════════════════════════════ */
@media(max-width: 767px) {
  /* Prevent body horizontal scroll */
  html, body { overflow-x: hidden; -webkit-text-size-adjust: 100%; }

  /* Topbar more compact + safe-area aware */
  .topbar {
    padding: 10px 12px !important;
    gap: 8px !important;
    min-height: 54px;
    padding-top: max(10px, env(safe-area-inset-top)) !important;
  }
  .topbar .tb-left, .topbar .tb-right { gap: 8px !important; }
  .sb-hamburger { min-width: 38px; min-height: 38px; }

  /* Sidebar: full-screen drawer with safe-area */
  .sidebar {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Modals: bottom-sheet style with drag indicator */
  .ov { align-items: flex-end !important; padding: 0 !important; }
  .ov .modal {
    width: 100% !important; max-width: 100% !important;
    border-radius: 22px 22px 0 0 !important;
    max-height: 94vh !important;
    padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    animation: sysSheetUp .28s cubic-bezier(.4,0,.2,1);
  }
  @keyframes sysSheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .ov.open .modal::before {
    content: ''; display: block; width: 38px; height: 4px;
    background: var(--border, #d4c9b4); border-radius: 100px;
    margin: -4px auto 12px; flex-shrink: 0;
  }
  .mhd { gap: 10px; }
  .cbtn { min-width: 38px; min-height: 38px; font-size: 18px; }

  /* Buttons: minimum 44px tap target */
  .btn, .btn-p, .btn-g, .btn-o, .btn-sm,
  button:not(.cbtn):not(.sb-hamburger):not(.fin-tab) {
    min-height: 44px;
  }
  .btn-sm { min-height: 38px; padding: 8px 14px; font-size: 12px; }

  /* Inputs: prevent iOS zoom (already in portal — reinforce) */
  input, textarea, select, .fi, .li, .fsel {
    font-size: 16px !important;
  }

  /* Tabs: horizontal scroll on mobile */
  .fin-tabs, .v9-tabs, .tabs {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .fin-tabs::-webkit-scrollbar, .v9-tabs::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .fin-tab { white-space: nowrap; flex-shrink: 0; padding: 10px 16px; min-height: 40px; }

  /* Fin action row: stack buttons on tiny screens */
  .fin-action-row {
    display: flex; flex-wrap: wrap; gap: 6px;
  }
  .fin-action-row > button, .fin-action-row > .btn {
    flex: 1 1 auto; font-size: 12px; padding: 9px 12px;
  }

  /* Tables fall back to horizontal scroll if rendered on mobile */
  table { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }

  /* Mobile cards: cleaner spacing */
  .m-card {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 8px;
  }
  .m-card:active { transform: scale(0.985); }

  /* Cards: tighter padding */
  .card { padding: 14px !important; border-radius: 14px; }

  /* Dashboard grid: stack on mobile */
  .dg { grid-template-columns: 1fr !important; gap: 12px !important; }

  /* Sidebar grid (kpi summary): stack 2 cols */
  .sg { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }

  /* Modal title sizing */
  .mt { font-size: 1.1rem; }
  .ms { font-size: 11.5px; }

  /* Tap highlight */
  button, a, [onclick] { -webkit-tap-highlight-color: rgba(74,103,65,0.10); }

  /* Active feedback */
  .btn:active, .btn-p:active, .btn-g:active, .btn-o:active,
  .fin-tab:active, .cbtn:active { transform: scale(0.97); }

  /* Login card */
  .login-card { padding: 28px 22px !important; }
  .login-inner { padding: 0 !important; }

  /* Modal forms: ensure inputs don't get cropped */
  .modal form, .modal { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

  /* Search box: bigger */
  .srch input { font-size: 16px !important; padding: 10px 12px 10px 32px !important; }

  /* Botones-ícono y cierre de modals: área de toque digna */
  .ibt { min-width: 38px; }
  .ibt.cl, .cbtn { min-width: 38px; min-height: 38px; }

  /* Drawer: items de nav y "Salir" más tocables */
  .nav-item { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .up-out { font-size: 11px; padding: 8px 12px; }
}

/* Very small screens (≤380px) */
@media(max-width: 380px) {
  .topbar { padding: 8px 10px !important; }
  .card { padding: 12px !important; }
  .sg { grid-template-columns: 1fr 1fr !important; }
  .v9-kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .btn { font-size: 12px; }
  .fin-tab { padding: 9px 12px; font-size: 12px; }
}

/* Landscape phone */
@media(max-width: 900px) and (max-height: 480px) and (orientation: landscape) {
  .ov .modal { max-height: 96vh !important; padding: 14px !important; }
  .login-card { padding: 18px 22px !important; }
}
/* Inputs de datos personales: tipear siempre se ve en MAYÚSCULAS.
   La conversión real del valor la hace un listener global (ver script). */
.up-input, .up-input::placeholder { text-transform: uppercase; }

/* ═══════════════════════════════════════
   EVENTOS — clases abiertas / workshops / cursos puntuales
═══════════════════════════════════════ */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.ev-empty { grid-column: 1/-1; padding: 28px; text-align: center; color: var(--muted); font-size: 13px; background: var(--warm); border: 1px dashed var(--border); border-radius: var(--cr); }
.ev-card { background: var(--warm); border: 1px solid var(--border); border-radius: var(--cr); padding: 15px 16px 16px; box-shadow: var(--sh); cursor: pointer; transition: transform var(--tr), box-shadow var(--tr); }
.ev-card:hover { transform: translateY(-3px); box-shadow: var(--shh); }
.ev-card.ev-past { opacity: .68; }
.ev-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.ev-money { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--sage-d); }
.ev-title { font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.15; }
.ev-inv { font-size: 12px; font-style: italic; color: var(--accent-d); margin-top: 2px; }
.ev-meta { font-size: 11.5px; color: var(--muted); margin: 8px 0 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ev-dot-Centro { background: var(--clay); }
.ev-dot-Faro { background: var(--blue); }
.ev-dot-Amarras { background: var(--sage); }
.ev-bar { height: 6px; border-radius: 20px; background: rgba(42,42,37,.08); overflow: hidden; }
.ev-fill { height: 100%; border-radius: 20px; transition: width .5s; }
.ev-fill.ev-ok { background: var(--sage); }
.ev-fill.ev-high { background: var(--accent); }
.ev-fill.ev-full { background: var(--clay); }
.ev-cupo-lbl { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.ev-cupo-lbl b { color: var(--text); }
/* detalle */
.ev-detail-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 4px; }
.ev-detail-stats > div { background: var(--cream); border-radius: 10px; padding: 12px; text-align: center; }
.ev-ds-v { font-family: var(--serif); font-size: 24px; font-weight: 400; line-height: 1; }
.ev-ds-v span { font-size: 14px; color: var(--muted); }
.ev-ds-l { font-size: 9.5px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.ev-pago-note { font-size: 12px; color: var(--text); background: rgba(196,150,42,.1); border-radius: 9px; padding: 10px 12px; margin-top: 14px; line-height: 1.5; }
.ev-pago-note b { color: var(--warn); }
.ev-ins-list { display: flex; flex-direction: column; gap: 7px; }
.ev-ins-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: var(--cream); border-radius: 10px; border: 1px solid transparent; transition: border var(--tr); }
.ev-ins-row:hover { border-color: var(--border); }
.ev-ins-check { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--border); background: #fff; color: var(--sage-d); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--tr); }
.ev-ins-check.on { background: var(--sage-d); border-color: var(--sage-d); color: #fff; }
.ev-ins-main { flex: 1; min-width: 0; }
.ev-ins-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ev-ins-meta { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-ins-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ev-ins-act { background: rgba(74,103,65,.1); color: var(--sage-d); border: none; border-radius: 7px; padding: 6px 9px; font-size: 11px; font-weight: 600; cursor: pointer; transition: all var(--tr); font-family: var(--sans); }
.ev-ins-act:hover { background: var(--sage-d); color: #fff; }
.ev-act-alta { background: rgba(200,184,154,.25); color: var(--accent-d); }
.ev-act-alta:hover { background: var(--accent-d); color: #fff; }
.ev-ins-x { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 7px; width: 26px; height: 26px; font-size: 11px; cursor: pointer; }
.ev-ins-x:hover { border-color: var(--err); color: var(--err); }
.ev-leadnote { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin-top: 14px; background: rgba(200,184,154,.12); border-radius: 9px; padding: 11px 13px; }
.ev-modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
@media(max-width: 640px) {
  .ev-detail-stats { grid-template-columns: 1fr 1fr; }
  /* Fila de inscripto: check + datos arriba, acciones en fila completa abajo */
  .ev-ins-row { flex-wrap: wrap; align-items: flex-start; row-gap: 9px; padding: 11px 12px; }
  .ev-ins-main { flex: 1 1 0; min-width: 0; }
  .ev-ins-name { font-size: 13.5px; }
  .ev-ins-meta { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.45; overflow-wrap: anywhere; }
  .ev-ins-check { width: 32px; height: 32px; }
  .ev-ins-right { flex-basis: 100%; min-width: 0; gap: 8px; }
  .ev-ins-act { flex: 1 1 auto; min-height: 40px; padding: 8px 10px; font-size: 12px; }
  .ev-ins-x { width: 40px; height: 40px; flex-shrink: 0; }
  /* Pie del modal de eventos: botones cómodos, sin desbordes */
  .ev-modal-foot { gap: 8px; }
  .ev-modal-foot .btn { flex: 1 1 auto; min-height: 42px; }
}
