/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B35;
    --secondary-color: #2C3E50;
    --dark-bg: #1a1a1a;
    --light-bg: #f5f5f5;
    --text-dark: #333;
    --text-light: #fff;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Login Page */
body:has(.login-container) {
    background: #0a0a12;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 0;
    background: url('../images/login-bg.png') center center / cover no-repeat fixed;
    position: relative;
}

.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 0;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2.5rem;
    color: var(--text-light);
    font-weight: 300;
}

.login-form {
    width: 100%;
}

.login-form .form-group:last-child {
    margin-bottom: 0;
}

.login-container .form-group {
    margin-bottom: 1.25rem;
}

.login-container .form-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(30, 30, 35, 0.9);
    color: var(--text-light);
    transition: background 0.3s;
}

.login-container .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.login-container .form-group input:focus {
    outline: none;
    background: rgba(40, 40, 48, 0.95);
}

.captcha-group {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-group .g-recaptcha {
    display: flex;
    justify-content: center;
}

.captcha-group .g-recaptcha > div {
    margin: 0 auto;
}

.login-form .btn-primary.btn-block {
    display: block;
    width: 100%;
    visibility: visible;
    margin-top: 0.5rem;
}

.captcha-checkbox-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #dadce0;
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.captcha-checkbox-label:hover {
    border-color: #8e8e8e;
}

.captcha-checkbox-label input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.captcha-checkbox-box {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 2px solid #dadce0;
    border-radius: 2px;
    background: #fff;
    transition: background 0.2s, border-color 0.2s;
}

.captcha-checkbox-label input:checked + .captcha-checkbox-box {
    background: #1a73e8;
    border-color: #1a73e8;
}

.captcha-checkbox-label input:checked + .captcha-checkbox-box::after {
    content: '';
    display: block;
    width: 6px;
    height: 12px;
    margin: 5px 0 0 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.captcha-checkbox-text {
    color: #3c4043;
    font-size: 0.95rem;
    font-weight: 400;
}

.login-container .btn-primary {
    background: #2563eb;
    margin-top: 0.5rem;
}

.login-container .btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 1000;
}

.whatsapp-float:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
    color: #fff;
}

.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: #e55a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background-color: #fee;
    color: var(--error-color);
    border: 1px solid #fcc;
}

.login-container .alert-error {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
}

/* Dashboard Layout */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    padding: 0;
    background-color: #f5f7fa;
}

.top-header {
    background: #fff;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e8f5e9;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #2e7d32;
}

.header-status .icon {
    font-size: 1rem;
}

.header-status-long { display: inline; }
.header-status-short { display: none; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.header-icon:hover {
    background: #e0e0e0;
}

.header-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Breadcrumbs - alinhamento e espaçamento */
.content-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumbs-section {
    flex: 1;
}

.greeting {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-dark);
    display: block;
    margin-bottom: 0.5rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.4;
}

.breadcrumb-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.breadcrumb-home:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    color: #999;
    font-weight: 400;
    margin: 0;
}

.breadcrumb-current {
    color: var(--text-dark);
    font-weight: 500;
}

/* Notificações */
.notification-wrapper {
    position: relative;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
}

.notification-dropdown-header {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-clear-all {
    border: 0;
    background: transparent;
    color: #dc2626;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.notification-clear-all:hover {
    text-decoration: underline;
}

.notification-dropdown-body {
    max-height: 320px;
    overflow-y: auto;
}

.notification-loading {
    padding: 24px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.notification-empty {
    padding: 24px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.notification-item-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.2s;
    flex: 1;
}

.notification-item:hover .notification-item-link {
    background: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item-remove {
    border: 0;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.85rem;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 999px;
    flex-shrink: 0;
}

.notification-item-remove:hover {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}

.notification-item-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.notification-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.notification-item-msg {
    font-size: 0.8rem;
    color: #666;
}

/* Modal de Pesquisa Global */
.search-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.search-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    padding: 0;
    animation: searchModalIn 0.2s ease-out;
}

@keyframes searchModalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.search-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-dark);
}

.search-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.search-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.search-modal-form {
    padding: 1.5rem;
}

.search-modal-field {
    margin-bottom: 1rem;
}

.search-modal-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.search-modal-field input,
.search-modal-field select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.search-modal-field input:focus,
.search-modal-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.search-modal-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.user-profile:hover {
    background: #f5f5f5;
}

.user-profile.user-profile-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.user-profile.sidebar-profile.user-profile-link:hover {
    background: rgba(0, 0, 0, 0.06);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #e55a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    overflow: hidden;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-inicial {
    font-weight: 600;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.user-credits {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.15rem;
}

.user-credits .icon-credits {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.user-credits-count {
    font-weight: 600;
    color: var(--text-dark);
}

.user-role {
    font-size: 0.75rem;
    color: #666;
}

.content-header {
    padding: 2rem;
    background: #fff;
    margin-bottom: 0;
}

.content-header h1 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0;
}

.content-header-geral {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
}

.content-header-geral .breadcrumbs-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.content-header-title-block {
    margin-top: 0.5rem;
    text-align: left;
    width: 100%;
}

.content-header-title-block h1 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    text-align: left;
}

