/* ==========================================================================
   ARQUIVO CSS DO PAINEL DE ADMINISTRAÇÃO - VERSÃO CORRIGIDA E ORGANIZADA
   Estilo: Dark Mode, baseado na identidade visual do site.
   ========================================================================== */

/* --- 1. VARIÁVEIS GLOBAIS E CONFIGURAÇÕES DE BASE --- */
:root {
    /* Cores de Fundo */
    --bg-main: #1a1f36;
    --bg-sidebar: #1f273e;
    --bg-content: #2a324d;
    --bg-hover: #3a435a;

    /* Cor de Destaque (Accent) */
    --accent-color: #00ffcc;
    --accent-dark: #00e6b8;
    --accent-text: #1a1f36; /* Texto para usar em cima da cor de destaque */

    /* Cores de Texto */
    --text-light: #ffffff;
    --text-medium: #d1d9e6;
    --text-dark: #a9b3c1;

    /* Cores Semânticas */
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    /* Bordas e Sombras */
    --border-color: #3a435a;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.25);

    /* Outras Propriedades */
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.admin-body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-medium);
    background-color: var(--bg-main);
    display: flex;
}

/* --- 2. LAYOUT PRINCIPAL (SIDEBAR, HEADER, MAIN) --- */
.admin-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 1000;
    transition: width var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
    transition: margin-left var(--transition);
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background-color: rgba(31, 39, 62, 0.7);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 24px;
    z-index: 900;
}

/* --- 3. COMPONENTES DA SIDEBAR --- */
.admin-sidebar .header-container {
    padding: 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}
.admin-sidebar .logo img {
    height: 36px;
}
.sidebar-toggle {
    background: none; border: none;
    color: var(--text-dark);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.sidebar-toggle:hover {
    background-color: var(--bg-content);
    color: var(--text-light);
}
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}
.nav-section {
    margin-bottom: 24px;
}
.nav-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-dark);
    padding: 0 16px;
    margin-bottom: 8px;
}
.nav-list {
    list-style: none;
    padding: 0 16px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
}
.nav-link:hover {
    background-color: var(--bg-content);
    color: var(--text-light);
}
.nav-link.active {
    background-color: rgba(0, 255, 204, 0.1);
    color: var(--accent-color);
    font-weight: 600;
}
.nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}
.admin-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
}
.profile-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--bg-content);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent-color);
}
.profile-info {
    line-height: 1.3;
}
.profile-name {
    font-weight: 600;
    color: var(--text-light);
}
.profile-role {
    font-size: 0.8rem;
    color: var(--text-dark);
}
.logout-btn {
    width: 100%;
    background: var(--accent-color);
    border: none;
    color: var(--accent-text);
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    transition: all var(--transition);
}
.logout-btn:hover {
    background-color: var(--accent-dark);
    box-shadow: 0 4px 15px rgba(0, 255, 204, 0.2);
}
.logout-btn * { color: var(--accent-text); } /* Forçar cor do texto e ícone */

/* --- 4. COMPONENTES DO HEADER --- */
.header-left .breadcrumb #page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.notification-btn {
    position: relative;
}
.notification-badge {
    position: absolute;
    top: -2px; right: -2px;
    background: var(--error-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-content);
}
.notifications-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-content);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 320px;
    z-index: 9999;
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
}
.notifications-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.notifications-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notifications-header h3 { font-size: 1rem; color: var(--text-light); }
.mark-all-read {
    background: none; border: none;
    color: var(--accent-color);
    font-size: 0.75rem;
    cursor: pointer;
}
.notifications-list {
    max-height: 300px;
    overflow-y: auto;
}

/* --- 5. COMPONENTES GERAIS (BOTÕES, CARDS, TABELAS, ETC) --- */

/* Seções e Títulos */
.admin-section { display: none; }
.admin-section.active { display: block; animation: fadeIn 0.4s ease-in-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.section-header, .dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.section-title h1, .dashboard-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}
.section-title p, .dashboard-title p {
    color: var(--text-dark);
}

/* Grids Principais */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Botões */
.btn-primary, .btn-secondary, .btn-danger, .action-btn, .refresh-btn {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
}
.btn-primary, .refresh-btn {
    background-color: var(--accent-color);
    color: var(--accent-text);
    border-color: var(--accent-color);
}
.btn-primary:hover, .refresh-btn:hover {
    background-color: var(--accent-dark);
    color: var(--accent-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 204, 0.2);
}
.btn-primary *, .refresh-btn * { color: var(--accent-text); }
.btn-danger {
    background-color: var(--error-color);
    color: var(--text-light);
    border-color: var(--error-color);
}
.btn-danger:hover { background-color: #c72e2e; }
.btn-secondary {
    background-color: var(--bg-content);
    color: var(--text-medium);
    border-color: var(--border-color);
}
.btn-secondary:hover { background-color: var(--border-color); color: var(--text-light); }

.btn-outline {
    background-color: transparent;
    color: var(--text-medium);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}
.btn-outline:hover { 
    background-color: var(--border-color); 
    color: var(--text-light); 
}

/* Ações em Lote */
.bulk-actions {
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-medium);
    font-weight: 500;
}

