/*
 * TurnoPro Design — components.css
 * ---------------------------------
 * Componentes reutilizables. Prefijo `tp-` para no chocar con Bootstrap.
 * Carga DESPUÉS de tokens.css y base.css.
 */

/* =================================================================
   App bar (header superior)
   ================================================================= */
.tp-app-bar {
    padding: var(--tp-space-4) 0;
    position: sticky;
    top: 0;
    z-index: var(--tp-z-raised);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    background: var(--tp-surface);
    border-bottom: 1px solid var(--tp-border);
    box-shadow: var(--tp-shadow-xs);
}
.tp-app-bar__inner {
    max-width: var(--tp-container);
    margin: 0 auto;
    padding: 0 var(--tp-space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tp-space-4);
}
.tp-app-bar__brand {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
    font-weight: var(--tp-weight-semibold);
    color: var(--tp-text);
}
.tp-app-bar__brand img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}
.tp-app-bar__brand-mark {
    width: 40px;
    height: 40px;
    border-radius: var(--tp-radius-md);
    background: linear-gradient(135deg, var(--tp-brand), var(--tp-brand-strong));
    color: var(--tp-brand-contrast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--tp-weight-bold);
    font-size: var(--tp-text-lg);
    box-shadow: var(--tp-shadow-brand);
}
.tp-app-bar__brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.tp-app-bar__brand-text strong { font-size: var(--tp-text-base); font-weight: var(--tp-weight-semibold); }
.tp-app-bar__brand-text small { font-size: var(--tp-text-xs); color: var(--tp-text-muted); }

.tp-app-bar__actions {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
}
.tp-app-bar__user {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
    padding: var(--tp-space-1) var(--tp-space-2) var(--tp-space-1) var(--tp-space-3);
    border-radius: var(--tp-radius-full);
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    box-shadow: var(--tp-shadow-xs);
}
.tp-app-bar__user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: right;
}
.tp-app-bar__user-info strong { font-size: var(--tp-text-sm); font-weight: var(--tp-weight-semibold); color: var(--tp-text); }
.tp-app-bar__user-info small  { font-size: var(--tp-text-xs); color: var(--tp-text-muted); }

/* =================================================================
   Page header (título + descripción de una sección, estilo hero)
   ================================================================= */
.tp-page-header {
    padding: var(--tp-space-12) 0 var(--tp-space-10);
    position: relative;
}
.tp-page-header__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--tp-space-2);
    padding: 6px var(--tp-space-3);
    border-radius: var(--tp-radius-full);
    background: var(--tp-brand-soft);
    color: var(--tp-brand-strong);
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-weight-semibold);
    letter-spacing: var(--tp-tracking-wide);
    text-transform: uppercase;
    margin-bottom: var(--tp-space-4);
    border: 1px solid rgba(var(--tp-brand-rgb), 0.20);
}
.tp-page-header__title {
    font-size: var(--tp-text-4xl);
    font-weight: var(--tp-weight-bold);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0;
    color: var(--tp-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--tp-text); /* fallback */
}
.tp-page-header__subtitle {
    color: var(--tp-text-muted);
    font-size: var(--tp-text-lg);
    margin-top: var(--tp-space-3);
    max-width: 64ch;
    line-height: var(--tp-leading-normal);
}

/* =================================================================
   Card (contenedor genérico)
   ================================================================= */
.tp-card {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-lg);
    padding: var(--tp-space-6);
    box-shadow: var(--tp-shadow-sm);
    transition: border-color var(--tp-transition), box-shadow var(--tp-transition), transform var(--tp-transition);
    display: flex;
    flex-direction: column;
    gap: var(--tp-space-4);
}
.tp-card--clickable {
    cursor: pointer;
    user-select: none;
}
.tp-card--clickable:hover {
    border-color: var(--tp-brand);
    box-shadow: var(--tp-shadow-md);
    transform: translateY(-2px);
}
.tp-card--clickable:active { transform: translateY(0); }
.tp-card--flat { box-shadow: none; }
.tp-card--raised { box-shadow: var(--tp-shadow-sm); border-color: transparent; }

