/* =====================================================
   SESIONES — Design System (Stitch adaptation)
   ===================================================== */

/* ── 0. Critical override ───────────────────────────── */
[hidden] { display: none !important; }

/* ── 1. Design tokens ───────────────────────────────── */
:root {
  /* Palette */
  --bg:               #FAF9F6;
  --surface:          #FFFFFF;
  --surface-low:      #FEF1EE;
  --surface-mid:      #F8EBE8;
  --surface-high:     #F2E6E2;
  --surface-highest:  #ECE0DD;

  --sidebar-bg:       #2C2825;
  --sidebar-border:   rgba(255,255,255,0.08);

  --primary:          #2D5C3A;
  --primary-container:#4E8B5F;
  --on-primary:       #FFFFFF;
  --primary-light:    #E4EFE6;

  --text-primary:     #1A201B;
  --text-secondary:   #3F5244;
  --text-muted:       #6B7E6F;
  --text-sidebar:     rgba(255,255,255,0.65);
  --text-sidebar-active: #7BBF8E;

  --border:           #E8E3DC;
  --border-strong:    #D7C2BC;

  --success:          #266862;
  --success-bg:       #E1F5F3;
  --success-text:     #003F3B;

  --amber:            #BA7517;
  --amber-bg:         #FEF3E2;
  --amber-text:       #7A4700;

  --error:            #BA1A1A;
  --error-bg:         #FFDAD6;
  --error-text:       #93000A;

  /* Typography */
  --font: 'Inter', 'Segoe UI', Arial, sans-serif;

  /* Radius */
  --radius-pill:      9999px;
  --radius-card:      20px;
  --radius-sm:        10px;
  --radius-xs:        8px;

  /* Spacing */
  --sidebar-w:        260px;
  --content-max:      1120px;
  --gap:              24px;

  /* Transitions */
  --t:                0.15s ease;
}

/* ── 2. Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }
img { display: block; max-width: 100%; }

/* ── 3. Layout ───────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.app-shell {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 40px var(--gap) 80px;
  max-width: calc(var(--content-max) + var(--sidebar-w));
}

/* ── 4. Brand ────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 24px 20px;
}

.brand-mark {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-container);
  color: var(--on-primary);
  font-size: 16px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.brand-text strong {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-text span {
  display: block;
  font-size: 11px;
  color: var(--text-sidebar);
  letter-spacing: 0.01em;
  margin-top: 2px;
}

/* ── 5. Sidebar nav ──────────────────────────────────── */
.sidebar nav {
  padding: 8px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--text-sidebar);
  transition: background var(--t), color var(--t);
  position: relative;
  border-left: 3px solid transparent;
}

.sidebar nav a .nav-icon {
  font-size: 20px;
  flex-shrink: 0;
  transition: color var(--t);
}

.sidebar nav a:hover {
  background: rgba(255,255,255,0.07);
  color: #FFFFFF;
}

.sidebar nav a.active {
  color: var(--primary-container);
  border-left-color: var(--primary-container);
  background: rgba(78,139,95,0.12);
  font-weight: 500;
  padding-left: 11px;
}

.sidebar nav a.active .nav-icon {
  color: var(--primary-container);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-container);
  color: var(--on-primary);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: var(--radius-pill);
  padding: 0 5px;
  margin-left: auto;
}

/* ── 6. Sidebar footer ───────────────────────────────── */
.sidebar-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--sidebar-border);
  margin-top: auto;
}

.sidebar-month {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-sidebar);
  margin-bottom: 4px;
}

.sidebar-stat {
  font-size: 12px;
  color: var(--text-sidebar);
  opacity: 0.7;
}

