/* Citas y reservas (plan GC): lo común de las fichas de la agenda —recursos, servicios, horarios, lista de espera, bonos
   y reserva por internet—. Antes cada página llevaba su copia (el CSS aislado no se comparte) y se desviaban. El lenguaje
   es el de las pantallas modernas (copias, marketing): cabecera con icono sobre fondo suave, tarjetas con borde superior
   de color, chips con cifra, vacío con borde discontinuo e icono, y listas con su propio desplazamiento. Prefijo «ma-»:
   solo lo usan estas pantallas. */

.ma-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
    box-sizing: border-box;
}

/* ── Cabecera ─────────────────────────────────────────────────────────── */

.ma-cabecera {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ma-cabecera-icono {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    color: #2563eb;
    font-size: 26px;
}

.ma-titulo {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
}

.ma-lema,
.ma-nota {
    margin: 2px 0 0;
    color: var(--texto-secundario, #6b7280);
    font-size: 0.88rem;
}

/* ── Tarjetas ─────────────────────────────────────────────────────────── */

.ma-tarjeta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--borde, #e5e7eb);
    border-top: 3px solid #2563eb;
    border-radius: 12px;
    background: var(--fondo-tarjeta, #fff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ma-tarjeta--ambar { border-top-color: #f59e0b; }
.ma-tarjeta--verde { border-top-color: #16a34a; }
.ma-tarjeta--violeta { border-top-color: #7c3aed; }

.ma-tarjeta-cabecera {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ma-tarjeta-titulo,
.ma-h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
}

.ma-h2 .material-symbols-rounded {
    color: #2563eb;
    font-size: 20px;
}

.ma-chip-cifra {
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

.ma-chip-nuevo {
    padding: 1px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.74rem;
    font-weight: 600;
}

.ma-grupos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 14px;
    align-items: start;
}

/* ── Alta rápida (una línea: escribir y pulsar Intro) ─────────────────── */

.ma-alta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #f8fbff;
}

.ma-alta-icono {
    color: #2563eb;
    font-size: 24px;
}

.ma-alta-input {
    flex: 1 1 240px;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--borde, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 0.95rem;
}

.ma-alta-input:focus {
    border-color: #2563eb;
    outline: 2px solid #dbeafe;
}

.ma-alta-campo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 600;
}

.ma-alta-campo .ma-input {
    height: 38px;
}

.ma-alta-campo--ancho {
    flex: 1 1 240px;
}

.ma-alta-o {
    margin-left: 8px;
    color: var(--texto-secundario, #6b7280);
    font-size: 0.8rem;
}

/* ── Vacío ────────────────────────────────────────────────────────────── */

.ma-vacio {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: var(--texto-secundario, #6b7280);
}

.ma-vacio > .material-symbols-rounded {
    color: #94a3b8;
    font-size: 30px;
}

.ma-vacio p { margin: 4px 0 0; }

.ma-vacio--fino {
    padding: 10px 12px;
    font-size: 0.86rem;
}

/* ── Listas y tablas (con su propio desplazamiento) ───────────────────── */

.ma-lista {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 420px;
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
}

.ma-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    background: #f8fafc;
}

.ma-item--inactivo { opacity: 0.6; }

.ma-item-icono {
    color: #94a3b8;
    font-size: 20px;
}

.ma-acciones {
    display: inline-flex;
    margin-left: auto;
}

.ma-casilla {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.ma-tabla-wrap {
    max-height: 520px;
    overflow: auto;
}

.ma-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ma-tabla th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 10px;
    border-bottom: 1px solid var(--borde, #e5e7eb);
    background: var(--fondo-tarjeta, #fff);
    color: var(--texto-secundario, #6b7280);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
}

.ma-tabla td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--borde, #e5e7eb);
    vertical-align: middle;
}

.ma-fila-inactiva td { opacity: 0.6; }

.ma-col-casilla {
    width: 70px;
    text-align: center;
}

.ma-col-accion {
    width: 120px;
    text-align: right;
    white-space: nowrap;
}

.ma-col-numero { width: 110px; }

/* ── Campos ───────────────────────────────────────────────────────────── */

.ma-input {
    width: 100%;
    min-width: 80px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--borde, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    box-sizing: border-box;
}

.ma-input:focus {
    border-color: #2563eb;
    outline: 2px solid #dbeafe;
}

.ma-input--nombre {
    flex: 1 1 160px;
    width: auto;
}

.ma-input--corto {
    width: 90px;
    min-width: 0;
}

/* El desplegable toma su aspecto de desplegables.css: aquí solo alto, ancho, borde y radio. */
.ma-select {
    width: 100%;
    min-width: 140px;
    height: 32px;
    border: 1px solid var(--borde, #e5e7eb);
    border-radius: 8px;
}

.ma-select--clase {
    width: auto;
    min-width: 120px;
}

.ma-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ma-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border: 1px solid var(--borde, #e5e7eb);
    border-radius: 999px;
    background: #fff;
    font-size: 0.82rem;
    cursor: pointer;
}

.ma-chip--activo {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

/* ── Botones ──────────────────────────────────────────────────────────── */

.ma-boton {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ma-boton .material-symbols-rounded { font-size: 18px; }
.ma-boton:disabled { opacity: 0.5; cursor: default; }
.ma-boton--primario { border-color: #2563eb; background: #2563eb; color: #fff; }
.ma-boton--secundario { border-color: var(--borde, #e5e7eb); background: #fff; color: inherit; }
.ma-boton--suave { height: 30px; padding: 0 10px; font-size: 0.86rem; }

.ma-boton-icono {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--texto-secundario, #6b7280);
    cursor: pointer;
}

.ma-boton-icono .material-symbols-rounded { font-size: 18px; }
.ma-boton-icono:hover { background: #eff6ff; color: #2563eb; }
.ma-boton-icono--peligro:hover { background: #fef2f2; color: #b91c1c; }

/* ── Pie de guardar ───────────────────────────────────────────────────── */

.ma-pie {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.ma-pie-aviso {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fffbeb;
    color: #b45309;
    font-size: 0.86rem;
}

.ma-pie-aviso .material-symbols-rounded { font-size: 18px; }

/* ── La agenda (GC4): lo que va dentro de Syncfusion ───────────────────
   Aquí y no en AgendaPage.razor.css: el CSS aislado no llega a las plantillas del componente. Todo bajo .ag-cuerpo
   para no tocar otros calendarios de la aplicación. */

.ag-cuerpo .e-schedule {
    border: none;
    font-family: inherit;
}

.ag-cuerpo .e-schedule .e-schedule-toolbar .e-toolbar-items,
.ag-cuerpo .e-schedule .e-schedule-toolbar {
    background: #fff;
}

.ag-cuerpo .e-schedule .e-schedule-toolbar {
    border-bottom: 1px solid #eef2f7;
    box-shadow: none;
}

.ag-cuerpo .e-schedule .e-schedule-toolbar .e-toolbar-item .e-tbar-btn {
    border-radius: 8px;
}

.ag-cuerpo .e-schedule .e-schedule-toolbar .e-toolbar-item.e-active-view .e-tbar-btn,
.ag-cuerpo .e-schedule .e-schedule-toolbar .e-toolbar-item.e-active-view .e-tbar-btn:focus,
.ag-cuerpo .e-schedule .e-schedule-toolbar .e-toolbar-item.e-active-view .e-tbar-btn:active {
    background: #eff6ff;
    box-shadow: none;
}

.ag-cuerpo .e-schedule .e-schedule-toolbar .e-toolbar-item.e-active-view .e-tbar-btn .e-tbar-btn-text {
    color: #2563eb;
    font-weight: 600;
}

.ag-cuerpo .e-schedule .e-schedule-toolbar .e-toolbar-item.e-date-range .e-tbar-btn-text {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 600;
}

/* Cabeceras: blancas, sin rejilla gruesa. */
.ag-cuerpo .e-schedule .e-vertical-view .e-date-header-wrap table th,
.ag-cuerpo .e-schedule .e-vertical-view .e-resource-cells,
.ag-cuerpo .e-schedule .e-vertical-view .e-header-cells,
.ag-cuerpo .e-schedule .e-vertical-view .e-left-indent-wrap table th {
    border-color: #eef2f7;
    background: #fff;
}

.ag-cuerpo .e-schedule .e-vertical-view .e-header-cells .e-header-day {
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.ag-cuerpo .e-schedule .e-vertical-view .e-header-cells .e-header-date {
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 600;
}

.ag-cuerpo .e-schedule .e-vertical-view .e-header-cells.e-current-day .e-header-date,
.ag-cuerpo .e-schedule .e-vertical-view .e-header-cells.e-current-day .e-header-day {
    color: #2563eb;
}

/* Rejilla: horas en gris suave, medias horas casi invisibles. */
.ag-cuerpo .e-schedule .e-vertical-view .e-time-cells-wrap table td,
.ag-cuerpo .e-schedule .e-vertical-view .e-time-slots {
    border-color: #eef2f7;
    background: #fff;
    color: #94a3b8;
    font-size: 0.75rem;
}

.ag-cuerpo .e-schedule .e-vertical-view .e-work-cells {
    border-color: #eef2f7;
    background: #fff;
}

.ag-cuerpo .e-schedule .e-vertical-view .e-work-cells.e-work-hours {
    background: #fff;
}

.ag-cuerpo .e-schedule .e-vertical-view .e-work-cells:not(.e-work-hours) {
    background: #f8fafc;
}

.ag-cuerpo .e-schedule .e-vertical-view .e-work-cells:hover {
    background: #eff6ff;
}

.ag-cuerpo .e-schedule .e-vertical-view .e-current-timeline {
    border-top-color: #ef4444;
}

/* La cabecera de cada columna: avatar del color del profesional o del recurso. */
.ag-titular {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 2px;
}

.ag-titular-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ag-color, #2563eb);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.ag-titular-textos {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.ag-titular-textos strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-titular-textos span {
    color: #64748b;
    font-size: 0.72rem;
}

/* Las citas: esquinas redondas y sombra suave; el color lo pone Syncfusion desde el titular. */
.ag-cuerpo .e-schedule .e-vertical-view .e-appointment {
    border: none;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.ag-evento {
    display: flex;
    flex-direction: column;
    gap: 1px;
    height: 100%;
    padding: 3px 6px;
    overflow: hidden;
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.25;
}

.ag-evento-hora {
    font-weight: 700;
    opacity: 0.9;
}

.ag-evento-texto {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
}

.ag-evento--llegada { box-shadow: inset 4px 0 0 #fbbf24; }
.ag-evento--atendida { opacity: 0.55; }
.ag-evento--nopresentada { opacity: 0.5; text-decoration: line-through; }
.ag-evento--solicitada { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 6px, transparent 6px 12px); font-style: italic; }

/* ── Servicios: una tarjeta por servicio ──────────────────────────────── */

.sv-rejilla {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 14px;
    max-height: 64vh;
    padding: 2px;
    overflow: auto;
}

.sv-tarjeta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--borde, #e5e7eb);
    border-top: 3px solid #7c3aed;
    border-radius: 12px;
    background: var(--fondo-tarjeta, #fff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sv-tarjeta--inactiva {
    border-top-color: #cbd5e1;
    background: #fafafa;
    opacity: 0.75;
}

.sv-cab {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sv-icono {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f5f3ff;
    color: #7c3aed;
    font-size: 21px;
}

.sv-titulo {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.sv-titulo strong {
    overflow: hidden;
    font-size: 1rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sv-sub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--texto-secundario, #6b7280);
    font-size: 0.78rem;
}

.sv-duracion {
    flex: 0 0 auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f5f3ff;
    color: #6d28d9;
    font-size: 0.8rem;
    font-weight: 600;
}

.sv-tiempos {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    background: #f8fafc;
}

.sv-campo {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 600;
}

.sv-campo .ma-input {
    min-width: 0;
}

.sv-bloque {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sv-rotulo {
    color: #475569;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sv-cualquiera {
    padding: 2px 10px;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: 0.82rem;
}

.sv-pie {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

/* ── Horarios ─────────────────────────────────────────────────────────── */

.ma-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ma-dia {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--borde, #e5e7eb);
}

.ma-dia-nombre {
    width: 100px;
    font-weight: 600;
}

.ma-tramo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ma-tramo .ma-input {
    width: 110px;
}

/* La semana tipo, dibujada (GC4): cada día con su barra de 6:00 a 23:00 y los tramos en color; los campos al lado. */

.ho-quien {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ho-pastillas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ho-pastilla {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px 0 10px;
    border: 1px solid var(--borde, #e5e7eb);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
}

.ho-pastilla .material-symbols-rounded {
    color: #94a3b8;
    font-size: 18px;
}

.ho-pastilla:hover { border-color: #bfdbfe; }

.ho-pastilla--activa {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.ho-pastilla--activa .material-symbols-rounded { color: #fff; }

/* Una sola rejilla para toda la semana (cada día con display: contents): así la regla de horas y las barras de todos
   los días tienen exactamente el mismo ancho, tenga cada día uno, dos o ningún tramo. */
.ho-semana {
    display: grid;
    grid-template-columns: 100px minmax(220px, 1fr) auto;
    align-items: center;
    column-gap: 14px;
}

.ho-dia {
    display: contents;
}

.ho-dia > * {
    align-self: stretch;
    display: flex;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid #f1f5f9;
}

.ho-dia--regla > * {
    min-height: 18px;
    border-bottom: none;
}

.ho-dia > .ho-barra,
.ho-dia > .ho-regla {
    display: block;
    align-self: center;
    min-height: 0;
}

.ho-dia > .ho-barra {
    box-shadow: 0 1px 0 #f1f5f9;
}

.ho-dia-nombre { font-weight: 600; }
.ho-dia--cerrado .ho-dia-nombre { color: #94a3b8; }

.ho-regla {
    position: relative;
    height: 16px;
    color: #94a3b8;
    font-size: 0.7rem;
}

.ho-regla span {
    position: absolute;
    transform: translateX(-50%);
}

.ho-barra {
    position: relative;
    height: 22px;
    border-radius: 6px;
    background: repeating-linear-gradient(90deg, #f1f5f9 0, #f1f5f9 calc(100% / 17 - 1px), #e2e8f0 calc(100% / 17 - 1px), #e2e8f0 calc(100% / 17));
}

.ho-bloque {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border-radius: 4px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.ho-cerrado {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #94a3b8;
    font-size: 0.75rem;
}

.ho-tramos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

@media (max-width: 1100px) {
    .ho-semana { grid-template-columns: 90px 1fr; }
    .ho-tramos { grid-column: 1 / -1; justify-content: flex-start; }
    .ho-dia--regla > :last-child { display: none; }
}