/* Tarjeta tipo "selector" (estilo dispositivos) */
.tp-tile {
    --accent: var(--tp-brand);
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-xl);
    padding: var(--tp-space-6);
    display: flex;
    flex-direction: column;
    gap: var(--tp-space-5);
    cursor: pointer;
    user-select: none;
    text-align: left;
    transition: transform var(--tp-transition), border-color var(--tp-transition), box-shadow var(--tp-transition);
    position: relative;
    overflow: hidden;
    min-height: 240px;
    box-shadow: var(--tp-shadow-sm);
    animation: tp-tile-in 0.5s var(--tp-ease-out) both;
}

/* Decoración: blob de color del accent en la esquina superior derecha */
.tp-tile::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--accent-rgb, var(--tp-brand-rgb)), 0.22), transparent 65%);
    pointer-events: none;
    transition: opacity var(--tp-transition);
    opacity: 0.65;
}
.tp-tile::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--tp-transition);
}

.tp-tile:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: var(--tp-shadow-accent);
}
.tp-tile:hover::before { opacity: 1; }
.tp-tile:hover::after { opacity: 1; }
.tp-tile:active { transform: translateY(-2px); }

.tp-tile__icon {
    width: 64px;
    height: 64px;
    border-radius: var(--tp-radius-lg);
    background: linear-gradient(135deg,
        rgba(var(--accent-rgb, var(--tp-brand-rgb)), 0.16),
        rgba(var(--accent-rgb, var(--tp-brand-rgb)), 0.05));
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all var(--tp-transition);
    flex-shrink: 0;
    border: 1px solid rgba(var(--accent-rgb, var(--tp-brand-rgb)), 0.22);
    box-shadow: 0 4px 12px -4px rgba(var(--accent-rgb, var(--tp-brand-rgb)), 0.35);
}
.tp-tile:hover .tp-tile__icon {
    background: var(--accent);
    color: white;
    transform: rotate(-4deg) scale(1.05);
    box-shadow: 0 12px 28px -8px rgba(var(--accent-rgb, var(--tp-brand-rgb)), 0.5);
    border-color: transparent;
}
.tp-tile__body { flex: 1; display: flex; flex-direction: column; gap: var(--tp-space-2); }
.tp-tile__title {
    font-size: var(--tp-text-xl);
    font-weight: var(--tp-weight-bold);
    color: var(--tp-text);
    line-height: var(--tp-leading-tight);
    letter-spacing: var(--tp-tracking-tight);
    margin: 0;
}
.tp-tile__desc {
    font-size: var(--tp-text-sm);
    color: var(--tp-text-muted);
    line-height: var(--tp-leading-normal);
    margin: 0;
}
.tp-tile__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--tp-space-2);
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-weight-semibold);
    color: var(--accent);
    margin-top: auto;
    transition: gap var(--tp-transition);
    padding-top: var(--tp-space-2);
    border-top: 1px dashed var(--tp-border);
}
.tp-tile:hover .tp-tile__cta { gap: var(--tp-space-3); }

@keyframes tp-tile-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stagger animation: cada tile entra un poco después que el anterior */
.tp-tile:nth-child(1) { animation-delay: 0ms; }
.tp-tile:nth-child(2) { animation-delay: 60ms; }
.tp-tile:nth-child(3) { animation-delay: 120ms; }
.tp-tile:nth-child(4) { animation-delay: 180ms; }
.tp-tile:nth-child(5) { animation-delay: 240ms; }
.tp-tile:nth-child(6) { animation-delay: 300ms; }
.tp-tile:nth-child(7) { animation-delay: 360ms; }
.tp-tile:nth-child(8) { animation-delay: 420ms; }