/* ── 7. Page header ──────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

.page-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 4px;
  flex-shrink: 0;
}

/* ── 8. Views ────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── 9. Buttons ──────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  background: var(--primary-container);
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t), opacity var(--t);
  white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { background: var(--primary); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--primary-container);
  border: 1.5px solid var(--primary-container);
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--surface-low); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--surface-high); color: var(--text-primary); }

.btn-danger-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--error);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t);
  white-space: nowrap;
}
.btn-danger-ghost:hover { background: var(--error-bg); }

.btn-sm {
  padding: 7px 16px;
  font-size: 13px;
}

.btn-icon {
  padding: 7px 10px;
  min-width: 34px;
}

/* ── 10. Inputs & selects ────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-container);
  box-shadow: 0 0 0 3px rgba(78,139,95,0.15);
}

input::placeholder { color: var(--text-muted); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2385736E' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Custom select component ─────────────────────────── */
.c-select-native {
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.c-select-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.c-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 42px;
  padding: 0 36px 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--t), background var(--t);
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.c-select-trigger:hover { border-color: var(--primary-container); }
.c-select-trigger.is-open {
  border-color: var(--primary-container);
  box-shadow: 0 0 0 3px rgba(78,139,95,0.15);
}
.c-select-trigger::after {
  content: 'expand_more';
  font-family: 'Material Symbols Outlined';
  font-size: 18px;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: transform 0.18s ease;
  pointer-events: none;
}
.c-select-trigger.is-open::after {
  transform: translateY(-50%) rotate(180deg);
}

.c-select-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  z-index: 300;
  overflow-y: auto;
  max-height: 240px;
}

.c-select-option {
  display: block;
  width: 100%;
  padding: 9px 16px;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background var(--t);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-select-option:hover { background: var(--primary-light); }
.c-select-option.is-selected { font-weight: 500; color: var(--primary); }

/* Small pill variant (sessionMonthFilter) */
.c-select-wrapper.sm {
  width: auto;
  min-width: 160px;
}
.c-select-wrapper.sm .c-select-trigger {
  height: 34px;
  font-size: 13px;
  font-weight: 700;
  padding: 0 32px 0 14px;
}
.c-select-wrapper.sm .c-select-trigger::after { font-size: 16px; right: 10px; }

/* Month/year controls in billing page */
.month-controls .c-select-wrapper {
  width: auto;
  min-width: 110px;
}
.month-controls .c-select-trigger {
  height: 36px;
  font-size: 13px;
  padding: 0 30px 0 14px;
}
.month-controls .c-select-trigger::after { font-size: 16px; right: 8px; }

/* Facturas toolbar */
.facturas-toolbar .c-select-wrapper {
  width: auto;
  min-width: 130px;
}
.facturas-toolbar .c-select-trigger {
  height: 38px;
  font-size: 13px;
  padding: 0 32px 0 14px;
}
.facturas-toolbar .c-select-trigger::after { font-size: 16px; right: 10px; }

@media (max-width: 640px) {
  .facturas-toolbar .c-select-wrapper { width: 100%; }
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* ── 11. Forms ───────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.inline-form-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 20px;
}

.inline-form-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.inline-form-help {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: -14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── 12. Stat cards ──────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background var(--t);
}
.stat-card:hover { background: var(--surface-low); }

.stat-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.3;
}

.stat-value {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card.warning .stat-value { color: var(--amber); }
.stat-card-ok   { border-left: 3px solid #4E8B5F; }
.stat-card-warn { border-left: 3px solid #E8A87C; }
.stat-card-ok   .stat-value { color: #2D5C3A; }
.stat-card-warn .stat-value { color: #C46B30; }

/* ── 13. Action cards (Inicio flow) ──────────────────── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
  margin-top: 12px;
}

.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.action-num {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--surface-low);
  color: var(--primary-container);
  font-size: 22px;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.action-card h2 {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.action-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
  flex: 1;
}

.action-card .btn-secondary,
.action-card .btn-ghost,
.action-card .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: auto;
}

/* ── 14. Quick session card ──────────────────────────── */
.quick-session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 20px;
  overflow: hidden;
}

.quick-session-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--t), color var(--t);
}
.quick-session-toggle:hover { background: var(--surface-low); color: var(--primary-container); }

.quick-session-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-low);
  color: var(--primary-container);
  font-size: 20px;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
}
.quick-session-toggle:hover .quick-session-icon {
  background: var(--primary-container);
  color: var(--on-primary);
}

