/* =========================================================
   VARIABLES
========================================================= */
:root {
    --primary: #034347;
    --primary-hover: #022f32;
    --accent: #a3b305;

    --bg: #f7f9f9;
    --card-bg: #ffffff;

    --text: #1F1F1F;
    --text-light: #6b7280;

    --border: #e5e7eb;
    --error: #dc2626;
    --success: #16a34a;
    --warning: #d97706;

    --radius: 10px;
}

/* FIX GLOBAL BOX MODEL */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* =========================================================
   BASE
========================================================= */
html, body {
    font-family: system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100%;
    margin: 0;
    overflow-x: hidden;
}
.app-body {
    min-height: 100dvh;
    display: flex;
}

/* =========================================================
   LOGIN LAYOUT (SPLIT SCREEN)
========================================================= */

.login-layout {
    display: flex;
    min-height: 100vh;
}

/* HERO IZQUIERDO */
.login-hero {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px;
}

.hero-content {
    max-width: 400px;
}

.hero-content h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 16px;
    opacity: 0.9;
}

/* FORM DERECHO */
.login-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* FORM CARD */
.login-form form {
    width: 100%;
    max-width: 380px;
}

/* TITULO */
.login-form h2 {
    margin-bottom: 20px;
}

/* PASSWORD TOGGLE */
.password-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 14px;
}

/* SWITCH CUSTOM (usa tu sistema pero lo adaptamos) */
.switch-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

.switch-container input {
    display: none;
}

.switch-slider {
    width: 38px;
    height: 20px;
    background: #ccc;
    border-radius: 50px;
    position: relative;
    cursor: pointer;
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.switch-container input:checked + .switch-slider {
    background: var(--primary);
}

.switch-container input:checked + .switch-slider::before {
    transform: translateX(18px);
}

/* BOTON LOGIN */
#loginBtn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
}

#loginBtn:hover {
    background: var(--primary-hover);
}

/* SPINNER */
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 1s linear infinite;
}

/* FORGOT */
.forgot {
    margin-top: 10px;
    text-align: center;
}

.forgot a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

/* ERROR */
.error {
    margin-top: 15px;
    padding: 10px;
    border-radius: var(--radius);
    background: #fef2f2;
    color: var(--error);
    font-size: 14px;
    text-align: center;
}


/* =========================================================
   LAYOUT
========================================================= */
.app {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* zona derecha */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

/* contenido crece */
.main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.content-header {
    margin-bottom: 20px;
}

.content-header h1 {
    margin: 0;
    font-size: 22px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

/* =========================================================
   OVERLAY
========================================================= */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: .2s;
    z-index: 2000;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   TOPBAR
========================================================= */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between; /* 🔥 CLAVE */
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: var(--radius);
    transition: background 0.2s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* hover tipo SaaS */
.topbar-user:hover {
    background: #f1f5f9;
}

/* nombre usuario */
.topbar-user span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.topbar-user:active {
    transform: scale(0.97);
}

.menu-btn {
    display: none;
}

/* ===============================
   AVATAR
=============================== */

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;
    font-weight: 600;

    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* =========================================================
   CARDS (MEJORADO)
========================================================= */
.card {
    background: var(--card-bg);
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: 0.2s;
}

.card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

/* =========================================================
   FORMULARIOS (PRO)
========================================================= */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    display: block;
    max-width: 100%;
}

label {
    font-size: 13px;
    margin-bottom: 5px;
    display: block;
}

input, select, textarea {
    width: 100%;
    padding: 11px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

input:focus {
    border-color: var(--primary);
}

/* ===============================
   SWITCH
=============================== */

.switch-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    width: 42px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 50px;
    transition: 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked + .slider {
    background: var(--primary);
}

.switch input:checked + .slider::before {
    transform: translateX(18px);
}

.switch-label {
    font-size: 14px;
    color: var(--text);
}

/* =========================================================
   BOTONES
========================================================= */
.btn {
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    background: #fff;
    color: var(--text);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
}

.btn-secondary {
    background: #f8fafc;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: var(--error);
    color: #fff;
    border: none;
}

/* =========================================================
   ALERTS
========================================================= */
.alert {
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.alert-success { background:#ecfdf5; color: var(--success); }
.alert-error { background:#fef2f2; color: var(--error); }

/* =========================================================
   EMPTY STATE
========================================================= */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* =========================================================
   LOADER
========================================================= */
.loader {
    border: 4px solid #eee;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   MODALES (PRO)
========================================================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);

    display: flex;
    justify-content: center;
    align-items: center;

    opacity: 0;
    visibility: hidden;
    transition: .2s;
    z-index: 3000;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    background: #fff;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}

.modal-content.modal-large {
    max-width: 860px;
}

/* HEADER */
.modal-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* BODY SCROLL */
.modal-body {
    padding: 15px;
    overflow-y: auto;
}

/* FOOTER */
.modal-footer {
    padding: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =========================================================
   TOAST
========================================================= */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 4000;
}

.toast {
    background: #fff;
    padding: 10px 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 768px) {

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-110%);

        overflow: hidden;             /* 🔥 evita fugas */
        box-shadow: 2px 0 20px rgba(0,0,0,0.15); /* opcional pro */
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .overlay {
        z-index: 2000;
    }

    .main-content {
        padding: 15px;
    }

    .menu-btn {
        display: block;
    }

    .topbar-user span {
        display: none; /* 🔥 solo avatar en móvil */
    }

    .topbar-user {
        padding: 5px;
    }

    /* .table th:nth-child(3),
    .table td:nth-child(3) {
        display: none; oculta intentos en móvil
    } */

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-layout {
        flex-direction: column;
    }

    .login-hero {
        display: none;
    }

    .login-form {
        flex: none;
        min-height: 100vh;
    }
}


/* =========================================================
   SIDEBAR PRO
========================================================= */

.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 15px 10px;
    transition: transform 0.25s ease, width 0.25s ease;
    z-index: 3000; /* MÁS ALTO QUE OVERLAY */
}

/* COLLAPSED */
.sidebar.collapsed {
    width: 70px;
}

/* HEADER */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    font-weight: 600;
}

/* LOGO */
.logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 10px;
    background: #f1f5f9;
    padding: 4px;
}

.sidebar.collapsed .title {
    display: none;
}

.sidebar.collapsed .logo {
    width: 100%;
    justify-content: center;
}

/* NAV */
.sidebar-nav {
    flex: 1;
    margin-top: 10px;
}

/* ITEM */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}

