:root {
    color-scheme: light;

    --bg: #f7f2ec;
    --surface: #ffffff;
    --ink: #241f1a;
    --muted: #726a62;
    --faint: #a89b8d;
    --dim: #c7bbae;

    --accent: #e6572a;
    --accent-dark: #c8481f;
    --accent-deep: #9c3617;
    --tint: #f7ddd1;
    --tint-ink: #7a2f16;

    --border: #e6ddd2;
    --line: #f0e9e0;
    --neutral: #ece6de;
    --neutral-ink: #4a433c;
    --row-hover: #faf6f1;

    --radius-control: 9px;
    --radius-card: 14px;
    --shadow-card: 0 1px 2px rgba(36, 31, 26, .08);
    --shadow-raised: 0 6px 16px rgba(36, 31, 26, .10);

    --font-body: 'Inter', system-ui, sans-serif;
    --font-display: 'Poppins', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
}

a { color: var(--accent-dark); }
a:hover { color: var(--accent-deep); }
::selection { background: var(--tint); }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Shell */

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

.sidebar {
    border-right: 1.5px solid var(--border);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 6px;
    text-decoration: none;
    color: inherit;
}

.brand__mark {
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
}

.brand__text { display: flex; flex-direction: column; min-width: 0; }

.brand__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand__role {
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
}

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 11px;
    border-radius: var(--radius-control);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14.5px;
    color: var(--ink);
    text-decoration: none;
}

.nav__item:hover { background: var(--row-hover); color: var(--ink); }

.nav__item.is-active {
    background: var(--tint);
    color: var(--tint-ink);
}

.nav__badge {
    font-size: 10px;
    font-weight: 500;
    color: var(--faint);
}

.nav__item.is-active .nav__badge { color: var(--tint-ink); }

.nav__badge--alert { color: var(--accent); font-weight: 600; }

.badge--alert { background: var(--accent); color: #fff; }

.sidebar__footer {
    margin-top: auto;
    border-top: 1.5px solid var(--border);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar__user {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
}

.sidebar__role { font-size: 11px; color: var(--faint); line-height: 1.5; }

.content { min-width: 0; padding: 26px 30px 56px; }

/* Encabezados de página */

.page-head {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.page-head h1 { margin: 0; font-size: 32px; }

.page-head__meta {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 600;
    padding-bottom: 7px;
}

.page-intro {
    font-size: 13.5px;
    color: var(--muted);
    margin: 0 0 24px;
    max-width: 70ch;
    line-height: 1.55;
}

.eyebrow {
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-dark);
    font-weight: 600;
}

.back-link {
    display: inline-block;
    margin-top: 22px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}

/* Botones */

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    border: 0;
    border-radius: var(--radius-control);
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.button:hover { background: var(--accent-dark); color: #fff; }

.button--ghost,
.button--danger {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--ink);
}

.button--ghost:hover { background: var(--surface); border-color: var(--accent); color: var(--ink); }
.button--danger:hover { background: var(--surface); border-color: var(--accent-dark); color: var(--accent-dark); }

.link-action {
    border: 0;
    background: none;
    padding: 0;
    color: var(--accent-dark);
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.link-action:hover { color: var(--accent-deep); }

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.toolbar__spacer { margin-left: auto; }

/* Tarjetas */

.card {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 18px;
    box-shadow: var(--shadow-card);
}

.card--outline {
    background: transparent;
    border: 1.5px solid var(--border);
    box-shadow: none;
}

.card h3, .card h4 { margin: 5px 0 12px; font-size: 18px; }

.card__number {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
    color: var(--accent-dark);
}

.card__note { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.layout-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.stack { display: flex; flex-direction: column; gap: 16px; }

/* Tablas */

.table-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

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

th {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1.5px solid var(--line);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 600;
}

td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    vertical-align: middle;
}

tbody tr:hover { background: var(--row-hover); }

td:first-child {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14.5px;
    color: var(--ink);
}

.cell-actions {
    text-align: right;
    white-space: nowrap;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.cell-empty { color: var(--faint); font-size: 13px; }

/* Etiquetas */

.badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 100px;
    background: var(--neutral);
    color: var(--neutral-ink);
}

.badge--accent { background: var(--tint); color: var(--tint-ink); }

.badge--muted { background: transparent; color: var(--faint); padding-left: 0; }

/* Avisos */

.flash, .error {
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: 12px;
    font-size: 13.5px;
    background: var(--surface);
    border-left: 3px solid var(--accent);
    box-shadow: var(--shadow-card);
}

.error { border-left-color: var(--accent-deep); color: var(--accent-deep); }

.import-errors p { margin: 0 0 8px; }
.import-errors ul { margin: 0; padding-left: 18px; }
.import-errors li { margin-bottom: 4px; }

/* Formularios */

.form-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    max-width: 560px;
}

form label {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 500;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="tel"],
form input[type="time"],
form input[type="number"],
form input[type="file"],
form select,
form textarea {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-control);
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: var(--accent-dark);
    outline: none;
}

form input[type="checkbox"],
form input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

form input[type="checkbox"] + label,
form label > input[type="checkbox"] { display: inline-block; }

form > div,
.form-card > form > div { margin-bottom: 14px; }

form .form-actions { margin: 20px 0 0; }

.form-help { font-size: 12.5px; color: var(--faint); line-height: 1.45; }

ul.form-error-message, .form-error-message {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    color: var(--accent-deep);
}

/* Login */

.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
}

