:root {
    --bg-main: #0b0f19;
    --bg-surface: #111827;
    --bg-card: #161f30;
    --bg-card-hover: #1c273c;
    --border-color: #233044;
    --border-light: #2d3d57;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout com Sidebar Lateral */
.app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    background-color: var(--bg-main);
}

.app-sidebar {
    width: 280px;
    min-width: 280px;
    background: #0d1322;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.app-sidebar::-webkit-scrollbar {
    width: 4px;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-header {
    padding: 20px 20px 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header .brand-text h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.user-profile-widget {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-avatar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.badge-role-admin {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.role-switcher-box label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.form-select-sm {
    width: 100%;
    background: #161f30;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
}

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-group-title {
    font-size: 10px;
    font-weight: 700;
    color: #4b5563;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 12px 12px 4px 12px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.03) 100%);
    border-color: rgba(59, 130, 246, 0.3);
    color: #38bdf8;
    font-weight: 600;
}

.sidebar-nav-item.nav-item-wizard {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.12) 0%, transparent 100%);
    border-color: rgba(168, 85, 247, 0.25);
    color: #c084fc;
}

.nav-icon {
    font-size: 16px;
    line-height: 1;
}

.nav-text {
    flex: 1;
}

.nav-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.nav-badge-new {
    background: linear-gradient(135deg, #9333ea, #3b82f6);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.app-main-wrapper {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.topbar-slim {
    height: 60px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(10px);
}

.current-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.system-clock {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
}

.topbar-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.topbar-link:hover {
    color: var(--text-primary);
    border-color: var(--accent-blue);
    background-color: rgba(59, 130, 246, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

/* Conteúdo Principal */
.main-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-sans);
    letter-spacing: -0.5px;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.text-accent { color: var(--accent-cyan); }
.text-success { color: var(--accent-emerald); }
.text-info { color: var(--accent-blue); }
.text-gold { color: #fbbf24; }

.modal-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
    margin-top: 10px;
}

.badge-expiring {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.slot-client-info {
    font-size: 11px;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.slot-expiry-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-amber);
}

/* Navegação por Abas */
.nav-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.nav-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
    color: #fff;
    background-color: var(--accent-blue);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tab-header h2 {
    font-size: 20px;
    font-weight: 600;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--accent-blue-hover);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-danger {
    background-color: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
    background-color: var(--accent-rose);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* Cards das Contas Master */
.masters-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.master-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.master-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.master-info-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.master-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ea4335, #4285f4);
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.master-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.master-email {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.master-badges {
    display: flex;
    gap: 8px;
}

.badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-suspended {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-storage {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Barra de Armazenamento */
.storage-section {
    background-color: var(--bg-card);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.storage-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-emerald));
    border-radius: 5px;
    transition: width 0.4s ease;
}

/* Detalhes da Master */
.master-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    background: rgba(0, 0, 0, 0.15);
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-item label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.detail-item span {
    color: var(--text-primary);
}

/* Slots Familiares */
.slots-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slots-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.slots-summary {
    font-size: 12px;
    color: var(--accent-cyan);
    font-weight: 600;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.slot-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slot-box:hover {
    transform: translateY(-2px);
    border-color: var(--accent-blue);
    background-color: var(--bg-card-hover);
}

.slot-occupied {
    border-left: 4px solid var(--accent-emerald);
}

.slot-empty {
    border-left: 4px solid var(--border-light);
    border-style: dashed;
}

.slot-number {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.slot-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.slot-user-email {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    word-break: break-all;
}

.slot-placeholder {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.slot-status-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
    margin-top: 4px;
}

.tag-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.tag-available {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Master Actions */
.master-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.quick-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Tabelas */
.table-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    background-color: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.log-action {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.action-create { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); }
.action-update { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.action-delete { background: rgba(244, 63, 94, 0.2); color: var(--accent-rose); }
.action-test_proxy { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }

/* Modais */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-dialog {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-sm {
    max-width: 450px;
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.btn-close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-card);
}

/* Formulários */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* 2FA Codes Area */
.codes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.code-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.code-badge code {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    font-size: 13px;
    font-weight: 500;
    z-index: 200;
    animation: slideIn 0.3s ease;
}

.toast-success {
    border-color: var(--accent-emerald);
    border-left: 4px solid var(--accent-emerald);
}

.toast-error {
    border-color: var(--accent-rose);
    border-left: 4px solid var(--accent-rose);
}

.toast.fade-out {
    opacity: 0;
    transition: opacity 0.4s ease;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Subtítulos e Ações de Header */
.tab-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Barra de Filtros e Busca */
.filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 260px;
}

.search-box input {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--accent-blue);
}

.filter-group select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

/* Badges Extras */
.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Chaves de API Mascaradas */
.key-masked {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, background-color 0.2s;
}

.key-masked:hover {
    border-color: var(--accent-cyan);
    background-color: rgba(6, 182, 212, 0.08);
}

/* Modal TOTP Dinâmico */
.totp-display-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin: 16px 0;
    text-align: center;
}

.totp-code-digits {
    font-family: var(--font-mono);
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--accent-cyan);
    margin-bottom: 16px;
    user-select: all;
}

.totp-timer-bar-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.totp-timer-bar {
    height: 100%;
    background-color: var(--accent-cyan);
    width: 100%;
    transition: width 1s linear, background-color 0.3s;
}

.totp-timer-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-block {
    width: 100%;
    justify-content: center;
    display: flex;
}

/* Botão Discreto de Versão no Topbar */
.btn-version-tag {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-version-tag:hover {
    background: rgba(6, 182, 212, 0.25);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
    transform: translateY(-1px);
}

/* Painel de Métricas de Quotas & Capacidade */
.quota-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.quota-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
}

.quota-card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.quota-card-value {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.quota-card-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Banner de Recomendação de Expansão Preditiva */
.capacity-recommendation-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    transition: border-color 0.3s, background-color 0.3s;
}

.capacity-recommendation-box.box-healthy {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), transparent);
}

.capacity-recommendation-box.box-warning {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), transparent);
}

.capacity-recommendation-box.box-critical {
    border-color: rgba(244, 63, 94, 0.5);
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.1), transparent);
}

.rec-icon {
    font-size: 28px;
}

.rec-content {
    flex: 1;
}

.rec-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rec-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.rec-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.rec-badge.badge-healthy {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.rec-badge.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.rec-badge.badge-critical {
    background: rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Barra de Progresso de Quota Diária na Tabela */
.quota-mini-progress {
    min-width: 140px;
}

.quota-mini-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.progress-bar-bg-mini {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill-mini {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.fill-accent {
    background: var(--accent-cyan);
}

.fill-warning {
    background: var(--accent-gold);
}

.fill-danger {
    background: var(--accent-rose);
}

/* Modal de Histórico de Releases & Linha do Tempo */
.modal-lg {
    max-width: 780px;
}

.version-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 8px;
}

.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.timeline-card.current-release {
    border-color: rgba(6, 182, 212, 0.5);
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.04), transparent);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-version-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.version-pill {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.pill-major {
    background: rgba(139, 92, 246, 0.2);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.pill-minor {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.current-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.4);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.timeline-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.timeline-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.timeline-changes {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.timeline-changes strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 8px;
}

.timeline-changes ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.timeline-changes li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.timeline-rollback {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    flex-wrap: wrap;
}

.rollback-label {
    color: var(--accent-rose);
    font-weight: 600;
}

.timeline-rollback code {
    font-family: var(--font-mono);
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

/* ==========================================================================
   WIZARD DE ONBOARDING (AJUDANTE 7 ETAPAS)
   ========================================================================== */

.tab-wizard-highlight {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    color: #38bdf8 !important;
    font-weight: 600;
}

.btn-wizard {
    background: linear-gradient(135deg, #0284c7 0%, #7c3aed 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    font-weight: 600;
    cursor: pointer;
}

.btn-wizard:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.wizard-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-width: 80px;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.wizard-step:hover {
    opacity: 0.8;
}

.wizard-step.active {
    opacity: 1;
}

.wizard-step.completed {
    opacity: 0.9;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.wizard-step.active .step-num {
    background: var(--accent);
    border-color: var(--accent);
    color: #0f172a;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

.wizard-step.completed .step-num {
    background: var(--success);
    border-color: var(--success);
    color: #0f172a;
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.wizard-step.active .step-label {
    color: var(--accent);
}

.wizard-step.completed .step-label {
    color: var(--text-primary);
}

.wizard-step-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 8px;
    position: relative;
    top: -12px;
}

.wizard-body-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    min-height: 480px;
}

.wizard-pane {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}

.wizard-pane.active {
    display: block;
}

.pane-instruction-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.pane-instruction-icon {
    font-size: 28px;
    line-height: 1;
}

.pane-instruction-box h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
    color: var(--accent);
}

.pane-instruction-box p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.wizard-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.summary-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 18px;
}

.summary-card h5 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card p {
    margin: 6px 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-all;
}

.summary-card p strong {
    color: var(--text-primary);
}

.wizard-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.wizard-step-counter {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

/* ==========================================================================
   COFRE DE PROVEDORES & CREDENCIAIS (VAULT)
   ========================================================================== */

.category-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-pills .pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.category-pills .pill:hover {
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.category-pills .pill.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
    color: #38bdf8;
    font-weight: 600;
}

.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.provider-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, border-color 0.2s;
}

.provider-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.4);
}

.provider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.provider-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.provider-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid var(--border-color);
}

.provider-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.provider-cat-tag {
    font-size: 11px;
    color: var(--text-muted);
}

.provider-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.provider-meta-row div span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
}

.provider-meta-row div strong {
    color: var(--text-primary);
}

.provider-creds-box {
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cred-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cred-field span {
    color: var(--text-muted);
}

.cred-field-value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.btn-toggle-pwd {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
}

.btn-toggle-pwd:hover {
    color: var(--accent-blue);
}

.provider-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
}

/* ==========================================================================
   CONTROLE DE ACESSO (RBAC / ACL)
   ========================================================================== */

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.role-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.role-icon {
    font-size: 24px;
}

.role-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.role-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    flex: 1;
}

.table-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.table-card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}


