  :root {
    --bg: #0b0a0d;
    --surface: #16141a;
    --surface-2: #1e1b24;
    --border: #2a2730;
    --border-soft: #221f28;
    --text: #e8e3ec;
    --muted: #8a8292;
    --subtle: #5a5565;
    --accent: #8b5cf6;
    --accent-soft: rgba(139,92,246,0.12);
    --cyan: #22d3ee;
    --cyan-soft: rgba(34,211,238,0.12);
    --success: #34d399;
    --success-soft: rgba(52,211,153,0.12);
    --warn: #fbbf24;
    --warn-soft: rgba(251,191,36,0.12);
    --danger: #f87171;
    --danger-soft: rgba(248,113,113,0.12);
    --radius: 14px;
    --radius-sm: 8px;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.45; }
  body { min-height: 100vh; }
  button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
  a { color: inherit; text-decoration: none; }

  /* Shell */
  .mockup-toolbar {
    position: sticky; top: 0; z-index: 100;
    background: linear-gradient(to bottom, rgba(11,10,13,0.98), rgba(11,10,13,0.92));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  }
  .mockup-toolbar .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
  .mockup-toolbar .toggle { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
  .mockup-toolbar .toggle button { padding: 6px 14px; font-size: 13px; border-radius: 999px; color: var(--muted); }
  .mockup-toolbar .toggle button.active { background: var(--accent-soft); color: var(--text); }
  .mockup-toolbar .jump { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
  .mockup-toolbar .jump button { font-size: 11px; padding: 4px 9px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; }
  .mockup-toolbar .jump button:hover { color: var(--text); border-color: var(--accent); }

  .device-frame {
    max-width: 420px; margin: 20px auto; background: var(--bg);
    border: 1px solid var(--border); border-radius: 28px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(139,92,246,0.05);
    position: relative; min-height: 800px;
  }
  .screen { display: none; min-height: 800px; padding-bottom: 90px; }
  .screen.active { display: block; }

  /* Header de cada pantalla */
  .hdr { padding: 18px 20px 12px; display: flex; align-items: center; justify-content: space-between; }
  .hdr .title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
  .hdr .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .hdr-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); color: var(--muted); }
  .hdr-btn:hover { color: var(--text); border-color: var(--accent); }
  .hdr-btn svg { width: 18px; height: 18px; }

  /* Home: big number saldo */
  .saldo-big { padding: 8px 20px 18px; }
  .saldo-big .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
  .saldo-big .value { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
  .saldo-big .delta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--success); margin-top: 4px; padding: 3px 8px; background: var(--success-soft); border-radius: 999px; }
  .saldo-big .delta.neg { color: var(--danger); background: var(--danger-soft); }
  .saldo-banco {
    margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
    display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer;
  }
  .saldo-banco:hover { color: var(--accent); }
  .saldo-banco .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
  .saldo-banco .val { font-weight: 600; font-family: 'JetBrains Mono'; }
  .saldo-banco .diff { color: var(--muted); font-size: 11px; font-family: 'JetBrains Mono'; }
  .saldo-banco .arr { margin-left: auto; color: var(--muted); font-size: 12px; }

  /* KPI grid */
  .kpi-grid { padding: 0 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 18px; }
  .kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; }
  .kpi .k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
  .kpi .v { font-size: 17px; font-weight: 600; margin-top: 4px; letter-spacing: -0.01em; }
  .kpi .hint { font-size: 10px; color: var(--subtle); margin-top: 2px; }

  /* Section */
  .sec { padding: 0 20px; margin-bottom: 22px; }
  .sec-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
  .sec-title .ico { font-size: 14px; }

  /* Pulso chart */
  .pulso { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px 10px; }
  .pulso svg { width: 100%; height: 160px; display: block; }
  .pulso .legend { display: flex; gap: 14px; padding: 8px 4px 0; font-size: 11px; color: var(--muted); }
  .pulso .legend span { display: inline-flex; align-items: center; gap: 5px; }
  .pulso .legend .dot { width: 10px; height: 2px; border-radius: 1px; }
  .pulso .legend .dot.real { background: var(--cyan); }
  .pulso .legend .dot.estim { background: var(--muted); background-image: linear-gradient(90deg, var(--muted) 50%, transparent 50%); background-size: 4px 2px; }
  .pulso .delta-chip { display: inline-block; padding: 3px 9px; font-size: 11px; border-radius: 999px; background: var(--success-soft); color: var(--success); margin-top: 4px; }
  .pulso-help { font-size: 11px; color: var(--muted); margin-bottom: 8px; line-height: 1.4; }

  /* Highlight animation */
  @keyframes glow {
    0% { box-shadow: 0 0 0 0 rgba(139,92,246,0.8); border-color: var(--accent); }
    100% { box-shadow: 0 0 0 8px rgba(139,92,246,0); border-color: var(--border); }
  }
  .gasto.highlight { animation: glow 2.5s ease-out; border-color: var(--accent); }
  .alumno.highlight { animation: glow 2.5s ease-out; border-color: var(--accent); }

  /* Month grid per alumno */
  .months-grid { display: flex; gap: 3px; margin-top: 8px; }
  .month-dot {
    width: 18px; height: 18px; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 600; font-family: 'Inter';
    flex-shrink: 0;
  }
  .month-dot.paid { background: var(--success-soft); color: var(--success); border: 1px solid rgba(52,211,153,0.4); }
  .month-dot.partial { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(251,191,36,0.4); }
  .month-dot.overdue { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(248,113,113,0.5); }
  .month-dot.future { background: var(--surface-2); color: var(--subtle); border: 1px solid var(--border); }
  .month-dot.current { box-shadow: 0 0 0 2px var(--accent); }

  /* Status chip per alumno */
  .chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; font-size: 10px; font-weight: 500; border-radius: 999px; }
  .chip-done { background: var(--accent-soft); color: var(--accent); }
  .chip-ahead { background: var(--cyan-soft); color: var(--cyan); }
  .chip-ok { background: var(--success-soft); color: var(--success); }
  .chip-late { background: var(--danger-soft); color: var(--danger); }
  .chip-partial { background: var(--warn-soft); color: var(--warn); }

  /* Tenpo KPI card */
  .tenpo-card {
    margin: 0 20px 18px;
    background: linear-gradient(135deg, var(--surface) 0%, rgba(139,92,246,0.06) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex; align-items: center; gap: 12px;
    cursor: pointer;
  }
  .tenpo-card:hover { border-color: var(--accent); }
  .tenpo-card .tenpo-ico {
    width: 38px; height: 38px; border-radius: 10px;
    background: #ffcc00; color: #000;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px;
    flex-shrink: 0;
  }
  .tenpo-card .tenpo-body { flex: 1; min-width: 0; }
  .tenpo-card .tenpo-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
  .tenpo-card .tenpo-value { font-size: 17px; font-weight: 700; margin-top: 2px; }
  .tenpo-card .tenpo-sub { font-size: 10px; color: var(--success); margin-top: 2px; }
  .tenpo-card .tenpo-arrow { color: var(--muted); font-size: 14px; flex-shrink: 0; }

  /* Lightbox for Tenpo image */
  .lightbox-overlay {
    position: absolute; inset: 0; z-index: 60;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(10px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 30px 20px;
  }
  .lightbox-overlay img { max-width: 100%; max-height: 60vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
  .lightbox-overlay .lb-caption { color: var(--muted); font-size: 12px; margin-top: 14px; text-align: center; }
  .lightbox-overlay .lb-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; background: var(--surface); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--text); }

  /* Perfil alumno */
  .profile-hero {
    padding: 20px;
    background: linear-gradient(135deg, var(--surface) 0%, rgba(139,92,246,0.08) 100%);
    border-bottom: 1px solid var(--border);
  }
  .profile-hero .avatar {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; margin-bottom: 10px;
  }
  .profile-hero h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
  .profile-hero .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
  .profile-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 20px 0; }
  .profile-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
  .profile-kpi .k { font-size: 9px; color: var(--muted); text-transform: uppercase; }
  .profile-kpi .v { font-size: 14px; font-weight: 600; margin-top: 3px; }

  .months-grid-big { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0 20px; margin-top: 14px; }
  .month-cell {
    aspect-ratio: 1.5;
    border-radius: 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 500;
    border: 1px solid var(--border);
  }
  .month-cell .m-name { font-size: 9px; text-transform: uppercase; opacity: 0.7; }
  .month-cell .m-amt { font-size: 11px; font-weight: 600; margin-top: 2px; font-family: 'JetBrains Mono'; }
  .month-cell.paid { background: var(--success-soft); color: var(--success); border-color: rgba(52,211,153,0.3); }
  .month-cell.partial { background: var(--warn-soft); color: var(--warn); border-color: rgba(251,191,36,0.3); }
  .month-cell.overdue { background: var(--danger-soft); color: var(--danger); border-color: rgba(248,113,113,0.4); }
  .month-cell.future { background: var(--surface); color: var(--subtle); }
  .month-cell.current { box-shadow: 0 0 0 2px var(--accent); }

  /* Breadcrumb de período */
  .periodo-bar {
    padding: 10px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    font-size: 12px;
  }
  .periodo-bar .crumb { color: var(--muted); cursor: pointer; }
  .periodo-bar .crumb:hover { color: var(--text); }
  .periodo-bar .sep { color: var(--subtle); }
  .periodo-bar .current-period { color: var(--text); font-weight: 500; }
  .periodo-bar .period-chip {
    margin-left: auto; padding: 3px 8px; border-radius: 999px;
    font-size: 10px; font-weight: 500;
  }
  .periodo-bar .period-chip.activo { background: var(--success-soft); color: var(--success); }
  .periodo-bar .period-chip.archivado { background: var(--warn-soft); color: var(--warn); }
  .periodo-bar select.period-select {
    background: transparent; border: none; color: var(--text);
    font: inherit; font-weight: 500; cursor: pointer; padding: 2px 4px;
  }
  .periodo-bar select.period-select:focus { outline: 1px solid var(--accent); border-radius: 4px; }

  /* Archivado banner */
  .archivado-banner {
    background: var(--warn-soft);
    border-bottom: 1px solid rgba(251,191,36,0.3);
    padding: 10px 16px;
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--warn);
  }
  .archivado-banner .ico { font-size: 14px; }

  /* Period card (portal) */
  .period-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; margin-bottom: 10px; cursor: pointer;
  }
  .period-card:hover { border-color: var(--accent); }
  .period-card.archived { opacity: 0.65; }
  .period-card .pc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
  .period-card .pc-title { font-size: 16px; font-weight: 600; }
  .period-card .pc-meta { font-size: 11px; color: var(--muted); }
  .period-card .pc-kpis { display: flex; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--muted); }
  .period-card .pc-kpis span { color: var(--text); font-weight: 600; }
  .period-card .pc-alert { margin-top: 8px; font-size: 11px; padding: 5px 8px; border-radius: 6px; }
  .period-card .pc-alert.warn { background: var(--warn-soft); color: var(--warn); }

  /* Wizard steps */
  .wizard-steps { display: flex; gap: 4px; padding: 0 20px; margin-bottom: 16px; }
  .wizard-step {
    flex: 1; height: 4px; border-radius: 2px; background: var(--border);
  }
  .wizard-step.active { background: var(--accent); }
  .wizard-step.done { background: var(--success); }

  .file-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 12px; margin-bottom: 6px; cursor: pointer;
    display: flex; align-items: center; gap: 10px;
  }
  .file-card:hover, .file-card.selected { border-color: var(--accent); background: var(--accent-soft); }
  .file-card .xl-ico { width: 36px; height: 36px; border-radius: 8px; background: #107c41; color: white; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
  .file-card .file-body { flex: 1; min-width: 0; }
  .file-card .file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .file-card .file-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
  .file-card .check { color: var(--accent); font-size: 18px; }

  .checkbox-row {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px; margin-bottom: 6px;
    display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  }
  .checkbox-row .cb { width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 4px; flex-shrink: 0; margin-top: 2px; position: relative; }
  .checkbox-row.checked .cb { background: var(--accent); border-color: var(--accent); }
  .checkbox-row.checked .cb::after { content: "✓"; position: absolute; top: -3px; left: 2px; color: white; font-size: 14px; font-weight: 700; }
  .checkbox-row .cb-body { flex: 1; }
  .checkbox-row .cb-title { font-size: 13px; font-weight: 500; }
  .checkbox-row .cb-hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

  /* Apoderados gestión */
  .apo-row {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 11px 12px; margin-bottom: 6px;
    display: flex; align-items: center; gap: 12px; cursor: pointer;
  }
  .apo-row:hover { border-color: var(--accent); }
  .apo-row .apo-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cyan-soft); color: var(--cyan); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
  .apo-row .apo-body { flex: 1; min-width: 0; }
  .apo-row .apo-name { font-size: 13px; font-weight: 500; }
  .apo-row .apo-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .apo-row .apo-count { font-size: 11px; color: var(--accent); padding: 2px 8px; background: var(--accent-soft); border-radius: 999px; }

  /* Toggle switch */
  .toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
  .toggle-switch input { opacity: 0; width: 0; height: 0; }
  .toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--border); border-radius: 24px; transition: background 0.2s; }
  .toggle-slider::before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: var(--muted); border-radius: 50%; transition: all 0.2s; }
  .toggle-switch input:checked + .toggle-slider { background: var(--accent-soft); }
  .toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); background: var(--accent); }

  /* Price input */
  .price-input {
    width: 72px; background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); padding: 6px 8px; border-radius: 6px;
    font: 500 12px 'JetBrains Mono'; text-align: right;
  }
  .price-input:focus { outline: none; border-color: var(--accent); }

  /* Caps editor modal */
  .caps-editor { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
  .caps-editor .row-cap { display: grid; grid-template-columns: 50px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
  .caps-editor .row-cap label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
  .caps-editor input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 6px; font: 500 13px 'JetBrains Mono'; text-align: right; }
  .caps-editor input:focus { outline: none; border-color: var(--accent); }
  .caps-editor input.disabled { opacity: 0.4; }

  /* FP chip in alumno row */
  .chip-fp { background: var(--cyan-soft); color: var(--cyan); font-size: 10px; padding: 2px 6px; border-radius: 999px; margin-left: 6px; }
  .chip-fp.paid { background: var(--success-soft); color: var(--success); }

  /* Eventos */
  .event { display: flex; align-items: flex-start; gap: 12px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; }
  .event .date { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; min-width: 38px; text-align: center; line-height: 1.1; padding-top: 2px; }
  .event .date .d { font-size: 17px; color: var(--text); font-weight: 600; }
  .event .body { flex: 1; }
  .event .name { font-size: 14px; font-weight: 500; }
  .event .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .event .amt { font-size: 13px; font-weight: 600; color: var(--danger); }
  .event .amt.in { color: var(--success); }

  /* Alertas */
  .alert { padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 6px; display: flex; gap: 10px; font-size: 12px; border: 1px solid; }
  .alert.warn { background: var(--warn-soft); border-color: rgba(251,191,36,0.25); color: var(--warn); }
  .alert.danger { background: var(--danger-soft); border-color: rgba(248,113,113,0.25); color: var(--danger); }
  .alert.info { background: var(--cyan-soft); border-color: rgba(34,211,238,0.25); color: var(--cyan); }
  .alert .ico { font-size: 14px; flex-shrink: 0; }
  .alert .txt { color: var(--text); }
  .alert.warn .ico { color: var(--warn); }
  .alert.danger .ico { color: var(--danger); }

  /* Timeline */
  .tl-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
  .tl-item:last-child { border-bottom: none; }
  .tl-ico { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
  .tl-ico.in { background: var(--success-soft); color: var(--success); }
  .tl-ico.out { background: var(--danger-soft); color: var(--danger); }
  .tl-body { flex: 1; min-width: 0; }
  .tl-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tl-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
  .tl-amt { font-size: 13px; font-weight: 600; white-space: nowrap; }
  .tl-amt.in { color: var(--success); }
  .tl-amt.out { color: var(--text); }

  /* Tabs bottom nav */
  .bottom-nav {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(22,20,26,0.96); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; padding: 6px 4px 10px;
  }
  .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; color: var(--muted); font-size: 10px; border-radius: 10px; min-width: 58px; }
  .bottom-nav button.active { color: var(--accent); }
  .bottom-nav button svg { width: 20px; height: 20px; }

  /* FAB */
  .fab {
    position: absolute; right: 18px; bottom: 78px; z-index: 10;
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--accent); color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 300;
    box-shadow: 0 10px 25px rgba(139,92,246,0.4), 0 0 0 1px rgba(255,255,255,0.05);
  }
  .fab:hover { transform: scale(1.05); }

  /* Alumnos list */
  .alumno { display: flex; align-items: center; gap: 12px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; }
  .alumno-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
  .alumno-body { flex: 1; min-width: 0; }
  .alumno-name { font-size: 13px; font-weight: 500; }
  .alumno-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
  .alumno-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
  .alumno-bar .fill { height: 100%; border-radius: 2px; }
  .alumno-bar .fill.ok { background: var(--success); }
  .alumno-bar .fill.mid { background: var(--warn); }
  .alumno-bar .fill.low { background: var(--danger); }
  .alumno-pct { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 38px; text-align: right; }
  .alumno-pct.ok { color: var(--success); }
  .alumno-pct.mid { color: var(--warn); }
  .alumno-pct.low { color: var(--danger); }

  /* Gasto card */
  .gasto { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; }
  .gasto-head { display: flex; justify-content: space-between; align-items: flex-start; }
  .gasto-concepto { font-size: 14px; font-weight: 500; }
  .gasto-monto { font-size: 15px; font-weight: 600; color: var(--text); }
  .gasto-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
  .gasto-act { display: inline-block; padding: 2px 7px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 5px; }
  .gasto-fotos { display: flex; gap: 4px; margin-top: 8px; }
  .gasto-foto { width: 48px; height: 48px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 10px; overflow: hidden; }

  /* Barras ingresos/egresos */
  .bars-chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px; }
  .bars-chart svg { width: 100%; height: 180px; }
  .bars-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 10px; color: var(--muted); padding-top: 8px; }
  .bars-legend span { display: inline-flex; align-items: center; gap: 5px; }
  .bars-legend .sq { width: 10px; height: 10px; border-radius: 2px; }

  /* Cumplimiento */
  .cumpl-big { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 8px; }
  .cumpl-big .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
  .cumpl-big .pct { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; color: var(--success); margin-top: 2px; }
  .cumpl-big .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .cumpl-bar { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; margin-top: 10px; }
  .cumpl-bar .fill { height: 100%; background: var(--success); border-radius: 5px; }

  /* Forms */
  .form { padding: 0 20px; }
  .form-group { margin-bottom: 14px; }
  .form-group label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
  .form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font: inherit; font-size: 14px;
  }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--accent); background: var(--surface-2);
  }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
  @media (max-width: 520px) {
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
  }
  .form-group input[type="date"], .form-group input[type="number"], .form-group input[type="text"], .form-group input[type="email"], .form-group input[type="tel"], .form-group select, .form-group textarea {
    min-width: 0;
    max-width: 100%;
  }

  .drop-zone { padding: 30px 20px; border: 2px dashed var(--border); border-radius: var(--radius); text-align: center; color: var(--muted); font-size: 13px; margin-top: 6px; }
  .drop-zone .ico { font-size: 28px; margin-bottom: 6px; color: var(--accent); }
  .thumbnails { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
  .thumb { width: 70px; height: 70px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); }
  .thumb .rm { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,0.7); color: white; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }

  .btn {
    padding: 12px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  }
  .btn-primary { background: var(--accent); color: white; width: 100%; }
  .btn-primary:hover { background: #7c4df5; }
  .btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text); width: 100%; }
  .btn-ghost { color: var(--muted); border: 1px solid var(--border); }

  /* Modal backdrop / sheet */
  .sheet-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 20; display: flex; align-items: flex-end;
  }
  .sheet {
    width: 100%; background: var(--surface); border-top-left-radius: 24px; border-top-right-radius: 24px;
    padding: 20px 20px 28px; border-top: 1px solid var(--border);
  }
  .sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: -8px auto 16px; }
  .sheet h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
  .sheet-option { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; }
  .sheet-option:hover { border-color: var(--accent); }
  .sheet-option .emoji { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
  .sheet-option .txt { flex: 1; }
  .sheet-option .nm { font-size: 14px; font-weight: 500; }
  .sheet-option .dc { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .sheet-option .arrow { color: var(--muted); }

  /* Toast */
  .toast {
    position: absolute; top: 70px; left: 20px; right: 20px; z-index: 50;
    padding: 12px 14px; background: var(--success-soft); border: 1px solid var(--success); color: var(--success);
    border-radius: var(--radius-sm); font-size: 13px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  }

  /* Sync panel */
  .sync-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 12px; }
  .sync-row .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .sync-row .dot.ok { background: var(--success); }
  .sync-row .dot.bad { background: var(--danger); }
  .sync-row .dot.pend { background: var(--warn); }
  .sync-row .txt { flex: 1; }
  .sync-row .tm { color: var(--muted); font-size: 11px; font-family: 'JetBrains Mono', monospace; }

  .pend-item { background: var(--warn-soft); border: 1px solid rgba(251,191,36,0.3); border-radius: var(--radius-sm); padding: 11px 12px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
  .pend-item .pd-body { flex: 1; font-size: 12px; }
  .pend-item .pd-body .nm { font-weight: 500; color: var(--text); }
  .pend-item .pd-body .mt { color: var(--warn); font-size: 11px; margin-top: 2px; }
  .pend-item .btn-sm { padding: 5px 10px; font-size: 11px; background: var(--warn); color: #000; border-radius: 6px; font-weight: 500; }

  /* Login */
  .login-screen { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 600px; padding: 40px 20px; text-align: center; }
  .login-screen .logo { font-size: 48px; margin-bottom: 20px; }
  .login-screen h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
  .login-screen p { color: var(--muted); font-size: 13px; margin-bottom: 30px; }
  .btn-google { background: white; color: #333; padding: 12px 20px; border-radius: 10px; display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; }

  /* Map view */
  .flow-map { max-width: 960px; margin: 40px auto; padding: 0 20px; }
  .flow-map h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: var(--muted); }
  .flow-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
  .flow-node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; cursor: pointer; transition: border-color 0.15s; }
  .flow-node:hover { border-color: var(--accent); }
  .flow-node .n { font-weight: 600; margin-bottom: 6px; }
  .flow-node .d { font-size: 11px; color: var(--muted); line-height: 1.4; }
  .flow-node .to { font-size: 10px; color: var(--accent); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.06em; }

  /* Eventos proyección detalle */
  .evt-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; margin-bottom: 6px; }
  .evt-box .hd { display: flex; justify-content: space-between; align-items: baseline; }
  .evt-box .nm { font-size: 13px; font-weight: 500; }
  .evt-box .mt-val { font-size: 13px; font-weight: 600; }
  .evt-box .mt-in { color: var(--success); }
  .evt-box .mt-out { color: var(--danger); }
  .evt-box .mt-dt { font-size: 11px; color: var(--muted); margin-top: 2px; }

  /* Utilities */
  .row { display: flex; align-items: center; gap: 8px; }
  .space-between { justify-content: space-between; }
  .muted { color: var(--muted); }
  .mono { font-family: 'JetBrains Mono', monospace; }
  .small { font-size: 11px; }
  .mt-12 { margin-top: 12px; }
  .mt-8 { margin-top: 8px; }
  .mb-8 { margin-bottom: 8px; }

  /* Responsive: show 2 frames side by side on wide screens */
  @media (min-width: 900px) {
    .workspace { max-width: 1400px; margin: 0 auto; padding: 20px; }
    .multi-frames { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 420px)); gap: 30px; justify-content: center; }
    .device-frame { margin: 0; }
  }

