/* ==========================================================================
   CALENDARIO DE TALLERES · Estilos principales
   Bootstrap 5 se usa como base; aquí se define la identidad visual y los
   ajustes de FullCalendar, modales, formularios y comportamiento responsive.
   ========================================================================== */

:root {
    --ink: #162033;
    --ink-soft: #334155;
    --muted: #64748b;
    --muted-light: #94a3b8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --line: #e4e9f2;
    --line-strong: #d7deea;
    --brand: #4f46e5;
    --brand-dark: #3730a3;
    --brand-soft: #eef2ff;
    --danger: #dc2626;
    --success: #059669;
    --warning: #d97706;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;
    --shadow-card: 0 24px 65px -38px rgba(15, 23, 42, 0.38);
    --shadow-soft: 0 12px 30px -20px rgba(15, 23, 42, 0.25);
    --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(circle at 8% -8%, rgba(99, 102, 241, 0.16), transparent 28rem),
        radial-gradient(circle at 98% 4%, rgba(14, 165, 233, 0.12), transparent 26rem),
        linear-gradient(180deg, #f8faff 0%, #f4f7fc 46%, #f7f9fc 100%);
}

::selection {
    color: #fff;
    background: var(--brand);
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: var(--brand);
}

/* --------------------------------------------------------------------------
   Estructura general
   -------------------------------------------------------------------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.app-container {
    width: 100%;
    max-width: 1680px;
    margin-inline: auto;
    padding-inline: clamp(12px, 1.8vw, 28px);
}

.app-header {
    position: relative;
    z-index: 1020;
    padding-block: clamp(14px, 1.8vw, 24px) 12px;
    border-bottom: 1px solid rgba(228, 233, 242, 0.85);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-block {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: clamp(10px, 1.2vw, 16px);
}

.brand-icon {
    display: grid;
    width: clamp(48px, 4.4vw, 60px);
    height: clamp(48px, 4.4vw, 60px);
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    border-radius: 18px;
    background: linear-gradient(145deg, #6366f1 0%, #4f46e5 52%, #4338ca 100%);
    box-shadow:
        0 15px 30px -14px rgba(79, 70, 229, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.brand-copy {
    min-width: 0;
}

.brand-eyebrow {
    display: block;
    margin-bottom: 2px;
    color: var(--brand);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-copy h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.45rem, 2.8vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.16;
}

.brand-copy p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: clamp(0.78rem, 1vw, 0.9rem);
}

.header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

.today-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
}

.today-chip i {
    color: var(--brand);
}

.app-main {
    flex: 1 0 auto;
    padding-block: 12px 20px;
}

.app-footer {
    padding-block: 11px;
    color: var(--muted-light);
    font-size: 0.75rem;
    border-top: 1px solid rgba(228, 233, 242, 0.9);
    background: rgba(255, 255, 255, 0.55);
}

.app-footer .app-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.footer-separator {
    color: #cbd5e1;
}

/* --------------------------------------------------------------------------
   Botones y formularios
   -------------------------------------------------------------------------- */
.btn {
    --bs-btn-focus-box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.16);
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.66rem 1.1rem;
    border: 0;
    background-image: linear-gradient(135deg, #6366f1, #4f46e5 58%, #4338ca);
    box-shadow: 0 12px 24px -14px rgba(79, 70, 229, 0.85);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btn-brand:hover,
.btn-brand:focus-visible {
    color: #fff;
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 16px 30px -15px rgba(79, 70, 229, 0.9);
}

.btn-brand:active {
    transform: translateY(0);
}

.btn-brand:disabled {
    opacity: 0.7;
    transform: none;
}

.btn-light {
    --bs-btn-color: var(--ink-soft);
    --bs-btn-bg: #f1f5f9;
    --bs-btn-border-color: #f1f5f9;
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: #e9eef5;
    --bs-btn-hover-border-color: #e9eef5;
}

.btn-outline-danger {
    --bs-btn-color: #b91c1c;
    --bs-btn-border-color: #fecaca;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #dc2626;
    --bs-btn-hover-border-color: #dc2626;
}

.btn-danger {
    --bs-btn-bg: #dc2626;
    --bs-btn-border-color: #dc2626;
    --bs-btn-hover-bg: #b91c1c;
    --bs-btn-hover-border-color: #b91c1c;
}

.form-control,
.form-select {
    min-height: 40px;
    color: var(--ink);
    font-size: 0.88rem;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background-color: #fff;
    box-shadow: none;
}

.form-control::placeholder {
    color: #a3afc2;
}

.form-control:focus,
.form-select:focus {
    color: var(--ink);
    border-color: #a5b4fc;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.11);
}

textarea.form-control {
    min-height: 76px;
    line-height: 1.55;
    resize: vertical;
}

.form-label {
    margin-bottom: 3px;
    color: var(--ink-soft);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.01em;
}

.required-mark {
    color: #e11d48;
    font-weight: 800;
}

.form-text {
    color: var(--muted-light);
    font-size: 0.71rem;
}

.form-control:disabled,
.form-select:disabled {
    background-color: #f4f6fa;
}

/* --------------------------------------------------------------------------
   Filtros
   -------------------------------------------------------------------------- */
.filters-card {
    padding: clamp(11px, 1.3vw, 16px);
    border: 1px solid rgba(224, 230, 240, 0.95);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.filter-controls {
    display: grid;
    grid-template-columns: minmax(240px, 1.65fr) minmax(170px, 0.85fr) minmax(170px, 0.85fr) auto;
    gap: 9px;
    align-items: end;
}

.filter-field {
    min-width: 0;
}

.filter-label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.filter-label-spacer {
    visibility: hidden;
}

.search-wrap {
    position: relative;
}

.search-wrap > .bi-search {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 2;
    color: var(--muted-light);
    font-size: 0.9rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-input {
    padding-right: 2.8rem;
    padding-left: 2.65rem;
}

.search-input::-webkit-search-cancel-button {
    display: none;
}

.search-clear {
    position: absolute;
    top: 50%;
    right: 9px;
    display: grid;
    width: 28px;
    height: 28px;
    padding: 0;
    place-items: center;
    color: #94a3b8;
    border: 0;
    border-radius: 50%;
    background: transparent;
    transform: translateY(-50%);
}

.search-clear:hover {
    color: var(--brand);
    background: var(--brand-soft);
}

.btn-filter-reset {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding-inline: 11px;
    color: var(--ink-soft);
    font-size: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    white-space: nowrap;
}

.btn-filter-reset:hover {
    color: var(--brand-dark);
    border-color: #c7d2fe;
    background: var(--brand-soft);
}

.filter-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px dashed var(--line);
}

.filter-summary-copy {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-summary-copy i {
    color: var(--brand);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 10px;
    overflow: hidden;
}

.legend-item {
    display: inline-flex;
    max-width: 180px;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 650;
    white-space: nowrap;
}

.legend-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--legend-color, var(--brand));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--legend-color, var(--brand)) 14%, transparent);
}