/* Botão de Versão no Footer da Sidebar */
.btn-version-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: monospace;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-version-pill:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.version-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

/* Timeline de Releases */
.releases-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.release-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 18px;
    transition: border-color 0.2s;
}

.release-card-current {
    border-color: rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
}

.release-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
}

.rollback-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px dashed rgba(244, 63, 94, 0.35);
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
}

.rollback-box code {
    color: #fca5a5;
    font-size: 0.82rem;
    user-select: all;
}


/* ==========================================
   ESTILOS: PLANEJADOR DE CAPACIDADE & HARDWARE
   ========================================== */
.planner-overview-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 900px) {
    .planner-overview-grid {
        grid-template-columns: 1fr;
    }
}

.planner-score-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.score-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.score-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--success);
    margin: 8px 0;
    font-family: monospace;
}

.score-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.score-bar-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.5s ease;
}

.hardware-telemetry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.telemetry-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.t-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.t-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 4px 0;
    font-family: monospace;
}

.t-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Recomendações Preditivas */
.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommendation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 16px 20px;
    transition: transform 0.2s ease;
}

.recommendation-card.rec-critical {
    border-left-color: var(--accent-rose);
    background: linear-gradient(90deg, rgba(244, 63, 94, 0.08), var(--bg-card));
}