.bulk-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bulk-buttons button {
    font-size: 14px;
    padding: 8px 16px;
}

@media (max-width: 768px) {
    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bulk-buttons {
        justify-content: center;
    }
}

.action-btn {
    background-color: var(--bg-content);
    border-color: var(--border-color);
    width: 40px; height: 40px;
    padding: 0;
    color: var(--text-dark);
}
.action-btn:hover { background: var(--bg-hover); color: var(--text-light); }

/* Cards */
.stat-card, .content-card, .settings-card, .analytics-card {
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition);
}
.stat-card:hover, .content-card:hover, .settings-card:hover, .analytics-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}
.card-header, .settings-header, .analytics-header {
    padding: 16px 24px;
    margin: -24px -24px 24px -24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h3, .settings-header h3, .analytics-header h3 { font-size: 1.1rem; color: var(--text-light); }
.stat-icon { font-size: 1.5rem; margin-bottom: 16px; color: var(--accent-color); }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--text-light); }
.stat-label { font-size: 0.9rem; color: var(--text-dark); }
.stat-change { display: none; }

/* Tabelas */
.table-container {
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.table-wrapper { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
    padding: 12px 24px;
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}
.admin-table th {
    font-weight: 600;
    background-color: var(--bg-sidebar);
    color: var(--text-dark);
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background-color: var(--bg-sidebar); }

/* Checkboxes nas Tabelas */
.admin-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
}

.admin-table input[type="checkbox"]:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.1);
}

.admin-table input[type="checkbox"]:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.admin-table input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 1px;
    color: var(--bg-main);
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

.admin-table input[type="checkbox"]:indeterminate {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.admin-table input[type="checkbox"]:indeterminate::after {
    content: '−';
    position: absolute;
    top: -3px;
    left: 2px;
    color: var(--bg-main);
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.admin-table th input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Badges (Status, Role) */
.status-badge, .role-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-badge.active, .status-badge.published { background-color: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.status-badge.inactive, .status-badge.deleted { background-color: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.role-badge.admin { background-color: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.role-badge.user { background-color: rgba(59, 130, 246, 0.2); color: #93c5fd; }

/* Paginação */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    color: var(--text-dark);
    font-size: 0.9rem;
}
.pagination { display: flex; gap: 8px; }
.page-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-content);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-dark);
    transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent-color); color: var(--accent-color); }
.page-btn.active { background: var(--accent-color); color: var(--accent-text); border-color: var(--accent-color); }

/* Formulários, Inputs, Selects */
.section-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.search-container { position: relative; }
.search-container i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dark); }
.search-container input, .filter-select, .admin-form input, .admin-form select, .admin-form textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--bg-content);
    color: var(--text-medium);
    transition: all var(--transition);
}
.search-container input { width: 250px; padding-left: 36px; }
.search-container input:focus, .filter-select:focus, .admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 255, 204, 0.1);
}
.admin-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 8px; color: var(--text-medium); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border-color); margin-top: 16px; }

/* Checkbox Personalizado */
.enhanced-checkbox { position: relative; display: inline-flex; align-items: center; cursor: pointer; user-select: none; }
.enhanced-checkbox input[type="checkbox"] { opacity: 0; position: absolute; }
.checkmark {
    height: 20px; width: 20px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.enhanced-checkbox input[type="checkbox"]:checked ~ .checkmark { background-color: var(--accent-color); border-color: var(--accent-color); }
.checkmark:after {
    content: ""; display: none; width: 5px; height: 10px;
    border: solid var(--bg-main);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.enhanced-checkbox input[type="checkbox"]:checked ~ .checkmark:after { display: block; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.6);
    z-index: 2000;
    backdrop-filter: blur(4px);
    opacity: 0; visibility: hidden;
    transition: all var(--transition);
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-content);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 2100;
    border: 1px solid var(--border-color);
    max-height: 90vh;
    display: flex; flex-direction: column;
    opacity: 0; visibility: hidden;
    transition: all var(--transition);
}
.modal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-content.small { max-width: 400px; width: 90vw; }
.modal-content.medium { max-width: 600px; width: 90vw; }
.modal-content.large { max-width: 800px; width: 90vw; }
.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { font-size: 1.125rem; color: var(--text-light); }
.close-modal { background: none; border: none; font-size: 1.25rem; color: var(--text-dark); cursor: pointer; }
.modal-body { padding: 24px; overflow-y: auto; }