.legend-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Calendario
   -------------------------------------------------------------------------- */
.calendar-card {
    margin-top: 12px;
    padding: clamp(10px, 1.25vw, 16px);
    border: 1px solid rgba(224, 230, 240, 0.95);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.calendar-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.calendar-tip {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 0.76rem;
}

.tip-icon {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--brand);
    border-radius: 9px;
    background: var(--brand-soft);
}

.count-pill {
    flex: 0 0 auto;
    padding: 4px 9px;
    color: var(--brand-dark);
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid #dfe3ff;
    border-radius: 999px;
    background: #f4f5ff;
}

.calendar-canvas {
    position: relative;
    height: clamp(540px, calc(100vh - 400px), 840px);
    height: clamp(540px, calc(100dvh - 400px), 840px);
    min-height: 540px;
}

#calendario {
    height: 100%;
}

.calendar-loading {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 650;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(3px);
}

.calendar-loading.is-active {
    display: flex;
}

.calendar-loading .spinner-border {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--brand);
}

.calendar-error {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 13px;
    padding: 12px 14px;
    color: #991b1b;
    font-size: 0.8rem;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff7f7;
}

.calendar-error > .bi {
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.calendar-error-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.calendar-error-copy span {
    color: #b45353;
}

.page-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 9px 0 0;
    color: var(--muted-light);
    font-size: 0.72rem;
    text-align: center;
}

.page-hint i {
    color: var(--success);
}

/* --------------------------------------------------------------------------
   Ajustes visuales de FullCalendar
   -------------------------------------------------------------------------- */
.fc {
    --fc-border-color: #e8edf5;
    --fc-page-bg-color: #ffffff;
    --fc-neutral-bg-color: #f8fafc;
    --fc-neutral-text-color: var(--muted);
    --fc-today-bg-color: rgba(238, 242, 255, 0.78);
    --fc-now-indicator-color: #ef4444;
    --fc-highlight-color: rgba(79, 70, 229, 0.1);
    --fc-button-text-color: var(--ink-soft);
    --fc-button-bg-color: #ffffff;
    --fc-button-border-color: var(--line-strong);
    --fc-button-hover-bg-color: var(--brand-soft);
    --fc-button-hover-border-color: #c7d2fe;
    --fc-button-active-bg-color: var(--brand);
    --fc-button-active-border-color: var(--brand);
    color: var(--ink);
    font-family: var(--font-sans);
}

.fc .fc-toolbar.fc-header-toolbar {
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 12px;
}