.quick-session-form {
  padding: 0 24px 24px;
  border-top: 1px solid var(--border);
}
.quick-session-form.hidden,
.quick-session-form[hidden] { display: none !important; }

/* ── 15. List header ─────────────────────────────────── */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.list-header h2 {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* ── 16. Data rows ───────────────────────────────────── */
.page-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.data-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background var(--t);
}
.data-row:hover { background: var(--surface-low); }

/* Avatar */
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-high);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.avatar.blue   { background: #dbeafe; color: #1d4ed8; }
.avatar.green  { background: var(--success-bg); color: var(--success); }
.avatar.purple { background: #ede9fe; color: #7c3aed; }
.avatar.orange { background: var(--amber-bg); color: var(--amber); }

.client-info {
  flex: 1;
  min-width: 0;
}
.client-info strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-info small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amount {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--t);
}
.data-row:hover .row-actions { opacity: 1; }
.factura-row .row-actions { opacity: 1; }

/* ── 17. Tags / badges ───────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.tag-pending  { background: var(--amber-bg);    color: var(--amber-text); }
.tag-invoiced { background: var(--surface-high); color: var(--text-muted); }
.tag-ok       { background: var(--success-bg);   color: var(--success-text); }
.tag-warning  { background: var(--amber-bg);     color: var(--amber-text); }
.tag-error    { background: var(--error-bg);     color: var(--error-text); }

/* ── 18. Client stats ────────────────────────────────── */
.client-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  grid-column: 1 / -1;
}
.client-stats span { font-weight: 500; }
.stats-sep { font-weight: 400 !important; opacity: 0.5; }

/* ── 19. Tab bar ─────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--surface-high);
  padding: 4px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

.tab-btn {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.tab-btn.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(32,26,25,0.08);
}
.tab-btn:hover:not(.active) { background: var(--surface-mid); }

/* ── 20. View toggle (Lista/Calendario) ──────────────── */
.view-toggle {
  display: flex;
  background: var(--surface-high);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.view-toggle-btn {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.view-toggle-btn.active {
  background: var(--surface);
  color: var(--text-primary);
}

/* ── 21. Repeat label ────────────────────────────────── */
.repeat-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  cursor: pointer;
  user-select: none;
  flex-direction: row;
}
.repeat-label input[type="checkbox"] {
  width: 16px; height: 16px;
  min-height: 16px;
  accent-color: var(--primary-container);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
  border-radius: 4px;
}

/* ── 22. Empty state ─────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 24px;
  gap: 12px;
}
.empty-state-icon {
  font-size: 36px;
  color: var(--text-muted);
  opacity: 0.5;
  margin-bottom: 4px;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}
.empty-state-body {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 340px;
  line-height: 1.6;
}

/* ── 23. Onboarding ──────────────────────────────────── */
.onboarding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  margin-bottom: 24px;
}
.onboarding-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.onboarding-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.onboarding-step:first-child { border-top: none; }

.onboarding-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-high);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.onboarding-step.done .onboarding-step-num {
  background: var(--success-bg);
  color: var(--success);
}

.onboarding-step-text { flex: 1; font-size: 14px; color: var(--text-secondary); }
.onboarding-step.done .onboarding-step-text { color: var(--text-muted); text-decoration: line-through; }
.onboarding-step .btn-ghost,
.onboarding-step .btn-secondary { flex-shrink: 0; }

/* ── 24. Readiness bar ───────────────────────────────── */
.readiness-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.readiness-item {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.readiness-check {
  font-size: 14px;
  color: var(--text-muted);
}
.readiness-item.readiness-ok {
  background: var(--success-bg);
  border-color: transparent;
  color: var(--success-text);
}
.readiness-item.readiness-ok .readiness-check { color: var(--success); }

/* ── 25. Billing panel ───────────────────────────────── */
.billing-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.billing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 24px 0;
}
.billing-header h2 {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.billing-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.month-controls {
  display: flex;
  gap: 8px;
}
.month-controls select {
  height: 36px;
  width: auto;
  min-width: 110px;
  font-size: 13px;
  padding: 0 32px 0 14px;
}

.billing-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 20px 24px 16px;
}
.billing-toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  height: 38px;
}

