/* ============================================
   Tech Atende - Sistema de Disparo
   Tema Claro e Escuro com Melhorias Visuais
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
    /* Cores Principais - Light Mode */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    /* Cores de Fundo - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    
    /* Cores de Texto - Light Mode */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #ffffff;
    
    /* Bordas e Sombras - Light Mode */
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --box-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    
    /* Transições */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   DARK MODE
   ============================================ */

html[data-theme="dark"],
body[data-theme="dark"],
[data-theme="dark"] {
    /* Cores Principais - Dark Mode */
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: rgba(96, 165, 250, 0.15);
    --secondary-color: #9ca3af;
    --success-color: #34d399;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --info-color: #22d3ee;
    
    /* Cores de Fundo - Dark Mode */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    
    /* Cores de Texto - Dark Mode */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #ffffff;
    
    /* Bordas e Sombras - Dark Mode */
    --border-color: #334155;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --box-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --box-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4), 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 18px;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle i {
    transition: var(--transition);
}

[data-theme="dark"] .theme-toggle .fa-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .fa-moon {
    display: block;
}

[data-theme="light"] .theme-toggle .fa-sun {
    display: block;
}

[data-theme="light"] .theme-toggle .fa-moon {
    display: none;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-md);
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

/* Container da logo */
.sidebar-header.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

/* Estilos da logo */
.logo-container img {
    max-height: 100px;
    max-width: 90%;
    object-fit: contain;
    transition: 0.3s ease-in-out;
}

/* Exibe logo conforme modo do tema */
.logo-container .logo-dark {
    display: block;
}

.logo-container .logo-light {
    display: none;
}

[data-theme="light"] .logo-container .logo-dark {
    display: none;
}

[data-theme="light"] .logo-container .logo-light {
    display: block;
}

.sidebar-logo {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.sidebar-subtitle {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
}

.sidebar-nav {
    padding: 8px 0;
}

.nav-menu {
    list-style: none;
    padding: 0;
}

.nav-item {
    margin: 2px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    border-radius: var(--border-radius);
    margin: 2px 0;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    transform: translateX(2px);
}

.nav-link:hover::before {
    transform: scaleY(1);
}

.nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

.nav-link.active::before {
    transform: scaleY(1);
}

.nav-link-danger {
    color: var(--danger-color);
}

.nav-link-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-left-color: var(--danger-color);
    color: var(--danger-color);
}

.nav-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 16px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.top-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(var(--bg-primary-rgb, 255, 255, 255), 0.8);
}

[data-theme="dark"] .top-header {
    background: rgba(15, 23, 42, 0.8);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-secondary);
}

.sidebar-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-name strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   CONTAINER E CARDS
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    padding: 28px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--box-shadow-md);
}

.card-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    transform: translateY(-1px);
}

/* Classe form-control (alias para inputs dentro de form-group) */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    transform: translateY(-1px);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'Consolas', 'Monaco', monospace;
}

.form-group small,
.help-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ============================================
   BOTÕES
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
    box-shadow: var(--box-shadow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-light);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: var(--text-light);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-edit {
    background: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.btn-edit:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary-color);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--warning-color);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

.btn-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.btn-info:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--info-color);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

/* ============================================
   TABELAS
   ============================================ */

.table-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-secondary);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
    transform: scale(1.01);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.badge-admin {
    background: var(--primary-light);
    color: var(--primary-color);
}

.badge-user {
    background: rgba(107, 114, 128, 0.15);
    color: var(--secondary-color);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-connected {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.status-connecting {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.status-disconnected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

/* ============================================
   ALERTAS
   ============================================ */

.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.alert:hover {
    transform: translateX(4px);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success-color);
}

.alert-error,
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.3);
    color: var(--info-color);
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    border: 1px solid var(--border-color);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 600;
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
}

.close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* ============================================
   SECTIONS E GRID
   ============================================ */

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 32px 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.button-group {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.button-group:hover {
    box-shadow: var(--box-shadow);
}

.button-group-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 15px;
}

.button-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    flex: 1;
    min-width: 150px;
}