.content-header-title-block .content-subtitle,
.content-header-title-block .section-desc {
    text-align: left;
    margin: 0.25rem 0 0 0;
    color: #666;
    font-size: 0.95rem;
}

.content-body {
    width: 100%;
    padding: 2rem;
}

/* Sidebar - tema claro por padrão */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background-color: #ffffff;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    padding: 1.5rem 1.5rem;
    text-align: center;
}

.sidebar-header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-header .notification-wrapper .header-icon {
    background: rgba(0, 0, 0, 0.06);
}

.sidebar-header .notification-wrapper .header-icon:hover {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-header .notification-dropdown {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 8px);
}

/* Logo: 48–64px, badge arredondado, centralizado */
.sidebar-logo-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 1.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    padding: 6px;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: contain;
    border-radius: 10px;
    display: block;
}

.sidebar-header img {
    max-width: 48px !important;
    max-height: 48px !important;
    width: 48px !important;
    height: 48px !important;
    object-fit: contain !important;
}

/* Título: escuro, 18–22px, laranja como accent */
.sidebar-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.35rem;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.sidebar-title .accent-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
}

/* Subtítulo: 12–13px, cinza médio, espaçamento 6–10px do título */
.sidebar-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin: 0.25rem 0 0;
    text-align: center;
}

/* Separador: linha fina */
.sidebar-header-divider {
    height: 1px;
    background: var(--border-color);
    margin-top: 1.5rem;
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}
.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
}
.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

.sidebar-menu ul {
    list-style: none;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-left-color: var(--primary-color);
}

.menu-item.active {
    background-color: rgba(255, 107, 53, 0.08);
    border-left-color: var(--primary-color);
}

.menu-item .icon {
    margin-right: 1rem;
    font-size: 1.2rem;
}

.menu-item .icon.icon-configuracoes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6b7280;
}
.menu-item .icon.icon-configuracoes svg {
    width: 20px;
    height: 20px;
}
.menu-item:hover .icon.icon-configuracoes,
.menu-item.active .icon.icon-configuracoes {
    color: var(--text-dark);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Perfil do usuário na sidebar - avatar laranja, nome e cargo */
.sidebar-user-profile {
    margin-bottom: 1rem;
}

.user-profile.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
}

.user-profile.sidebar-profile .user-avatar.sidebar-avatar,
.user-profile.sidebar-profile .user-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: #FF6B35;
    background: linear-gradient(135deg, #FF6B35, #e55a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.user-profile.sidebar-profile .user-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.user-profile.sidebar-profile .user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-profile.sidebar-profile .user-role {
    font-size: 0.8rem;
    color: #6b7280;
}

.logout-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #b91c1c;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    background-color: rgba(220, 53, 69, 0.12);
}

.logout-btn:hover {
    background-color: rgba(220, 53, 69, 0.2);
    color: #991b1b;
}

.logout-btn .icon {
    margin-right: 0.75rem;
}

/* Stats Grid - Cards de Status de Clientes */
.client-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-card {
    padding: 2rem;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s;
}

.status-card:hover {
    transform: translateY(-5px);
}

.status-card.active {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.status-card.expired {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.status-card.deactivated {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
}

.status-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.status-info h3 {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.status-number {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Cards Financeiros */
.financial-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.financial-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.financial-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.financial-info h3 {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.financial-period {
    font-size: 0.75rem;
    color: #999;
}

.financial-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 2px;
}

/* Filtros dos Gráficos */
.charts-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.charts-filters-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
}
.chart-filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    color: #666;
    background: #f0f0f0;
    border: 1px solid #ddd;
    transition: all 0.2s;
}
.chart-filter-btn:hover {
    background: #e8e8e8;
    color: var(--primary-color);
}
.chart-filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Gráficos */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 250px;
}

/* Alertas de Vencimento */
.alerts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .alerts-grid {
        grid-template-columns: 1fr;
    }
}