@media (prefers-reduced-motion: reduce) {
    .tp-tile { animation: none; }
    .tp-tile:hover { transform: none; }
    .tp-tile:hover .tp-tile__icon { transform: none; }
}

/* =================================================================
   Botones
   ================================================================= */
.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--tp-space-2);
    padding: var(--tp-space-3) var(--tp-space-5);
    border-radius: var(--tp-radius);
    border: 1px solid transparent;
    background: var(--tp-surface);
    color: var(--tp-text);
    font-family: inherit;
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-weight-semibold);
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--tp-transition);
    white-space: nowrap;
}
.tp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tp-btn--primary {
    background: linear-gradient(135deg, var(--tp-brand), var(--tp-brand-strong));
    color: var(--tp-brand-contrast);
    border-color: var(--tp-brand-strong);
    box-shadow: 0 2px 6px -1px rgba(var(--tp-brand-rgb), 0.4), inset 0 1px 0 rgba(255,255,255,0.18);
}
.tp-btn--primary:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: var(--tp-shadow-brand);
}
.tp-btn--primary:active:not(:disabled) { transform: translateY(0); filter: brightness(0.97); }

.tp-btn--secondary {
    background: var(--tp-surface);
    color: var(--tp-text);
    border-color: var(--tp-border-strong);
}
.tp-btn--secondary:hover:not(:disabled) {
    border-color: var(--tp-brand);
    color: var(--tp-brand-strong);
}

.tp-btn--ghost {
    background: transparent;
    color: var(--tp-text-muted);
    border-color: transparent;
}
.tp-btn--ghost:hover:not(:disabled) {
    background: var(--tp-surface-alt);
    color: var(--tp-text);
}

.tp-btn--danger {
    background: var(--tp-danger);
    color: white;
    border-color: var(--tp-danger);
}

.tp-btn--sm { padding: var(--tp-space-2) var(--tp-space-3); font-size: var(--tp-text-xs); }
.tp-btn--lg { padding: var(--tp-space-4) var(--tp-space-6); font-size: var(--tp-text-base); }
.tp-btn--block { width: 100%; }

/* =================================================================
   Badges / chips
   ================================================================= */
.tp-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--tp-space-1);
    padding: 2px var(--tp-space-2);
    border-radius: var(--tp-radius-full);
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-weight-medium);
    background: var(--tp-surface-alt);
    color: var(--tp-text-muted);
    line-height: 1.4;
}
.tp-badge--brand   { background: var(--tp-brand-soft);   color: var(--tp-brand-strong); }
.tp-badge--success { background: var(--tp-success-soft); color: var(--tp-success); }
.tp-badge--warning { background: var(--tp-warning-soft); color: var(--tp-warning); }
.tp-badge--danger  { background: var(--tp-danger-soft);  color: var(--tp-danger); }
.tp-badge--info    { background: var(--tp-info-soft);    color: var(--tp-info); }

/* =================================================================
   Inputs (mínimo viable)
   ================================================================= */
.tp-input,
.tp-select,
.tp-textarea {
    width: 100%;
    padding: var(--tp-space-3) var(--tp-space-4);
    background: var(--tp-surface);
    border: 1px solid var(--tp-border-strong);
    border-radius: var(--tp-radius);
    font-family: inherit;
    font-size: var(--tp-text-sm);
    color: var(--tp-text);
    transition: border-color var(--tp-transition), box-shadow var(--tp-transition);
}
.tp-input:focus,
.tp-select:focus,
.tp-textarea:focus {
    outline: none;
    border-color: var(--tp-brand);
    box-shadow: 0 0 0 3px rgba(var(--tp-brand-rgb), 0.18);
}
.tp-label {
    display: block;
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-weight-medium);
    color: var(--tp-text);
    margin-bottom: var(--tp-space-2);
}

/* =================================================================
   Avatar / initials
   ================================================================= */
.tp-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--tp-radius-full);
    background: var(--tp-brand-soft);
    color: var(--tp-brand-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-weight-semibold);
    flex-shrink: 0;
}