/* ICON */
.sidebar-item .icon {
    width: 20px;
    text-align: center;
}

/* TEXT HIDE */
.sidebar.collapsed .text {
    display: none;
}

/* HOVER */
.sidebar-item:hover {
    background: #f1f5f9;
}

/* ACTIVE */
.sidebar-item.active {
    background: rgba(3,67,71,0.1);
    color: var(--primary);
    position: relative;
}

/* LEFT BAR */
.sidebar-item.active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--primary);
    border-radius: 5px;
}

/* GROUP */
.sidebar-group {
    margin-top: 10px;
}

/* TOGGLE */
.sidebar-group-toggle {
    width: 100%;
    border: none;
    background: none;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    border-radius: var(--radius);
}

.sidebar-group-toggle:hover {
    background: #f1f5f9;
}

/* ARROW */
.arrow {
    transition: transform 0.2s;
}

.sidebar-group-toggle.open .arrow {
    transform: rotate(180deg);
}

/* SUBMENU */
.sidebar-submenu {
    display: none;
    padding-left: 30px;
}

.sidebar-submenu.show {
    display: block;
}

/* FOOTER */
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

/* =========================================================
   TABLE PRO (SaaS STYLE)
========================================================= */

.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
}

/* TABLA BASE */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
}

/* HEADER */
.table thead {
    background: #f9fafb;
}

.table th {
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
    padding: 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* FILAS */
.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

/* HOVER */
.table tbody tr {
    transition: all 0.15s ease;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* CLICKABLE ROW */
.table tbody tr.clickable {
    cursor: pointer;
}

.table tbody tr.clickable:active {
    transform: scale(0.998);
}

.table tbody tr.fila-intento:hover {
    background: #eef6f7;
}

/* EMPTY */
.table-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
}

/* =========================================================
   BADGES (ESTADO / SEMAFORO)
========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

/* COLORES */
.badge-gray {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-green {
    background: #ecfdf5;
    color: var(--success);
}

.badge-yellow {
    background: #fffbeb;
    color: var(--warning);
}

.badge-red {
    background: #fef2f2;
    color: var(--error);
}

/* DOT */
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* =========================================================
   PERSON CELL (AVATAR + TEXTO)
========================================================= */

.cell-person {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cell-person .avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

/* =========================================================
   DETALLE PAGE PRO
========================================================= */

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.detail-header h1 {
    margin: 0;
    font-size: 20px;
}

/* GRID INFO */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.detail-grid .full {
    grid-column: 1 / -1;
}

/* ACTION BAR */
.actions-bar {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

/* CARD HEADER */
.card-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

/* FILA INTENTO CLICK */
.fila-intento {
    cursor: pointer;
}

/* =========================================================
   DASHBOARD SHELL - META BUSINESS STYLE
========================================================= */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 64px;
    --shell-transition: 200ms ease;
}

html,
body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-body {
    display: block;
    min-height: 100dvh;
    background: #f6f7f9;
}

.app-shell {
    min-height: 100dvh;
    width: 100%;
}

.app-main {
    min-height: 100dvh;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--shell-transition);
}

.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed-width);
}