.invoice-list {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

/* Billing candidate (client row in facturar) */
.billing-candidate {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.billing-candidate.selected { border-color: var(--primary-container); background: var(--surface-low); }
.billing-candidate.has-warning { border-color: #E8A87C; }

.billing-candidate input[type="checkbox"] {
  width: 16px; height: 16px; min-height: 16px;
  accent-color: var(--primary-container);
  flex-shrink: 0;
}

.billing-candidate-hint {
  width: 100%;
  font-size: 12px;
  color: var(--amber);
  padding-left: 26px;
}

.billing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.billing-footer-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 3px;
}
.billing-footer-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.billing-total-selected {
  display: flex;
  align-items: center;
  gap: 20px;
}
.total-selected-amount { text-align: right; }
.total-selected-amount .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 3px;
}
.total-selected-amount .value {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* Results card */
.results-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  margin-top: 16px;
}
.results-card h2 {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.results-summary { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.results-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.results-list li { font-size: 13px; color: var(--text-secondary); padding: 4px 0; border-bottom: 1px solid var(--border); }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 26. Facturas KPIs ───────────────────────────────── */
.facturas-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 20px;
}

/* ── 27. Facturas chart ──────────────────────────────── */
.factura-chart-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px 20px 16px;
  margin-bottom: 20px;
}
.factura-chart-wrap::before {
  content: "Facturación por mes";
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.chart-bar         { fill: #7BBF8E; cursor: default; transition: fill 0.12s; }
.chart-bar:hover   { fill: var(--primary-container); }
.chart-bar-current { fill: var(--primary-container); }
.chart-bar-future  { fill: var(--surface-high); }
.chart-bar-empty   { fill: var(--border); }
.chart-month-label { font-size: 10px; fill: var(--text-muted); font-family: inherit; }
.chart-month-current { fill: var(--text-primary); font-weight: 700; }
.chart-empty-msg   { font-size: 13px; fill: var(--text-muted); font-family: inherit; }
.chart-tooltip {
  position: absolute;
  background: var(--text-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  white-space: nowrap;
  transform: translateX(-50%);
  z-index: 10;
}

/* ── 28. Facturas toolbar ────────────────────────────── */
.facturas-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.facturas-toolbar select,
.facturas-toolbar input {
  height: 38px;
  width: auto;
  min-width: 130px;
  font-size: 13px;
  padding: 0 32px 0 14px;
}
.facturas-toolbar input { padding: 0 16px; min-width: 180px; }

/* ── 29. Factura rows ────────────────────────────────── */
.facturas-list { display: flex; flex-direction: column; gap: 8px; }

.factura-wrap { display: flex; flex-direction: column; }

.factura-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  transition: background var(--t);
}
.factura-row:hover { background: var(--surface-low); }
.factura-row.cobrada { opacity: 0.72; }
.factura-row.expanded { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.factura-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 90px;
}

.factura-expand {
  flex-shrink: 0;
  width: 28px; min-width: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.factura-chevron {
  font-size: 20px;
  display: block;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.factura-chevron.is-open { transform: rotate(180deg); }

.factura-sessions-detail {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.factura-session-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.factura-session-item:last-child { border-bottom: none; padding-bottom: 0; }
.factura-session-date { color: var(--text-primary); font-weight: 500; }
.factura-session-price { font-weight: 500; color: var(--text-primary); text-align: right; }
.factura-sessions-empty { font-size: 13px; color: var(--text-muted); margin: 0; text-align: center; padding: 8px 0; }

/* ── 30. Ajustes ─────────────────────────────────────── */
.ajustes-single { max-width: 560px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
}
.panel-header h2 {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.panel-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.fiscal-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.fiscal-card-body { flex: 1; }
.fiscal-field-main {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.fiscal-field-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 0;
  border-top: 1px solid var(--border);
}
.fiscal-field-label { color: var(--text-muted); min-width: 80px; }
.fiscal-edit-btn { flex-shrink: 0; }

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.numeracion-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  width: fit-content;
}
.chip-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.chip-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ── 31. Calendar ────────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 4px;
}
.calendar-header {
  padding: 16px 4px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.calendar-month-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.calendar-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 6px 0;
}
.calendar-day {
  min-height: 56px;
  padding: 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--t);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.calendar-day:hover { background: var(--surface-low); }
.calendar-day.other-month { opacity: 0.35; }
.calendar-day.selected { background: var(--surface-low); border: 1px solid var(--border-strong); }
.calendar-day.today .calendar-day-num {
  background: var(--primary-container);
  color: var(--on-primary);
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.calendar-day-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.calendar-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary-container);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.calendar-day.has-sessions { cursor: pointer; }
.calendar-detail {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.calendar-detail-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── 32. Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32,26,25,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 28px;
  max-width: 380px;
  width: calc(100% - 40px);
  box-shadow: 0 8px 32px rgba(32,26,25,0.15);
}
.modal-box h3 {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.modal-box p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── 33. Toast ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text-primary);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 400;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  max-width: 340px;
  pointer-events: none;
  border-left: 3px solid transparent;
}
.toast.toast-success { border-left-color: #7BBF8E; }

/* ── 34. Bottom navigation (mobile) ─────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--sidebar-border);
  z-index: 100;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--text-sidebar);
  position: relative;
  transition: color var(--t);
}
.bottom-nav a .material-symbols-outlined {
  font-size: 22px;
}
.bottom-nav a.active { color: var(--primary-container); }
.bottom-nav a .nav-badge {
  position: absolute;
  top: 6px; right: calc(50% - 18px);
  min-width: 16px; height: 16px;
  font-size: 9px;
}

/* ── 35. Responsive ──────────────────────────────────── */
@media (max-width: 780px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }

  .app-shell {
    margin-left: 0;
    padding: 24px 16px 80px;
  }

  .page-header h1 { font-size: 24px; }

  .summary-grid,
  .facturas-kpis {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .action-grid { grid-template-columns: 1fr; }

  .form-grid { grid-template-columns: 1fr; }

  .billing-footer { flex-direction: column; align-items: stretch; }
  .billing-total-selected { justify-content: space-between; }

  .month-controls { flex-wrap: wrap; }

  .facturas-toolbar { flex-direction: column; align-items: stretch; }
  .facturas-toolbar select,
  .facturas-toolbar input { width: 100%; }

  .factura-row { flex-wrap: wrap; }

  .factura-session-item { grid-template-columns: 1fr auto; }
  .factura-session-svc { grid-column: 1; font-size: 12px; }
  .factura-session-price { grid-row: 1; }

  .calendar-day { min-height: 40px; }
  .calendar-day-num { font-size: 11px; }
  .calendar-dot { width: 5px; height: 5px; }

  .toast-container { left: 16px; right: 16px; bottom: 72px; }
  .toast { max-width: 100%; }
}

@media (max-width: 480px) {
  .summary-grid,
  .facturas-kpis {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .stat-value { font-size: 24px; }
}

/* ── 36. Flatpickr overrides ─────────────────────────── */

/* Reset our global input/select styles inside Flatpickr */
.flatpickr-calendar select,
.flatpickr-calendar input[type="number"] {
  height: auto !important;
  min-height: auto !important;
  background-image: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 2px !important;
  width: auto !important;
  font-weight: 500 !important;
}
.flatpickr-calendar select:focus,
.flatpickr-calendar input[type="number"]:focus {
  border: none !important;
  box-shadow: none !important;
}

/* Calendar container */
.flatpickr-calendar {
  font-family: var(--font) !important;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 28px rgba(0,0,0,0.12);
  padding: 12px;
  width: 296px;
  background: var(--surface);
}

/* Remove the pointing arrow/nub */
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after { display: none; }

/* Month header */
.flatpickr-months { padding-bottom: 6px; }
.flatpickr-months .flatpickr-month {
  background: transparent;
  color: var(--text-primary);
  fill: var(--text-primary);
  height: 36px;
}
.flatpickr-current-month {
  font-size: 14px;
  font-weight: 500;
  padding-top: 6px;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  fill: var(--text-muted);
  padding-top: 8px;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: var(--primary); }

/* Weekday row */
.flatpickr-weekdays { background: transparent; }
span.flatpickr-weekday {
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Day cells */
.flatpickr-day {
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 400;
  border: 1px solid transparent;
  height: 36px;
  line-height: 36px;
  max-width: 36px;
}
.flatpickr-day:hover:not(.flatpickr-disabled):not(.selected):not(.today) {
  background: var(--primary-light);
  border-color: transparent;
  color: var(--text-primary);
}
.flatpickr-day.selected,
.flatpickr-day.selected:focus,
.flatpickr-day.selected:hover {
  background: var(--primary-container);
  border-color: var(--primary-container);
  color: var(--on-primary);
}
.flatpickr-day.today:not(.selected) {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.flatpickr-day.today:not(.selected):hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--border);
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  color: var(--border);
}

/* Alt input (visible date field) */
.flatpickr-input.flatpickr-alt-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7E6F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 38px;
  cursor: pointer;
}

/* =====================================================
   BACKEND INTEGRATION — añadidos sobre el diseño base
   ===================================================== */

/* ── Notice banner ───────────────────────────────────── */
.notice {
  margin: 0 0 22px;
  padding: 13px 18px;
  border: 1px solid rgba(78, 139, 95, 0.28);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}
.notice.error {
  border-color: rgba(186, 26, 26, 0.34);
  background: var(--error-bg);
  color: var(--error-text);
}

/* ── Logout link (sidebar footer) ────────────────────── */
.sidebar-logout {
  display: inline-flex;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-sidebar);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.sidebar-logout:hover { color: var(--text-sidebar-active); }

/* ── Auth / login screen ─────────────────────────────── */
body.auth-locked .sidebar,
body.auth-locked .app-shell,
body.auth-locked .bottom-nav { display: none; }
body:not(.auth-locked) .auth-screen { display: none; }

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 44px);
  background:
    radial-gradient(1100px 560px at 100% 0%, rgba(78, 139, 95, 0.10), transparent 60%),
    var(--bg);
}
.auth-card {
  width: min(1060px, 100%);
  min-height: min(660px, calc(100vh - 48px));
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(44, 40, 37, 0.14);
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(340px, 0.92fr);
  overflow: hidden;
}

/* Columna izquierda: formularios */
.auth-forms {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px);
}
.auth-brand-sm {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}
.auth-brand-sm .brand-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-form h2 {
  font-size: 24px;
  font-weight: 500;
  margin: 0;
}
.auth-sub {
  margin: -4px 0 8px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}
.auth-form label input {
  min-height: 46px;
}
.btn-google {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.btn-google:hover {
  border-color: rgba(45, 92, 58, 0.42);
  box-shadow: 0 10px 24px rgba(44, 40, 37, 0.08);
  transform: translateY(-1px);
}
.google-mark {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: #4285F4;
  font-weight: 700;
  font-size: 14px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}
.auth-link-inline {
  align-self: flex-end;
  margin-top: -4px;
  padding: 3px 2px;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  border-radius: var(--radius-xs);
  transition: color var(--t);
}
.auth-link-inline::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 1px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.25s ease;
}
.auth-link-inline:hover { color: var(--primary); }
.auth-link-inline:hover::after {
  transform: scaleX(1);
  transform-origin: left center;
}
.auth-link-inline:focus-visible {
  outline: none;
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78,139,95,0.2);
}
@media (prefers-reduced-motion: reduce) {
  .auth-link-inline::after { transition: none; }
}
.auth-switch {
  margin: 8px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.auth-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }
.auth-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--error);
  font-weight: 500;
  font-size: 13px;
}
.auth-message[data-type="info"] { color: var(--text-secondary); }
.auth-message[data-type="success"] { color: var(--success-text); }