.fc .fc-toolbar-chunk {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fc .fc-toolbar-title {
    color: var(--ink);
    font-size: clamp(1.15rem, 2.2vw, 1.65rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.fc .fc-toolbar-title::first-letter {
    text-transform: uppercase;
}

.fc .fc-button {
    min-height: 34px;
    padding: 0.4rem 0.72rem;
    color: var(--ink-soft);
    font-family: var(--font-sans);
    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1.2;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
    box-shadow: none;
    text-transform: none;
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.fc .fc-button:hover {
    color: var(--brand-dark);
    border-color: #c7d2fe;
    background: var(--brand-soft);
}

.fc .fc-button:focus-visible {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    color: #fff;
    border-color: var(--brand);
    background: var(--brand);
}

.fc .fc-button-primary:disabled {
    color: var(--muted-light);
    border-color: var(--line);
    background: #f8fafc;
    opacity: 1;
}

.fc .fc-button .fc-icon {
    font-size: 1rem;
    vertical-align: -0.08em;
}

.fc .fc-prev-button,
.fc .fc-next-button {
    width: 34px;
    padding-inline: 0;
}

.fc .fc-col-header-cell {
    background: #f8fafc;
}

.fc .fc-col-header-cell-cushion {
    padding: 7px 3px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-decoration: none;
    text-transform: uppercase;
}

.fc .fc-daygrid-day-number {
    padding: 5px 7px;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 750;
    text-decoration: none;
}

.fc .fc-day-today .fc-daygrid-day-number {
    display: grid;
    width: 26px;
    height: 26px;
    margin: 2px;
    padding: 0;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    background: var(--brand);
}

.fc .fc-daygrid-day.fc-day-today {
    background: var(--fc-today-bg-color);
}

.fc .fc-daygrid-day:hover {
    background: #fbfcff;
}

.fc .fc-daygrid-day-frame {
    min-height: 84px;
}

.fc .fc-daygrid-event {
    margin: 1px 2px;
    padding: 2px 4px;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.35;
    border: 0;
    border-radius: 7px;
    box-shadow: 0 2px 5px -3px rgba(15, 23, 42, 0.35);
    cursor: pointer;
}

.fc .fc-daygrid-event:hover {
    filter: brightness(1.05);
}

.fc .fc-daygrid-event-dot {
    display: none;
}

.fc .fc-event-time {
    font-weight: 800;
    opacity: 0.94;
}

.fc .fc-event-title {
    font-weight: 650;
}

/* Los títulos largos se recortan con puntos suspensivos en la vista de mes. */
.fc .fc-daygrid-event .fc-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc .fc-daygrid-more-link {
    margin: 2px 5px;
    color: var(--brand);
    font-size: 0.7rem;
    font-weight: 800;
    text-decoration: none;
}

.fc .fc-timegrid-event {
    padding: 0;
    border: 0;
    border-left: 3px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    box-shadow: 0 5px 12px -8px rgba(15, 23, 42, 0.5);
    cursor: pointer;
}

.fc .fc-timegrid-event .fc-event-main {
    padding: 3px 6px;
}

.fc .fc-timegrid-event .fc-event-time {
    font-size: 0.7rem;
}

.fc .fc-timegrid-event .fc-event-title {
    font-size: 0.74rem;
}

.fc .fc-timegrid-slot {
    height: 2.35em;
}

.fc .fc-timegrid-slot-label-cushion {
    color: var(--muted-light);
    font-size: 0.67rem;
    font-weight: 650;
}

.fc .fc-timegrid-axis-cushion {
    color: var(--muted-light);
    font-size: 0.67rem;
    font-weight: 650;
}

.fc .fc-timegrid-now-indicator-line {
    border-color: var(--fc-now-indicator-color);
}

.fc .fc-timegrid-now-indicator-arrow {
    border-color: var(--fc-now-indicator-color);
    border-width: 5px 0 5px 6px;
}

.fc .fc-popover {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: 0 20px 50px -24px rgba(15, 23, 42, 0.4);
}

.fc .fc-popover-header {
    padding: 8px 10px;
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 800;
    background: var(--surface-soft);
}

.fc .fc-daygrid-more-link:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.fc .fc-event.evento-cancelado {
    opacity: 0.52;
}

.fc .fc-event.evento-cancelado .fc-event-title {
    text-decoration: line-through;
}

.fc .fc-event.evento-realizado {
    opacity: 0.68;
}

.fc .fc-event.evento-realizado .fc-event-title::before {
    content: "✓ ";
}

.fc-theme-standard .fc-scrollgrid {
    border-color: var(--line);
    border-radius: 13px;
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: var(--line);
}

.fc .fc-scroller {
    scrollbar-color: #cbd5e1 transparent;
    scrollbar-width: thin;
}

.fc .fc-scroller::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.fc .fc-scroller::-webkit-scrollbar-thumb {
    border: 2px solid #fff;
    border-radius: 999px;
    background: #cbd5e1;
}

/* --------------------------------------------------------------------------
   Modales y formularios
   -------------------------------------------------------------------------- */
.modal-backdrop.show {
    opacity: 0.46;
}

.modal-content {
    border: 0;
    border-radius: var(--radius-xl);
    box-shadow: 0 34px 90px -30px rgba(15, 23, 42, 0.6);
}

.modal-form {
    overflow: hidden;
}

.modal-header {
    align-items: flex-start;
    padding: 10px clamp(12px, 1.3vw, 16px);
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 0 0, rgba(99, 102, 241, 0.08), transparent 18rem),
        #fbfcff;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--brand);
    font-size: 1.12rem;
    border: 1px solid #dfe3ff;
    border-radius: 13px;
    background: var(--brand-soft);
}

.modal-title {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 800;
    letter-spacing: -0.025em;
}

.modal-header .btn-close {
    margin: 0 0 0 4px;
    padding: 0.55rem;
    font-size: 0.7rem;
    border-radius: 50%;
    background-size: 0.75rem;
}

.modal-header .btn-close:hover {
    background-color: #eef2ff;
}

.modal-body {
    padding: clamp(10px, 1.2vw, 14px);
}

.modal-form .modal-body > .row.g-4 {
    --bs-gutter-x: 0.8rem;
    --bs-gutter-y: 0.5rem;
}

.modal-form .form-panel .row.g-3 {
    --bs-gutter-x: 0.65rem;
    --bs-gutter-y: 0.5rem;
}

.modal-form .mb-3 {
    margin-bottom: 0.5rem !important;
}

.modal-form .mt-3 {
    margin-top: 0.45rem !important;
}

.form-panel {
    padding: clamp(9px, 1vw, 12px);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fbfcff;
}

.color-picker-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.color-input {
    width: 46px;
    min-height: 42px;
    flex: 0 0 auto;
    padding: 4px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: 0;
    border-radius: 6px;
}

.color-input::-moz-color-swatch {
    border: 0;
    border-radius: 6px;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.color-swatch {
    position: relative;
    width: 27px;
    height: 27px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--swatch-color);
    box-shadow: 0 0 0 1px #d7deea;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.color-swatch:hover {
    transform: scale(1.08);
}

.color-swatch.activo {
    box-shadow:
        0 0 0 2px var(--ink),
        0 0 0 4px #fff;
    transform: scale(1.06);
}

.modal-footer {
    padding: 8px clamp(12px, 1.3vw, 16px);
    border-top: 1px solid var(--line);
    background: #fbfcff;
}

.modal-footer-form {
    align-items: center;
    justify-content: space-between;
    gap: 7px;
}

.footer-note {
    color: var(--muted-light);
    font-size: 0.69rem;
}

.footer-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.footer-buttons .btn {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.modal-body .alert {
    font-size: 0.8rem;
    border-radius: 11px;
}

/* --------------------------------------------------------------------------
   Modal de detalle
   -------------------------------------------------------------------------- */
.detail-modal-content {
    overflow: hidden;
}

.detalle-hero {
    --detalle-color: #4f46e5;
    position: relative;
    overflow: hidden;
    padding: clamp(18px, 2.4vw, 25px);
    color: #fff;
    background:
        radial-gradient(circle at 92% 0%, rgba(255, 255, 255, 0.24), transparent 14rem),
        radial-gradient(circle at 0% 100%, rgba(15, 23, 42, 0.2), transparent 20rem),
        var(--detalle-color);
}

.detalle-hero::after {
    position: absolute;
    top: -55px;
    right: -35px;
    width: 180px;
    height: 180px;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    box-shadow:
        0 0 0 28px rgba(255, 255, 255, 0.04),
        0 0 0 58px rgba(255, 255, 255, 0.025);
    pointer-events: none;
}

/* Si el color elegido es claro, el detalle usa texto oscuro para mantener
   una legibilidad adecuada. */
.detalle-hero.texto-oscuro {
    color: #111827;
}

.detalle-hero.texto-oscuro .detalle-titulo {
    color: #111827;
}

.detalle-hero.texto-oscuro .detalle-categoria {
    color: #111827;
    border-color: rgba(15, 23, 42, 0.16);
    background: rgba(255, 255, 255, 0.42);
}

.detalle-hero.texto-oscuro .detalle-fecha-corta {
    color: rgba(15, 23, 42, 0.72);
}

.detalle-hero.texto-oscuro .status-pill {
    color: #111827;
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.42);
}

.detalle-hero.texto-oscuro .status-pill::before {
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.detalle-hero.texto-oscuro .detalle-close {
    color: #111827;
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.38);
}

.detalle-hero.texto-oscuro::after {
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow:
        0 0 0 28px rgba(15, 23, 42, 0.025),
        0 0 0 58px rgba(15, 23, 42, 0.015);
}

.detalle-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 85%;
}

.detalle-categoria {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    margin-bottom: 9px;
    color: #fff;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(4px);
}

.detalle-titulo {
    margin: 0;
    color: #fff;
    font-size: clamp(1.35rem, 3.4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.detalle-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 9px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    color: #fff;
    font-size: 0.67rem;
    font-weight: 750;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.2);
}

.status-pill::before {
    width: 6px;
    height: 6px;
    content: "";
    border-radius: 50%;
    background: #e2e8f0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.status-pill[data-estado="Disponible"]::before {
    background: #7dd3fc;
}

.status-pill[data-estado="Programado"]::before {
    background: #c7d2fe;
}

.status-pill[data-estado="En Curso"]::before {
    background: #6ee7b7;
}

.status-pill[data-estado="Realizado"]::before {
    background: #cbd5e1;
}

.status-pill[data-estado="Cancelado"]::before {
    background: #fca5a5;
}

.detalle-fecha-corta {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.72rem;
    font-weight: 600;
}

.detalle-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    color: #fff;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(6px);
    transition: background-color 140ms ease, transform 140ms ease;
}

.detalle-close:hover {
    background: rgba(15, 23, 42, 0.32);
    transform: rotate(6deg);
}

.detalle-highlight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    padding: 11px;
    border: 1px solid #e0e7ff;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f7f8ff, #fbfcff);
}

