/* ============================================================
   CRM BR L.A.B. — Premium Components
   ============================================================ */

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    text-decoration: none;
    line-height: 1.25rem;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
    background: var(--primary);
    color: var(--primary-text);
    box-shadow: var(--shadow-neon);
    border: none;
}
.btn-primary:hover { 
    filter: brightness(1.15);
    box-shadow: 0 0 25px var(--primary-glow);
    transform: translateY(-1px);
}

/* Neon glow reforçado no tema claro */
[data-theme="light"] .btn-primary {
    box-shadow: 0 0 12px rgba(0, 119, 255, 0.25),
                0 2px 8px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .btn-primary:hover {
    box-shadow: 0 0 28px rgba(0, 119, 255, 0.45),
                0 4px 12px rgba(0, 0, 0, 0.1);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}
.btn-secondary:hover { 
    background: var(--bg-hover); 
    border-color: var(--primary); 
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { 
    background: #ef4444; 
    color: #fff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

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

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1rem; }
.btn-icon { padding: 0; width: 40px; height: 40px; border-radius: 50%; }

/* ─── Cards ─────────────────────────────────────────────── */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition-slow);
}
.card:hover { 
    border-color: var(--primary-glow);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body { padding: 1.5rem; }
.card-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.1);
}

/* ─── Metric Cards ──────────────────────────────────────── */
.metric-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-slow);
    position: relative;
    overflow: visible;
}
.metric-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.metric-card:hover { 
    transform: translateY(-4px); 
    border-color: var(--primary-glow);
    background: rgba(255, 255, 255, 0.05);
}
.metric-card:hover::after { transform: scaleX(1); }

.metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.05em;
    text-shadow: 0 0 20px var(--primary-glow);
}

/* ─── Inputs ────────────────────────────────────────────── */
.input, .select, .textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-family);
    font-size: 0.9375rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    outline: none;
    transition: all var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { min-height: 100px; resize: vertical; }
.select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2371717a%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px; padding-right: 2.5rem; }

/* Correção para opções do Select no tema escuro */
.select option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

.input-group {
    margin-bottom: 1.25rem;
}
.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* ─── Badges ────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    letter-spacing: 0.01em;
}
.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger  { background: rgba(239,68,68,0.15);  color: var(--danger); }
.badge-info    { background: rgba(59,130,246,0.15);  color: var(--info); }
.badge-neutral { background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border); }

/* ─── Tags ──────────────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.tag-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ─── Tables ────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: var(--bg-surface); }
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}
.table th {
    text-align: left;
    padding: 0.875rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}
.table tr:hover td { background: var(--bg-hover); }
.table tr:last-child td { border-bottom: none; }

/* ─── Modal ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 999999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.5rem !important;
    box-sizing: border-box !important;
    animation: fadeIn 0.15s ease;
}
.modal-overlay.active { display: flex !important; }
.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin: auto !important;
    position: relative !important;
}
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 1.125rem; }
.modal-close {
    background: var(--bg-hover);
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.modal-close:hover { color: var(--text-primary); background: var(--border); }
.modal-body { padding: 1.5rem; }
.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-body);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ─── Toast Notifications ───────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.toast {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInBottom 0.3s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.3s ease 3.5s forwards;
    box-shadow: var(--shadow-lg);
    max-width: 380px;
}
.toast-success { background: #111; color: #fff; border: 1px solid #333; border-left: 4px solid var(--success); }
.toast-error   { background: #111; color: #fff; border: 1px solid #333; border-left: 4px solid var(--danger); }
.toast-info    { background: #111; color: #fff; border: 1px solid #333; border-left: 4px solid var(--info); }
[data-theme="light"] .toast-success { background: #fff; color: #111; border-color: #e5e5e5; }
[data-theme="light"] .toast-error { background: #fff; color: #111; border-color: #e5e5e5; }
[data-theme="light"] .toast-info { background: #fff; color: #111; border-color: #e5e5e5; }

/* ─── Pagination ────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    justify-content: center;
    padding: 1rem 0;
}
.pagination button {
    padding: 0.375rem 0.875rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}
.pagination button:hover { border-color: var(--text-muted); color: var(--text-primary); }
.pagination button.active {
    background: var(--text-primary);
    color: var(--bg-body);
    border-color: var(--text-primary);
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ─── Empty State ───────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1.25rem;
    opacity: 0.5;
}
.empty-state h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* ─── Skeleton Loading ──────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-active) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius);
}
.skeleton-text { height: 16px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 120px; }

/* ─── Avatar ────────────────────────────────────────────── */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #fff;
    background: var(--primary);
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2);
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.75rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.125rem; }