.pw-wrapper {
  position: relative;
  display: flex;
}
.pw-wrapper input {
  flex: 1;
  padding-right: 48px !important;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  transition: color var(--t), background var(--t);
  -webkit-tap-highlight-color: transparent;
}
.pw-toggle:hover {
  color: var(--text-secondary);
  background: var(--surface-mid);
}
.pw-toggle:active {
  background: var(--surface-high);
}
.pw-toggle:focus-visible {
  outline: none;
  color: var(--primary-container);
  box-shadow: 0 0 0 3px rgba(78,139,95,0.25);
}
.pw-icon {
  position: absolute;
  width: 20px;
  height: 20px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pw-icon-eye {
  opacity: 1;
  transform: scale(1) rotate(0);
}
.pw-icon-eye-off {
  opacity: 0;
  transform: scale(0.6) rotate(-12deg);
}
.pw-toggle.is-visible .pw-icon-eye {
  opacity: 0;
  transform: scale(0.6) rotate(12deg);
}
.pw-toggle.is-visible .pw-icon-eye-off {
  opacity: 1;
  transform: scale(1) rotate(0);
}
@media (prefers-reduced-motion: reduce) {
  .pw-icon { transition: opacity 0.2s ease; }
  .pw-icon-eye, .pw-icon-eye-off,
  .pw-toggle.is-visible .pw-icon-eye,
  .pw-toggle.is-visible .pw-icon-eye-off { transform: none; }
}

/* Columna derecha: panel de marca */
.auth-promo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 56px);
  color: #fff;
  background:
    radial-gradient(820px 460px at 100% 100%, rgba(123, 191, 142, 0.32), transparent 55%),
    linear-gradient(150deg, var(--primary) 0%, #244c30 58%, #1c3d27 100%);
}
.auth-promo .eyebrow {
  margin-bottom: 8px;
  color: var(--text-sidebar-active);
}
.auth-promo h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.08;
  color: #fff;
}
.auth-promo-text {
  max-width: 440px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.6;
}
.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.auth-highlights span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 860px) {
  .auth-screen { align-items: stretch; padding: 0; }
  .auth-card {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border-radius: 0;
    border: 0;
  }
  .auth-promo { display: none; }
}

