/* Estilos compartidos de login, administración y panel de cliente.
   Usa la misma paleta y tipografía que el sitio público. */

:root {
    --blue: #5264ff;
    --blue-strong: #4356ee;
    --lime: #d8ef00;
    --lime-edge: #cde80b;
    --sand: #f4f2ef;
    --ink: #111111;
    --muted: #6b645e;
    --line: #e7e3de;
    --danger: #b3261e;
    --success: #2d6a35;
    --radius-lg: 24px;
    --radius-md: 13px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: "Inter", Arial, sans-serif;
    color: var(--ink);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

/* Sin esto, clases con display (p. ej. .button) anulan el atributo hidden. */
[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

.logo {
    color: var(--blue);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -2px;
    text-decoration: none;
}


/* =========================================================
   FORMULARIOS
========================================================= */

.form {
    display: grid;
    gap: 20px;
}

.field {
    display: grid;
    gap: 8px;
}

.field label {
    font-size: 14px;
    font-weight: 600;
}

.field input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
    font-size: 16px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.field input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(82, 100, 255, .18);
}

.field-hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 92px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 22px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--blue);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease;
}

.button:hover {
    background: var(--blue-strong);
}

a.button {
    text-decoration: none;
}

.button:disabled {
    opacity: .6;
    cursor: progress;
}

.button-quiet {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    font-size: 14px;
}

.button-quiet:hover {
    background: var(--sand);
}

/* Obligatorios y errores por campo (showError en api.js) */

.field:has(:required) > .field-label::after,
.field:has(:required) > label::after {
    content: " *";
    color: var(--danger);
}

.login-form .field > label::after,
.field-optional > .field-label::after {
    content: none;
}

.form-legend {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13px;
}

[aria-invalid="true"],
.field [aria-invalid="true"] {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(179, 38, 30, .14) !important;
}

.field-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.button-small {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 13px;
}

.form-message {
    min-height: 20px;
    font-size: 14px;
    line-height: 1.4;
}

.form-message.error {
    color: var(--danger);
}

.form-message.success {
    color: var(--success);
}


/* =========================================================
   LOGIN
========================================================= */

.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
}

.login-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    padding: 44px 6vw 56px;
    background: linear-gradient(135deg, #5364ff, #4e60f6);
    color: #ffffff;
}

.login-brand::before {
    content: "";
    position: absolute;
    top: -260px;
    right: -200px;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .17), rgba(255, 255, 255, 0) 70%);
}

.login-brand .logo {
    position: relative;
    color: #ffffff;
    font-size: 39px;
    letter-spacing: -2.4px;
}

.login-brand-copy {
    position: relative;
    max-width: 580px;
}

.login-brand h1 {
    font-size: clamp(40px, 4vw, 64px);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -3px;
}

.login-brand p {
    max-width: 480px;
    margin-top: 24px;
    color: rgba(255, 255, 255, .88);
    font-size: 19px;
    line-height: 1.5;
}

.login-stamp {
    position: absolute;
    top: 22%;
    right: 12%;
    width: 170px;
    height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 8px solid var(--lime-edge);
    border-radius: 50%;
    background: var(--lime);
    color: var(--blue);
    text-align: center;
    transform: rotate(-8deg);
}

.login-stamp::after {
    content: "";
    position: absolute;
    inset: 11px;
    border: 1.5px dashed currentColor;
    border-radius: 50%;
    opacity: .65;
}

.login-stamp span {
    font-size: 10px;
    font-weight: 700;
}

