* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--tcl-font);
    color: var(--tcl-text);
    background: var(--tcl-bg);
}
.tcl-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: 14px 0;
    color: var(--tcl-white);
    background: linear-gradient(135deg, var(--tcl-blue-night), #123866);
    box-shadow: 0 8px 24px rgba(11,31,58,.18);
}
.tcl-brand { font-weight: 800; letter-spacing: .2px; font-size: 1.15rem; }
.tcl-brand-subtitle { opacity: .78; font-size: .82rem; }
.tcl-user-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 999px;
    font-size: .86rem;
}
.tcl-shell {
    display: flex;
    min-height: calc(100vh - 72px);
}
.tcl-sidebar {
    width: 260px;
    flex: 0 0 260px;
    padding: 24px 16px;
    background: var(--tcl-white);
    border-right: 1px solid var(--tcl-border);
}
.tcl-sidebar-title {
    margin: 0 8px 14px;
    font-size: .76rem;
    font-weight: 700;
    color: var(--tcl-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.tcl-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    margin-bottom: 6px;
    border-radius: 12px;
    color: #334155;
    text-decoration: none;
    font-weight: 650;
}
.tcl-sidebar-link:hover { background: #eef4ff; color: var(--tcl-blue-night); }
.tcl-sidebar-link.active { background: var(--tcl-blue-night); color: var(--tcl-white); }
.tcl-sidebar-link.mobile { color: var(--tcl-text); }
.tcl-sidebar-link.mobile.active { color: var(--tcl-white); }
.tcl-sidebar-icon { width: 26px; text-align: center; }
.tcl-main {
    flex: 1;
    padding: 28px;
    min-width: 0;
}
.tcl-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.tcl-page-header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2.1rem);
    font-weight: 850;
    color: var(--tcl-blue-night);
}
.tcl-page-header p { margin: 4px 0 0; color: var(--tcl-muted); }
.tcl-card {
    background: var(--tcl-white);
    border: 1px solid var(--tcl-border);
    border-radius: var(--tcl-radius);
    box-shadow: var(--tcl-shadow);
}
.tcl-stat-card {
    padding: 18px;
    height: 100%;
}
.tcl-stat-label { color: var(--tcl-muted); font-size: .9rem; font-weight: 700; }
.tcl-stat-value { font-size: 2rem; font-weight: 850; color: var(--tcl-blue-night); }
.tcl-stat-note { color: var(--tcl-muted); font-size: .85rem; }
.tcl-section-title { font-weight: 800; color: var(--tcl-blue-night); }
.tcl-footer {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 18px;
    color: var(--tcl-muted);
    font-size: .85rem;
}
.tcl-status-live { color: var(--tcl-green); font-weight: 800; }
@media (max-width: 991.98px) {
    .tcl-main { padding: 18px; }
    .tcl-page-header { margin-bottom: 16px; }
}