/* =================================================================
   Divider
   ================================================================= */
.tp-divider {
    height: 1px;
    background: var(--tp-border);
    border: 0;
    margin: var(--tp-space-6) 0;
}

/* =================================================================
   Skeleton (loading)
   ================================================================= */
.tp-skeleton {
    background: linear-gradient(
        90deg,
        var(--tp-surface-alt) 0%,
        var(--tp-border) 50%,
        var(--tp-surface-alt) 100%
    );
    background-size: 200% 100%;
    animation: tp-shimmer 1.4s linear infinite;
    border-radius: var(--tp-radius);
}
@keyframes tp-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =================================================================
   Responsive — tablet (≤ 1024px)
   ================================================================= */
@media (max-width: 1024px) {
    .tp-app-bar__inner,
    .tp-container,
    .tp-container-narrow {
        padding-left: var(--tp-space-5);
        padding-right: var(--tp-space-5);
    }

    .tp-page-header { padding: var(--tp-space-8) 0 var(--tp-space-6); }
    .tp-page-header__title { font-size: var(--tp-text-2xl); }

    .tp-tile { min-height: 200px; }
}

/* =================================================================
   Responsive — móvil (≤ 640px)
   ================================================================= */
@media (max-width: 640px) {
    .tp-app-bar { padding: var(--tp-space-3) 0; }
    .tp-app-bar__inner {
        padding-left: var(--tp-space-4);
        padding-right: var(--tp-space-4);
        gap: var(--tp-space-2);
    }
    .tp-app-bar__brand img { height: 28px; }
    .tp-app-bar__brand span:not(.tp-app-bar__brand-keep) {
        /* opcionalmente ocultar texto largo del brand en móvil */
        font-size: var(--tp-text-sm);
    }
    .tp-app-bar__actions { gap: var(--tp-space-2); }
    .tp-app-bar__actions .tp-muted { display: none; }   /* esconde email/nombre largo */

    .tp-container,
    .tp-container-narrow {
        padding-left: var(--tp-space-4);
        padding-right: var(--tp-space-4);
    }

    .tp-page-header { padding: var(--tp-space-6) 0 var(--tp-space-5); }
    .tp-page-header__title { font-size: var(--tp-text-2xl); }
    .tp-page-header__subtitle { font-size: var(--tp-text-sm); }

    .tp-tile {
        padding: var(--tp-space-4);
        min-height: 0;            /* dejar que el contenido decida */
        gap: var(--tp-space-3);
    }
    .tp-tile__icon { width: 44px; height: 44px; font-size: 20px; }
    .tp-tile__title { font-size: var(--tp-text-base); }
    .tp-tile__desc  { font-size: var(--tp-text-xs); }

    .tp-card { padding: var(--tp-space-4); }

    .tp-btn { padding: var(--tp-space-3) var(--tp-space-4); }
    .tp-btn--lg { padding: var(--tp-space-3) var(--tp-space-5); font-size: var(--tp-text-sm); }
}

/* =================================================================
   Móvil extra-pequeño (≤ 400px)
   ================================================================= */
@media (max-width: 400px) {
    .tp-page-header__title { font-size: var(--tp-text-xl); }
    .tp-tile__icon { width: 40px; height: 40px; font-size: 18px; }
}

/* =================================================================
   Toolbar (header de pantalla con título + buscador + botón)
   ================================================================= */
