/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}
body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f8f9fb;
    color: #17181c;
    overflow-x: hidden;
}
/* VARIABLES */
:root {
    --white: #ffffff;
    --background: #f8f9fb;
    --border: #e9eaee;
    --text: #17181c;
    --text-light: #777b85;
    --text-muted: #a0a3aa;
    --sidebar-width: 250px;
}
/* DASHBOARD */
.dashboard {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}
/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 25px 16px;
    background: #ffffff;
    border-right: 1px solid var(--border);
}

/* LOGO */
.logo {
    width: 100%;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    margin-bottom: 25px;
    flex-shrink: 0;
    overflow: hidden;
}
.logo-image {
    display: block;
    width: 115px;
    height: 115px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

/* MENÚ */
.menu {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}
.menu-title {
    padding: 0 12px;
    margin: 18px 0 9px;
    color: #a3a5ab;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}
.menu-item {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 13px;
    margin-bottom: 4px;
    border-radius: 9px;
    color: #777b85;
    background: transparent;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.18s ease, color 0.18s ease;
}
.menu-item:hover {
    background: #f6f7f9;
    color: #17181c;
}
.menu-item.active {
    background: #f1f2f4;
    color: #111111;
    font-weight: 600;
}
.icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}
.icon svg {
    display: block;
}
/* LOGOUT SIDEBAR */
.sidebar-bottom {
    padding-top: 12px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
}
.sidebar-bottom .menu-item {
    margin-bottom: 0;
}
/* MAIN */
.main {
    flex: 1;
    min-width: 0;
    width: auto;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}
/* TOPBAR */
.topbar {
    width: 100%;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 35px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}
.page-title {
    min-width: 0;
}
.page-title h1 {
    margin: 0 0 4px;
    color: #17181c;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 700;
}
.page-title p {
    margin: 0;
    color: #777b85;
    font-size: 12px;
}
/* PARTE DERECHA */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
}
/* NOTIFICACIONES */
.notification {
    position: relative;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #e7e8ec;
    border-radius: 11px;
    background: #ffffff;
    color: #17181c;
    cursor: pointer;
    outline: none;
}
.notification:hover {
    background: #fafafa;
}
.notification svg {
    display: block;
}
.notification-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    top: 9px;
    right: 9px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #ef4444;
}
/* PERFIL */
.profile-menu {
    position: relative;
    display: flex;
    align-items: center;
}
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    text-align: left;
}
.profile-trigger:hover,
.profile-trigger:focus,
.profile-trigger:active {
    border: 0;
    outline: none;
    background: transparent;
}
.profile-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: #111111;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.profile-info {
    min-width: 75px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}