/* ── Collapsible "más datos" sections in forms ───────── */
.form-more {
  border: none;
  background: transparent;
  padding: 4px 0;
  color: var(--primary-container);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.form-more:hover { color: var(--primary); }
.form-more-panel { display: grid; gap: 16px; }

/* ── Invoice detail (backend) inside factura expand ──── */
.factura-detail {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.factura-detail .invoice-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
  margin: 0;
}
.factura-detail .invoice-totals div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.factura-detail .invoice-totals dt { color: var(--text-muted); }
.factura-detail .invoice-totals dd { color: var(--text-primary); font-weight: 500; margin: 0; }

.detail-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.issue-blockers {
  background: var(--amber-bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--amber-text);
}
.issue-blockers strong { display: block; margin-bottom: 4px; }
.issue-blockers ul { margin: 0; padding-left: 18px; }

.payment-line,
.event-line,
.integrity-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.payment-line:last-child,
.event-line:last-child,
.integrity-line:last-child { border-bottom: none; }

/* Status pill tones for backend invoice statuses */
.tag-neutral { background: var(--surface-high); color: var(--text-muted); }
.tag-sent    { background: #dbeafe;             color: #1d4ed8; }
.tag-void    { background: var(--surface-high); color: var(--text-muted); text-decoration: line-through; }

/* Ajustes — herramientas extra */
.tools-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.tools-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}