.detalle-highlight-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--brand);
    font-size: 1.05rem;
    border-radius: 11px;
    background: var(--brand-soft);
}

.detalle-fecha-hora {
    margin: 1px 0 2px;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.45;
}

.detalle-highlight small {
    color: var(--muted);
    font-size: 0.72rem;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.info-label i {
    color: var(--brand);
    font-size: 0.77rem;
}

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

.info-tile {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
}

.info-tile-wide {
    grid-column: 1 / -1;
}

.info-tile p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.info-tile p.texto-vacio {
    color: var(--muted-light);
    font-style: italic;
    font-weight: 500;
}

.detail-footer {
    align-items: center;
    justify-content: space-between;
    gap: 9px;
}

.detail-footer .btn {
    display: inline-flex;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

/* --------------------------------------------------------------------------
   Modal de eliminación
   -------------------------------------------------------------------------- */
.delete-modal-content {
    overflow: hidden;
    text-align: center;
}

.delete-modal-content .modal-body {
    padding: 21px 20px 14px;
}

.delete-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 11px;
    place-items: center;
    color: #dc2626;
    font-size: 1.4rem;
    border: 1px solid #fecaca;
    border-radius: 50%;
    background: #fff1f2;
    box-shadow: 0 0 0 8px #fff7f8;
}

.delete-title {
    margin: 0 0 5px;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.delete-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.delete-name {
    margin: 10px 0 0;
    padding: 9px 11px;
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 700;
    overflow-wrap: anywhere;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
}

.delete-footer {
    justify-content: center;
    gap: 6px;
    padding: 10px 16px 14px;
    border-top: 0;
    background: #fff;
}

.delete-footer .btn {
    display: inline-flex;
    min-width: 110px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   Notificaciones, FAB y accesibilidad
   -------------------------------------------------------------------------- */
.toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    display: flex;
    width: min(370px, calc(100vw - 32px));
    flex-direction: column;
    gap: 9px;
    pointer-events: none;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 12px 13px;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 22px 48px -24px rgba(15, 23, 42, 0.45);
    pointer-events: auto;
    animation: toast-in 220ms ease-out both;
    backdrop-filter: blur(10px);
}

.app-toast.is-hiding {
    animation: toast-out 180ms ease-in both;
}

.app-toast-success {
    border-left-color: var(--success);
}

.app-toast-error {
    border-left-color: var(--danger);
}

.app-toast-info {
    border-left-color: #0284c7;
}

.app-toast-icon {
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 1rem;
    line-height: 1.2;
}

.app-toast-success .app-toast-icon {
    color: var(--success);
}

.app-toast-error .app-toast-icon {
    color: var(--danger);
}

.app-toast-info .app-toast-icon {
    color: #0284c7;
}

.app-toast-message {
    flex: 1;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.45;
}

.app-toast-close {
    flex: 0 0 auto;
    padding: 1px 2px;
    color: #94a3b8;
    font-size: 0.7rem;
    border: 0;
    background: transparent;
}

.app-toast-close:hover {
    color: var(--ink);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-5px) scale(0.98);
    }
}