/* ─── Animations ────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes slideInBottom { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ============================================================
   CRM BR L.A.B. — Contrast and Legibility Controls
   ============================================================ */

/* Global select element resets for peak legibility */
select {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius);
}

select option {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
}

/* Explicit class styles overriding for both native inputs and custom listboxes */
.select, select.select, select.input {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
}

.select option, select.select option, select.input option {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
}

/* Chat operator dropdown selectors style and contrast adjustments */
.qa-dropdown {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
}

.qa-dropdown-item {
    color: var(--text-primary) !important;
}

.qa-dropdown-item:hover {
    background: var(--bg-hover) !important;
}

/* Perfect alignment for light theme to assure maximum contrast ratios */
[data-theme="light"] select {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="light"] select option {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
}

[data-theme="light"] .qa-dropdown {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
}

[data-theme="light"] .qa-dropdown-item:hover {
    background: var(--bg-hover) !important;
}

/* ─── Box Discreto de Automação & Recuo de IA (SaaS Premium) ──────── */
.ia-automation-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 32px;
    border-radius: var(--radius, 6px);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.02);
    transition: all var(--transition, 0.15s ease);
    flex-shrink: 0;
    box-sizing: border-box;
}
[data-theme='dark'] .ia-automation-box {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}
.ia-automation-box.silenced {
    border-color: rgba(6, 182, 212, 0.35);
    background: rgba(6, 182, 212, 0.04);
}
.ia-automation-box.active {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.04);
}
.ia-automation-box.paused {
    border-color: rgba(107, 114, 128, 0.25);
    background: rgba(107, 114, 128, 0.04);
}


/* ─── Botões Específicos do Módulo (SaaS) ────────────────── */
.btn-saas {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn-saas-primary {
    background-color: var(--primary);
    color: var(--primary-text) !important;
}
.btn-saas-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}
.btn-saas-outline {
    background-color: transparent;
    border-color: var(--border-strong);
    color: var(--text-primary) !important;
}
.btn-saas-outline:hover {
    background-color: var(--bg-hover);
    border-color: var(--text-muted);
}
.btn-saas-outline-danger {
    background-color: transparent;
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger) !important;
}
.btn-saas-outline-danger:hover {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: var(--danger);
}

/* ─── Service Desk & Tickets Pro Max Components ─────────── */
.sla-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
}
.sla-timer-badge.sla-normal {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.sla-timer-badge.sla-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.sla-timer-badge.sla-critical {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: pulseGlow 1.5s infinite;
}
.sla-timer-badge.sla-paused {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.ticket-kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 10px;
    cursor: grab;
    transition: all var(--transition);
    position: relative;
    border-left: 4px solid var(--primary);
}
.ticket-kanban-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.ticket-kanban-card.priority-low { border-left-color: #64748b; }
.ticket-kanban-card.priority-normal { border-left-color: #3b82f6; }
.ticket-kanban-card.priority-high { border-left-color: #f59e0b; }
.ticket-kanban-card.priority-critical { border-left-color: #ef4444; }

.workload-meter {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
}
.workload-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}
.workload-bar-fill {
    height: 100%;
    transition: width 0.4s ease;
}

.laudo-phase-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.laudo-phase-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
}
.laudo-photo-preview {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    border: 1px dashed var(--border);
}

.canvas-signature-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
    width: 100%;
}
.canvas-signature-pad {
    width: 100%;
    height: 160px;
    display: block;
    cursor: crosshair;
    touch-action: none;
    background: var(--bg-input);
}

/* ─── Button Emerald Access (Acessar Empresa) ─────────────── */
.btn-emerald-access {
    background: #10b981;
    color: #ffffff !important;
    border: 1px solid rgba(16, 185, 129, 0.8);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
    white-space: nowrap;
}
.btn-emerald-access:hover {
    background: #059669;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}
.btn-emerald-access:active {
    transform: translateY(0);
}

/* ─── CEO Operating / Impersonation TopBar Badge ─────────── */
.ceo-operating-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-left: 10px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
    transition: all 0.2s ease;
}
.ceo-operating-badge .ceo-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    flex-shrink: 0;
}
.ceo-operating-badge strong {
    color: #ffffff;
    font-weight: 700;
}
[data-theme="light"] .ceo-operating-badge strong {
    color: #0b141a;
}
.ceo-operating-badge .ceo-badge-close {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
    padding: 1px 6px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
    margin-left: 4px;
}
.ceo-operating-badge .ceo-badge-close:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ─── Field Labels & Interactive Info Badge (i) Tooltips ─── */
.field-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
    user-select: none;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}