.tp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tp-space-4);
    padding: var(--tp-space-4) 0;
    flex-wrap: wrap;
}
.tp-toolbar__left  { display: flex; align-items: center; gap: var(--tp-space-3); min-width: 0; flex: 1; }
.tp-toolbar__title { font-size: var(--tp-text-2xl); font-weight: var(--tp-weight-semibold); color: var(--tp-text); margin: 0; }
.tp-toolbar__right { display: flex; align-items: center; gap: var(--tp-space-2); }
.tp-toolbar__search {
    position: relative;
    min-width: 220px;
}
.tp-toolbar__search input {
    width: 100%;
    padding: var(--tp-space-2) var(--tp-space-3) var(--tp-space-2) 36px;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    background: var(--tp-surface);
    font-family: inherit; font-size: var(--tp-text-sm);
    color: var(--tp-text);
    transition: border-color .15s, box-shadow .15s;
}
.tp-toolbar__search input:focus {
    outline: none;
    border-color: var(--tp-brand);
    box-shadow: 0 0 0 3px rgba(var(--tp-brand-rgb), 0.20);
}
.tp-toolbar__search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tp-text-subtle);
    pointer-events: none;
}

/* =================================================================
   Tabla limpia (sin DataTables)
   ================================================================= */
.tp-table {
    width: 100%;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-md);
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}
.tp-table thead th {
    background: var(--tp-surface-alt);
    padding: var(--tp-space-3) var(--tp-space-4);
    text-align: left;
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tp-text-muted);
    border-bottom: 1px solid var(--tp-border);
}
.tp-table tbody td {
    padding: var(--tp-space-3) var(--tp-space-4);
    font-size: var(--tp-text-sm);
    color: var(--tp-text);
    border-bottom: 1px solid var(--tp-border);
    vertical-align: middle;
}
.tp-table tbody tr:last-child td { border-bottom: none; }
.tp-table tbody tr:hover { background: rgba(var(--tp-brand-rgb), 0.05); }
.tp-table tbody tr.tp-table__row--inactive td { opacity: 0.55; }
.tp-table__actions { display: flex; gap: var(--tp-space-2); justify-content: flex-end; }
.tp-table__num { text-align: right; font-variant-numeric: tabular-nums; }

/* =================================================================
   Drawer (panel lateral derecho con backdrop)
   ================================================================= */
.tp-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: var(--tp-z-overlay, 90);
}
.tp-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.tp-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(480px, 92vw);
    background: var(--tp-surface);
    box-shadow: -16px 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: var(--tp-z-modal, 100);
    display: flex;
    flex-direction: column;
}
.tp-drawer.is-open { transform: translateX(0); }
.tp-drawer__header {
    padding: var(--tp-space-5) var(--tp-space-6);
    border-bottom: 1px solid var(--tp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tp-space-3);
}
.tp-drawer__title { margin: 0; font-size: var(--tp-text-lg); font-weight: var(--tp-weight-semibold); color: var(--tp-text); }
.tp-drawer__close {
    background: transparent;
    border: none;
    color: var(--tp-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--tp-radius-sm);
}
.tp-drawer__close:hover { background: var(--tp-surface-alt); color: var(--tp-text); }
.tp-drawer__body {
    padding: var(--tp-space-5) var(--tp-space-6);
    overflow-y: auto;
    flex: 1;
}
.tp-drawer__body .tp-field { margin-bottom: var(--tp-space-4); }
.tp-drawer__footer {
    padding: var(--tp-space-4) var(--tp-space-6);
    border-top: 1px solid var(--tp-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--tp-space-2);
    background: var(--tp-surface-alt);
}

/* =================================================================
   Empty state
   ================================================================= */
.tp-empty {
    padding: var(--tp-space-12) var(--tp-space-6);
    text-align: center;
    color: var(--tp-text-muted);
}
.tp-empty__icon {
    width: 64px; height: 64px;
    border-radius: var(--tp-radius-full);
    background: var(--tp-brand-soft);
    color: var(--tp-brand-strong);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin-bottom: var(--tp-space-4);
}
.tp-empty__title { font-size: var(--tp-text-lg); font-weight: var(--tp-weight-semibold); color: var(--tp-text); margin-bottom: var(--tp-space-2); }
.tp-empty__desc { color: var(--tp-text-muted); margin-bottom: var(--tp-space-5); max-width: 380px; margin-left: auto; margin-right: auto; }

/* =================================================================
   Toast (notificación ephemeral)
   ================================================================= */