/* Elementos ocultos por padrão no desktop */
.mobile-menu-toggle { 
    display: none; 
}

/* --- 6. ESTILOS RESPONSIVOS --- */
@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: none; }
    .mobile-menu-toggle { 
        display: block; 
        background: none; 
        border: none; 
        font-size: 1.5rem; 
        cursor: pointer; 
        color: var(--text-dark); 
        margin-top: 20px;
        padding: 8px;
        border-radius: var(--radius-md);
        transition: all var(--transition);
    }
    .mobile-menu-toggle:hover {
        background-color: var(--bg-content);
        color: var(--text-light);
    }
    .header-left { display: flex; align-items: center; gap: 16px; }
}
@media (max-width: 768px) {
    .admin-main, .admin-header { padding: 16px; }
    .admin-header { position: static; margin-bottom: 16px; }
    .section-header, .dashboard-header { flex-direction: column; align-items: stretch; }
    .stats-grid, .content-grid, .settings-grid, .analytics-grid, .form-row { grid-template-columns: 1fr; }
    .section-actions { flex-direction: column; align-items: stretch; }
    .search-container input { width: 100%; }
    .pagination-container { flex-direction: column; gap: 16px; }
    
    /* CORREÇÕES PARA ELEMENTOS QUE ESTÃO ESTOURANDO A LARGURA */
    
    /* Inputs, textareas e selects - garantir que se ajustem à largura */
    input[type="text"], 
    input[type="email"], 
    input[type="password"], 
    input[type="number"],
    input[type="url"],
    input[type="search"],
    textarea, 
    select {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important; /* Evita overflow em flex containers */
    }
    
    /* Forçar quebra de linha em textos longos */
    p, td, th, div, span, h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        hyphens: auto !important;
    }
    
    /* URLs e textos técnicos que podem não ter espaços */
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-table {
        min-width: 100% !important;
        width: 100% !important;
    }
    
    .admin-table td, .admin-table th {
        max-width: 150px !important; /* Limitar largura máxima das células */
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: normal !important; /* Permitir quebra de linha */
    }
    
    /* Botões flexíveis */
    .btn, .button, .action-btn {
        max-width: 100% !important;
        width: auto !important;
        min-width: auto !important;
        flex-shrink: 1 !important;
    }
    
    /* Containers flexíveis */
    .bulk-actions, .section-actions, .form-row {
        flex-wrap: wrap !important;
        overflow: hidden !important;
    }
    
    /* Códigos e elementos pre-formatados */
    pre, code {
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        overflow-x: auto !important;
        max-width: 100% !important;
    }
    
    /* Cards e containers */
    .stat-card, .content-card, .settings-card, .analytics-card {
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    /* Notificações e dropdowns */
    .notifications-menu {
        width: calc(100vw - 32px) !important;
        max-width: 320px !important;
        left: 16px !important;
        right: 16px !important;
    }
}

/* Correções específicas para elementos que podem estar com problemas */
.admin-table td {
    color: var(--text-medium);
}
.admin-table th {
    color: var(--text-dark);
}
/* Garantir que todos os inputs tenham as cores corretas */
input, select, textarea {
    color: var(--text-medium) !important;
    background-color: var(--bg-content) !important;
    border-color: var(--border-color) !important;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 255, 204, 0.1) !important;
}
/* Garantir que placeholders tenham cor adequada */
input::placeholder, textarea::placeholder {
    color: var(--text-dark) !important;
}
/* Correção para dropdown de notificações */
.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color var(--transition);
    color: var(--text-medium);
}
.notification-item:hover {
    background-color: var(--bg-sidebar);
}
.notification-item.unread {
    background-color: rgba(0, 255, 204, 0.05);
    border-left: 3px solid var(--accent-color);
}
.notification-item h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}
.notification-item p {
    font-size: 0.8rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}
.notification-item .notification-time {
    font-size: 0.75rem;
    color: var(--text-dark);
}

/* ==========================================================================
   ESTILOS PARA CONFIGURAÇÕES (SETTINGS)
   ========================================================================== */

/* Configurações - Container */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Item de configuração */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label:first-child {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-medium);
    flex: 1;
}

/* Inputs de texto para configurações */
.setting-item input[type="text"] {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    color: var(--text-medium);
    font-size: 0.9rem;
    min-width: 200px;
    transition: all var(--transition);
}

.setting-item input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 255, 204, 0.1);
}

.setting-item input[type="text"]:readonly {
    background-color: var(--bg-hover);
    color: var(--text-dark);
    cursor: not-allowed;
    opacity: 0.7;
}