.recommendation-card.rec-warning {
    border-left-color: var(--gold);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), var(--bg-card));
}

.recommendation-card.rec-info {
    border-left-color: var(--success);
}

/* Pools Multi-IA */
.ai-pools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
}

.ai-pool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.ai-pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* Mensagens & Notificações */
.messages-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.message-card.unread {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(30, 41, 59, 0.7);
}

/* Chips de Filtro Multi-Provedores */
.provider-chips-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ai-filter-chip {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ai-filter-chip:hover, .ai-filter-chip.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}


/* ==========================================
   ESTILOS: MODO LISTA / TABELA & AÇÕES EM MASSA
   ========================================== */
.view-mode-toggle {
    display: inline-flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3px;
    gap: 4px;
    margin-left: auto;
}

.btn-toggle-view {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle-view:hover {
    color: var(--text-primary);
}

.btn-toggle-view.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Barra Flutuante de Ações em Massa */
.batch-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    padding: 10px 18px;
    margin-top: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 0.25s ease;
}

.selection-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.batch-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Cabeçalhos Ordenáveis */
.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s, color 0.2s;
}

.sortable-th:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

.sort-icon {
    display: inline-block;
    font-size: 0.8rem;
    margin-left: 4px;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}

.sortable-th:hover .sort-icon,
.sortable-th.active-sort .sort-icon {
    opacity: 1;
    color: var(--accent);
}

