/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1d2e;
    color: #e0e0e0;
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

h1, h3, h4, h5, h6 {
    color: #b8c5d6;
}

a {
    color: #8b9dc3;
}

strong {
    color: #c0cad6;
}

small {
    color: #909090;
}

/* Radio Button Styles */
input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

label:has(input[type="radio"]:checked) {
    border-color: #667eea !important;
    background: #2d3142 !important;
}

label:has(input[type="radio"]):hover {
    border-color: #8b9dc3 !important;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #1e2139;
    color: #a8b2d1;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.3s ease;
    border-right: 1px solid #2a2f4a;
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid #2a2f4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #252942;
}

.sidebar .logo {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.sidebar .logo::before {
    content: '◆';
    color: #667eea;
    font-size: 1.5rem;
}

.sidebar .logo:hover {
    color: #667eea;
    transform: translateX(2px);
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #1e2139;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #2a2f4a;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #353b5c;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    margin: 0.25rem 0.75rem;
    color: #a8b2d1;
    text-decoration: none;
    transition: all 0.25s ease;
    border-radius: 8px;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: #252942;
    color: #ffffff;
    border-left-color: #667eea;
    transform: translateX(3px);
}

.nav-item:hover .nav-icon {
    color: #667eea;
    transform: scale(1.15);
}

.nav-item.active {
    background: #2d3250;
    color: #ffffff;
    border-left-color: #667eea;
    font-weight: 600;
}

.nav-item.active .nav-icon {
    color: #667eea;
}

.nav-icon {
    font-size: 1.15rem;
    margin-right: 0.875rem;
    min-width: 28px;
    text-align: center;
    color: #6b7aa1;
    transition: all 0.25s ease;
}

.nav-text {
    font-size: 0.925rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.nav-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

/* Submenu */
.nav-item-parent {
    position: relative;
}

.nav-item-parent > .nav-item {
    justify-content: space-between;
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #151827;
}

.nav-item-parent.open .nav-submenu {
    max-height: 200px;
}

.nav-subitem {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem 0.75rem 3rem;
    color: #8b9dc3;
    text-decoration: none;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    font-size: 0.875rem;
}

.nav-subitem:hover {
    background: #1e2139;
    color: #ffffff;
    border-left-color: #667eea;
    padding-left: 3.2rem;
}

.nav-subitem .nav-icon {
    font-size: 1rem;
    margin-right: 0.75rem;
    min-width: 24px;
    text-align: center;
    color: #6b7aa1;
}

.nav-subitem:hover .nav-icon {
    color: #667eea;
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #2a2f4a;
    text-align: center;
    color: #6b7aa1;
    font-size: 0.8rem;
    background: #1a1d33;
}

.sidebar-footer small {
    display: block;
    opacity: 0.8;
}

/* Main Wrapper */
.main-wrapper {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    background: #252837;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #2d3142;
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #667eea;
}

.page-title {
    font-size: 1.2rem;
    color: #8b9dc3;
    margin: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
}

.container {
    max-width: 100%;
}

/* Cards */
.card {
    background: #252837;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid #2d3142;
}

.card h2 {
    margin-bottom: 1rem;
    color: #8b9dc3;
    border-bottom: 2px solid #2d3142;
    padding-bottom: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #252837;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-align: center;
    border-top: 4px solid #667eea;
    border: 1px solid #2d3142;
}

.stat-card h3 {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #252837;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #2d3142;
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #2d3142;
    color: #e0e0e0;
}

tr:hover {
    background: #2d3142;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #b0b0b0;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #3d4152;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #1e2130;
    color: #e0e0e0;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #252837;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Search Box */
.search-box {
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-box input:focus {
    border-color: #667eea;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background: #1e3a2e;
    color: #6ee7b7;
}

.badge-warning {
    background: #3a2e1e;
    color: #fcd34d;
}

.badge-danger {
    background: #3a1e1e;
    color: #fca5a5;
}

.badge-info {
    background: #1e2a3a;
    color: #93c5fd;
}

/* Animação de pulso para indicadores online */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.stat-card small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

#onlineCount {
    animation: pulse 2s ease-in-out infinite;
}

/* Tecla Keyboard */
kbd {
    background: #333;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 1px solid #555;
}

/* Search Results Hover */
#searchResults > div > div:hover {
    background: #2d3142 !important;
    border-color: #667eea !important;
}

/* Actions */
.actions {
    display: flex;
    gap: 0.5rem;
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Footer */
.footer {
    background: #252837;
    color: #b0b0b0;
    text-align: center;
    padding: 1rem 2rem;
    margin-top: auto;
    border-top: 1px solid #2d3142;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #1e3a2e;
    color: #6ee7b7;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #3a1e1e;
    color: #fca5a5;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background: #1e2a3a;
    color: #93c5fd;
    border-left: 4px solid #3b82f6;
}

.alert-warning {
    background: #3a2e1e;
    color: #fcd34d;
    border-left: 4px solid #f59e0b;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .top-bar {
        padding: 1rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #2d3142;
    padding-bottom: 0;
    margin: -0.5rem -0.5rem 0 -0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.875rem 1.5rem;
    color: #8b9dc3;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #b8c5d6;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Popup Modal Centralizado */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-content {
    background: #252837;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid #667eea;
    animation: popupSlide 0.3s ease;
    position: relative;
}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-content .alert {
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
}

.popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: #8b9dc3;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.popup-close:hover {
    color: #ffffff;
    transform: rotate(90deg);
}

.popup-auto-close {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #8b9dc3;
}

/* Modal de Confirmação */
.confirm-modal .popup-content {
    max-width: 450px;
}

.confirm-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    text-align: center;
}

.confirm-message {
    font-size: 1.05rem;
    color: #a8b2d1;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirm-buttons .btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    min-width: 120px;
}