.setting-item input[type="text"]:disabled {
    background-color: var(--bg-hover);
    color: var(--text-dark);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin: 0;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    border-radius: 24px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
}

.slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    background-color: var(--text-light);
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"]:checked + .slider {
    background-color: var(--accent-color);
}

.toggle-switch input[type="checkbox"]:checked + .slider:before {
    transform: translateX(26px);
    background-color: var(--accent-text);
}

.toggle-switch:hover .slider {
    box-shadow: 0 0 0 4px rgba(0, 255, 204, 0.1);
}

/* Estado de foco para acessibilidade */
.toggle-switch input[type="checkbox"]:focus + .slider {
    box-shadow: 0 0 0 4px rgba(0, 255, 204, 0.2);
}

/* Estatísticas do Sistema */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item span:first-child {
    color: var(--text-medium);
    font-weight: 500;
}

.stat-item span:last-child {
    color: var(--text-light);
    font-weight: 600;
    text-align: right;
    min-width: 140px;
}

/* Animação de loading para estatísticas */
.stat-item span.loading {
    color: var(--accent-color);
    font-style: italic;
    opacity: 0.8;
}

.stat-item span.error {
    color: var(--error-color);
    font-style: italic;
}

/* Indicadores visuais para diferentes tipos de dados */
.stat-item[data-type="disk"] span:last-child::before {
    content: "💾 ";
    margin-right: 4px;
}

.stat-item[data-type="database"] span:last-child::before {
    content: "🗄️ ";
    margin-right: 4px;
}

.stat-item[data-type="uptime"] span:last-child::before {
    content: "⏱️ ";
    margin-right: 4px;
}

.stat-item[data-type="memory"] span:last-child::before {
    content: "🧠 ";
    margin-right: 4px;
}

.stat-item[data-type="processes"] span:last-child::before {
    content: "🐍 ";
    margin-right: 4px;
}

/* RESPONSIVIDADE MOBILE */
@media screen and (max-width: 768px) {
    .admin-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .admin-sidebar {
        order: 2;
        width: 100%;
        margin: 0;
        padding: 15px;
    }

    .admin-main {
        order: 1;
        width: 100%;
        margin: 0;
        padding: 15px;
    }

    .admin-header {
        padding: 15px;
        text-align: center;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
    }

    .admin-header h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .content-section {
        margin-bottom: 20px;
    }

    .section-header {
        padding: 15px;
        font-size: 1rem;
    }

    .admin-table {
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }

    .admin-table table {
        min-width: 600px;
        width: 100%;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }

    .actions-column {
        min-width: 120px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        margin: 2px;
    }

    .bulk-actions {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .bulk-actions .bulk-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .bulk-actions .bulk-controls button {
        flex: 1;
        min-width: 120px;
        margin: 0;
    }

    /* Estatísticas do sistema em mobile */
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
        gap: 5px;
    }

    .stat-item span:last-child {
        text-align: left;
        min-width: unset;
        color: var(--accent-color);
        font-size: 0.9rem;
    }

    /* Forms responsivos */
    .admin-form {
        padding: 15px;
    }

    .admin-form input,
    .admin-form textarea,
    .admin-form select {
        font-size: 16px; /* Evita zoom no iOS */
        padding: 12px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Garantir que todos os elementos de formulário se ajustem */
    .setting-item input,
    .setting-item textarea,
    .setting-item select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Labels e textos de formulário */
    .setting-item label {
        display: block !important;
        margin-bottom: 8px !important;
        word-wrap: break-word !important;
    }

    /* Toggle switches em mobile */
    .toggle-switch {
        transform: scale(1.1);
        margin: 10px 0;
    }

    /* Modais em mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        padding: 20px;
    }

    /* Navegação lateral em mobile */
    .admin-nav ul {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .admin-nav li {
        width: 100%;
    }

    .admin-nav a {
        display: block;
        padding: 12px;
        text-align: center;
        border-radius: 6px;
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    .admin-container {
        padding: 10px;
        gap: 10px;
    }

    .admin-header h1 {
        font-size: 1.3rem;
    }

    .admin-sidebar,
    .admin-main {
        padding: 10px;
    }

    .admin-table table {
        min-width: 500px;
    }

    .admin-table th,
    .admin-table td {
        padding: 6px 4px;
        font-size: 0.75rem;
    }

    .btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .bulk-actions .bulk-controls button {
        min-width: 100px;
        font-size: 0.8rem;
    }

    .stat-item span:last-child {
        font-size: 0.8rem;
    }

    .modal-content {
        margin: 10px auto;
        padding: 15px;
    }
}

/* Melhorias para cards de configuração */
.settings-card .settings-header h3 {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-card .settings-header p {
    color: var(--text-dark);
    font-size: 0.85rem;
    margin: 0;
}