/* Stacking context elevation when hover or focus is active on tooltip */
.metric-card:has(.info-badge-hint:hover),
.metric-card:has(.info-badge-hint:focus),
.metric-card:has(.info-badge-hint:focus-within),
.metrics-grid:has(.info-badge-hint:hover),
.metrics-grid:has(.info-badge-hint:focus),
.card:has(.info-badge-hint:hover),
.card:has(.info-badge-hint:focus),
.card:has(.info-badge-hint:focus-within),
.card-header:has(.info-badge-hint:hover),
.card-header:has(.info-badge-hint:focus),
.page-header:has(.info-badge-hint:hover),
.page-header:has(.info-badge-hint:focus),
.table-container:has(.info-badge-hint:hover),
.table-container:has(.info-badge-hint:focus),
thead:has(.info-badge-hint:hover),
thead:has(.info-badge-hint:focus),
tr:has(.info-badge-hint:hover),
tr:has(.info-badge-hint:focus),
th:has(.info-badge-hint:hover),
th:has(.info-badge-hint:focus),
td:has(.info-badge-hint:hover),
td:has(.info-badge-hint:focus),
.hud-grid-half:has(.info-badge-hint:hover),
.hud-grid-half:has(.info-badge-hint:focus),
.hud-grid-half:has(.info-badge-hint:focus-within),
.input-group:has(.info-badge-hint:hover),
.input-group:has(.info-badge-hint:focus),
.input-group:has(.info-badge-hint:focus-within),
.field-label:has(.info-badge-hint:hover),
.field-label:has(.info-badge-hint:focus),
.checkbox-label:has(.info-badge-hint:hover),
.checkbox-label:has(.info-badge-hint:focus) {
    position: relative !important;
    z-index: 9999999 !important;
    overflow: visible !important;
}

.info-badge-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--primary, #06b6d4);
    font-size: 0.65rem;
    font-weight: 800;
    font-family: inherit;
    line-height: 1;
    cursor: help;
    position: relative;
    vertical-align: middle;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    outline: none;
    z-index: 50;
}