.checkbox-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
    transform: translateY(-2px);
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.button-config {
    display: none;
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.button-config.active {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.button-config-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.button-config-fields.full-width {
    grid-template-columns: 1fr;
}

/* ============================================
   RESULTS
   ============================================ */

.results {
    margin-top: 24px;
    padding: 24px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    display: none;
}

.results.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.results h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

.result-item {
    padding: 16px;
    margin-bottom: 12px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    background: var(--bg-secondary);
    transition: var(--transition);
}

.result-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.result-item.success {
    border-left-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.result-item.error {
    border-left-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

.result-number {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.result-message {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

.summary {
    margin-top: 24px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
}

.summary-item {
    display: inline-block;
    margin: 0 30px;
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.summary-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
    font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */

.main-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 24px;
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .container {
        padding: 16px;
    }
    
    .button-fields {
        grid-template-columns: 1fr;
    }
    
    .summary-item {
        margin: 0 15px;
    }
    
    .header-content {
        padding: 12px 16px;
    }
    
    .page-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden {
    display: none !important;
}

/* ============================================
   QR CODE CONTAINER
   ============================================ */

.qrcode-container {
    text-align: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.qrcode-container img {
    max-width: 100%;
    border-radius: var(--border-radius);
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* ============================================
   TABS SYSTEM
   ============================================ */

.tabs-container {
    margin-top: 24px;
}

.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    padding-bottom: 0;
}

.nav-tab-item {
    list-style: none;
    margin: 0;
}

.nav-tab-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.nav-tab-link:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.nav-tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-secondary);
}

.nav-tab-link i {
    font-size: 16px;
}

.tab-content {
    margin-top: 24px;
}

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

.tab-pane.active {
    display: block;
}

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

/* ============================================
   FORM CONTAINER (Mensagens)
   ============================================ */

.form-container {
    padding: 24px 0;
}

.form-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.message-form {
    max-width: 800px;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.form-actions .btn {
    min-width: 150px;
}

/* ============================================
   FORM SECTION COMPONENT
   Componente reutilizável para seções de formulário
   ============================================ */

.form-section.module {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 0;
    margin-bottom: 24px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.form-section.module:hover {
    box-shadow: var(--box-shadow-md);
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: default;
    user-select: none;
}

.module-header.section-header {
    cursor: pointer;
    transition: var(--transition-fast);
}

.module-header.section-header:hover {
    background-color: var(--bg-hover);
}

.module-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-title i {
    font-size: 20px;
    color: var(--primary-color);
}

.toggle-icon {
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.section-header.active .toggle-icon {
    transform: rotate(180deg);
}

.form-body {
    padding: 24px;
    background-color: var(--bg-primary);
}

.form-body.collapsed {
    display: none;
}

.form-body .form-group,
.form-body .mb-3 {
    margin-bottom: 20px;
}

.form-body label,
.form-body .form-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-body input[type="text"],
.form-body input[type="email"],
.form-body input[type="password"],
.form-body input[type="number"],
.form-body input[type="date"],
.form-body input[type="datetime-local"],
.form-body input[type="file"],
.form-body select,
.form-body textarea,
.form-body .form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition-fast);
}

.form-body input:focus,
.form-body select:focus,
.form-body textarea:focus,
.form-body .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    background-color: var(--bg-primary);
}

.form-body input::placeholder,
.form-body textarea::placeholder {
    color: var(--text-muted);
}

.form-body small,
.form-body .form-text,
.form-body .text-muted {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.form-body .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 500;
    font-size: 15px;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.form-body .btn i {
    font-size: 16px;
}

.form-body .btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.form-body .btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-md);
}

.form-body .btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-light);
}

.form-body .btn-secondary:hover {
    background-color: var(--bg-hover);
    transform: translateY(-1px);
}

.form-body .btn-success {
    background-color: var(--success-color);
    color: var(--text-light);
}

.form-body .btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-md);
}

.form-body .btn-danger {
    background-color: var(--danger-color);
    color: var(--text-light);
}

.form-body .btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-md);
}

.form-body .btn-warning {
    background-color: var(--warning-color);
    color: var(--text-light);
}

.form-body .btn-warning:hover {
    background-color: #d97706;
    transform: translateY(-1px);
}

.form-body .btn-info {
    background-color: var(--info-color);
    color: var(--text-light);
}

.form-body .btn-info:hover {
    background-color: #0891b2;
    transform: translateY(-1px);
}

/* ============================================
   MELHORIAS DE VISIBILIDADE - DARK MODE
   ============================================ */

/* Corrige cabeçalhos e textos primários para melhor visibilidade */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .module-header,
html[data-theme="dark"] .card-title {
    color: #00e0ff !important;
    font-weight: bold;
}

/* Títulos com emojis (como 📊) - cor especial */
html[data-theme="dark"] h3.module-header,
html[data-theme="dark"] h2.module-header,
html[data-theme="dark"] .card-title.module-header {
    color: #00d6a0 !important;
    font-size: 18px;
    letter-spacing: 0.5px;
}

/* Legendas e descrições */
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .description,
html[data-theme="dark"] .card p:not(.card-title),
html[data-theme="dark"] .card small,
html[data-theme="dark"] .card-subtitle,
html[data-theme="dark"] label:not(.form-check-label),
html[data-theme="dark"] .card-header p,
html[data-theme="dark"] .sub-title {
    color: #ccc !important;
}

/* Campos de filtros e formulários */
html[data-theme="dark"] .card input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] .card select,
html[data-theme="dark"] .card textarea,
html[data-theme="dark"] .form-control {
    background-color: #12141c !important;
    color: #e0e0e0 !important;
    border: 1px solid #2e2e2e !important;
}

html[data-theme="dark"] .card input:focus,
html[data-theme="dark"] .card select:focus,
html[data-theme="dark"] .card textarea:focus,
html[data-theme="dark"] .form-control:focus {
    background-color: #1a1d2e !important;
    border-color: #00e0ff !important;
    color: #ffffff !important;
}

/* Labels de formulário */
html[data-theme="dark"] .form-label {
    color: #ccc !important;
    font-weight: 500;
}

/* Textos secundários em cards */
html[data-theme="dark"] .card-body p,
html[data-theme="dark"] .card-body small {
    color: #b8b8b8 !important;
}

/* Melhorar contraste de badges */
html[data-theme="dark"] .badge {
    font-weight: 600;
}

/* Melhorar visibilidade de tabelas */
html[data-theme="dark"] .data-table th {
    color: #00e0ff !important;
    font-weight: 600;
}

html[data-theme="dark"] .data-table td {
    color: #e0e0e0 !important;
}

.form-body .preview-box,
.form-body .placeholder {
    padding: 16px;
    background-color: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-style: italic;
    min-height: 60px;
    margin-top: 12px;
}

.form-body .preview-box:not(:empty) {
    font-style: normal;
    color: var(--text-primary);
    border-style: solid;
    border-color: var(--primary-color);
}

/* Responsividade */
@media (max-width: 768px) {
    .form-section.module {
        margin-bottom: 16px;
    }
    
    .module-header {
        padding: 16px 20px;
    }
    
    .module-title {
        font-size: 16px;
    }
    
    .form-body {
        padding: 20px;
    }
    
    .form-body .btn {
        width: 100%;
        justify-content: center;
    }
}