.profile-info strong {
    display: block;
    margin: 0;
    color: #17181c;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.profile-info span {
    display: block;
    margin: 0;
    color: #8b9099;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}
.profile-arrow {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 3px;
    color: #777b85;
    transition: transform 0.2s ease;
}
.profile-arrow svg {
    display: block;
}
.profile-menu.active .profile-arrow {
    transform: rotate(180deg);
}
/* DROPDOWN */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 260px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e7e8ec;
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.10);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 2000;
}
.profile-menu.active .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 9px 12px;
}
.dropdown-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: #111111;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}
.dropdown-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.profile-dropdown-header > div:last-child {
    min-width: 0;
}
.profile-dropdown-header strong {
    display: block;
    overflow: hidden;
    color: #17181c;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.profile-dropdown-header span {
    display: block;
    margin-top: 3px;
    color: #777b85;
    font-size: 10px;
}
.profile-dropdown-divider {
    width: 100%;
    height: 1px;
    margin: 3px 0;
    background: #e9eaee;
}
.profile-dropdown-item {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 7px;
    border-radius: 7px;
    color: #4f535b;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.profile-dropdown-item:hover {
    background: #f4f6f8;
    color: #021b44;
}
.dropdown-icon {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #f1f3f5;
    color: #68707a;
}
.dropdown-icon svg {
    display: block;
}
.profile-dropdown-item:hover .dropdown-icon {
    background: #eaf0f7;
    color: #021b44;
}
.profile-dropdown-item.logout-item {
    color: #b42318;
}
.profile-dropdown-item.logout-item:hover {
    background: #fff4f2;
    color: #b42318;
}
.profile-dropdown-item.logout-item .dropdown-icon {
    background: #fff4f2;
    color: #b42318;
}
/* CONTENIDO */
.content {
    width: 100%;
    padding: 20px 28px 30px;
    margin: 0;
    overflow: hidden;
}
/* BIENVENIDA */
.welcome {
    width: 100%;
    min-height: 142px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 24px 28px;
    margin: 0 0 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
}
.welcome-info {
    min-width: 0;
}
.section-label {
    display: block;
    margin-bottom: 7px;
    color: #a0a3aa;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
}
.welcome h2 {
    margin: 0 0 7px;
    color: #17181c;
    font-size: 20px;
    line-height: 1.2;
}
.welcome p {
    margin: 0;
    color: #777b85;
    font-size: 12px;
    line-height: 1.5;
}
/* FECHA */
.date {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: #17181c;
}
.date > svg {
    flex: 0 0 18px;
}
.date > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.date strong {
    color: #17181c;
    font-size: 13px;
    white-space: nowrap;
}
.date span {
    color: #a0a3aa;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* ESTADO DEL SISTEMA */
.system-status {
    width: 100%;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 24px;
    margin-bottom: 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
}
.system-status-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.system-status-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #ecfdf3;
    color: #16a34a;
}
.small-label {
    display: block;
    margin-bottom: 4px;
    color: #a0a3aa;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}
.system-status-left strong {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
}
.system-status-left p {
    margin: 0;
    color: #777b85;
    font-size: 11px;
    line-height: 1.4;
}
.system-active {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    color: #16a34a;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.system-active span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
}
/* TARJETAS */
.qr-cards {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.dashboard-card {
    min-width: 0;
    min-height: 190px;
    padding: 21px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
}
.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 17px;
}
.card-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
}
.card-icon.gray {
    background: #f3f4f6;
    color: #333840;
}
.card-icon.blue {
    background: #eff6ff;
    color: #2563eb;
}
.card-icon.purple {
    background: #f5f3ff;
    color: #7c3aed;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}
.status-badge.green {
    background: #ecfdf3;
    color: #16a34a;
}
.status-badge.gray {
    background: #f3f4f6;
    color: #858a93;
}
.dashboard-card h3 {
    margin: 0 0 8px;
    color: #17181c;
    font-size: 15px;
    line-height: 1.3;
}
.dashboard-card p {
    margin: 0;
    color: #777b85;
    font-size: 11px;
    line-height: 1.55;
}
.card-link {
    display: block;
    margin-top: 15px;
    color: #858a93;
    font-size: 11px;
}
.big-number {
    display: block;
    margin-bottom: 3px;
    color: #111111;
    font-size: 27px;
    line-height: 1.1;
}
.last-access {
    display: block;
    margin-bottom: 6px;
    color: #17181c;
    font-size: 14px;
}
/* ESCÁNER */
.scanner-banner {
    width: 100%;
    min-height: 132px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 24px 28px;
    margin-bottom: 16px;
    background: #111214;
    border-radius: 14px;
    color: #ffffff;
}
.scanner-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 17px;
}
.scanner-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #303238;
    border-radius: 13px;
    color: #ffffff;
}
.scanner-label {
    display: block;
    margin-bottom: 5px;
    color: #8d929b;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}
.scanner-banner h3 {
    margin: 0 0 6px;
    font-size: 17px;
}
.scanner-banner p {
    max-width: 700px;
    margin: 0;
    color: #a7abb2;
    font-size: 11px;
    line-height: 1.6;
}
.scanner-status {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 9px 14px;
    border: 1px solid #303238;
    border-radius: 20px;
    color: #a7abb2;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.scanner-status span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
}
/* PANELES INFERIORES */
.bottom-panels {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 16px;
}
.bottom-card {
    min-width: 0;
    min-height: 220px;
    padding: 21px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
}
.bottom-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f1f3;
}
.bottom-card-header > div:first-child > span {
    display: block;
    margin-bottom: 5px;
    color: #9a9ea6;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}
.bottom-card-header h3 {
    margin: 0;
    font-size: 15px;
}
.bottom-card-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #f5f6f8;
    color: #555b65;
}
.bottom-card-icon.success {
    background: #ecfdf3;
    color: #16a34a;
}
/* PANEL VACÍO */
.empty-panel {
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 8px;
    text-align: center;
}
.empty-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border-radius: 11px;
    background: #f5f6f8;
    color: #8c919a;
}
.empty-panel strong {
    margin-bottom: 5px;
    font-size: 12px;
}
.empty-panel p {
    max-width: 330px;
    margin: 0;
    color: #777b85;
    font-size: 10px;
    line-height: 1.5;
}
/* SEGURIDAD */
.security-list {
    padding-top: 8px;
}
.security-list > div {
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid #f1f2f4;
}
.security-list > div:last-child {
    border-bottom: 0;
}
.security-list span {
    color: #777b85;
    font-size: 11px;
}
.security-list strong {
    color: #16a34a;
    font-size: 10px;
    white-space: nowrap;
}
.security-list .current-role {
    color: #17181c;
}
/* MENÚ MÓVIL */
.mobile-menu {
    display: none;
}
.mobile-menu button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #ffffff;
    color: #17181c;
    cursor: pointer;
}
/* TABLET */
@media (max-width: 1100px) {
    .topbar {
        padding: 0 24px;
    }
    .content {
        padding: 18px 22px 25px;
    }
    .qr-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .qr-cards .dashboard-card:first-child {
        grid-column: span 2;
    }
}
/* TABLET PEQUEÑA */
@media (max-width: 850px) {
    :root {
        --sidebar-width: 0px;
    }
    .sidebar {
        display: none;
    }
    .main {
        width: 100%;
        margin-left: 0;
    }
    .mobile-menu {
        display: block;
        margin-right: 12px;
    }
    .topbar {
        height: 76px;
        padding: 0 20px;
    }
    .page-title {
        flex: 1;
    }
    .page-title h1 {
        font-size: 19px;
    }
    .profile-info,
    .profile-arrow {
        display: none;
    }
    .content {
        padding: 18px 18px 24px;
    }
    .welcome {
        min-height: auto;
        padding: 21px;
        align-items: flex-start;
        flex-direction: column;
    }
    .date {
        align-self: flex-start;
    }
    .system-status {
        align-items: flex-start;
        flex-direction: column;
    }
    .system-active {
        align-self: flex-start;
    }
    .qr-cards {
        grid-template-columns: 1fr;
    }
    .qr-cards .dashboard-card:first-child {
        grid-column: auto;
    }
    .bottom-panels {
        grid-template-columns: 1fr;
    }
    .scanner-banner {
        align-items: flex-start;
        flex-direction: column;
    }
    .scanner-status {
        align-self: flex-start;
    }
}
/* MÓVIL */
@media (max-width: 560px) {
    .topbar {
        padding: 0 15px;
    }
    .topbar-right {
        gap: 10px;
    }
    .notification {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
    .profile-avatar {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
    .profile-dropdown {
        right: -4px;
        width: 245px;
    }
    .content {
        padding: 14px 14px 20px;
    }
    .welcome {
        margin-bottom: 12px;
        padding: 18px;
    }
    .system-status {
        margin-bottom: 12px;
        padding: 18px;
    }
    .dashboard-card {
        padding: 18px;
    }
    .scanner-banner {
        padding: 20px;
    }
    .bottom-card {
        padding: 18px;
    }
}
/* MÓVIL PEQUEÑO */
@media (max-width: 400px) {
    .page-title p {
        display: none;
    }
    .notification {
        display: none;
    }
    .profile-dropdown {
        width: 235px;
    }
}