.info-badge-hint:hover,
.info-badge-hint:focus,
.info-badge-hint:focus-within {
    background: var(--primary, #06b6d4);
    color: #ffffff;
    border-color: var(--primary, #06b6d4);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
    transform: scale(1.1);
    z-index: 999999999 !important;
}

.info-badge-hint .tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 270px;
    max-width: min(290px, calc(100vw - 36px));
    box-sizing: border-box;
    background: #090e17 !important;
    color: #f1f5f9 !important;
    text-align: left;
    border-radius: 6px;
    padding: 0.75rem 0.95rem;
    position: absolute;
    z-index: 999999999 !important;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(6, 182, 212, 0.45);
    font-size: 0.725rem;
    font-weight: 500;
    line-height: 1.45;
    text-transform: none;
    letter-spacing: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
    pointer-events: none;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.info-badge-hint .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #090e17 transparent transparent transparent;
}

.info-badge-hint.tooltip-bottom .tooltip-text {
    bottom: auto;
    top: 140%;
    transform: translateX(-50%) translateY(-4px);
}
.info-badge-hint.tooltip-bottom .tooltip-text::after {
    top: auto;
    bottom: 100%;
    border-color: transparent transparent #090e17 transparent;
}

/* Automatic viewport protection for right column in grids and checkbox lists */
.hud-grid-half > div:nth-child(even) .info-badge-hint .tooltip-text,
.hud-grid-half > div:nth-child(2) .info-badge-hint .tooltip-text,
.col-md-6:nth-child(even) .info-badge-hint .tooltip-text,
.checkbox-label .info-badge-hint .tooltip-text {
    left: auto !important;
    right: -10px !important;
    transform: translateY(-4px) !important;
}

.hud-grid-half > div:nth-child(even) .info-badge-hint .tooltip-text::after,
.hud-grid-half > div:nth-child(2) .info-badge-hint .tooltip-text::after,
.col-md-6:nth-child(even) .info-badge-hint .tooltip-text::after,
.checkbox-label .info-badge-hint .tooltip-text::after {
    left: auto !important;
    right: 14px !important;
}

.info-badge-hint.tooltip-left .tooltip-text,
.info-badge-hint.tooltip-force-left .tooltip-text,
.info-badge-hint.tooltip-align-left .tooltip-text {
    left: -10px !important;
    right: auto !important;
    transform: translateY(4px) !important;
}
.info-badge-hint.tooltip-left .tooltip-text::after,
.info-badge-hint.tooltip-force-left .tooltip-text::after,
.info-badge-hint.tooltip-align-left .tooltip-text::after {
    left: 16px !important;
    right: auto !important;
}

.info-badge-hint.tooltip-right .tooltip-text,
.info-badge-hint.tooltip-force-right .tooltip-text,
.info-badge-hint.tooltip-align-right .tooltip-text {
    left: auto !important;
    right: -10px !important;
    transform: translateY(4px) !important;
}
.info-badge-hint.tooltip-right .tooltip-text::after,
.info-badge-hint.tooltip-force-right .tooltip-text::after,
.info-badge-hint.tooltip-align-right .tooltip-text::after {
    left: auto !important;
    right: 16px !important;
}

.info-badge-hint:hover .tooltip-text,
.info-badge-hint:focus .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.info-badge-hint.tooltip-bottom:hover .tooltip-text,
.info-badge-hint.tooltip-bottom:focus .tooltip-text {
    transform: translateX(-50%) translateY(0);
}
.info-badge-hint.tooltip-left:hover .tooltip-text,
.info-badge-hint.tooltip-left:focus .tooltip-text,
.info-badge-hint.tooltip-force-left:hover .tooltip-text,
.info-badge-hint.tooltip-force-left:focus .tooltip-text,
.info-badge-hint.tooltip-align-left:hover .tooltip-text,
.info-badge-hint.tooltip-align-left:focus .tooltip-text {
    transform: translateY(0) !important;
}
.info-badge-hint.tooltip-right:hover .tooltip-text,
.info-badge-hint.tooltip-right:focus .tooltip-text,
.info-badge-hint.tooltip-force-right:hover .tooltip-text,
.info-badge-hint.tooltip-force-right:focus .tooltip-text,
.info-badge-hint.tooltip-align-right:hover .tooltip-text,
.info-badge-hint.tooltip-align-right:focus .tooltip-text,
.hud-grid-half > div:nth-child(even) .info-badge-hint:hover .tooltip-text,
.hud-grid-half > div:nth-child(even) .info-badge-hint:focus .tooltip-text,
.hud-grid-half > div:nth-child(2) .info-badge-hint:hover .tooltip-text,
.hud-grid-half > div:nth-child(2) .info-badge-hint:focus .tooltip-text,
.checkbox-label .info-badge-hint:hover .tooltip-text,
.checkbox-label .info-badge-hint:focus .tooltip-text {
    transform: translateY(0) !important;
}

/* ─── Unified Floating & Collapsible Filter Panel ────────── */
.filters-panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-lg);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 1024px) {
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
}