.fab {
    position: fixed;
    right: max(15px, env(safe-area-inset-right));
    bottom: max(15px, env(safe-area-inset-bottom));
    z-index: 1030;
    display: none;
    width: 50px;
    height: 50px;
    place-items: center;
    color: #fff;
    font-size: 1.35rem;
    border: 0;
    border-radius: 17px;
    background: linear-gradient(145deg, #6366f1, #4338ca);
    box-shadow: 0 16px 30px -10px rgba(67, 56, 202, 0.72);
}

.fab:active {
    transform: scale(0.96);
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 3000;
    padding: 9px 13px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    background: var(--ink);
    transform: translateY(-180%);
    transition: transform 150ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.noscript-message {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 4000;
    padding: 13px;
    color: #7f1d1d;
    font-size: 0.82rem;
    text-align: center;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff1f2;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .filter-controls {
        grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(150px, 1fr)) auto;
    }

    .calendar-canvas {
        height: clamp(520px, calc(100vh - 390px), 830px);
        height: clamp(520px, calc(100dvh - 390px), 830px);
    }
}

@media (max-width: 991.98px) {
    .filter-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-field-search {
        grid-column: 1 / -1;
    }

    .filter-field-actions {
        display: flex;
        align-items: flex-end;
    }

    .filter-field-actions .btn {
        width: 100%;
    }

    .filter-label-spacer {
        display: none;
    }

    .filter-summary-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .legend {
        justify-content: flex-start;
    }

    .calendar-canvas {
        height: clamp(510px, calc(100vh - 400px), 810px);
        height: clamp(510px, calc(100dvh - 400px), 810px);
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 14px;
    }

    .app-header {
        padding-block: 12px 10px;
    }

    .brand-copy p {
        display: none;
    }

    .header-actions .btn-brand {
        display: none;
    }

    .today-chip {
        font-size: 0.72rem;
    }

    .app-main {
        padding-top: 10px;
    }

    .filters-card {
        border-radius: 17px;
    }

    .filter-controls {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .filter-field-search {
        grid-column: auto;
    }

    .filter-field-actions {
        display: block;
    }

    .calendar-card {
        padding: 9px;
        border-radius: 19px;
    }

    .calendar-card-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
        padding-bottom: 8px;
    }

    .calendar-tip {
        align-items: flex-start;
        font-size: 0.71rem;
    }

    .count-pill {
        align-self: flex-start;
    }

    .calendar-canvas {
        height: clamp(490px, 68vh, 720px);
        height: clamp(490px, 68dvh, 720px);
        min-height: 490px;
    }

    .fc .fc-toolbar.fc-header-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-bottom: 11px;
    }

    .fc .fc-toolbar-chunk {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 4px;
    }

    .fc .fc-toolbar-chunk:nth-child(2) {
        order: -1;
    }

    .fc .fc-toolbar-title {
        width: 100%;
        font-size: 1.15rem;
        text-align: center;
    }

    .fc .fc-button {
        min-height: 31px;
        padding: 0.34rem 0.52rem;
        font-size: 0.69rem;
    }

    .fc .fc-prev-button,
    .fc .fc-next-button {
        width: 31px;
    }

    .fc .fc-col-header-cell-cushion {
        padding: 5px 1px;
        font-size: 0.6rem;
    }

    .fc .fc-daygrid-day-number {
        padding: 3px 4px;
        font-size: 0.7rem;
    }

    .fc .fc-day-today .fc-daygrid-day-number {
        width: 23px;
        height: 23px;
    }

    .fc .fc-daygrid-event {
        margin-inline: 2px;
        padding: 1px 3px;
        font-size: 0.65rem;
    }

    .fc .fc-daygrid-more-link {
        font-size: 0.64rem;
    }

    .fc .fc-timegrid-slot {
        height: 2.1em;
    }

    .fc .fc-timegrid-event .fc-event-main {
        padding: 3px 5px;
    }

    .modal-dialog {
        margin: 8px;
    }

    .modal-fullscreen-sm-down .modal-header {
        padding: 9px 10px;
    }

    .modal-fullscreen-sm-down .modal-body {
        padding: 8px;
    }

    .modal-footer-form {
        align-items: stretch;
        flex-direction: column;
    }

    .modal-footer-form .footer-note {
        display: none;
    }

    .modal-footer-form .footer-buttons {
        width: 100%;
    }

    .modal-footer-form .footer-buttons .btn {
        flex: 1;
    }

    .detail-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .detail-footer > .btn,
    .detail-footer .footer-buttons {
        width: 100%;
    }

    .detail-footer .footer-buttons .btn {
        flex: 1;
    }

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

    .info-tile-wide {
        grid-column: auto;
    }

    .fab {
        display: grid;
    }

    .app-footer {
        padding-bottom: 78px;
    }

    .toast-stack {
        top: 10px;
        right: 10px;
        width: calc(100vw - 20px);
    }
}

