:root {
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface-2: #EEF2F6;
  --ink: #0F1319;
  --muted: #5A6472;
  --border: #DEE3EA;
  --primary: #1FA5D9;
  --primary-dark: #1585B2;
  --primary-soft: #E8F6FC;
  --dark-bar: #0A0A0A;
  --dark-card: #12151B;
  --accent: #0E7490;
  --accent-soft: #E0F2FE;
  --ok: #16794F;
  --ok-soft: #E3F6ED;
  --warn: #B86B14;
  --warn-soft: #FDF2E2;
  --danger: #B42318;
  --danger-soft: #FDECEB;
  --wa: #1FA855;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(10, 12, 16, .05), 0 1px 2px rgba(10, 12, 16, .04);
  --shadow-lg: 0 18px 42px rgba(10, 12, 16, .22);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* Login */
.login-screen {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at top, #1A2332 0%, #0A0A0A 72%);
}
.login-card {
  width: 100%; max-width: 390px; background: #111318;
  padding: 32px 26px; border-radius: 20px; box-shadow: var(--shadow-lg);
  text-align: center; border: 1px solid rgba(31, 165, 217, .35); color: #FFFFFF;
}
.login-logo {
  width: 96px; height: 96px; border-radius: 50%;
  margin: 0 auto 14px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
  border: 2px solid var(--primary);
  background: #0A0A0A;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-brand-lockup { margin-bottom: 10px; }
.login-brand-main {
  font-family: Didot, "Playfair Display", "Bodoni MT", Georgia, serif;
  font-size: 1.75rem; font-weight: 700; letter-spacing: 0.14em; color: #FFFFFF; line-height: 1.05;
}
.login-brand-sub {
  font-family: Didot, "Playfair Display", "Bodoni MT", Georgia, serif;
  font-size: 0.76rem; letter-spacing: 0.32em; color: var(--primary); margin-top: 2px;
}
.login-card .sub { color: #9DA6B4; margin: 0 0 18px; font-size: .92rem; }
.login-card input {
  width: 100%; padding: 14px; font-size: 1.1rem; text-align: center; letter-spacing: 3px;
  border: 1.5px solid #2A303C; border-radius: var(--radius-sm); margin-bottom: 12px;
  background: #0A0A0A; color: #FFFFFF;
}

/* Layout general */
.app { min-height: 100dvh; padding-bottom: 88px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--dark-bar);
  border-bottom: 2px solid var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-logo {
  width: 48px; height: 48px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  border: 1.5px solid var(--primary);
  background: #0A0A0A;
  box-shadow: 0 2px 10px rgba(31, 165, 217, .28);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-lockup { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.brand-title-serif {
  font-family: Didot, "Playfair Display", "Bodoni MT", Georgia, serif;
  font-weight: 700; font-size: 1.12rem; letter-spacing: .12em;
  color: #FFFFFF; text-transform: uppercase;
}
.brand-badge {
  font-size: .66rem; font-weight: 800; letter-spacing: .16em;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(31, 165, 217, .18); color: #38BDF8;
  border: 1px solid rgba(31, 165, 217, .45);
}
.brand-sub { font-size: .78rem; color: #A0AAB8; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.main, .app-main {
  max-width: 1140px; margin: 0 auto; padding: 28px 22px 44px;
}
.view {
  padding-top: 6px;
  scroll-margin-top: 88px;
}
.section-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin: 4px 0 20px; flex-wrap: wrap;
}
.section-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.section-head h2 { margin: 0; font-size: 1.38rem; letter-spacing: -.01em; line-height: 1.2; }
.section-head .sub { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.row-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 600; font-size: .93rem;
  background: var(--surface-2); color: var(--ink);
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: #FFFFFF; box-shadow: 0 2px 8px rgba(31, 165, 217, .28); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary-top {
  background: #181C24; color: #E2E8F0; border-color: #2D3545;
}
.btn.secondary-top:hover { background: #232936; border-color: var(--primary); color: #FFFFFF; }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: #F6C8C5; }
.btn.wa { background: var(--wa); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: .84rem; border-radius: 8px; }
.btn.full { width: 100%; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  display: inline-grid; place-items: center; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }

.select, input[type="text"], input[type="tel"], input[type="search"], input[type="date"],
input[type="time"], input[type="number"], input[type="password"], select, textarea {
  padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  font-size: .95rem; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 165, 217, .16);
}
.select.sm { padding: 7px 10px; font-size: .88rem; width: auto; }
.input-date { width: auto; padding: 7px 11px; font-size: .9rem; }

/* Stage pill */
.stage-pill {
  display: inline-flex; align-items: center; padding: 5px 11px;
  border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: #0A0A0A; color: #38BDF8; letter-spacing: .03em;
  border: 1px solid rgba(31, 165, 217, .45);
}

/* Tarjetas */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card .sub { margin: -2px 0 12px; color: var(--muted); font-size: .86rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* KPIs / Stats Grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.stat-card.highlight {
  background: linear-gradient(135deg, #0A0A0A 0%, #141B26 100%);
  color: #FFFFFF; border-color: var(--primary);
}
.stat-card.highlight .stat-label { color: #38BDF8; }
.stat-card.highlight .stat-sub { color: #B0BAC9; }
.stat-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.stat-val { font-size: 1.48rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.stat-sub { font-size: .8rem; color: var(--muted); }

/* Calendario */
.cal-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-title { margin: 0 6px; font-size: 1.2rem; text-transform: capitalize; min-width: 165px; text-align: center; }

.cal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: #0A0A0A; border-bottom: 1px solid #1E2430;
  font-size: .76rem; font-weight: 700; color: #CBD5E1;
  text-transform: uppercase; letter-spacing: .06em; text-align: center; padding: 9px 0;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 92px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 6px; display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); cursor: pointer; position: relative;
  transition: background .12s ease; overflow: hidden; min-width: 0;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--primary-soft); }
.cal-cell.other { background: #F8F9FB; color: #A8B0BC; }
.cal-cell.closed { background: #F1F3F7; color: #949EAA; }
.cal-cell.blocked {
  background: repeating-linear-gradient(135deg, #FCEEEE, #FCEEEE 8px, #F9E2E2 8px, #F9E2E2 16px);
}
.cal-cell.today .day-num {
  background: var(--primary); color: #fff; border-radius: 999px;
  width: 26px; height: 26px; display: inline-grid; place-items: center;
}
.day-head { display: flex; align-items: center; justify-content: space-between; font-size: .84rem; font-weight: 700; }
.day-free { font-size: .68rem; color: var(--ok); font-weight: 600; }
.day-closed-tag { font-size: .67rem; color: var(--muted); }
.day-pills { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.pill {
  font-size: .72rem; padding: 2px 6px; border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 600; line-height: 1.3; border-left: 3px solid var(--primary);
  background: var(--primary-soft); color: #0B4F6C;
}
.pill.st-pendiente { background: var(--warn-soft); color: var(--warn); border-left-color: var(--warn); }
.pill.st-realizado { background: var(--ok-soft); color: var(--ok); border-left-color: var(--ok); }
.pill-more { font-size: .7rem; color: var(--muted); font-weight: 600; padding-left: 4px; }

.legend {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 4px 16px;
  font-size: .8rem; color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.st-confirmado { background: var(--primary); }
.dot.st-pendiente { background: var(--warn); }
.dot.st-realizado { background: var(--ok); }
.dot.st-blocked { background: #E3A0A8; }

/* Lista de turnos */
.appt-list { display: flex; flex-direction: column; gap: 10px; }
.appt-item {
  display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; transition: border-color .12s, transform .06s;
}
.appt-item:hover { border-color: var(--primary); }
.appt-time {
  text-align: center; padding: 6px 8px; border-radius: 10px;
  background: #0A0A0A; color: #38BDF8; font-weight: 800; font-size: .95rem; line-height: 1.15;
  border: 1px solid rgba(31, 165, 217, .35);
}
.appt-time small { display: block; font-size: .7rem; font-weight: 600; color: #CBD5E1; margin-top: 2px; }
.appt-main { min-width: 0; }
.appt-client { font-weight: 700; font-size: .98rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.appt-meta { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.appt-actions { display: flex; align-items: center; gap: 6px; }

.badge {
  display: inline-block; font-size: .71rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
}
.badge.confirmado { background: var(--primary-soft); color: var(--primary-dark); }
.badge.pendiente { background: var(--warn-soft); color: var(--warn); }
.badge.realizado { background: var(--ok-soft); color: var(--ok); }
.badge.cancelado { background: #EEE; color: #777; text-decoration: line-through; }
.badge.low-stock { background: var(--danger-soft); color: var(--danger); }
.badge.ok-stock { background: var(--ok-soft); color: var(--ok); }

/* Tarjetas de Profesionales */
.pro-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px;
}
.pro-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.pro-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pro-avatar-row { display: flex; align-items: center; gap: 12px; }
.pro-color-badge {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 1.05rem; flex-shrink: 0;
}
.pro-name { font-weight: 800; font-size: 1.08rem; margin: 0; }
.pro-role { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.pro-Cut-box {
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center;
}
.pro-metric-lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.pro-metric-val { font-size: 1.05rem; font-weight: 800; margin-top: 2px; }
.pro-metric-val.pro-share { color: var(--primary-dark); }
.pro-metric-val.shop-share { color: var(--ok); }
.pro-stats-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border); font-size: .83rem; color: var(--muted);
}

/* Tablas (Productos y Caja Diaria) */
.table-wrap { overflow-x: auto; margin-top: 12px; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: .87rem;
}
.data-table th {
  text-align: left; padding: 9px 8px; background: var(--surface-2);
  color: var(--muted); font-size: .71rem; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td {
  padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle;
  white-space: nowrap;
}
.data-table td:first-child {
  white-space: normal; min-width: 145px;
}
.data-table td .row-actions {
  display: inline-flex; gap: 6px; align-items: center; flex-wrap: nowrap; white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #F8FAFC; }
.num-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.profit-pill {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: .82rem;
  white-space: nowrap;
}
.stock-Quick {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--surface-2); padding: 3px 5px; border-radius: 8px;
  border: 1px solid var(--border);
}
.stock-step-btn {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 800; font-size: .95rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink); padding: 0; flex-shrink: 0;
}
.stock-step-btn:hover {
  border-color: var(--primary); color: var(--primary); background: var(--primary-soft);
}
.stock-pill {
  min-width: 48px; text-align: center; font-weight: 700; font-size: .84rem;
  padding: 2px 6px; border-radius: 6px; white-space: nowrap; display: inline-block;
}
.stock-pill.ok {
  background: var(--ok-soft); color: var(--ok);
}
.stock-pill.low {
  background: var(--warn-soft); color: var(--warn);
}
.stock-pill.out {
  background: var(--danger-soft); color: var(--danger);
}

/* Caja Diaria layout */
.cashbox-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cash-two-col {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin-bottom: 16px;
}

/* Clientes */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px; margin-bottom: 14px;
}
.search-bar input { border: none; padding: 11px 4px; background: transparent; }
.search-bar input:focus { box-shadow: none; }
.clients-list { display: flex; flex-direction: column; gap: 10px; }
.client-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.client-num {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: #0A0A0A; color: #38BDF8; font-weight: 800; font-size: .8rem; margin-right: 6px;
}

/* Formularios y Ajustes */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid label, .block-lbl { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.full-col { grid-column: 1 / -1; }
.block-lbl { margin: 12px 0; }
.hint { font-weight: 400; font-size: .78rem; color: var(--muted); }
.hint code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.comm-preview-bar {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--primary-soft); border: 1px solid rgba(31, 165, 217, .35);
  font-size: .86rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  margin-bottom: 12px; color: var(--ink);
}

.items-editor { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.item-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr auto; gap: 8px; align-items: center; }
.item-row.payplace { grid-template-columns: 1fr auto; }

.schedule-editor { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 14px; }
.sched-row {
  display: grid; grid-template-columns: 120px 1fr 1fr 110px; gap: 8px; align-items: center;
  padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm);
}
.sched-row.off { opacity: .55; }
.sched-day { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.sched-day input { width: 18px; height: 18px; accent-color: var(--primary); }

.block-add-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 8px; margin-bottom: 12px; }
.chips-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 11px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; font-size: .84rem;
}
.chip button { border: none; background: none; color: var(--danger); font-weight: 700; padding: 0 2px; }

/* Selector de cliente y multiprestación en modal turno */
.client-picker {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; margin-bottom: 12px;
}
.client-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lbl { font-size: .86rem; font-weight: 700; color: var(--ink); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg-btn { border: none; background: transparent; padding: 5px 10px; font-size: .8rem; font-weight: 600; border-radius: 6px; color: var(--muted); }
.seg-btn.active { background: var(--primary); color: #fff; }
.cp-selected {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); padding: 9px 12px; border-radius: 8px; border: 1px solid var(--primary);
}
.cp-results {
  max-height: 170px; overflow-y: auto; margin-top: 6px;
  background: var(--surface); border-radius: 8px; border: 1px solid var(--border);
}
.cp-item {
  padding: 8px 11px; border-bottom: 1px solid var(--border); cursor: pointer;
  display: flex; justify-content: space-between; font-size: .88rem;
}
.cp-item:hover { background: var(--primary-soft); }

.svc-box, .pay-box, .repeat-box {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; margin-bottom: 12px;
}
.svc-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.svc-row { display: grid; grid-template-columns: 1.6fr 1fr auto; gap: 8px; align-items: center; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.input-with-btn { display: flex; gap: 6px; }
.balance-bar {
  display: flex; justify-content: space-between; padding-top: 8px;
  border-top: 1px dashed var(--border); font-size: .86rem; font-weight: 700;
}
.repeat-title { font-size: .84rem; font-weight: 700; margin-bottom: 8px; }
.time-row { display: flex; gap: 6px; }

/* Tabbar inferior */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  height: 68px; background: #0A0A0A; border-top: 1px solid #1E2430;
  display: grid; grid-template-columns: repeat(6, 1fr);
  max-width: 100%; padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  border: none; background: none; color: #8A94A4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: .72rem; font-weight: 600; position: relative;
}
.tab.active { color: var(--primary); font-weight: 700; }
.tab.active::before {
  content: ""; position: absolute; top: 0; width: 38px; height: 3px;
  background: var(--primary); border-radius: 0 0 4px 4px;
}

/* Modales */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: end center;
}
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 16, .6); backdrop-filter: blur(2px); }
.modal-sheet {
  position: relative; z-index: 1; width: 100%; max-width: 620px;
  max-height: 92dvh; background: var(--surface);
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
@media (min-width: 640px) {
  .modal { place-items: center; padding: 20px; }
  .modal-sheet { border-radius: 18px; max-height: 88dvh; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1.12rem; }
.modal-eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-dark); font-weight: 700; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.spacer { flex: 1; }
.day-modal-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.slot-chip {
  padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); font-size: .83rem; font-weight: 600;
}
.slot-chip:hover { border-color: var(--primary); background: var(--primary-soft); }

.err {
  background: var(--danger-soft); color: var(--danger);
  padding: 10px 12px; border-radius: 8px; font-size: .88rem; font-weight: 600; margin: 8px 0 0;
}
.empty {
  text-align: center; padding: 24px 14px; color: var(--muted); font-size: .9rem;
}

.toast {
  position: fixed; bottom: 82px; left: 50%; transform: translateX(-50%);
  background: #0A0A0A; color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: .88rem; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 80; border: 1px solid var(--primary);
}

@media (max-width: 820px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cash-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .form-grid, .form-grid.three, .pay-grid { grid-template-columns: 1fr; }
  .cal-cell { min-height: 74px; padding: 4px; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .sched-row { grid-template-columns: 1fr 1fr; }
  .block-add-row { grid-template-columns: 1fr; }
  .secondary-top span { display: none; }
}

/* Login limpio (Usuario y Contraseña) */
.login-card { max-width: 400px; }
.login-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.login-fields input {
  width: 100%; padding: 13px 14px; font-size: 1rem; text-align: left; letter-spacing: normal;
  border: 1.5px solid #2A303C; border-radius: var(--radius-sm); margin-bottom: 0;
  background: #0A0A0A; color: #FFFFFF;
}
.login-fields input::placeholder { color: #7C8798; }

/* Clases de tarjetas de Profesionales, Clientes y Formularios */
.pro-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pro-avatar {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: #FFFFFF; font-weight: 800; font-size: 1.08rem; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.pro-comm-badge {
  font-size: .76rem; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
  border: 1px solid rgba(31, 165, 217, .35); white-space: nowrap;
}
.pro-metrics {
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center;
  border: 1px solid var(--border);
}
.pro-metric-box { display: flex; flex-direction: column; gap: 3px; }
.pm-lbl { font-size: .71rem; color: var(--muted); text-transform: uppercase; font-weight: 700; letter-spacing: .03em; }
.pm-val { font-size: 1.04rem; font-weight: 800; color: var(--ink); }
.pro-take .pm-val { color: var(--primary-dark); }
.salon-take .pm-val { color: var(--ok); }
.pro-stats-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted);
  flex-wrap: wrap;
}

.client-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; width: 100%;
}
.client-name { font-weight: 800; font-size: 1.02rem; color: var(--ink); }
.client-phone { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.client-notes {
  font-size: .84rem; color: var(--ink); background: var(--surface-2);
  padding: 6px 10px; border-radius: 8px; width: 100%;
}
.client-actions {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.comm-pro { color: var(--primary-dark); }
.comm-salon { color: var(--ok); }
.balance-bar.ok { color: var(--ok); }
.balance-bar.pending { color: var(--warn); }
.item-row.two { grid-template-columns: 1fr auto; }
.cp-empty { padding: 10px 12px; font-size: .85rem; color: var(--muted); text-align: center; }

.user-role-badge {
  font-size: .7rem; font-weight: 800; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 999px;
  background: #182232; color: #E2E8F0; border: 1px solid #334155;
}
.user-role-badge.is-pro {
  background: rgba(22, 121, 79, .25); color: #6EE7B7; border-color: rgba(110, 231, 183, .4);
}
.user-role-badge.is-admin {
  background: rgba(31, 165, 217, .22); color: #38BDF8; border-color: rgba(56, 189, 248, .45);
}

.tabbar {
  display: flex; align-items: stretch; justify-content: space-around;
}
.tabbar .tab {
  flex: 1; min-width: 0;
}

.pro-cred-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 8px; background: #0A0A0A; color: #E2E8F0;
  font-size: .8rem; border: 1px solid #262E3D;
}
.pro-cred-bar code {
  color: #38BDF8; font-weight: 700; background: rgba(31, 165, 217, .14);
  padding: 2px 6px; border-radius: 4px;
}
