/* Admin CSS - Layout Profissional Moderno e Responsivo */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
    background: var(--background);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

/* Main Container - Border principal responsivo */
.main-flex {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1976d2 0%, #1565c0 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-top {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 12px;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.sidebar-title span {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.sidebar-menu {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.sidebar-menu li {
    margin: 2px 8px;
}

.sidebar-menu .menu-section {
    padding: 20px 20px 8px 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu a,
.sidebar-menu button,
.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::before,
.sidebar-menu button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #21cbf3;
    transform: scaleY(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu a:hover,
.sidebar-menu button:hover,
.sidebar a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateX(4px);
}

.sidebar-menu a:hover::before,
.sidebar-menu button:hover::before {
    transform: scaleY(1);
}

.sidebar-menu a.active,
.sidebar-menu button.active,
.sidebar a.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-menu a.active::before,
.sidebar-menu button.active::before {
    transform: scaleY(1);
}

/* Content Panel - Área principal responsiva */
.content-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background);
    padding: 40px;
    overflow-x: hidden;
}

/* Container - Border interno dos logins */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Login List - Card de logins com border */
.login-list,
.login-list-full {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 32px;
}

.login-list h2 {
    margin: 0 0 24px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

/* Login List Item - Item individual com border responsivo */
.login-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border-radius: 12px;
    background: var(--surface-muted);
    border: 1px solid transparent;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.login-list-item:hover {
    background: var(--border);
    border-color: var(--primary);
    transform: translateX(4px);
}

.login-list-item:last-child {
    margin-bottom: 0;
}

.login-list-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.login-list-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Button Ver Cadastro */
.login-list-lupa {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.login-list-lupa:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.login-list-lupa img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 28, 59, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal-window {
    width: min(1000px, 95vw);
    max-height: 90vh;
    overflow: auto;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modal-pop 0.25s ease-out;
}

@keyframes modal-pop {
    from {
        transform: scale(0.95) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--surface-muted);
    color: var(--text-dark);
}

.modal-body {
    padding: 28px;
}

/* Detail Card (Topologia) */
.detail-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.detail-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1rem;
    color: var(--text-muted);
    margin: 0 0 8px;
    font-weight: 700;
}

.detail-title {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.badge {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--surface-muted);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid var(--border);
}

/* Topology Graph */
.topology-graph {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 16px;
}

.node-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.node-login__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(25, 118, 210, 0.3);
}

.node-login__label {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.connector-line {
    width: 3px;
    height: 50px;
    background: linear-gradient(180deg, rgba(31,110,212,0.3), rgba(31,110,212,1));
}

/* PC Node Grid */
.pc-node-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    width: 100%;
}

.pc-node {
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    background: var(--surface);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.pc-node:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(25, 118, 210, 0.2);
}

.pc-node.active {
    border-color: var(--primary);
    background: rgba(25, 118, 210, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(25, 118, 210, 0.25);
}

.pc-node__icon {
    width: 56px;
    height: 56px;
}

.pc-node__name {
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.03rem;
    text-align: center;
    color: var(--text-dark);
}

/* PC Detail Card */
.pc-detail-card {
    border-radius: 16px;
    border: 2px dashed var(--border);
    padding: 28px;
    background: var(--surface-muted);
    min-height: 200px;
}

.pc-detail-inner {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.pc-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.pc-detail-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(31, 110, 212, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-detail-icon img {
    width: 36px;
    height: 36px;
}

.pc-detail-header h4 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
}

.pc-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.pc-detail-grid .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

.pc-detail-grid .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.detail-placeholder {
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
    padding: 40px 20px;
}

.detail-placeholder.loading {
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.empty-state,
.detail-error {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-weight: 600;
}

.detail-error {
    color: #e53935;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .content-panel {
        padding: 32px 24px;
    }
    
    .pc-node-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .main-flex {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        padding: 8px;
    }
    
    .sidebar-menu li {
        flex: 1 1 45%;
        margin: 4px;
    }
    
    .sidebar-menu a,
    .sidebar a {
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .sidebar-menu a.active,
    .sidebar-menu a:hover,
    .sidebar a.active,
    .sidebar a:hover {
        border-left: none;
        border-bottom-color: #21cbf3;
    }
    
    .content-panel {
        padding: 24px 16px;
    }
    
    .login-list,
    .login-list-full {
        padding: 24px 16px;
    }
    
    .login-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .login-list-lupa {
        width: 100%;
        justify-content: center;
    }
    
    .pc-node-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .detail-header {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .detail-title {
        font-size: 1.6rem;
    }
    
    .pc-detail-grid {
        grid-template-columns: 1fr;
    }
}