.prof-pill-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.775rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.prof-pill-item:hover {
    border-color: var(--primary);
    background: rgba(6, 182, 212, 0.08);
}

.prof-pill-item input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}

.badge-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 12px;
    min-width: 18px;
    line-height: 1.2;
}

/* ==========================================================================
   PWA INSTALLATION BANNER & IOS SAFARI SHEET (SaaS Mobile Design System)
   ========================================================================== */

/* Floating Install Banner (Android / Chromium) - Padrão Ouro Mágico */
.pwa-install-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(140%);
    width: calc(100% - 32px);
    max-width: 520px;
    background: rgba(10, 16, 30, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 242, 255, 0.32);
    border-radius: 18px;
    box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.85),
                0 0 35px rgba(0, 242, 255, 0.16),
                inset 0 1px 1px rgba(255, 255, 255, 0.15);
    z-index: 999999;
    padding: 14px 18px;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s ease,
                box-shadow 0.35s ease;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.pwa-install-banner.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.pwa-banner-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(circle at 35% 35%, #0e1e33 0%, #050811 100%);
    border: 1px solid rgba(0, 242, 255, 0.35);
    box-shadow: 0 0 18px rgba(0, 242, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    box-sizing: border-box;
}

.pwa-banner-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    display: block;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pwa-banner-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.pwa-banner-title {
    font-size: 0.9375rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.pwa-banner-badge {
    background: rgba(0, 242, 255, 0.12);
    color: #00f2ff;
    border: 1px solid rgba(0, 242, 255, 0.35);
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 6px;
    line-height: 1.1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.pwa-banner-desc {
    font-size: 0.775rem;
    color: #94a3b8;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.pwa-btn-dismiss {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
}

.pwa-btn-dismiss:hover {
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.06);
}

.pwa-btn-install {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #00f2ff 0%, #0088ff 100%);
    color: #050811;
    border: none;
    font-size: 0.8125rem;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 242, 255, 0.4);
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
}

.pwa-btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 242, 255, 0.6);
    filter: brightness(1.06);
}

.pwa-btn-install:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 242, 255, 0.3);
}

.pwa-btn-install svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.pwa-btn-install:hover svg {
    transform: translateY(1px);
}

@media (max-width: 540px) {
    .pwa-install-banner {
        bottom: 16px;
        width: calc(100% - 20px);
        padding: 10px 14px;
        border-radius: 14px;
    }
    .pwa-banner-content {
        gap: 10px;
    }
    .pwa-banner-icon {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }
    .pwa-banner-badge {
        font-size: 0.575rem;
        padding: 2px 5px;
    }
    .pwa-banner-desc {
        font-size: 0.7rem;
    }
    .pwa-banner-actions {
        gap: 6px;
    }
    .pwa-btn-install {
        padding: 7px 12px;
        font-size: 0.775rem;
        border-radius: 8px;
    }
    .pwa-btn-dismiss {
        padding: 7px 10px;
        font-size: 0.775rem;
        border-radius: 8px;
    }
}

/* iOS Safari Instruction Sheet (Bottom Sheet) */
.pwa-ios-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.pwa-ios-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.pwa-ios-sheet {
    width: 100%;
    max-width: 480px;
    background: #0d1424;
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-bottom: none;
    border-radius: 24px 24px 0 0;
    padding: 16px 20px 28px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 12px));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-ios-backdrop.active .pwa-ios-sheet {
    transform: translateY(0);
}

.pwa-ios-indicator {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 16px auto;
}

.pwa-ios-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
}

.pwa-ios-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    background: #050811;
    border: 1px solid rgba(0, 229, 255, 0.25);
    flex-shrink: 0;
}

.pwa-ios-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-ios-header-text {
    flex: 1;
    min-width: 0;
}

.pwa-ios-title {
    font-size: 1rem;
    font-weight: 700;
    color: #F8FAFC;
    line-height: 1.25;
}

.pwa-ios-subtitle {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-top: 2px;
    line-height: 1.35;
}