@media (max-width: 575.98px) {
    .app-container {
        padding-inline: 9px;
    }

    .brand-icon {
        width: 44px;
        height: 44px;
        border-radius: 15px;
    }

    .brand-eyebrow {
        font-size: 0.58rem;
    }

    .brand-copy h1 {
        font-size: 1.26rem;
    }

    .today-chip {
        padding: 6px 8px;
    }

    .today-chip span {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .filter-summary-row {
        gap: 9px;
    }

    .calendar-canvas {
        min-height: 490px;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 58px;
    }

    .fc .fc-toolbar-chunk {
        gap: 3px;
    }

    .fc .fc-button {
        padding-inline: 0.44rem;
        font-size: 0.65rem;
    }

    .modal-fullscreen-sm-down.modal-dialog {
        /* Bootstrap aplica margin:0 con una sola clase; esta regla evita que
           el margin genérico de .modal-dialog desplace el modal fullscreen. */
        margin: 0;
    }

    .modal-fullscreen-sm-down .modal-content {
        border-radius: 0;
    }

    /* En pantallas pequeñas el mes tiene celdas muy angostas: ocultamos la
       hora para que al menos se lea el título de la actividad. */
    .fc .fc-daygrid-event .fc-event-time {
        display: none;
    }

    .detalle-hero-inner {
        max-width: 92%;
    }

    .detalle-titulo {
        font-size: 1.32rem;
    }

    .detalle-hero {
        padding: 21px 18px;
    }

    .detalle-close {
        top: 10px;
        right: 10px;
    }

    .delete-modal-content {
        border-radius: 18px;
    }

    .delete-modal-content .modal-body {
        padding: 23px 18px 15px;
    }

    .delete-footer {
        flex-wrap: nowrap;
    }

    .delete-footer .btn {
        min-width: 0;
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ==========================================================================
   AUTENTICACIÓN Y GESTIÓN DE USUARIOS
   ========================================================================== */

/* --------------------------------------------------------------------------
   Mensajes y menú de usuario
   -------------------------------------------------------------------------- */
.app-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 11px;
    margin-bottom: 12px;
    font-size: 0.78rem;
    line-height: 1.45;
    border-radius: 12px;
}

.app-alert-icon {
    flex: 0 0 auto;
    margin-top: 2px;
}

.app-alert a {
    font-weight: 700;
}

.auth-error-list {
    margin: 3px 0 0;
    padding-left: 18px;
    font-size: 0.76rem;
}

.auth-error-list li + li {
    margin-top: 2px;
}

.user-menu {
    position: relative;
    flex: 0 0 auto;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px 3px 3px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px -18px rgba(15, 23, 42, 0.5);
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.user-chip:hover,
.user-chip:focus-visible {
    border-color: #c7d2fe;
    background: #f8faff;
    box-shadow: 0 9px 20px -16px rgba(79, 70, 229, 0.45);
}

.user-avatar {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    border-radius: 50%;
    background: linear-gradient(145deg, #6366f1, #4338ca);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.user-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.08;
    text-align: left;
}

.user-copy strong {
    max-width: 128px;
    overflow: hidden;
    font-size: 0.7rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 600;
}

.user-chevron {
    color: var(--muted-light);
    font-size: 0.62rem;
}

.user-dropdown {
    z-index: 1040;
    min-width: 232px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 22px 45px -24px rgba(15, 23, 42, 0.45);
}

.user-dropdown-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 5px 8px 7px;
}

.user-dropdown-name {
    font-size: 0.8rem;
    font-weight: 800;
}

.user-dropdown-email {
    max-width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-head .badge-rol {
    margin-top: 3px;
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    font-size: 0.77rem;
    font-weight: 600;
    border-radius: 8px;
}

.user-dropdown .dropdown-item i {
    width: 16px;
    color: var(--muted);
    text-align: center;
}

.user-dropdown .dropdown-item:hover i,
.user-dropdown .dropdown-item:focus i {
    color: var(--brand);
}

.user-dropdown .dropdown-item.text-danger,
.user-dropdown .dropdown-item.text-danger i {
    color: var(--danger) !important;
}

.user-logout-form {
    margin: 0;
}

.readonly-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    color: #b45309;
    font-size: 0.66rem;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid #fde68a;
    border-radius: 999px;
    background: #fffbeb;
}

.brand-link {
    color: inherit;
    text-decoration: none;
}

.brand-link:hover {
    color: inherit;
}

.brand-title {
    display: block;
    color: var(--ink);
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.app-header-simple {
    padding-block: 12px 10px;
}

.btn-header-link {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.48rem 0.82rem;
    font-size: 0.76rem;
    white-space: nowrap;
    border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Páginas internas: perfil y administración
   -------------------------------------------------------------------------- */
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.page-heading h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.55rem, 2.6vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.15;
}

.page-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.page-kicker {
    display: block;
    margin-bottom: 2px;
    color: var(--brand);
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.panel-card {
    padding: clamp(13px, 1.6vw, 20px);
    border: 1px solid rgba(224, 230, 240, 0.95);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.04rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.panel-head-icon {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--brand);
    font-size: 0.94rem;
    border: 1px solid #dfe3ff;
    border-radius: 11px;
    background: var(--brand-soft);
}

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

.profile-content {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.account-card {
    text-align: center;
}

.account-avatar {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 8px;
    place-items: center;
    color: #fff;
    font-size: 1.18rem;
    font-weight: 800;
    border-radius: 22px;
    background: linear-gradient(145deg, #6366f1, #4338ca);
    box-shadow: 0 14px 25px -16px rgba(67, 56, 202, 0.8);
}

.account-card h2 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.account-email {
    margin: 3px 0 9px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.75rem;
}

.account-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-bottom: 12px;
}

.account-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-top: 10px;
    text-align: left;
    border-top: 1px solid var(--line);
}

.account-list div {
    display: grid;
    gap: 1px;
}

.account-list dt {
    color: var(--muted-light);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.account-list dd {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.profile-form {
    display: grid;
    gap: 10px;
}

.panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 2px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
}

.detail-block {
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
}

.detail-block:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-block h3 {
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-block p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.8rem;
    line-height: 1.5;
}

.preline {
    white-space: pre-line;
}

.danger-panel {
    border-color: #fee2e2;
    background: #fffafa;
}

.danger-actions {
    display: grid;
    gap: 9px;
}

.danger-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    background: #fff;
}

.danger-action strong {
    display: block;
    color: var(--ink);
    font-size: 0.78rem;
}

.danger-action p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.7rem;
}

.danger-action form {
    flex: 0 0 auto;
}

.danger-action-delete {
    border-color: #fecaca;
    background: #fff1f2;
}

/* --------------------------------------------------------------------------
   Administración de usuarios
   -------------------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(224, 230, 240, 0.95);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.stat-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    font-size: 0.98rem;
    border-radius: 12px;
}

.stat-icon-brand {
    color: var(--brand);
    background: var(--brand-soft);
}

.stat-icon-warning {
    color: #b45309;
    background: #fffbeb;
}

.stat-icon-success {
    color: var(--success);
    background: #ecfdf5;
}

.stat-icon-info {
    color: #0e7490;
    background: #ecfeff;
}

.stat-card strong {
    display: block;
    color: var(--ink);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1;
}

.stat-card span:last-child {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 650;
}

.config-card {
    margin-bottom: 12px;
}

.config-grid {
    display: grid;
    grid-template-columns: minmax(190px, 0.9fr) minmax(270px, 1.35fr) 140px auto;
    align-items: end;
    gap: 10px;
}

.config-field {
    min-width: 0;
}

.config-switch {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding-left: 2.55em;
}

.config-switch .form-check-input {
    margin-top: 0;
}

.config-switch .form-check-label {
    font-size: 0.78rem;
    font-weight: 700;
}

.config-code-row {
    display: flex;
    gap: 6px;
}

.config-code-row .form-control {
    min-width: 0;
    flex: 1 1 auto;
}

.config-code-row .btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding-inline: 10px;
    white-space: nowrap;
}

.config-actions .btn {
    min-height: 40px;
    white-space: nowrap;
}

.config-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.45;
}

.config-note i {
    margin-top: 2px;
    color: var(--brand);
}

.users-filters {
    display: grid;
    grid-template-columns: minmax(200px, 1.4fr) repeat(2, minmax(130px, 0.6fr)) auto;
    align-items: end;
    gap: 8px;
    margin-bottom: 9px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--line);
}

.users-filter-search {
    min-width: 0;
}

.users-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.users-table {
    min-width: 850px;
    margin-bottom: 0;
    font-size: 0.78rem;
}

.users-table thead th {
    padding: 7px 8px;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom-color: var(--line);
}

.users-table tbody td {
    padding: 8px;
    vertical-align: middle;
    border-bottom-color: #eef2f7;
}

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

.users-table tbody tr:hover td {
    background: #fbfcff;
}

.user-cell {
    display: flex;
    min-width: 190px;
    align-items: center;
    gap: 8px;
}

.mobile-user-meta,
.mobile-manage-link {
    display: none;
}

.table-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--brand-dark);
    font-size: 0.68rem;
    font-weight: 800;
    border-radius: 11px;
    background: var(--brand-soft);
}

.user-cell strong {
    display: block;
    max-width: 210px;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.77rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-cell small {
    display: block;
    max-width: 210px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--ink-soft);
    font-size: 0.71rem;
    white-space: nowrap;
}

.contact-cell i {
    color: var(--brand);
    font-size: 0.68rem;
}

.contact-cell small {
    color: var(--muted-light);
    font-size: 0.65rem;
}

.table-date {
    color: var(--ink-soft);
    font-size: 0.71rem;
    white-space: nowrap;
}

.badge-rol,
.badge-estado {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 999px;
}

.badge-rol-admin {
    color: #5b21b6;
    border-color: #ddd6fe;
    background: #ede9fe;
}

.badge-rol-lider {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #dbeafe;
}

.badge-rol-asistente {
    color: #475569;
    border-color: #e2e8f0;
    background: #f1f5f9;
}

.estado-pendiente {
    color: #b45309;
    border-color: #fde68a;
    background: #fffbeb;
}

.estado-activo {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.estado-inactivo {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.pagination-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.pagination .page-link {
    min-width: 30px;
    padding: 5px 8px;
    color: var(--ink-soft);
    font-size: 0.71rem;
    text-align: center;
    border-color: var(--line);
    border-radius: 8px;
}

.pagination .page-item + .page-item .page-link {
    margin-left: 2px;
}

.pagination .page-item.active .page-link {
    color: #fff;
    border-color: var(--brand);
    background: var(--brand);
}

.pagination .page-item.disabled .page-link {
    color: #cbd5e1;
}

.empty-state {
    padding: 30px 15px;
    color: var(--muted);
    text-align: center;
}

.empty-state-icon {
    display: grid;
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    place-items: center;
    color: var(--brand);
    font-size: 1.3rem;
    border-radius: 16px;
    background: var(--brand-soft);
}

.empty-state h3 {
    margin: 0;
    color: var(--ink);
    font-size: 0.98rem;
    font-weight: 800;
}

.empty-state p {
    margin: 4px 0 0;
    font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   Pantallas de acceso y registro
   -------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% -8%, rgba(99, 102, 241, 0.16), transparent 28rem),
        radial-gradient(circle at 98% 4%, rgba(14, 165, 233, 0.12), transparent 26rem),
        linear-gradient(180deg, #f8faff 0%, #f4f7fc 46%, #f7f9fc 100%);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.05fr) minmax(480px, 0.95fr);
}

.auth-shell-register {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
}

.auth-visual {
    position: relative;
    display: flex;
    overflow: hidden;
    align-items: center;
    padding: clamp(28px, 5vw, 72px);
    color: #fff;
    background:
        radial-gradient(circle at 16% 10%, rgba(129, 140, 248, 0.58), transparent 28rem),
        radial-gradient(circle at 92% 88%, rgba(14, 165, 233, 0.3), transparent 24rem),
        linear-gradient(145deg, #1e1b4b 0%, #312e81 48%, #4338ca 100%);
}

.auth-visual::before,
.auth-visual::after {
    position: absolute;
    content: "";
    border-radius: 50%;
    pointer-events: none;
}

.auth-visual::before {
    top: -18%;
    right: -12%;
    width: min(34vw, 460px);
    height: min(34vw, 460px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 0 0 45px rgba(255, 255, 255, 0.03),
        0 0 0 90px rgba(255, 255, 255, 0.025);
}

.auth-visual::after {
    bottom: -22%;
    left: -10%;
    width: min(28vw, 370px);
    height: min(28vw, 370px);
    background: rgba(255, 255, 255, 0.06);
    filter: blur(1px);
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    max-width: 570px;
    flex-direction: column;
    gap: clamp(26px, 4vw, 54px);
    margin-inline: auto;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}

.auth-brand:hover {
    color: #fff;
}

.auth-brand-icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    font-size: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(8px);
}

.auth-brand-eyebrow {
    display: block;
    margin-bottom: 1px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.auth-brand strong {
    display: block;
    font-size: 1.06rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-visual-copy .auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 5px 9px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-visual-copy h1 {
    max-width: 13ch;
    margin: 0 0 13px;
    font-size: clamp(2rem, 3.6vw, 3.35rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.03;
}

.auth-visual-copy p {
    max-width: 48ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.65;
}

.auth-feature-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.79rem;
    line-height: 1.45;
}

.auth-feature-icon {
    display: grid;
    width: 33px;
    height: 33px;
    flex: 0 0 auto;
    place-items: center;
    color: #c7d2fe;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
}

.auth-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: clamp(20px, 3.5vw, 52px);
}

.auth-panel-wide {
    padding: clamp(16px, 2.4vw, 38px);
}

.auth-card {
    width: min(100%, 460px);
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid rgba(224, 230, 240, 0.95);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 34px 80px -46px rgba(15, 23, 42, 0.5);
}

.auth-card-wide {
    width: min(100%, 900px);
    padding: clamp(18px, 2.4vw, 30px);
}

.auth-card-head {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 16px;
}

.auth-card-icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    font-size: 1.15rem;
    border-radius: 14px;
    background: linear-gradient(145deg, #6366f1, #4338ca);
    box-shadow: 0 12px 22px -14px rgba(67, 56, 202, 0.8);
}

.auth-eyebrow {
    display: block;
    margin-bottom: 1px;
    color: var(--brand);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.auth-card-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.35rem, 2.2vw, 1.72rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.auth-card-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.77rem;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-field {
    display: grid;
    gap: 3px;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap > .auth-input-icon {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 2;
    color: var(--muted-light);
    font-size: 0.92rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-input-icon + .auth-input {
    padding-left: 2.55rem;
}

.auth-input {
    min-height: 43px;
}

.auth-input-password {
    padding-right: 2.8rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    color: var(--muted-light);
    font-size: 0.84rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--brand);
    background: var(--brand-soft);
}

.auth-submit {
    width: 100%;
    min-height: 44px;
    margin-top: 2px;
}

.auth-secondary {
    display: inline-flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 0 10px;
    color: var(--muted-light);
    font-size: 0.68rem;
    font-weight: 600;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    flex: 1;
    content: "";
    background: var(--line);
}

.auth-help {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    margin: 13px 0 0;
    color: var(--muted-light);
    font-size: 0.68rem;
    line-height: 1.4;
    text-align: center;
}

.auth-help i {
    margin-top: 2px;
}

.auth-footer {
    color: var(--muted-light);
    font-size: 0.68rem;
    text-align: center;
}

.auth-form-register {
    gap: 0;
}

.auth-access-code {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    padding: 11px 12px;
    border: 1px solid #c7d2fe;
    border-radius: 16px;
    background: linear-gradient(135deg, #f5f7ff, #eef2ff);
}

.auth-access-code-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--brand);
    font-size: 0.88rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px -8px rgba(79, 70, 229, 0.5);
}

.auth-access-code-body {
    min-width: 0;
    flex: 1 1 auto;
}

.auth-access-code .form-label {
    margin-bottom: 4px;
    font-size: 0.74rem;
    font-weight: 800;
}

.auth-access-code .form-text {
    margin-top: 3px;
}

.auth-section {
    min-inline-size: 0;
    margin: 0 0 12px;
    padding: 12px 13px 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fcfdff;
}

.auth-section legend {
    display: flex;
    width: auto;
    align-items: center;
    gap: 7px;
    float: none;
    margin: 0 0 9px;
    padding: 0 5px;
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.auth-section-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    color: var(--brand);
    font-size: 0.76rem;
    border-radius: 8px;
    background: var(--brand-soft);
}

.auth-check {
    margin-top: 12px;
    padding-left: 1.65em;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.auth-check .form-check-input {
    margin-top: 0.16em;
}

.auth-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.auth-form-actions .auth-submit,
.auth-form-actions .auth-secondary {
    width: auto;
    flex: 1 1 180px;
    margin-top: 0;
}

.auth-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Responsive para autenticación y gestión
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .auth-shell {
        grid-template-columns: minmax(0, 0.92fr) minmax(460px, 1.08fr);
    }

    .auth-shell-register {
        grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    }

    .auth-visual-copy h1 {
        font-size: clamp(1.85rem, 3.2vw, 2.85rem);
    }
}

@media (max-width: 991.98px) {
    .auth-shell,
    .auth-shell-register {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        padding: 26px 22px;
    }

    .auth-visual-content {
        max-width: 720px;
        gap: 14px;
    }

    .auth-visual-copy h1 {
        max-width: 22ch;
        margin-bottom: 7px;
        font-size: clamp(1.6rem, 5vw, 2.2rem);
    }

    .auth-visual-copy p,
    .auth-feature-list {
        display: none;
    }

    .auth-panel,
    .auth-panel-wide {
        justify-content: flex-start;
        padding: 16px;
    }

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

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

    .config-actions {
        grid-column: 1 / -1;
    }

    .users-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .users-filter-search {
        grid-column: 1 / -1;
    }

    .users-filter-actions {
        grid-column: 1 / -1;
    }

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

    .config-actions {
        grid-column: auto;
    }

    .config-actions .btn {
        width: 100%;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .account-card {
        text-align: left;
    }

    .account-avatar {
        margin-inline: 0;
    }

    .account-badges {
        justify-content: flex-start;
    }

    .account-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 16px;
    }
}

@media (max-width: 767.98px) {
    .auth-visual {
        display: none;
    }

    .auth-panel,
    .auth-panel-wide {
        min-height: 100vh;
        padding: 12px;
    }

    .auth-page:not(.auth-page-register) .auth-panel {
        justify-content: center;
    }

    .auth-card,
    .auth-card-wide {
        padding: 17px;
        border-radius: 20px;
    }

    .auth-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-radius: 12px;
    }

    .auth-section {
        padding: 10px 10px 11px;
    }

    .auth-form-actions {
        flex-direction: column;
    }

    .auth-form-actions .auth-submit,
    .auth-form-actions .auth-secondary {
        width: 100%;
        flex: 1 1 auto;
    }

    .user-copy,
    .user-chevron {
        display: none;
    }

    .user-chip {
        padding: 3px;
    }

    .readonly-chip {
        padding: 0;
        width: 32px;
        height: 32px;
        justify-content: center;
        border-radius: 50%;
    }

    .readonly-chip span {
        display: none;
    }

    .header-actions {
        gap: 5px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .page-heading .btn {
        width: 100%;
    }

    .panel-card {
        padding: 12px;
        border-radius: 17px;
    }

    .stats-grid {
        gap: 7px;
    }

    .stat-card {
        padding: 9px;
        border-radius: 13px;
    }

    .stat-icon {
        width: 33px;
        height: 33px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .stat-card strong {
        font-size: 1.12rem;
    }

    .stat-card span:last-child {
        font-size: 0.6rem;
    }

    .users-filters {
        grid-template-columns: 1fr;
    }

    .users-filter-search,
    .users-filter-actions {
        grid-column: auto;
    }

    .users-filter-actions .btn {
        flex: 1;
    }

    .users-table {
        min-width: 0;
    }

    .users-table thead {
        display: none;
    }

    .users-table,
    .users-table tbody,
    .users-table tr,
    .users-table td {
        display: block;
        width: 100%;
    }

    .users-table tbody tr {
        padding: 10px 0;
        border-bottom: 1px solid var(--line);
    }

    .users-table tbody tr:last-child {
        border-bottom: 0;
    }

    .users-table tbody td {
        padding: 0;
        border: 0;
    }

    .users-table tbody td:nth-child(n + 2) {
        display: none;
    }

    .user-cell {
        min-width: 0;
        align-items: flex-start;
        gap: 9px;
    }

    .user-cell > div {
        min-width: 0;
        flex: 1 1 auto;
    }

    .user-cell strong,
    .user-cell small {
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .mobile-user-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 4px;
    }

    .mobile-manage-link {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 3px;
        padding: 5px 8px;
        font-size: 0.67rem;
        border-radius: 8px;
    }

    .pagination-wrap {
        justify-content: center;
    }

    .account-list {
        grid-template-columns: 1fr;
    }

    .danger-action {
        align-items: stretch;
        flex-direction: column;
    }

    .danger-action form .btn {
        width: 100%;
    }

    .panel-actions {
        flex-direction: column-reverse;
    }

    .panel-actions .btn {
        width: 100%;
    }

    .app-header-simple .btn-header-link span {
        display: none;
    }

    .app-header-simple .btn-header-link {
        width: 38px;
        padding: 0;
    }
}

@media (max-width: 575.98px) {
    .auth-card-head {
        gap: 8px;
    }

    .auth-card-head h2 {
        font-size: 1.28rem;
    }

    .auth-card-head p {
        font-size: 0.72rem;
    }

    .auth-help {
        font-size: 0.65rem;
    }

    .today-chip {
        display: none;
    }

    .brand-copy {
        max-width: calc(100vw - 175px);
    }

    .brand-title {
        overflow: hidden;
        font-size: 1rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-header-simple .brand-copy {
        max-width: calc(100vw - 150px);
    }
}