/* Ficha Completa do Dossiê do Wizard */
.dossier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.dossier-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.dossier-card h4 {
    margin: 0 0 12px 0;
    color: var(--accent);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 8px;
}

.dossier-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.dossier-label {
    color: var(--text-muted);
}

.dossier-val {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}


/* ==========================================
   ESTILOS: GOVERNANÇA, USUÁRIOS, RBAC & SESSÕES
   ========================================== */

.permissions-matrix-grid label {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.permissions-matrix-grid label:hover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.user-actions-row button:hover {
    filter: brightness(1.2);
    border-color: var(--accent) !important;
}

.badge-role-super_admin {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-role-operador_tecnico {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-role-financeiro_suporte {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-role-auditor_leitura {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}


/* ==========================================
   FICHA DE CONTA MASTER 100% EDITÁVEL & ENQUADRADA
   ========================================== */
#modal-master-dossier .modal-dialog {
    max-width: 1200px !important;
    width: 96vw !important;
    max-height: 94vh !important;
    display: flex;
    flex-direction: column;
    margin: auto;
}

#modal-master-dossier .modal-body {
    overflow-y: auto !important;
    max-height: calc(94vh - 140px) !important;
    padding: 20px 24px;
}

.dossier-header-banner {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(121, 40, 202, 0.12));
    border: 1px solid var(--border-accent);
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.dossier-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .dossier-grid {
        grid-template-columns: 1fr !important;
    }
}

.dossier-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.dossier-card h4 {
    margin: 0 0 12px 0;
    color: var(--accent);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.dossier-input-group {
    margin-bottom: 10px;
}

.dossier-input-group label {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dossier-input, .dossier-select, .dossier-textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.dossier-input:focus, .dossier-select:focus, .dossier-textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.dossier-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    margin-top: 8px;
}

.dossier-slots-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 900px;
}

.dossier-slots-table th {
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 8px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.dossier-slots-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.dossier-slots-table input, .dossier-slots-table select {
    padding: 6px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    width: 100%;
    box-sizing: border-box;
}

.dossier-slots-table input:focus, .dossier-slots-table select:focus {
    border-color: var(--accent);
    outline: none;
}

/* ==========================================
   ESTILOS: GESTÃO DE REVENDAS & ATACADO
   ========================================== */
.reseller-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.reseller-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid var(--accent);
}

.reseller-stat-card h5 {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.reseller-stat-card .val {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}


/* ==========================================
   SUPERVISÓRIO NOC 360° — DESIGN PREMIUM v3.0
   ========================================== */
.noc-header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.97) 0%, rgba(10, 15, 30, 0.98) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}

.noc-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.noc-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.noc-live-pill {
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.35);
    color: #00e676;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.noc-pulse {
    width: 7px;
    height: 7px;
    background: #00e676;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%   { transform: scale(0.85); opacity: 0.6; }
    50%  { transform: scale(1.25); opacity: 1; box-shadow: 0 0 8px #00e676; }
    100% { transform: scale(0.85); opacity: 0.6; }
}

