/* Estilos para Configurações */
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media (max-width:768px){ .form-row{ grid-template-columns:1fr; } }

/* ====== DARK MODE - Configurações ====== */
body[data-theme="dark"] .page-header {
    border-bottom-color: #3a3939 !important;
}

body[data-theme="dark"] .page-header h1 {
    color: var(--page-h1-cor, #dfdfdf) !important;
}

body[data-theme="dark"] .page-header p {
    color: var(--page-p-color, #e2e2e2) !important;
}

/* Tabs */
body[data-theme="dark"] .tabs-container {
    background: var(--fundo-tabela-th, rgb(29, 28, 28)) !important;
    border-color: #3a3939 !important;
}

body[data-theme="dark"] .tab-button {
    background: transparent !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
    border-color: #3a3939 !important;
}

body[data-theme="dark"] .tab-button:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--color-modal-h3, #dfdfdf) !important;
}

body[data-theme="dark"] .tab-button.active {
    background: rgba(30, 58, 138, 0.3) !important;
    background-color: rgba(30, 58, 138, 0.3) !important;
    color: #93c5fd !important;
    border-bottom-color: #60A5FA !important;
}

/* Tab Content - Sobrescrever estilos inline */
body[data-theme="dark"] .tab-content {
    background: transparent !important;
}

body[data-theme="dark"] .tab-content.active {
    background: transparent !important;
}

/* Cards */
body[data-theme="dark"] .card {
    background: var(--fundo-tabela-th, rgb(29, 28, 28)) !important;
    border-color: #3a3939 !important;
}

body[data-theme="dark"] .card-header {
    background: var(--fundo-tabela-th, rgb(29, 28, 28)) !important;
    border-bottom-color: #3a3939 !important;
}

body[data-theme="dark"] .card-header h3 {
    color: var(--color-modal-h3, #dfdfdf) !important;
}

body[data-theme="dark"] .card-body {
    background: var(--fundo-tabela-th, rgb(29, 28, 28)) !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
}

body[data-theme="dark"] .card-body * {
    color: inherit;
}

body[data-theme="dark"] .card-body h3,
body[data-theme="dark"] .card-body h4,
body[data-theme="dark"] .card-body h5 {
    color: var(--color-modal-h3, #dfdfdf) !important;
}

body[data-theme="dark"] .card-body p,
body[data-theme="dark"] .card-body span {
    color: var(--tabela-color-td, #e4e4e4) !important;
}

/* Form Groups */
body[data-theme="dark"] .form-group label {
    color: var(--color-stat-content, #e2e2e2) !important;
}

body[data-theme="dark"] .form-control {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: #3a3939 !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
}

body[data-theme="dark"] .form-control:focus {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: #60A5FA !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
}

body[data-theme="dark"] .form-control::placeholder {
    color: #888888 !important;
}

body[data-theme="dark"] textarea.form-control {
    background: rgba(0, 0, 0, 0.3) !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
}

/* Config Sections - Sobrescrever estilos inline do JavaScript */
body[data-theme="dark"] .config-section {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: #3a3939 !important;
    padding: 20px !important;
    border-radius: 8px !important;
}

body[data-theme="dark"] .config-section h4 {
    color: var(--color-modal-h3, #dfdfdf) !important;
    margin: 0 0 20px 0 !important;
}

body[data-theme="dark"] .config-section h4 i {
    color: #8b5cf6 !important;
}

body[data-theme="dark"] .config-section .form-group {
    background: transparent !important;
}

body[data-theme="dark"] .config-section .form-row {
    background: transparent !important;
}

body[data-theme="dark"] .config-section label {
    color: var(--color-stat-content, #e2e2e2) !important;
}

/* Checkbox Labels */
body[data-theme="dark"] .checkbox-label {
    color: var(--color-stat-content, #e2e2e2) !important;
}

body[data-theme="dark"] .checkbox-label .checkmark {
    border-color: #3a3939 !important;
    background: rgba(0, 0, 0, 0.3) !important;
}

body[data-theme="dark"] .checkbox-label input:checked ~ .checkmark {
    background: #1E3A8A !important;
    border-color: #1E3A8A !important;
}

body[data-theme="dark"] .form-text {
    color: #aaaaaa !important;
}

/* Logo Preview - Sobrescrever estilos inline */
body[data-theme="dark"] .logo-preview {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: #3a3939 !important;
    border: 2px dashed #3a3939 !important;
}

body[data-theme="dark"] .logo-placeholder {
    color: #888888 !important;
}

/* Modulos Grid */
body[data-theme="dark"] .modulos-grid {
    background: var(--fundo-tabela-th, rgb(29, 28, 28)) !important;
}

body[data-theme="dark"] .modulo-card {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: #3a3939 !important;
}

body[data-theme="dark"] .modulo-card:hover {
    border-color: #60A5FA !important;
    background: rgba(0, 0, 0, 0.4) !important;
}

body[data-theme="dark"] .modulo-card.ativo {
    background: rgba(5, 150, 105, 0.2) !important;
    border-color: #10B981 !important;
}

body[data-theme="dark"] .modulo-card.inativo {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: #3a3939 !important;
    opacity: 0.6 !important;
}

body[data-theme="dark"] .modulo-card h4,
body[data-theme="dark"] .modulo-nome {
    color: var(--color-modal-h3, #dfdfdf) !important;
}

body[data-theme="dark"] .modulo-card p,
body[data-theme="dark"] .modulo-descricao {
    color: var(--tabela-color-td, #e4e4e4) !important;
}

body[data-theme="dark"] .modulo-checkbox {
    color: var(--tabela-color-td, #e4e4e4) !important;
}

/* Código do Módulo - Sobrescrever estilos inline */
body[data-theme="dark"] .modulo-codigo {
    background: rgba(0, 0, 0, 0.4) !important;
    color: #93c5fd !important;
    border: 1px solid #3a3939 !important;
}

/* Estado do Módulo - Sobrescrever estilos inline */
body[data-theme="dark"] .modulo-status {
    border: 1px solid transparent !important;
}

body[data-theme="dark"] .modulo-status.active {
    background-color: rgba(5, 150, 105, 0.3) !important;
    color: #6ee7b7 !important;
    border-color: #10B981 !important;
}

body[data-theme="dark"] .modulo-status.inactive {
    background-color: rgba(220, 38, 38, 0.3) !important;
    color: #fca5a5 !important;
    border-color: #DC2626 !important;
}

/* Meta informações do módulo */
body[data-theme="dark"] .modulo-meta {
    color: var(--tabela-color-td, #e4e4e4) !important;
}

body[data-theme="dark"] .modulo-ordem {
    color: #aaaaaa !important;
}

/* Module Badge */
body[data-theme="dark"] .module-badge {
    background: rgba(0, 0, 0, 0.4) !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
    border: 1px solid #3a3939 !important;
}

/* Table Container */
body[data-theme="dark"] .table-container {
    background: var(--fundo-tabela-th, rgb(29, 28, 28)) !important;
}

body[data-theme="dark"] .table-container table {
    background: var(--fundo-tabela-th, rgb(29, 28, 28)) !important;
}

body[data-theme="dark"] .table-container th {
    background: rgba(0, 0, 0, 0.3) !important;
    color: var(--color-modal-h3, #dfdfdf) !important;
    border-color: #3a3939 !important;
}

body[data-theme="dark"] .table-container td {
    color: var(--tabela-color-td, #e4e4e4) !important;
    border-color: #3a3939 !important;
}

body[data-theme="dark"] .table-container tr:hover {
    background: rgba(0, 0, 0, 0.2) !important;
}

/* Tipos e Marcas Container */
body[data-theme="dark"] .tipos-marcas-container {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: #3a3939 !important;
}

body[data-theme="dark"] .tipo-item,
body[data-theme="dark"] .marca-item {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: #3a3939 !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
}

body[data-theme="dark"] .tipo-item:hover,
body[data-theme="dark"] .marca-item:hover {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: #60A5FA !important;
}

/* Add Item Controls */
body[data-theme="dark"] .add-item-controls input {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: #3a3939 !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
}

body[data-theme="dark"] .add-item-controls input:focus {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: #60A5FA !important;
}

/* Buttons */
body[data-theme="dark"] .btn-primary {
    background: #1E3A8A !important;
    color: white !important;
}

body[data-theme="dark"] .btn-primary:hover {
    background: #1E40AF !important;
}

body[data-theme="dark"] .btn-secondary {
    background: #4B5563 !important;
    color: white !important;
}

body[data-theme="dark"] .btn-secondary:hover {
    background: #6B7280 !important;
}

body[data-theme="dark"] .btn-outline-secondary {
    background: transparent !important;
    border-color: #3a3939 !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
}

body[data-theme="dark"] .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: #60A5FA !important;
}

body[data-theme="dark"] .btn-success {
    background: #059669 !important;
    color: white !important;
}

body[data-theme="dark"] .btn-success:hover {
    background: #047857 !important;
}

body[data-theme="dark"] .btn-warning {
    background: #D97706 !important;
    color: white !important;
}

body[data-theme="dark"] .btn-warning:hover {
    background: #B45309 !important;
}

body[data-theme="dark"] .btn-danger {
    background: #DC2626 !important;
    color: white !important;
}

body[data-theme="dark"] .btn-danger:hover {
    background: #B91C1C !important;
}

body[data-theme="dark"] .btn-sm {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: #3a3939 !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
}

body[data-theme="dark"] .btn-sm:hover {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: #60A5FA !important;
}

/* Modal */
body[data-theme="dark"] .modal-content {
    background: var(--fundo-modal-content, rgb(36, 35, 35)) !important;
}

body[data-theme="dark"] .modal-header {
    background: var(--fundo--modal-header, rgb(50, 49, 49)) !important;
    border-bottom-color: #3a3939 !important;
}

body[data-theme="dark"] .modal-header h3 {
    color: var(--color-modal-h3, #dfdfdf) !important;
}

body[data-theme="dark"] .modal-body {
    background: var(--fundo-modal-content, rgb(36, 35, 35)) !important;
    color: var(--tabela-color-td, #e4e4e4) !important;
}

body[data-theme="dark"] .modal-footer {
    background: var(--fundo--modal-header, rgb(50, 49, 49)) !important;
    border-top-color: #3a3939 !important;
}

body[data-theme="dark"] .modal-close {
    color: #aaaaaa !important;
}

body[data-theme="dark"] .modal-close:hover {
    background: #3a3939 !important;
    color: #e4e4e4 !important;
}

/* Text Muted */
body[data-theme="dark"] .text-muted {
    color: #888888 !important;
}