.login__pitch {
    padding: 56px 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    background: var(--ink);
    color: var(--bg);
}

.login__pitch .brand__mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 17px;
    color: var(--ink);
}

.login__pitch .brand__name { font-size: 20px; }
.login__pitch .brand__role { color: var(--dim); font-size: 10.5px; letter-spacing: 0.14em; }

.login__claim {
    margin: 0 0 16px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 52px;
    line-height: 1.04;
    max-width: 12ch;
}

.login__text {
    margin: 0;
    max-width: 52ch;
    font-size: 15.5px;
    line-height: 1.6;
    color: #d8cfc4;
    text-wrap: pretty;
}

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

.login__chip {
    background: #332c25;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.login__chip strong { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; }

.login__chip span {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b7ab9d;
}

.login__panel {
    padding: 56px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.login__card {
    background: var(--surface);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-raised);
}

.login__card h1 { margin: 6px 0 20px; font-size: 26px; }
.login__card .button { width: 100%; min-height: 44px; font-size: 15px; }

/* Horario semanal */

.schedule-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px 18px;
}

.schedule {
    display: grid;
    grid-template-columns: 64px repeat(var(--schedule-days, 5), minmax(0, 1fr));
    gap: 6px;
}

.schedule__corner { padding: 8px; }

.schedule__day {
    padding: 8px 10px;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 600;
}

.schedule__hour {
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--muted);
}

.schedule-scroll { overflow-x: auto; }

.schedule__cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 74px;
}

.schedule__cell.is-free {
    border-radius: 10px;
    border: 1.5px dashed var(--border);
    background: var(--surface);
}

.schedule__cell.is-closed {
    border-radius: 10px;
    background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, transparent 6px, transparent 12px);
}

.slot {
    border-radius: 10px;
    padding: 9px 10px;
    background: var(--tint);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.slot__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.15;
}

.slot__sub { font-size: 11px; color: var(--muted); line-height: 1.3; }

.slot__meta {
    font-size: 9.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--faint);
}

.legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.legend__item { display: flex; align-items: center; gap: 7px; }

.legend__swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: block;
    background: var(--tint);
}

.legend__swatch--free { background: var(--surface); border: 1.5px solid var(--border); }

.legend__swatch--recovery { background: var(--surface); border: 1.5px solid var(--accent); }

.legend__swatch--closed {
    background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 3px, transparent 3px, transparent 6px);
    border: 1.5px solid var(--border);
}

.legend__label {
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--faint);
}

/* Listas de enlaces */

.link-list { display: flex; flex-direction: column; gap: 9px; }

.link-list__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--surface);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
}

.link-list__item:hover { border-color: var(--accent); color: var(--ink); }

.link-list__meta { font-size: 10px; color: var(--faint); }

.section-label {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 600;
}

.roster {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.roster__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.roster__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    min-width: 140px;
}

.roster__note {
    font-size: 12.5px;
    color: var(--muted);
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.inline-form input[type="text"],
.inline-form select {
    width: auto;
    min-width: 180px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
}

.inline-form > div,
.inline-form label { margin: 0; }

.filters { margin-bottom: 18px; }

.button--small {
    min-height: 34px;
    padding: 6px 14px;
    font-size: 12.5px;
}

.cell-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cell-lines span {
    font-size: 12px;
    color: var(--muted);
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 30px 0 12px;
}

.section-head h2 { margin: 0; font-size: 20px; }

@media (max-width: 1080px) {
    .layout-split { grid-template-columns: minmax(0, 1fr); }
    .login { grid-template-columns: minmax(0, 1fr); }
    .login__pitch { padding: 40px 32px; }
    .login__claim { font-size: 38px; }
}

@media (max-width: 860px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1.5px solid var(--border); }
    .content { padding: 22px 18px 40px; }
    .schedule { grid-template-columns: 56px repeat(var(--schedule-days, 5), minmax(130px, 1fr)); min-width: 720px; }
}

.toolbar__label {
    font-size: 13px;
    color: var(--muted);
    align-self: center;
}

.schedule__date {
    display: block;
    font-size: 10.5px;
    font-weight: 400;
    color: var(--faint);
}

.schedule__cell .slot[draggable='true'] { cursor: grab; }

.slot--dragging { opacity: 0.4; }

.schedule__cell--over {
    border-radius: 10px;
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
}

.slot--moved { box-shadow: inset 3px 0 0 var(--accent); }

.slot--cancelled { opacity: 0.55; }

.slot--recovery {
    background: var(--surface);
    border: 1.5px solid var(--accent);
}

.move-dialog {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    max-width: 380px;
    background: var(--surface);
    color: inherit;
}

.move-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }

.move-dialog h2 {
    font-family: var(--font-display);
    font-size: 17px;
    margin: 0 0 6px;
}

.move-dialog p {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 16px;
}

.move-dialog__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