.main-content {
    max-width: 1280px;
    padding: calc(var(--topbar-height) + 24px) 24px 32px;
}

.overlay {
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(1px);
    z-index: 1050;
}

/* ===============================
   TOPBAR
=============================== */
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    z-index: 1000;
    min-height: var(--topbar-height);
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e6e8ec;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    backdrop-filter: saturate(160%) blur(10px);
    transition: left var(--shell-transition);
}

.sidebar-collapsed .topbar {
    left: var(--sidebar-collapsed-width);
}

.topbar-left {
    min-width: 0;
    gap: 14px;
}

.topbar-title {
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    letter-spacing: 0;
}

.topbar-title span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-btn {
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: background var(--shell-transition), border-color var(--shell-transition), color var(--shell-transition);
}

.menu-btn:hover {
    background: #f8fafc;
    border-color: #d1d5db;
    color: var(--primary);
}

.menu-btn:focus-visible,
.sidebar-link:focus-visible {
    outline: 2px solid rgba(3, 67, 71, 0.35);
    outline-offset: 2px;
}

.topbar-user {
    min-width: 0;
    height: 40px;
    gap: 10px;
    padding: 4px 6px 4px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
}

.topbar-user:hover {
    background: #f8fafc;
    border-color: #e5e7eb;
}

.topbar-user-name {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===============================
   SIDEBAR
=============================== */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1100;
    width: var(--sidebar-width);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #ffffff;
    border-right: 1px solid #e6e8ec;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width var(--shell-transition), transform var(--shell-transition);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    overflow: visible;
}

.sidebar-header {
    height: 48px;
    padding: 0 4px 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eef0f3;
}

.sidebar-brand {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111827;
    text-decoration: none;
    border-radius: 8px;
}

.sidebar-brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f3f6f6;
}

.sidebar-brand-mark img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.sidebar-brand-text {
    min-width: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
}

.sidebar-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.sidebar-section {
    display: grid;
    gap: 4px;
    margin-top: 8px;
}

.sidebar-link {
    position: relative;
    min-height: 42px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--shell-transition), color var(--shell-transition);
}

.sidebar-link:hover {
    background: #f3f6f6;
    color: #0f172a;
}

.sidebar-link.active {
    background: rgba(3, 67, 71, 0.1);
    color: var(--primary);
}

.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 999px;
    background: var(--primary);
}

.sidebar-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-chevron {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: #94a3b8;
    transition: transform var(--shell-transition);
}

.sidebar-chevron .sidebar-icon {
    width: 16px;
    height: 16px;
}

.sidebar-group-toggle.open .sidebar-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: none;
    gap: 3px;
    padding: 2px 0 2px 16px;
    margin-left: 10px;
    border-left: 1px solid #e7eaee;
}

.sidebar-submenu.show {
    display: grid;
}

.sidebar-submenu .sidebar-link {
    min-height: 38px;
    padding-left: 10px;
    font-size: 13px;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eef0f3;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-chevron {
    opacity: 0;
    visibility: hidden;
    width: 0;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
}

.sidebar.collapsed .sidebar-submenu {
    display: none;
}

.sidebar.collapsed .sidebar-link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    z-index: 1300;
    max-width: 220px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(-4px);
    transition: opacity var(--shell-transition), transform var(--shell-transition);
}

.sidebar.collapsed .sidebar-link[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.sidebar.collapsed .sidebar-link[data-tooltip]:hover {
    overflow: visible;
}

@media (max-width: 768px) {
    .app-main,
    .sidebar-collapsed .app-main {
        margin-left: 0;
    }

    .topbar,
    .sidebar-collapsed .topbar {
        left: 0;
        min-height: 58px;
        padding: 0 14px;
    }

    .menu-btn {
        display: inline-flex;
    }

    .main-content {
        padding: calc(58px + 16px) 14px 24px;
    }

    .sidebar,
    .sidebar.collapsed {
        width: min(86vw, var(--sidebar-width));
        overflow-x: hidden;
        overflow-y: auto;
        transform: translateX(-105%);
        box-shadow: 18px 0 40px rgba(15, 23, 42, 0.18);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.collapsed .sidebar-brand {
        justify-content: flex-start;
    }

    .sidebar.collapsed .sidebar-brand-text,
    .sidebar.collapsed .sidebar-label,
    .sidebar.collapsed .sidebar-chevron {
        width: auto;
        opacity: 1;
        visibility: visible;
    }

    .sidebar.collapsed .sidebar-link {
        justify-content: flex-start;
        gap: 12px;
        padding: 9px 10px;
    }

    .topbar-user-name {
        display: none;
    }
}