.alert-card {
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-card.expired {
    background: #fee;
    border-left: 4px solid #dc3545;
}

.alert-card.today {
    background: #e8f5e9;
    border-left: 4px solid #28a745;
}

.alert-card.near {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.alert-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.alert-card.expired h3 {
    color: #dc3545;
}

.alert-card.today h3 {
    color: #28a745;
}

.alert-card.near h3 {
    color: #856404;
}

.alert-instruction {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.alert-message {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.alert-table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 240px;
}

.alert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.alert-table th,
.alert-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.alert-table th {
    font-weight: 600;
    background: rgba(0, 0, 0, 0.04);
}

.alert-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.badge-ativo {
    background: #28a745;
    color: #fff;
}

.badge-inativo {
    background: #6c757d;
    color: #fff;
}

.btn-alert-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    text-decoration: none;
    margin-right: 0.25rem;
    transition: opacity 0.2s;
}

.btn-alert-action:hover {
    opacity: 0.8;
}

.btn-alert-action.btn-whatsapp {
    background: #25d366;
    color: #fff;
}

/* Stats Grid (mantido para compatibilidade) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Formulário de Cliente */
.content-header .subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    font-weight: normal;
}

.client-form {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #fff;
    color: var(--text-dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-control::placeholder {
    color: #999;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    appearance: none;
    background: #ccc;
    border-radius: 13px;
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch:checked {
    background: #28a745;
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    pointer-events: none;
}

.toggle-switch:checked + .toggle-slider {
    transform: translateX(24px);
}

.form-help {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.form-help .link {
    color: var(--primary-color);
    text-decoration: none;
}

.form-help .link:hover {
    text-decoration: underline;
}

.tags-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

/* Menu com submenu */
.sidebar-menu li.has-submenu {
    position: relative;
}

.sidebar-menu li.has-submenu.active .submenu {
    display: block;
}

.submenu {
    display: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
}

/* Submenu aninhado (ex: Webhook dentro de WhatsApp) */
.submenu .submenu {
    padding-left: 1.25rem;
    margin-top: 0.25rem;
}

.submenu li {
    margin: 0.25rem 0;
}

.submenu .menu-item {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.submenu .menu-item:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
}

.submenu .menu-item.active {
    opacity: 1;
    background-color: transparent;
    border-left: 3px solid var(--primary-color);
}

.badge-new {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: auto;
}

.badge-green {
    background: #28a745;
    color: white;
}

.badge-blue {
    background: #007bff;
    color: white;
}

.badge-purple {
    background: #6f42c1;
    color: white;
}

.badge-orange {
    background: #fd7e14;
    color: white;
}

.badge-red {
    background: #dc3545;
    color: white;
}

.badge-dark-purple {
    background: #5a32a3;
    color: white;
}

.menu-arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.sidebar-menu li.has-submenu.active .menu-arrow {
    transform: rotate(90deg);
}

/* Tabelas */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: #f5f5f5;
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid #e0e0e0;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    color: var(--text-dark);
}

.table tbody tr:hover {
    background: #f9f9f9;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    margin-right: 0.5rem;
    transition: all 0.3s;
}

.btn-small.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-small.btn-danger:hover {
    background: #c82333;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: #fff;
    margin-bottom: 0;
}

.content-header h1 {
    margin: 0;
}

/* content-header-geral: alinhamento à esquerda (perfil, configuracoes) */
.content-header.content-header-geral {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
}

.content-header.content-header-geral .breadcrumbs-section {
    justify-content: flex-start;
}

.content-header.content-header-geral .content-header-title-block {
    text-align: left;
    width: 100%;
}

.content-header.content-header-geral .content-header-title-block h1,
.content-header.content-header-geral .content-header-title-block .content-subtitle {
    text-align: left;
}

/* Botão de alternar tema */
.theme-toggle-btn {
    border: none;
    font-size: 1.2rem;
    background: inherit;
}

.theme-toggle-btn:hover {
    background: inherit;
}

.theme-toggle-btn .theme-icon-moon {
    display: none;
}

.theme-toggle-btn .theme-icon-sun {
    display: inline;
}

html.theme-dark .theme-toggle-btn .theme-icon-moon {
    display: inline;
}

html.theme-dark .theme-toggle-btn .theme-icon-sun {
    display: none;
}

/* Tema escuro */
html.theme-dark {
    --light-bg: #0f0f12;
    --text-dark: #e4e8f0;
    --border-color: #2a2a32;
}

html.theme-dark body {
    background-color: var(--light-bg);
    color: var(--text-dark);
}

html.theme-dark .main-content {
    background-color: #0f0f12;
}

html.theme-dark .top-header {
    background: #1a1a1f;
    border-bottom-color: var(--border-color);
}

/* Sidebar - tema escuro */
html.theme-dark .sidebar {
    background-color: var(--dark-bg);
    color: var(--text-light);
    border-right-color: #2a2a32;
}
html.theme-dark .sidebar-title { color: #f0f0f0; }
html.theme-dark .sidebar-subtitle { color: #A0A0A0; }
html.theme-dark .sidebar-header-divider { background: rgba(255, 255, 255, 0.12); }
html.theme-dark .sidebar-footer { border-top-color: rgba(255, 255, 255, 0.1); }
html.theme-dark .sidebar-logo-badge { background: rgba(255, 255, 255, 0.08); }
html.theme-dark .sidebar-menu { scrollbar-color: rgba(255, 255, 255, 0.3) transparent; }
html.theme-dark .sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); }
html.theme-dark .sidebar-menu::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.5); }
html.theme-dark .menu-item { color: var(--text-light); }
html.theme-dark .menu-item:hover { background-color: rgba(255, 255, 255, 0.1); }
html.theme-dark .menu-item.active { background-color: transparent; }
html.theme-dark .submenu .menu-item:hover { background-color: rgba(255, 255, 255, 0.15); }
html.theme-dark .user-profile.sidebar-profile { background: rgba(255, 255, 255, 0.05); }
html.theme-dark .user-profile.sidebar-profile .user-name { color: var(--text-light); }
html.theme-dark .user-profile.sidebar-profile .user-role { color: rgba(255, 255, 255, 0.7); }
html.theme-dark .user-profile.sidebar-profile.user-profile-link:hover { background: rgba(255, 255, 255, 0.1); }
html.theme-dark .logout-btn { color: #fca5a5; background-color: rgba(220, 53, 69, 0.2); }
html.theme-dark .logout-btn:hover { background-color: rgba(220, 53, 69, 0.4); color: #fecaca; }
html.theme-dark .sidebar-header .notification-wrapper .header-icon { background: rgba(255, 255, 255, 0.1); }
html.theme-dark .sidebar-header .notification-wrapper .header-icon:hover { background: rgba(255, 255, 255, 0.2); }
html.theme-dark .menu-item .icon.icon-configuracoes { color: #b0b8c4; }
html.theme-dark .menu-item:hover .icon.icon-configuracoes,
html.theme-dark .menu-item.active .icon.icon-configuracoes { color: #e4e8f0; }

html.theme-dark .header-icon {
    background: #2a2a32;
}

html.theme-dark .header-icon:hover {
    background: #3a3a42;
}

html.theme-dark .header-status {
    background: rgba(40, 167, 69, 0.2);
    color: #4ade80;
}

html.theme-dark .content-header,
html.theme-dark .content-header-with-actions {
    background: #1a1a1f;
    border-bottom-color: var(--border-color);
}

html.theme-dark .content-header h1,
html.theme-dark .greeting,
html.theme-dark .breadcrumb-current {
    color: var(--text-dark);
}

html.theme-dark .breadcrumbs,
html.theme-dark .breadcrumb-home {
    color: #9ca3af;
}

html.theme-dark .breadcrumb-home:hover {
    color: var(--primary-color);
}

html.theme-dark .user-profile:hover {
    background: #2a2a32;
}

html.theme-dark .user-name {
    color: var(--text-dark);
}

html.theme-dark .user-credits { color: #9ca3af; }
html.theme-dark .user-credits .icon-credits { stroke: #9ca3af; }
html.theme-dark .user-credits-count { color: var(--text-light, #f3f4f6); }

html.theme-dark .user-role {
    color: #9ca3af;
}

html.theme-dark .content-body {
    background: transparent;
}

/* Filtros gráficos - tema escuro */
html.theme-dark .charts-filters-label {
    color: var(--text-dark);
}
html.theme-dark .chart-filter-btn {
    background: #25252d;
    border-color: var(--border-color);
    color: #9ca3af;
}
html.theme-dark .chart-filter-btn:hover {
    background: #2a2a32;
    color: var(--primary-color);
}
html.theme-dark .chart-filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Cards e elementos no tema escuro */
html.theme-dark .financial-card,
html.theme-dark .chart-card,
html.theme-dark .alert-card {
    background: #1a1a1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html.theme-dark .financial-card h3,
html.theme-dark .chart-card h3,
html.theme-dark .alert-card h3 {
    color: var(--text-dark);
}

html.theme-dark .financial-info h3,
html.theme-dark .financial-period {
    color: #9ca3af;
}

html.theme-dark .financial-value {
    color: var(--text-dark);
}

html.theme-dark .alert-card.expired {
    background: rgba(220, 53, 69, 0.15);
}

html.theme-dark .alert-card.today {
    background: rgba(255, 193, 7, 0.1);
}

html.theme-dark .alert-card.near {
    background: rgba(40, 167, 69, 0.1);
}

html.theme-dark .alert-revendedores {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.35);
}

html.theme-dark .alert-instruction {
    color: #d1d5db !important;
    opacity: 1;
}

html.theme-dark .alert-message {
    background: rgba(0, 0, 0, 0.25) !important;
    color: #e4e8f0 !important;
}

html.theme-dark .alert-table th,
html.theme-dark .alert-table td {
    border-bottom-color: var(--border-color);
    color: var(--text-dark);
}

html.theme-dark .alert-table th {
    background: rgba(0, 0, 0, 0.2);
}

html.theme-dark .alert-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Botão Ver Fatura / Gerar Fatura - legível no tema escuro */
html.theme-dark .btn-alert-link {
    background: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
html.theme-dark .btn-alert-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
html.theme-dark .alert-card.near .btn-alert-link {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.5);
}
html.theme-dark .alert-card.near .btn-alert-link:hover {
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.2);
}
html.theme-dark .alert-card.today .btn-alert-link {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.5);
}
html.theme-dark .alert-card.today .btn-alert-link:hover {
    color: #86efac;
    background: rgba(74, 222, 128, 0.2);
}
html.theme-dark .alert-card.expired .btn-alert-link {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.5);
}
html.theme-dark .alert-card.expired .btn-alert-link:hover {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.2);
}

/* Notificações dropdown */
html.theme-dark .notification-dropdown {
    background: #1a1a1f;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

html.theme-dark .notification-dropdown-header {
    background: #25252d;
    border-bottom-color: var(--border-color);
}

html.theme-dark .notification-clear-all {
    color: #f87171;
}

html.theme-dark .notification-item {
    border-bottom-color: var(--border-color);
}

html.theme-dark .notification-item-link {
    color: var(--text-dark);
}

html.theme-dark .notification-item:hover .notification-item-link {
    background: #25252d;
}

html.theme-dark .notification-item-msg {
    color: #9ca3af;
}

html.theme-dark .notification-item-remove {
    color: #9ca3af;
}

/* Modal de busca */
html.theme-dark .search-modal {
    background: #1a1a1f;
}

html.theme-dark .search-modal-header {
    border-bottom-color: var(--border-color);
}

html.theme-dark .search-modal-header h3 {
    color: var(--text-dark);
}

html.theme-dark .search-modal-close {
    background: #2a2a32;
    color: #9ca3af;
}

html.theme-dark .search-modal-close:hover {
    background: #3a3a42;
    color: var(--text-dark);
}

html.theme-dark .search-modal-field label {
    color: var(--text-dark);
}

html.theme-dark .search-modal-field input,
html.theme-dark .search-modal-field select {
    background: #25252d;
    border-color: var(--border-color);
    color: var(--text-dark);
}

/* Tabelas e formulários */
html.theme-dark .card,
html.theme-dark .table-container {
    background: #1a1a1f;
    border-color: var(--border-color);
}

html.theme-dark .card-header {
    background: #25252d;
    border-bottom-color: var(--border-color);
}

html.theme-dark .card-header h3 {
    color: var(--text-dark);
}

html.theme-dark table {
    color: var(--text-dark);
}

html.theme-dark table th {
    background: #25252d;
    border-color: var(--border-color);
}

html.theme-dark table td {
    border-color: var(--border-color);
}

html.theme-dark .form-control {
    background: #25252d;
    border-color: var(--border-color);
    color: var(--text-dark);
}

html.theme-dark .form-control:focus {
    background: #2a2a32;
}

html.theme-dark .form-control::placeholder {
    color: #6b7280;
}

/* Breadcrumbs section */
html.theme-dark .breadcrumb-separator {
    color: #6b7280;
}

/* Formulários e cards no tema escuro */
html.theme-dark .client-form,
html.theme-dark .form-card,
html.theme-dark .form-card-produto,
html.theme-dark .form-card-pedido,
html.theme-dark .form-card-whatsapp,
html.theme-dark .filters-card,
html.theme-dark .table-card,
html.theme-dark .revendedores-table-card,
html.theme-dark .stat-card,
html.theme-dark .tokens-table-card,
html.theme-dark .fatura-historial-card,
html.theme-dark .view-card,
html.theme-dark .credit-card {
    background: #1a1a1f !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

html.theme-dark .form-title,
html.theme-dark .section-title,
html.theme-dark .section-header h2 {
    color: var(--text-dark) !important;
}

/* Servidores gerenciar - tema escuro */
html.theme-dark .servers-section {
    background: #1a1a1f !important;
    border-color: var(--border-color) !important;
}
html.theme-dark .servers-section .section-header {
    border-bottom-color: var(--border-color) !important;
}
html.theme-dark .servers-section .section-subtitle {
    color: #9ca3af !important;
}
html.theme-dark .servers-section .gear-icon {
    color: #9ca3af !important;
}
html.theme-dark .servers-section .gear-icon:hover {
    color: var(--text-dark) !important;
}
html.theme-dark .search-card {
    background: #25252d !important;
    border-color: var(--border-color) !important;
}
html.theme-dark .search-input-group label {
    color: #9ca3af !important;
}
html.theme-dark .search-input-group .form-control {
    background: #1a1a1f !important;
    border-color: var(--border-color) !important;
    color: var(--text-dark) !important;
}
html.theme-dark .search-input-group .form-control::placeholder {
    color: #6b7280 !important;
}
html.theme-dark .table-card .table,
html.theme-dark .servers-section .table-card {
    background: #1a1a1f !important;
}
html.theme-dark .servers-section .table thead {
    background: #25252d !important;
}
html.theme-dark .servers-section .table th {
    color: #9ca3af !important;
    border-bottom-color: var(--border-color) !important;
}
html.theme-dark .servers-section .table td {
    color: var(--text-dark) !important;
    border-bottom-color: var(--border-color) !important;
}
html.theme-dark .servers-section .table tbody tr:hover {
    background: #25252d !important;
}
html.theme-dark .servers-section .no-results {
    color: #9ca3af !important;
}
html.theme-dark .servers-section .table-footer {
    background: #25252d !important;
    border-top-color: var(--border-color) !important;
}
html.theme-dark .servers-section .pagination-info {
    color: #9ca3af !important;
}

/* Formulário de pedidos - tema escuro */
html.theme-dark .form-subtitle {
    color: #9ca3af !important;
}

html.theme-dark .produtos-section {
    border-top-color: var(--border-color) !important;
}

html.theme-dark .item-row {
    background: #25252d !important;
    border: 1px solid var(--border-color);
}

html.theme-dark .item-row .form-group label {
    color: #9ca3af !important;
}

html.theme-dark .total-section {
    background: #25252d !important;
    border: 1px solid var(--border-color);
}

html.theme-dark .total-label {
    color: var(--text-dark) !important;
}

html.theme-dark .total-value {
    color: #a78bfa !important;
}

html.theme-dark .btn-remove-item {
    background: rgba(220, 53, 69, 0.5) !important;
    color: #fca5a5 !important;
}

html.theme-dark .btn-remove-item:hover {
    background: rgba(220, 53, 69, 0.7) !important;
    color: #fff !important;
}

html.theme-dark .content-header .subtitle,
html.theme-dark .content-subtitle,
html.theme-dark .section-subtitle,
html.theme-dark .content-header-title-block .section-desc {
    color: #9ca3af !important;
}

html.theme-dark .content-header .breadcrumbs-section a,
html.theme-dark .content-header .breadcrumbs-section a:link,
html.theme-dark .content-header .breadcrumbs-section a:visited {
    color: #9ca3af !important;
    text-decoration: none !important;
}

html.theme-dark .content-header .breadcrumbs-section a:hover {
    color: var(--primary-color) !important;
}

html.theme-dark .content-header .breadcrumbs-section span:not(.breadcrumb-current) {
    color: #9ca3af !important;
}

html.theme-dark .content-header .breadcrumbs-section .breadcrumb-current {
    color: var(--text-dark) !important;
}

html.theme-dark .content-header .breadcrumb-sep {
    color: #6b7280 !important;
}

/* Perfil - tema escuro */
html.theme-dark .profile-card {
    background: #1a1a1f !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
}

html.theme-dark .profile-details {
    background: transparent !important;
}

html.theme-dark .profile-row {
    border-bottom-color: var(--border-color) !important;
}

html.theme-dark .profile-label {
    color: #9ca3af !important;
}

html.theme-dark .profile-value {
    color: var(--text-dark) !important;
}

html.theme-dark .profile-actions {
    background: #25252d !important;
    border-top-color: var(--border-color) !important;
}

html.theme-dark .profile-actions .btn-secondary {
    background: #3a3a42 !important;
    color: var(--text-dark) !important;
    border-color: var(--border-color);
}

html.theme-dark .profile-actions .btn-secondary:hover {
    background: #4a4a52 !important;
}

html.theme-dark .profile-actions .btn-outline {
    background: transparent !important;
    color: var(--text-dark) !important;
    border-color: var(--border-color) !important;
}

html.theme-dark .profile-actions .btn-outline:hover {
    background: #2a2a32 !important;
    color: var(--text-dark) !important;
}

/* Configurações - tema escuro */
html.theme-dark .config-card {
    background: linear-gradient(135deg, #1a1f2e 0%, #252b3b 100%) !important;
    border-color: rgba(255,255,255,0.06) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

html.theme-dark .config-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
}

html.theme-dark .config-card-header {
    border-bottom-color: rgba(255,255,255,0.06) !important;
}

html.theme-dark .config-card-header h3 {
    color: #e4e8f0 !important;
}

html.theme-dark .config-card-body p {
    color: #a0aec0 !important;
}

html.theme-dark .form-plano-ate label {
    color: #a0aec0 !important;
}

html.theme-dark .form-plano-ate input[type="date"] {
    background: rgba(0,0,0,0.2) !important;
    border-color: rgba(255,255,255,0.2) !important;
    color: #e4e8f0 !important;
}

/* Relatórios - Atalhos Rápidos tema escuro */
html.theme-dark .atalhos-rapidos-card {
    background: #1a1a1f !important;
}

html.theme-dark .atalhos-rapidos-card h3 {
    color: var(--text-dark) !important;
}

html.theme-dark .relatorio-link {
    background: rgba(255,255,255,0.06) !important;
    border-color: var(--border-color) !important;
    color: var(--text-dark) !important;
}

html.theme-dark .relatorio-link:hover {
    background: rgba(255,255,255,0.12) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

html.theme-dark .form-group label,
html.theme-dark .filter-group label,
html.theme-dark .toggle-label span {
    color: var(--text-dark) !important;
}

html.theme-dark .form-help {
    color: #9ca3af !important;
}

html.theme-dark .form-section {
    border-bottom-color: var(--border-color) !important;
}

html.theme-dark .form-actions {
    border-top-color: var(--border-color) !important;
}

/* Custom select (clientes) */
html.theme-dark .custom-select-trigger {
    background: #25252d !important;
    border-color: var(--border-color) !important;
    color: var(--text-dark) !important;
}

html.theme-dark .custom-select-dropdown {
    background: #1a1a1f !important;
    border-color: var(--border-color) !important;
}

html.theme-dark .custom-option:hover {
    background: #25252d !important;
}

html.theme-dark .custom-option.selected {
    background: rgba(111, 66, 193, 0.3) !important;
}

html.theme-dark .servidor-label,
html.theme-dark .custom-option {
    color: var(--text-dark) !important;
}

html.theme-dark .custom-select-arrow {
    color: #9ca3af !important;
}

/* WhatsApp prefix no formulário */
html.theme-dark .whatsapp-nacional .whatsapp-prefix {
    background: #25252d !important;
    border-color: var(--border-color) !important;
    color: var(--text-dark) !important;
}

/* WhatsApp internacional - seletor de país (mesmo estilo do nacional) */
html.theme-dark .whatsapp-country-trigger {
    background: #25252d !important;
    border-color: var(--border-color) !important;
    color: var(--text-dark) !important;
}
html.theme-dark .whatsapp-country-arrow {
    color: #9ca3af !important;
}
html.theme-dark .whatsapp-country-dropdown {
    background: #25252d !important;
    border-color: var(--border-color) !important;
}
html.theme-dark .whatsapp-country-option {
    color: var(--text-dark) !important;
}
html.theme-dark .whatsapp-country-option:hover {
    background: rgba(111, 66, 193, 0.2) !important;
}
html.theme-dark .whatsapp-country-option.selected {
    background: rgba(111, 66, 193, 0.3) !important;
}

/* Tabela - cabeçalho e linhas */
html.theme-dark .table thead,
html.theme-dark .table thead th {
    background: #25252d !important;
    border-color: var(--border-color) !important;
    color: var(--text-dark) !important;
}

html.theme-dark .table tbody td {
    border-color: var(--border-color) !important;
    color: var(--text-dark) !important;
}

html.theme-dark .table tbody tr:hover {
    background: #25252d !important;
}

/* Color picker (servidores) */
html.theme-dark .color-picker {
    border-color: var(--border-color) !important;
}

html.theme-dark .color-text {
    color: var(--text-dark) !important;
}

/* Form warnings (servidores) */
html.theme-dark .form-warnings {
    background: #25252d !important;
    border-color: #6f42c1 !important;
}

html.theme-dark .warning-info {
    background: rgba(111, 66, 193, 0.2) !important;
    color: #c4b5fd !important;
}

/* No results */
html.theme-dark .no-results-text {
    color: #9ca3af !important;
}

/* WhatsApp Gerenciar - tema escuro */
html.theme-dark .configs-whatsapp-card {
    background: #1a1a1f !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--border-color);
}

html.theme-dark .configs-whatsapp-title {
    color: var(--text-dark) !important;
}

html.theme-dark .configs-whatsapp-desc {
    color: #9ca3af !important;
}

html.theme-dark .configs-whatsapp-card .data-table thead {
    background: #25252d !important;
}

html.theme-dark .configs-whatsapp-card .data-table th {
    color: #9ca3af !important;
    border-bottom-color: var(--border-color) !important;
}

html.theme-dark .configs-whatsapp-card .data-table td {
    color: var(--text-dark) !important;
    border-bottom-color: var(--border-color) !important;
}

html.theme-dark .configs-whatsapp-card .data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

html.theme-dark .configs-whatsapp-card .status-ativo {
    background: rgba(40, 167, 69, 0.25) !important;
    color: #4ade80 !important;
}

html.theme-dark .configs-whatsapp-card .status-conectado {
    background: rgba(59, 130, 246, 0.25) !important;
    color: #60a5fa !important;
}

html.theme-dark .configs-whatsapp-card .status-aguardando_qr {
    background: rgba(245, 158, 11, 0.25) !important;
    color: #fbbf24 !important;
}

html.theme-dark .configs-whatsapp-card .status-inativo {
    background: rgba(107, 114, 128, 0.25) !important;
    color: #9ca3af !important;
}

html.theme-dark .whatsapp-config-card {
    background: #1a1a1f !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html.theme-dark .whatsapp-config-title {
    color: var(--text-dark) !important;
}

html.theme-dark .whatsapp-config-instruction {
    color: #9ca3af !important;
}

html.theme-dark .var-tag {
    background: #2a2a32 !important;
    color: #e4e8f0 !important;
    border-color: #3a3a42 !important;
}

html.theme-dark .var-tag:hover {
    background: #6f42c1 !important;
    color: #fff !important;
    border-color: #6f42c1 !important;
}

html.theme-dark .var-tag-special {
    background: rgba(255, 193, 7, 0.25) !important;
    border-color: #b59f3b !important;
    color: #fef08a !important;
}

html.theme-dark .section-label {
    color: var(--text-dark) !important;
}

html.theme-dark .mensagem-blue .section-label { color: #60a5fa !important; }
html.theme-dark .mensagem-green .section-label { color: #4ade80 !important; }
html.theme-dark .mensagem-orange .section-label { color: #fb923c !important; }
html.theme-dark .mensagem-red .section-label { color: #f87171 !important; }
html.theme-dark .mensagem-purple .section-label { color: #a78bfa !important; }

html.theme-dark .mensagem-textarea {
    background: #25252d !important;
    border-color: var(--border-color) !important;
    color: var(--text-dark) !important;
}

html.theme-dark .mensagem-textarea::placeholder {
    color: #6b7280 !important;
}

html.theme-dark .mensagem-textarea:focus {
    border-color: #6f42c1 !important;
    box-shadow: 0 0 0 2px rgba(111, 66, 193, 0.25) !important;
}

html.theme-dark .form-actions-whatsapp {
    border-top-color: var(--border-color) !important;
}

html.theme-dark .alert-success {
    background: rgba(40, 167, 69, 0.2) !important;
    color: #4ade80 !important;
}

html.theme-dark .alert-info {
    background: rgba(111, 66, 193, 0.2) !important;
    color: #c4b5fd !important;
    border-color: rgba(111, 66, 193, 0.5) !important;
}

html.theme-dark .alert-info a {
    color: #a78bfa !important;
}

html.theme-dark .alert-info a:hover {
    color: #c4b5fd !important;
}

html.theme-dark .phone-frame {
    background: #1a1a1f !important;
    border-color: #3a3a42 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

html.theme-dark .phone-status-bar {
    background: #25252d !important;
    color: #9ca3af !important;
}

html.theme-dark .phone-chat-area {
    background: #1f2937 !important;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23374151' fill-opacity='0.3'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") !important;
}

html.theme-dark .wa-message-preview {
    background: #166534 !important;
    color: #dcfce7 !important;
}

html.theme-dark .phone-input-bar {
    background: #25252d !important;
}

html.theme-dark .phone-input-icon,
html.theme-dark .phone-input-icons {
    color: #9ca3af !important;
}

html.theme-dark .phone-input-placeholder {
    color: #6b7280 !important;
}

/* Table responsive - scroll horizontal em tabelas */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive table {
    min-width: 500px;
}

/* Mobile: botão hamburger e overlay */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1002;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: var(--primary-color, #6f42c1);
    color: #fff;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    -webkit-tap-highlight-color: transparent;
}
.sidebar-toggle .hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
        position: relative;
        top: auto;
        left: auto;
        z-index: 1;
        flex-shrink: 0;
    }
    .sidebar-overlay {
        transition: opacity 0.2s;
    }
    body.sidebar-open .sidebar-overlay {
        display: block;
        opacity: 1;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .main-content {
        margin-left: 0;
        padding-top: 0;
    }
    .top-header {
        padding: 12px;
        flex-wrap: nowrap;
        gap: 0.5rem;
        min-height: 48px;
        align-items: center;
        justify-content: flex-start;
    }
    .top-header > div:empty:first-child {
        display: none;
    }
    .top-header-right {
        display: flex;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 0.4rem;
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        align-items: center;
        margin-left: 0;
    }
    .header-status {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .header-status .icon { font-size: 0.85rem; }
    .header-actions {
        gap: 0.25rem;
        flex-shrink: 0;
    }
    .header-icon {
        min-width: 36px;
        min-height: 36px;
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    .user-profile {
        padding: 0.25rem;
        gap: 0.4rem;
        flex-shrink: 0;
    }
    .user-profile .user-details {
        display: none;
    }
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    .content-body,
    .content-header-with-actions {
        padding: 1rem;
    }
    .content-header-with-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    .filters-grid,
    .filtros-webhook-grid,
    .filtros-webhook-form .filtros-webhook-grid {
        grid-template-columns: 1fr;
    }
    .client-status-grid,
    .financial-grid,
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .login-container {
        padding: 1rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .client-form {
        padding: 1rem;
    }
    .btn-action {
        min-height: 44px;
        padding: 0.6rem 1rem;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-responsive table {
        min-width: 600px;
    }
}
@media (max-width: 480px) {
    .main-content {
        padding-top: 0;
    }
    .top-header {
        padding: 8px;
    }
    .header-status-long { display: none !important; }
    .header-status-short { display: inline !important; }
    .content-body,
    .content-header-with-actions {
        padding: 0.75rem;
    }
}

/* Linha destacada ao abrir cliente a partir do início (?cliente_id=) */
.cliente-row-highlight {
    outline: 2px solid rgba(59, 130, 246, 0.85);
    outline-offset: -2px;
    background: rgba(59, 130, 246, 0.08);
}