.login-stamp strong {
    margin-top: 4px;
    font-size: 24px;
    letter-spacing: -.6px;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.login-form {
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -1.4px;
}

.login-form .lead {
    margin-top: -8px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}

.login-form .button {
    width: 100%;
    margin-top: 4px;
}

.login-back {
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.login-back a {
    color: var(--blue);
    font-weight: 600;
}


/* =========================================================
   APLICACIÓN (ADMIN Y PANEL)
========================================================= */

body[data-auth="pending"] .app-main {
    visibility: hidden;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 76px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 4vw;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.topbar-section {
    padding-left: 20px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.topbar-link {
    color: var(--blue);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.topbar-link:hover {
    text-decoration: underline;
}

.topbar-user {
    margin-left: auto;
    color: var(--muted);
    font-size: 14px;
}

.app-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 4vw 80px;
}

.page-heading h1 {
    font-size: clamp(34px, 3.2vw, 48px);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -2px;
}

.page-heading p {
    margin-top: 10px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.5;
}

.card {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--sand);
}

.card-outlined {
    border: 1px solid var(--line);
    background: #ffffff;
}

.card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.4px;
}

.card-count {
    color: var(--muted);
    font-size: 14px;
}


/* Aviso de versión nueva (api.js) */

.update-banner {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 300;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 16px 14px 20px;
    border-radius: 16px;
    background: var(--ink);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 16px 40px rgba(17, 17, 17, .3);
}

.update-banner .button {
    min-height: 42px;
    background: var(--lime);
    color: var(--ink);
}

/* Ventanas (<dialog>) del panel y de administración */

.dialog {
    display: flex;
    flex-direction: column;
    width: min(460px, calc(100vw - 32px));
    max-height: 88vh;
    margin: auto;
    padding: 26px;
    border: 0;
    border-radius: 22px;
    color: var(--ink);
}

.dialog .form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dialog-body {
    display: grid;
    gap: 16px;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 4px;
}

.dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.dialog-close {
    flex: none;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
    background: var(--sand);
    color: var(--ink);
    font-size: 17px;
}

.dialog-close:hover {
    background: var(--line);
}

.dialog-wide {
    width: min(720px, calc(100vw - 32px));
}

.dialog::backdrop {
    background: rgba(17, 17, 17, .45);
}

.dialog h2 {
    font-size: 21px;
    letter-spacing: -.4px;
}

.dialog-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.form > .link-button {
    justify-self: start;
}

.reset-result {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--sand);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 18px;
    letter-spacing: .04em;
    word-break: break-all;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
}



/* =========================================================
   ADMINISTRACIÓN
========================================================= */

.admin-layout {
    display: grid;
    grid-template-columns: minmax(300px, 390px) 1fr;
    gap: 28px;
    align-items: start;
    margin-top: 36px;
}

.admin-section {
    margin-top: 72px;
    padding-top: 48px;
    border-top: 1px solid var(--line);
    /* Al llegar por su enlace (#opiniones), la barra de arriba no tapa el título. */
    scroll-margin-top: 40px;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    padding: 0 14px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.client-name {
    display: block;
    font-weight: 600;
}

.client-username {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.empty-state {
    padding: 44px 16px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}


/* Administración · Pagos en línea */

.with-month {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
}

.with-month > div {
    max-width: 720px;
}

.month-picker {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.month-picker input,
.owner-select {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    font: inherit;
    font-size: 15px;
}

.pay-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0 20px;
}

.pay-stat {
    display: grid;
    gap: 6px;
    padding: 20px;
    border-radius: 18px;
    background: var(--sand);
}

.pay-stat span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.pay-stat strong {
    font-size: 26px;
    letter-spacing: -.6px;
}

.pay-stat.is-alert {
    background: #fff4c2;
}

.card + .card {
    margin-top: 20px;
}

.data-table .numeric {
    text-align: right;
    white-space: nowrap;
}

.badge.badge-good {
    background: #e5f4e8;
    color: #1d6b34;
}

.badge.badge-bad {
    background: #fbe9e7;
    color: var(--danger);
}

.referral-code {
    display: block;
    font-size: 15px;
    letter-spacing: 1px;
}

.referral-cell .row-actions {
    flex-wrap: nowrap;
    margin-left: -8px;
}

.referral-cell .link-button {
    white-space: nowrap;
}

/* Cuestionario del cliente visto por el equipo (questionnaire-view.js) */

.qa {
    display: grid;
    gap: 18px;
}

.qa h3 {
    margin-bottom: 8px;
    font-size: 15px;
}

.qa-list {
    display: grid;
    gap: 12px;
    list-style: none;
}

.qa-item p {
    margin-top: 4px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.qa-empty {
    color: var(--muted);
    font-style: italic;
}

.research-packet {
    max-height: 360px;
    overflow: auto;
    padding: 12px;
    border-radius: 12px;
    background: var(--sand);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.signup-about summary {
    color: var(--blue-strong);
    font-weight: 600;
    cursor: pointer;
}

.signup-about p {
    max-width: 360px;
    margin-top: 6px;
    line-height: 1.45;
    white-space: pre-line;
}


/* =========================================================
   PANEL DEL CLIENTE
========================================================= */

.panel-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: calc(100vh - 76px);
}

.panel-nav {
    padding: 32px 16px;
    border-right: 1px solid var(--line);
}

.panel-nav > ul {
    position: sticky;
    top: 108px;
    display: grid;
    gap: 22px;
    list-style: none;
    /* Con muchas secciones la lista no cabe en la pantalla; se desplaza sola en lugar de
       obligar a bajar toda la página para alcanzar las últimas. */
    max-height: calc(100vh - 124px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.panel-nav ul ul {
    display: grid;
    gap: 2px;
    margin-top: 6px;
    list-style: none;
}

.nav-section-label {
    padding: 0 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.panel-nav a {
    display: block;
    padding: 11px 14px;
    border-radius: 11px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.panel-nav a:hover {
    background: var(--sand);
}

.panel-nav a[aria-current="page"] {
    background: var(--blue);
    color: #ffffff;
}

.panel-main {
    width: 100%;
    margin: 0;
}

.panel-main:focus {
    outline: none;
}

.panel-main .admin-layout,
.single-layout {
    margin-top: 32px;
}

/* Cumpleaños: día, mes y año en una fila que se parte sola en celulares angostos. */
.birthday-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 8px;
}

.birthday-field select,
.birthday-field input {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #ffffff;
    font: inherit;
}

.birthday-field input {
    text-align: center;
}

.birthday-field input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(82, 100, 255, .18);
}

.search {
    width: 100%;
    height: 44px;
    margin-bottom: 12px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: 15px;
}

.data-table td.numeric,
.data-table th:last-child {
    text-align: right;
    white-space: nowrap;
}

.data-table tr.is-inactive td {
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef0ff;
    color: var(--blue-strong);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-muted {
    background: var(--sand);
    color: var(--muted);
}

.cell-sub {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.link-button {
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--blue);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.link-button:hover {
    background: #eef0ff;
}

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

.field select {
    width: 100%;
    height: 52px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
    font-size: 16px;
}

.field-label {
    font-size: 14px;
    font-weight: 600;
}

.field-checkbox,
.choice {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    cursor: pointer;
}

.field-checkbox input,
.choice input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.choices,
.list-field,
.sizes,
.settings-group {
    display: grid;
    align-content: start;
    gap: 10px;
    border: 0;
}

.choices legend,
.list-field legend,
.sizes legend,
.settings-group legend {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.settings-group legend {
    font-size: 18px;
    letter-spacing: -.3px;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.settings-lists {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    align-items: start;
    gap: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.list-editor {
    display: grid;
    gap: 8px;
    list-style: none;
}

.list-editor li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* Un fieldset no se encoge por defecto (min-width: min-content) y desborda en celular. */
fieldset {
    min-width: 0;
}

.list-editor input {
    flex: 1 1 160px;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    font-size: 15px;
}

.list-field .button-quiet {
    justify-self: start;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {

    .admin-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .panel-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    .panel-nav {
        padding: 10px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        overflow-x: auto;
    }

    .panel-nav > ul {
        position: static;
        display: flex;
        gap: 4px;
    }

    .panel-nav ul ul {
        display: flex;
        margin-top: 0;
    }

    .nav-section-label {
        display: none;
    }

    .panel-nav a {
        white-space: nowrap;
    }

}

@media (max-width: 900px) {

    .login {
        grid-template-columns: minmax(0, 1fr);
    }

    .login-brand {
        gap: 28px;
        padding: 28px 22px 40px;
    }

    .login-brand h1 {
        font-size: 34px;
        letter-spacing: -1.6px;
    }

    .login-brand p {
        font-size: 16px;
    }

    .login-stamp {
        display: none;
    }

}

@media (max-width: 600px) {

    .dialog {
        width: 100%;
        max-width: none;
        max-height: 100%;
        height: 100%;
        margin: 0;
        padding: 18px 16px;
        border-radius: 0;
    }

    .dialog-actions {
        gap: 8px;
    }

    /* Cerrar ya está en la ✕ de arriba: abajo solo queda la acción principal. */
    .dialog-actions .button-quiet {
        display: none;
    }

    .dialog-actions .button[type="submit"] {
        width: 100%;
        min-height: 54px;
        font-size: 16px;
    }

    .pay-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .topbar {
        gap: 12px;
        padding: 0 18px;
    }

    .topbar-section,
    .topbar-user {
        display: none;
    }

    .topbar .button-quiet {
        margin-left: auto;
    }

    .app-main {
        padding: 32px 18px 60px;
    }

    .card {
        padding: 22px 18px;
    }

}

@media (prefers-reduced-motion: reduce) {

    * {
        transition: none !important;
    }

}


/* Campos de formulario compartidos (app/fields.js): comercial y clínica */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.form-grid .field:has(textarea) {
    grid-column: 1 / -1;
}

.field input[type="datetime-local"],
.field input[type="url"],
.field input[type="number"],
.field input[type="time"],
.field input[type="date"] {
    width: 100%;
    font: inherit;
}

/* Igual que los campos de una línea (.field input): sin esto, una página que solo carga
   app.css (el formulario previo del paciente) dejaba el cuadro con el estilo del navegador. */
.field textarea {
    width: 100%;
    min-height: 84px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    line-height: 1.45;
    resize: vertical;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.field textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(82, 100, 255, .18);
}

/* Opciones de un toque en vez de listas desplegables */

.choice-chips {
    margin: 0;
}

.form-grid .field:has(.choice-chips) {
    grid-column: 1 / -1;
}

.choice-chips .chip {
    min-height: 36px;
    padding: 0 14px;
}

.badge.badge-warn {
    background: #fff4e0;
    color: #8a5300;
}

@media (max-width: 600px) {

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

}

/* Dos columnas de tarjetas (comercial y clínica) */

.two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
}

@media (max-width: 1000px) {

    .two-columns {
        grid-template-columns: minmax(0, 1fr);
    }

}

/* El selector de la barra: director en comercial, consultorio en la clínica */

.director-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.director-picker select {
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
}

.director-picker[hidden] + .topbar-link[hidden] + .topbar-user,
.director-picker[hidden] + .topbar-user {
    margin-left: auto;
}

@media (max-width: 700px) {

    .director-picker span {
        display: none;
    }

}

/* /admin › Clientes: Entrar · Exportar · Restablecer contraseña (admin.js). */
.client-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

/* Exportar un negocio: Desde y Hasta uno junto al otro; en el celular, uno debajo del otro. */
.date-range {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

/* /admin › Opiniones (admin-feedback.js): lo que mandan los negocios desde su «!». Las que
   faltan por leer llevan la orilla azul y su número sale en rojo junto a «Opiniones». */
.feedback-unread {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.feedback-unread[hidden] {
    display: none;
}

.feedback-list {
    display: grid;
    gap: 12px;
}

.feedback-item {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
}

.feedback-item.unread {
    border-color: var(--blue);
    box-shadow: inset 4px 0 0 var(--blue);
}

.feedback-head,
.feedback-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.feedback-foot {
    justify-content: space-between;
}

.feedback-stars {
    color: #c99a00;
    letter-spacing: 1px;
}

.feedback-text {
    font-size: 15px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* El administrador de SǝIE dentro de un negocio (acting-banner.js): siempre a la vista,
   arriba de todo, para que no se olvide en qué negocio está ni cómo regresar. */
.acting-banner {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 16px;
    padding: 10px 16px;
    background: var(--ink, #111111);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.acting-back {
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: #d8ef00;
    color: #111111;
    font: inherit;
    cursor: pointer;
}

/* /admin › Pagos: accesos de quien pagó (admin-access.js). Usuario y contraseña en letra
   de ancho fijo, para que se lean y copien sin confundir l con 1 ni O con 0. */
.access-secret {
    font-family: ui-monospace, Consolas, monospace;
    user-select: all;
}

.access-link {
    word-break: break-all;
}

.access-users {
    margin: 6px 0 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
}

.access-dialog {
    width: min(720px, calc(100vw - 32px));
}

/* Alta de cada doctor de un consultorio (admin-onboarding.js). */
.onboarding-links {
    margin-top: 10px;
}

.onboarding-list {
    display: grid;
    gap: 8px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.onboarding-doctor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 14px;
}

.onboarding-actions {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    flex-basis: 100%;
}

.onboarding-actions .link-button {
    text-decoration: none;
}