/* KPI GRID — 4 colunas desktop */
.noc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

@media (max-width: 1200px) { .noc-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .noc-kpi-grid { grid-template-columns: 1fr; } }

.noc-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-blue);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: default;
}

.noc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.noc-card.green  { border-left-color: #10b981; }
.noc-card.gold   { border-left-color: #f59e0b; }
.noc-card.cyan   { border-left-color: #06b6d4; }
.noc-card.purple { border-left-color: #8b5cf6; }
.noc-card.rose   { border-left-color: #f43f5e; }

.noc-card-label {
    font-size: 0.66rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.6px;
}

.noc-card-val {
    font-size: 1.45rem;
    font-weight: 800;
    color: #f3f4f6;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.noc-card-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.noc-trend {
    font-size: 0.68rem;
    font-weight: 700;
    margin-top: 3px;
    opacity: 0.9;
}

.noc-progress-bar-wrap {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.noc-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* GRID INFERIOR */
.noc-two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

@media (max-width: 900px) { .noc-two-col-grid { grid-template-columns: 1fr; } }

/* TRÁFEGO */
.traffic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.traffic-row:last-child { border-bottom: none; }

.traffic-info strong {
    display: block;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 600;
}

.traffic-info span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* LATÊNCIA */
.latency-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.latency-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
}

.latency-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 5px var(--accent-emerald);
    flex-shrink: 0;
}

.latency-status-dot.offline {
    background: var(--accent-rose);
    box-shadow: 0 0 5px var(--accent-rose);
}

.latency-info {
    flex: 1;
    min-width: 0;
}

.latency-info strong {
    font-size: 0.78rem;
    color: var(--text-primary);
    display: block;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.latency-info small {
    font-size: 0.66rem;
    color: var(--text-muted);
}

.latency-val {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ========================================== */
/* MATRIZ VISUAL DE QUOTAS & GRÁFICOS INTERATIVOS */
/* ========================================== */
.quota-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.chart-card-interactive {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.chart-card-interactive:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 198, 255, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 198, 255, 0.15);
}

.chart-card-interactive::after {
    content: "🔍 Clique p/ Detalhes";
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.68rem;
    background: rgba(0, 198, 255, 0.12);
    border: 1px solid rgba(0, 198, 255, 0.3);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.chart-card-interactive:hover::after {
    opacity: 1;
    background: var(--accent);
    color: #000;
}

.chart-row {
    margin-bottom: 12px;
}

.chart-row:last-child {
    margin-bottom: 0;
}

.chart-row-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.chart-row-meta strong {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-row-meta .chart-values {
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.chart-bar-dual {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-bar-blue { background: linear-gradient(90deg, #0072ff, #00c6ff); }
.chart-bar-green { background: linear-gradient(90deg, #059669, #10b981); }
.chart-bar-purple { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.chart-bar-amber { background: linear-gradient(90deg, #d97706, #f59e0b); }
.chart-bar-rose { background: linear-gradient(90deg, #e11d48, #fb7185); }

/* Master Grid 10 Barras */
.master-ten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.master-mini-slot {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.master-mini-slot:hover {
    border-color: var(--accent);
    background: rgba(0, 198, 255, 0.08);
}

.master-mini-slot .slot-title {
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.master-mini-pills {
    display: flex;
    justify-content: center;
    gap: 3px;
}

.slot-dot {
    width: 6px;
    height: 12px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.slot-dot.active {
    background: #00c6ff;
    box-shadow: 0 0 4px #00c6ff;
}

/* Mini Dash Strip no topo de cada aba */
.mini-dash-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px 16px;
    background: rgba(18, 24, 38, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
}

.mini-dash-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mini-dash-icon {
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    flex-shrink: 0;
}

.mini-dash-text h4 {
    margin: 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.mini-dash-text .mini-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