/* ── Extensiones fondo-curso (sobre design del mockup) ── */
body { padding-bottom: env(safe-area-inset-bottom); }
.container { max-width: 720px; margin: 0 auto; padding: 16px; }
.hero-apo {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(139,92,246,0.08) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.hero-apo h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.hero-apo .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.progress-bar {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-bar .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width .4s ease;
}
.meses-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-paid { background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.3); color: var(--success); }
.chip-pending { background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--muted); opacity: 0.6; }
.chip-partial { background: rgba(251,191,36,0.12); border: 1px solid rgba(251,191,36,0.3); color: var(--warn); }

.staging-banner {
  background: #c02020;
  color: white;
  padding: 6px 12px;
  font-size: 11px;
  text-align: center;
  font-weight: 500;
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.footer { text-align: center; font-size: 11px; color: var(--muted); padding: 24px 16px 40px; }

/* Admin desktop-friendly tweaks (no device-frame) */
.admin-shell { max-width: 1000px; margin: 0 auto; padding: 20px; padding-bottom: 120px; }
.admin-shell .hdr { padding: 0 0 20px; }
.admin-shell .sec, .admin-shell .kpi-grid, .admin-shell .saldo-big, .admin-shell .tenpo-card { padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; }
.admin-shell .kpi-grid { grid-template-columns: repeat(4, 1fr); }
.admin-shell .bottom-nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; max-width: 1000px; width: 100%; border-radius: 14px 14px 0 0; z-index: 50; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.admin-shell .fab { position: fixed; bottom: 80px; right: max(18px, calc(50vw - 500px + 18px)); z-index: 55; }
body.modal-open .fab { display: none !important; }
body.modal-open .bottom-nav { display: none !important; }
@media (max-width: 720px) {
  .admin-shell { padding: 16px; padding-bottom: 110px; }
  .admin-shell .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-shell .fab { right: 18px; }
}
.screen-pane { display: none; }
.screen-pane.active { display: block; }