.pwa-ios-close-btn {
    background: rgba(255, 255, 255, 0.07);
    border: none;
    color: #94A3B8;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.pwa-ios-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #F8FAFC;
}

.pwa-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.pwa-ios-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
}

.pwa-ios-step-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.15);
    color: #00E5FF;
    border: 1px solid rgba(0, 229, 255, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.pwa-ios-step-content {
    font-size: 0.8125rem;
    color: #E2E8F0;
    line-height: 1.45;
}

.pwa-ios-icon-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #00E5FF;
    font-size: 0.75rem;
    font-weight: 500;
}

.pwa-ios-item-preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    color: #F8FAFC;
    font-size: 0.75rem;
}

.pwa-ios-footer {
    display: flex;
}

.pwa-ios-btn-got-it {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00E5FF 0%, #0088FF 100%);
    color: #050811;
    font-size: 0.875rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.25);
    transition: all 0.2s ease;
}

.pwa-ios-btn-got-it:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
}

@media (max-width: 480px) {
    .pwa-install-banner {
        bottom: 12px;
        width: calc(100% - 24px);
        padding: 12px 14px;
    }
    .pwa-banner-desc {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* ─── Mobile SaaS Ergonomics & Navigation (Native PWA Experience) ─────────── */
/* ══════════════════════════════════════════════════════════════════════════════ */

/* 1. Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(5, 8, 17, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
    z-index: 9990;
    align-items: center;
    justify-content: space-around;
    user-select: none;
}

[data-theme='light'] .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    position: relative;
    transition: color 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active {
    transform: scale(0.92);
}

.mobile-nav-item.active {
    color: #00E5FF;
}

[data-theme='light'] .mobile-nav-item.active {
    color: #0284c7;
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
    transition: transform 0.15s ease;
}

.mobile-nav-item.active svg {
    transform: translateY(-1px);
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.5));
}

.mobile-nav-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 15px;
    height: 15px;
    line-height: 15px;
    border-radius: 10px;
    padding: 0 3px;
    text-align: center;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* 2. Horizontal Chip Scroller (Carrossel Horizontal de Filtros & Ações) */
.horizontal-chip-scroller {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px;
    max-width: 100%;
}

.horizontal-chip-scroller::-webkit-scrollbar {
    display: none;
}

.chip-scroller-item {
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* 3. Mobile Modal Bottom Sheet Styles (Ativado em telas <= 768px) */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }

    .modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .modal {
        border-radius: 20px 20px 0 0 !important;
        max-width: 100vw !important;
        width: 100vw !important;
        max-height: 92dvh !important;
        margin: 0 !important;
        border-bottom: none !important;
        animation: slideUpMobile 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    @keyframes slideUpMobile {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .modal-header {
        position: sticky;
        top: 0;
        background: var(--bg-surface);
        z-index: 10;
        border-bottom: 1px solid var(--border);
        padding: 1rem 1.25rem;
    }

    .modal-header::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.2);
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
    }

    [data-theme='light'] .modal-header::before {
        background: rgba(0, 0, 0, 0.15);
    }

    .modal-body {
        padding: 1.25rem;
        max-height: calc(92dvh - 120px);
        overflow-y: auto;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--bg-surface);
        z-index: 10;
        padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom, 0px)) 1.25rem;
        border-top: 1px solid var(--border);
    }

    /* 4. Mobile Safe Floating Popup */
    .followup-floating-popup {
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
        left: 12px !important;
        right: 12px !important;
        bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
        margin: 0 !important;
    }

    #operator-minimized-followup-pill {
        bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
        right: 12px !important;
    }

    /* 5. Mobile Copilot Support Window */
    .support-window {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        min-width: 100vw !important;
        min-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        bottom: 0 !important;
        right: 0 !important;
        transform: none !important;
        z-index: 100000 !important;
    }

    .support-resize-handle {
        display: none !important;
    }

    .support-header {
        border-radius: 0 !important;
    }

    .support-input-area {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* 6. Mobile Operator Notes Drawer */
    #operator-notes-drawer {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        border-left: none !important;
    }
}