/* Auth V2 */
.tcl-login-body {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(13,110,253,.18), transparent 32%), linear-gradient(135deg, var(--tcl-blue-night), #0f2747 55%, #071525);
}
.tcl-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.tcl-login-card {
    width: min(100%, 460px);
    padding: 28px;
    background: var(--tcl-white);
    border-radius: 22px;
    box-shadow: 0 28px 80px rgba(0,0,0,.28);
}
.tcl-login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}
.tcl-login-logo {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--tcl-blue-night);
    color: #fff;
    font-weight: 900;
    letter-spacing: .04em;
}
.tcl-login-brand h1 { margin: 0; font-size: 1.25rem; font-weight: 850; color: var(--tcl-blue-night); }
.tcl-login-brand p { margin: 2px 0 0; color: var(--tcl-muted); font-size: .88rem; }
.tcl-login-heading h2 { font-weight: 850; color: var(--tcl-blue-night); font-size: 1.45rem; }
.tcl-login-heading p { color: var(--tcl-muted); }
.tcl-login-footer { margin-top: 18px; text-align: center; color: var(--tcl-muted); font-size: .82rem; }
.tcl-org-box {
    margin: 0 8px 14px;
    padding: 12px;
    border-radius: 14px;
    background: #f1f5f9;
    border: 1px solid var(--tcl-border);
}
.tcl-org-box span { display: block; color: var(--tcl-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.tcl-org-box strong { display: block; color: var(--tcl-blue-night); font-size: .92rem; }
.tcl-table thead th { color: var(--tcl-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
/* Usuarios V3 */
.tcl-role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.tcl-role-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--tcl-border);
    border-radius: 12px;
    background: #f8fafc;
    font-weight: 650;
    color: var(--tcl-text);
    cursor: pointer;
}
.tcl-role-check input { margin: 0; }
.tcl-role-check:hover { border-color: rgba(13,110,253,.35); background: #eef4ff; }
.tcl-role-list { font-size: .88rem; color: #334155; }
.tcl-table td { vertical-align: middle; }

/* V22 - Navegación compacta, responsive y amigable para smartphone */
:root {
    --tcl-sidebar-width: 238px;
    --tcl-topbar-height: 58px;
}
.min-w-0 { min-width: 0; }
.tcl-topbar {
    padding: 10px 0;
    min-height: var(--tcl-topbar-height);
}
.tcl-brand { font-size: 1.02rem; line-height: 1.1; }
.tcl-brand-subtitle { font-size: .75rem; line-height: 1.1; }
.tcl-menu-button { min-width: 38px; font-weight: 800; }
.tcl-user-chip {
    min-height: 28px;
    padding: 3px 10px;
    max-width: min(46vw, 420px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: .8rem;
}
.tcl-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
}
.tcl-shell { min-height: calc(100vh - var(--tcl-topbar-height)); }
.tcl-sidebar {
    width: var(--tcl-sidebar-width);
    flex: 0 0 var(--tcl-sidebar-width);
    padding: 0;
    background: #ffffff;
    border-right: 1px solid var(--tcl-border);
}
.tcl-sidebar-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100vh - var(--tcl-topbar-height));
    position: sticky;
    top: var(--tcl-topbar-height);
}
.tcl-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px 16px;
}
.tcl-sidebar-brand-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 8px;
    border-bottom: 1px solid #eef2f7;
}
.tcl-sidebar-brand-mini strong { display: block; color: var(--tcl-blue-night); font-size: .94rem; line-height: 1.1; }
.tcl-sidebar-brand-mini small { display: block; color: var(--tcl-muted); font-size: .72rem; line-height: 1.1; }
.tcl-sidebar-logo {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--tcl-blue-night);
    color: #fff;
    font-size: .8rem;
    font-weight: 900;
    letter-spacing: .03em;
}
.tcl-org-box {
    margin: 10px 10px 8px;
    padding: 9px 10px;
    border-radius: 12px;
}
.tcl-org-box span { font-size: .66rem; }
.tcl-org-box strong { font-size: .82rem; line-height: 1.15; }
.tcl-sidebar-title {
    margin: 12px 8px 5px;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .09em;
}
.tcl-sidebar-link {
    gap: 8px;
    padding: 7px 9px;
    margin-bottom: 3px;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 680;
    line-height: 1.16;
}
.tcl-sidebar-link small {
    display: block;
    color: inherit;
    opacity: .68;
    font-size: .68rem;
    font-weight: 550;
    margin-top: 1px;
}
.tcl-sidebar-icon {
    width: 22px;
    flex: 0 0 22px;
    font-size: .95rem;
    text-align: center;
}
.tcl-sidebar-text {
    min-width: 0;
    display: block;
}
.tcl-sidebar-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tcl-main {
    padding: 20px 22px;
}
.tcl-page-header {
    margin-bottom: 14px;
}
.tcl-page-header h1 {
    font-size: clamp(1.22rem, 1.7vw, 1.72rem);
    line-height: 1.15;
}
.tcl-page-header p {
    font-size: .88rem;
    line-height: 1.35;
}
.tcl-card {
    border-radius: 14px;
}
.tcl-stat-card { padding: 14px; }
.tcl-stat-label { font-size: .78rem; }
.tcl-stat-value { font-size: 1.55rem; }
.tcl-stat-note { font-size: .78rem; }
.tcl-table thead th { font-size: .72rem; }
.table { font-size: .88rem; }
.btn { --bs-btn-border-radius: .65rem; }
.form-label { font-size: .86rem; font-weight: 700; color: #334155; }
.form-control, .form-select { font-size: .9rem; border-radius: .7rem; }
.badge { font-weight: 750; }
.offcanvas.tcl-mobile-menu { max-width: min(88vw, 340px); }
.tcl-mobile-menu .offcanvas-header { padding: 14px 16px; }
.tcl-mobile-menu .offcanvas-body { padding: 8px 12px 18px; }
.tcl-mobile-menu .tcl-sidebar-link { padding: 10px 11px; margin-bottom: 4px; font-size: .9rem; }
@media (max-width: 991.98px) {
    body { background: #f7f9fc; }
    .tcl-main { padding: 14px; }
    .tcl-page-header {
        display: block;
        margin-bottom: 12px;
    }
    .tcl-page-header h1 { font-size: 1.24rem; }
    .tcl-page-header p { font-size: .82rem; }
    .tcl-card { border-radius: 13px; }
    .table-responsive { border-radius: 12px; }
    .tcl-footer { padding: 12px; font-size: .76rem; }
}
@media (max-width: 575.98px) {
    .tcl-topbar .container-fluid { gap: 8px; }
    .tcl-brand { font-size: .96rem; }
    .tcl-user-chip { max-width: 42vw; padding: 3px 8px; font-size: .74rem; }
    .btn-sm { --bs-btn-padding-y: .22rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .78rem; }
    .tcl-main { padding: 10px; }
    .tcl-page-header h1 { font-size: 1.14rem; }
    .tcl-page-header p { display: none; }
    .tcl-stat-value { font-size: 1.35rem; }
    .table { font-size: .8rem; }
}

/* V25 - Menú desplegable/accordion compacto */
.tcl-menu-group {
    margin: 4px 0 6px;
}
.tcl-menu-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #334155;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}
.tcl-menu-group-toggle:hover {
    background: #f1f5f9;
    color: var(--tcl-blue-night);
}
.tcl-menu-group.active-group > .tcl-menu-group-toggle {
    background: #eef4ff;
    color: var(--tcl-blue-night);
}
.tcl-menu-group-icon {
    width: 23px;
    flex: 0 0 23px;
    text-align: center;
    font-size: .95rem;
}
.tcl-menu-group-text {
    min-width: 0;
    display: block;
    flex: 1;
}
.tcl-menu-group-text strong {
    display: block;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tcl-menu-group-text small {
    display: block;
    margin-top: 1px;
    color: var(--tcl-muted);
    font-size: .64rem;
    font-weight: 650;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tcl-menu-group-caret {
    width: 17px;
    flex: 0 0 17px;
    text-align: center;
    color: #64748b;
    font-size: .95rem;
    transform: rotate(-90deg);
    transition: transform .16s ease;
}
.tcl-menu-group.open > .tcl-menu-group-toggle .tcl-menu-group-caret {
    transform: rotate(0deg);
}
.tcl-menu-group-panel {
    display: none;
    padding: 2px 0 3px 25px;
}
.tcl-menu-group-panel.show {
    display: block;
}
.tcl-menu-group-panel .tcl-sidebar-link {
    padding: 6px 8px;
    margin-bottom: 2px;
    border-radius: 9px;
    font-size: .805rem;
}
.tcl-menu-group-panel .tcl-sidebar-icon {
    width: 11px;
    flex-basis: 11px;
    color: #94a3b8;
    font-size: .75rem;
}
.tcl-sidebar-link.disabled {
    opacity: .48;
    pointer-events: none;
}
.tcl-mobile-menu .tcl-menu-group-toggle {
    padding: 10px 10px;
}
.tcl-mobile-menu .tcl-menu-group-panel {
    padding-left: 23px;
}
.tcl-mobile-menu .tcl-menu-group-panel .tcl-sidebar-link {
    padding: 9px 9px;
    font-size: .86rem;
}
@media (min-width: 992px) {
    .tcl-sidebar-scroll {
        padding-top: 7px;
    }
}
@media (max-width: 575.98px) {
    .tcl-menu-group-text strong { font-size: .86rem; }
    .tcl-menu-group-text small { display: none; }
}