.tp-toast-host {
    position: fixed;
    top: var(--tp-space-4);
    right: var(--tp-space-4);
    display: flex;
    flex-direction: column;
    gap: var(--tp-space-2);
    z-index: var(--tp-z-toast, 200);
    pointer-events: none;
}
.tp-toast {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-left: 4px solid var(--tp-brand);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow-md);
    padding: var(--tp-space-3) var(--tp-space-4);
    font-size: var(--tp-text-sm);
    color: var(--tp-text);
    min-width: 240px;
    max-width: 380px;
    pointer-events: auto;
    animation: tp-toast-in .2s ease;
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
}
.tp-toast--success { border-left-color: var(--tp-success); }
.tp-toast--error   { border-left-color: var(--tp-danger); }
.tp-toast--warning { border-left-color: var(--tp-warning); }
.tp-toast i { color: inherit; }
.tp-toast--success i { color: var(--tp-success); }
.tp-toast--error   i { color: var(--tp-danger); }
.tp-toast--warning i { color: var(--tp-warning); }
@keyframes tp-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =================================================================
   Field group (label + helper text) — útil dentro de drawer
   ================================================================= */
.tp-field { display: flex; flex-direction: column; gap: 6px; }
.tp-field__hint { font-size: var(--tp-text-xs); color: var(--tp-text-subtle); }
.tp-field__row { display: grid; gap: var(--tp-space-3); grid-template-columns: 1fr 1fr; }

/* =================================================================
   Sidebar (navegación admin)
   ================================================================= */
.tp-layout {
    display: grid;
    grid-template-columns: 256px 1fr;
    min-height: 100vh;
}
@media (max-width: 900px) {
    .tp-layout { grid-template-columns: 1fr; }
    .tp-sidebar { display: none; }
}
/* Sidebar oscuro permanente (look enterprise), independiente del tema claro/oscuro del contenido */
.tp-sidebar {
    background: var(--tp-sidebar-bg);
    background-image: linear-gradient(180deg, var(--tp-sidebar-bg-2), var(--tp-sidebar-bg) 220px);
    border-right: 1px solid var(--tp-sidebar-border);
    padding: var(--tp-space-5) 0 var(--tp-space-8);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.tp-sidebar__brand {
    padding: 0 var(--tp-space-5) var(--tp-space-5);
    border-bottom: 1px solid var(--tp-sidebar-border);
    margin-bottom: var(--tp-space-4);
    display: flex; align-items: center; gap: var(--tp-space-3);
}
.tp-sidebar__brand .tp-app-bar__brand-text strong { color: #fff; }
.tp-sidebar__brand .tp-app-bar__brand-text small  { color: var(--tp-sidebar-muted); }
.tp-sidebar__nav { list-style: none; padding: 0 var(--tp-space-3); margin: 0; display: flex; flex-direction: column; gap: 2px; }
.tp-sidebar__item a {
    display: flex; align-items: center; gap: var(--tp-space-3);
    padding: 10px var(--tp-space-4);
    color: var(--tp-sidebar-text);
    text-decoration: none;
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-weight-medium);
    border-radius: var(--tp-radius);
    transition: background .15s, color .15s;
    position: relative;
}
.tp-sidebar__item a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.tp-sidebar__item--active a {
    color: #fff;
    background: linear-gradient(90deg, rgba(var(--tp-brand-rgb), 0.30), rgba(var(--tp-brand-rgb), 0.12));
    box-shadow: inset 0 0 0 1px rgba(var(--tp-brand-rgb), 0.25);
}
.tp-sidebar__item--active a::before {
    content: ''; position: absolute; left: -var(--tp-space-3); left: -4px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 3px; background: var(--tp-brand);
}
.tp-sidebar__item i { width: 20px; text-align: center; font-size: 15px; opacity: .9; }
.tp-content { padding: var(--tp-space-6) var(--tp-space-8); min-width: 0; background: var(--tp-bg); }
