@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
    color-scheme: light;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-family: var(--font-sans);

    /* Clinical Clarity Tokens (Light Mode) */
    --primary: #154e89;           /* Azul royal odontológico/médico */
    --primary-dark: #003768;      /* Azul marinho profundo para títulos e hover */
    --primary-light: #226bb8;     /* Azul intermediário */
    --primary-container: #d4e3ff; /* Superfície primária suave */
    --on-primary: #ffffff;

    --secondary: #00658f;         /* Ciano / Azul complementar */
    --secondary-container: #5dc2ff;
    --accent: #2499d3;            /* Ciano do arco do logo */
    --accent-hover: #1b81b4;
    --accent-light: #e0f2fe;

    --tertiary: #00593c;          /* Verde esmeralda clínico (status online/ativo) */
    --tertiary-fixed: #6ffbbe;
    --tertiary-fixed-dim: #10b981;
    --tertiary-bg: rgba(16, 185, 129, 0.12);

    --danger: #ba1a1a;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;

    --bg: #f8fafc;                /* Fundo clínico suave */
    --card: #ffffff;              /* Superfície dos cards */
    --card-subtle: #f0f4f9;       /* Blocos secundários e tabelas */
    --text: #031c38;              /* Azul ardósia profundo para texto principal */
    --text-main: #031c38;
    --text-muted: #475569;
    --muted: #475569;             /* Texto secundário */
    --surface-bg: #f8fafc;
    --surface-card: #ffffff;
    --border: #ccdbe8;            /* Bordas suaves */
    --border-color: #ccdbe8;
    --border-subtle: #e2eaf1;

    --card-shadow: 0 4px 20px -2px rgba(12, 35, 64, 0.05), 0 1px 3px rgba(12, 35, 64, 0.03);
    --card-shadow-hover: 0 12px 32px -4px rgba(12, 35, 64, 0.08), 0 2px 6px rgba(12, 35, 64, 0.04);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --topbar-bg: rgba(255, 255, 255, 0.94);
}

[data-theme="dark"] {
    color-scheme: dark;

    /* Clinical Clarity Tokens (Dark Mode) */
    --primary: #2575c5;           /* Azul royal iluminado */
    --primary-dark: #164f8c;      /* Hover dos botões primários */
    --primary-light: #3b8cd9;
    --primary-container: #154e89;
    --on-primary: #ffffff;

    --secondary: #38bdf8;         /* Ciano luminoso */
    --secondary-container: #0284c7;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --accent-light: rgba(56, 189, 248, 0.15);

    --tertiary: #34d399;
    --tertiary-fixed: #6ffbbe;
    --tertiary-fixed-dim: #10b981;
    --tertiary-bg: rgba(16, 185, 129, 0.16);

    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.28);

    --bg: #0a121e;                /* Fundo escuro azul-ardósia profundo */
    --card: #132032;              /* Superfície dos cards com alto contraste */
    --card-subtle: #192a40;       /* Blocos secundários */
    --text: #e6eef7;              /* Texto principal com excelente legibilidade */
    --text-main: #e6eef7;
    --text-muted: #94a3b8;
    --muted: #94a3b8;             /* Texto secundário */
    --surface-bg: #0a121e;
    --surface-card: #132032;
    --border: #223752;            /* Bordas suaves */
    --border-color: #223752;
    --border-subtle: #18283d;

    --card-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.45);
    --card-shadow-hover: 0 12px 36px -4px rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --topbar-bg: rgba(19, 32, 50, 0.94);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}

.app-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-body > main.container {
    flex: 1 0 auto;
}

a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 68px;
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.03);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    color: var(--text);
}
.topbar-brand:hover {
    text-decoration: none !important;
}

.brand-svg-logo {
    height: 32px;
    width: auto;
    display: block;
}

.topbar-clinic-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card-subtle);
    border: 1px solid var(--border-subtle);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    max-width: 320px;
}
.topbar-clinic-badge .clinic-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-clinic-badge .material-symbols-outlined {
    font-size: 16px;
    color: var(--primary);
}

.topbar-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--tertiary-bg);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tertiary);
}
[data-theme="dark"] .topbar-status-badge {
    color: #34d399;
}
.status-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tertiary-fixed-dim);
    animation: statusPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Center Navigation Segmented Pills */
.topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}
.topbar-nav {
    display: inline-flex;
    align-items: center;
    background: var(--card-subtle);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
    border: 1px solid var(--border-subtle);
}
.nav-pill {
    padding: 7px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 9px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}
.nav-pill:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] .nav-pill:hover {
    background: rgba(255, 255, 255, 0.06);
}
.nav-pill.active {
    background: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(21, 78, 137, 0.28);
}
.nav-pill-tv {
    background: var(--accent-light);
    color: var(--accent) !important;
}
.nav-pill-tv:hover {
    background: var(--accent);
    color: #ffffff !important;
}

/* Topbar Right */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-audio-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--card-subtle);
    border: 1px solid var(--border-subtle);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary);
}
.topbar-audio-indicator .material-symbols-outlined {
    font-size: 15px;
}

.brand {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-dark);
    text-decoration: none;
    line-height: 1.35;
    display: inline-flex;
    align-items: center;
}
.brand:hover {
    color: var(--primary);
    text-decoration: none;
}

.container { width: min(1440px, calc(100% - 48px)); margin: 28px auto; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 32px 36px; box-shadow: var(--card-shadow); transition: box-shadow 0.2s ease, border-color 0.2s ease; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

h1 { margin: 0 0 24px; font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.02em; }
h2 { margin-top: 0; font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--primary-dark); letter-spacing: -0.015em; }
h3 { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--primary-dark); }

label { display: block; font-weight: 700; margin: 0 0 8px; color: var(--text); }
input, select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 16px;
    margin-bottom: 16px;
    background: #fff;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
[data-theme="dark"] input,
[data-theme="dark"] select {
    background: #0f1927;
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] select option {
    background: #132032;
    color: var(--text);
}
[data-theme="dark"] input::placeholder {
    color: #5c7491;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(36, 153, 211, 0.2);
}

.button, 
a.button, 
button.button, 
button.small,
button[type="submit"]:not(.theme-toggle-btn):not(.btn-repeat-call):not(.settings-tab-btn):not(.secondary):not(.danger) {
    border: 0;
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    background: var(--primary);
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none !important;
    transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease, color .15s ease;
}
.button:hover, 
a.button:hover, 
button.button:hover,
button.small:hover,
button[type="submit"]:not(.theme-toggle-btn):not(.btn-repeat-call):not(.settings-tab-btn):not(.secondary):not(.danger):hover,
.button:focus, 
a.button:focus, 
button.button:focus,
button.small:focus,
button[type="submit"]:not(.theme-toggle-btn):not(.btn-repeat-call):not(.settings-tab-btn):not(.secondary):not(.danger):focus { 
    background: var(--primary-dark) !important; 
    color: #ffffff !important;
    text-decoration: none !important; 
    box-shadow: 0 4px 12px rgba(13, 52, 95, 0.25);
}
.button:active, 
a.button:active, 
button.button:active,
button.small:active,
button[type="submit"]:not(.theme-toggle-btn):not(.btn-repeat-call):not(.settings-tab-btn):not(.secondary):not(.danger):active { 
    transform: translateY(1px); 
    color: #ffffff !important;
}

/* Botões Secundários */
.button.secondary, 
button.secondary, 
a.button.secondary,
button.small.secondary { 
    background: #f1f5f9 !important; 
    color: #0f172a !important; 
    border: 1px solid #cbd5e1 !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.button.secondary .material-symbols-outlined,
button.secondary .material-symbols-outlined,
a.button.secondary .material-symbols-outlined {
    color: #0f172a !important;
}
.button.secondary:hover, 
button.secondary:hover, 
a.button.secondary:hover,
button.small.secondary:hover,
.button.secondary:focus, 
button.secondary:focus, 
a.button.secondary:focus,
button.small.secondary:focus { 
    background: var(--primary) !important; 
    color: #ffffff !important; 
    border-color: var(--primary) !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(21, 78, 137, 0.25);
}
.button.secondary:hover .material-symbols-outlined,
button.secondary:hover .material-symbols-outlined,
a.button.secondary:hover .material-symbols-outlined {
    color: #ffffff !important;
}

[data-theme="dark"] .button.secondary,
[data-theme="dark"] button.secondary,
[data-theme="dark"] a.button.secondary,
[data-theme="dark"] button.small.secondary {
    background: #192a40 !important;
    color: #38bdf8 !important;
    border: 1px solid #263e5e !important;
}
[data-theme="dark"] .button.secondary .material-symbols-outlined,
[data-theme="dark"] button.secondary .material-symbols-outlined,
[data-theme="dark"] a.button.secondary .material-symbols-outlined {
    color: #38bdf8 !important;
}
[data-theme="dark"] .button.secondary:hover,
[data-theme="dark"] button.secondary:hover,
[data-theme="dark"] a.button.secondary:hover,
[data-theme="dark"] button.small.secondary:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
[data-theme="dark"] .button.secondary:hover .material-symbols-outlined,
[data-theme="dark"] button.secondary:hover .material-symbols-outlined,
[data-theme="dark"] a.button.secondary:hover .material-symbols-outlined {
    color: #ffffff !important;
}

/* Botões Danger / Perigo */
.button.danger, 
button.danger, 
a.button.danger,
button.small.danger { 
    background: #fee2e2 !important; 
    color: #991b1b !important; 
    border: 1px solid #fca5a5 !important;
    font-weight: 700 !important;
}
.button.danger .material-symbols-outlined,
button.danger .material-symbols-outlined,
a.button.danger .material-symbols-outlined {
    color: #991b1b !important;
}
.button.danger:hover, 
button.danger:hover, 
a.button.danger:hover,
button.small.danger:hover,
.button.danger:focus, 
button.danger:focus, 
a.button.danger:focus,
button.small.danger:focus { 
    background: #dc2626 !important; 
    color: #ffffff !important; 
    border-color: #dc2626 !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
.button.danger:hover .material-symbols-outlined,
button.danger:hover .material-symbols-outlined,
a.button.danger:hover .material-symbols-outlined {
    color: #ffffff !important;
}

[data-theme="dark"] .button.danger,
[data-theme="dark"] button.danger,
[data-theme="dark"] a.button.danger,
[data-theme="dark"] button.small.danger {
    background: #451111 !important;
    color: #fca5a5 !important;
    border: 1px solid #7f1d1d !important;
}
[data-theme="dark"] .button.danger .material-symbols-outlined,
[data-theme="dark"] button.danger .material-symbols-outlined,
[data-theme="dark"] a.button.danger .material-symbols-outlined {
    color: #fca5a5 !important;
}
[data-theme="dark"] .button.danger:hover,
[data-theme="dark"] button.danger:hover,
[data-theme="dark"] a.button.danger:hover,
[data-theme="dark"] button.small.danger:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}
[data-theme="dark"] .button.danger:hover .material-symbols-outlined,
[data-theme="dark"] button.danger:hover .material-symbols-outlined,
[data-theme="dark"] a.button.danger:hover .material-symbols-outlined {
    color: #ffffff !important;
}

.button.accent, button.accent, a.button.accent { 
    background: var(--accent); 
    color: #ffffff !important; 
}
.button.accent:hover, button.accent:hover, a.button.accent:hover,
.button.accent:focus, button.accent:focus, a.button.accent:focus { 
    background: var(--accent-hover) !important; 
    color: #ffffff !important; 
    text-decoration: none !important; 
}
.button.small, button.small, a.button.small { 
    padding: 7px 12px; 
    font-size: 13px; 
    border-radius: 9px; 
}

.alert {
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 22px;
    font-weight: 600;
    font-size: 14.5px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    line-height: 1.4;
}
.alert .material-symbols-outlined {
    font-size: 22px;
    flex-shrink: 0;
}
.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
[data-theme="dark"] .alert-success {
    background: #062a1a;
    color: #6ee7b7;
    border-color: #047857;
}
.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
[data-theme="dark"] .alert-error {
    background: #2a0b0b;
    color: #fca5a5;
    border-color: #991b1b;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 14px;
}

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: middle; }
th { color: #0f172a !important; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: #f1f5f9 !important; border-bottom: 2px solid #cbd5e1 !important; white-space: nowrap; }
tr:hover td { background: #f6fafd; }
.nowrap { white-space: nowrap; }
.actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.actions form { margin: 0; display: inline-flex; }
.muted { color: var(--muted); }
.last-call { font-size: 24px; line-height: 1.4; }
.recent-calls-list { margin-bottom: 24px; }
.recent-call-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: 20px;
}
.recent-call-item:last-child { border-bottom: none; }
.recent-call-info {
    flex: 1 1 auto;
    min-width: 0;
}
.recent-call-action {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.recent-call-patient { 
    font-size: 24px; 
    font-weight: 800; 
    line-height: 1.25; 
    color: var(--text); 
    margin-bottom: 6px; 
}
.recent-call-meta { 
    font-size: 17px; 
    color: var(--text); 
    line-height: 1.4;
}
.recent-call-room { 
    font-weight: 700; 
    color: var(--primary); 
    font-size: 17px;
}

.button-repeat {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(21, 78, 137, 0.2);
    transition: background-color .15s ease, transform .2s ease, box-shadow .15s ease;
}
.button-repeat svg {
    width: 22px;
    height: 22px;
    transition: transform .25s ease;
}
.button-repeat:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 4px 14px rgba(13, 52, 95, 0.35);
    transform: translateY(-1px);
}
.button-repeat:hover svg {
    transform: rotate(60deg);
}
.button-repeat:active {
    transform: translateY(1px) scale(0.95);
}

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: radial-gradient(circle at 80% 20%, #e2eff9 0%, #edf3f8 50%, #e0ebf5 100%);
}
.login-main {
    flex: 1 0 auto;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    width: 100%;
}
.login-card {
    width: min(530px, calc(100% - 32px));
    padding: 38px 40px;
    box-shadow: 0 20px 45px rgba(12, 35, 64, .08);
}
.login-card h1 {
    color: var(--primary-dark);
    font-size: clamp(20px, 4.2vw, 26px);
    margin: 0 0 24px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.app-footer {
    width: 100%;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    font-size: 14px;
    color: var(--muted);
    margin-top: auto;
}
.app-footer-content {
    width: min(1440px, calc(100% - 48px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.app-footer-brand {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 14px;
}
.app-footer-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #e2eef7;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
}
.app-footer-login {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(204, 219, 232, 0.7);
}

/* Menu de Perfil Moderno (Clinical Clarity Profile Menu) */
.profile-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 4px 10px 4px 4px;
    background: #ffffff !important;
    border: 1.5px solid var(--border-subtle) !important;
    border-radius: 999px;
    color: #0f172a !important;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all .15s ease;
}
.profile-btn .material-symbols-outlined {
    color: #475569 !important;
}
.profile-btn:hover,
.profile-btn:focus-visible {
    background: #f1f5f9 !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    outline: none;
    box-shadow: 0 2px 8px rgba(21, 78, 137, 0.15);
}
.profile-btn:hover .material-symbols-outlined,
.profile-btn:focus-visible .material-symbols-outlined {
    color: var(--primary) !important;
}
.profile-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(21, 78, 137, 0.25);
}
.profile-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}
.profile-name {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-role {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}
.profile-chevron {
    color: var(--muted);
    transition: transform .2s ease;
}
.profile-menu.open .profile-chevron {
    transform: rotate(180deg);
}
.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 230px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--card-shadow-hover);
    padding: 6px;
    display: none;
    z-index: 1000;
}
.profile-menu.open .profile-dropdown {
    display: block;
    animation: profileDropdownFade .15s ease-out;
}
@keyframes profileDropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.profile-dropdown-user {
    padding: 10px 14px 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}
.profile-dropdown-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-dropdown-role {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    border-radius: 9px;
    text-decoration: none !important;
    transition: background .15s ease, color .15s ease;
}
.profile-dropdown-item:hover {
    background: var(--card-subtle);
    color: var(--primary);
    text-decoration: none !important;
}
.profile-dropdown-item .material-symbols-outlined {
    font-size: 18px;
}
.profile-dropdown-item-danger {
    color: var(--danger) !important;
}
.profile-dropdown-item-danger:hover {
    background: var(--danger-bg) !important;
    color: var(--danger) !important;
}

/* Tela de Mudança de Senha (Password Change) */
.password-change-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 16px 0 40px;
}
.password-change-layout {
    width: 100%;
    max-width: 1140px;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
    gap: 32px;
    align-items: start;
}
.password-change-main {
    width: 100%;
    min-width: 0;
}
.password-change-sidebar {
    width: 100%;
    min-width: 0;
}
@media (max-width: 980px) {
    .password-change-layout {
        grid-template-columns: 1fr;
        max-width: 680px;
        gap: 24px;
    }
}
.password-change-card {
    width: min(640px, 100%);
    padding: 36px 40px;
}
.password-forced-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.password-forced-banner svg {
    flex-shrink: 0;
    color: #2563eb;
    margin-top: 2px;
}
.password-forced-banner h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1e40af;
    margin: 0 0 6px;
}
.password-forced-banner p {
    font-size: 14px;
    color: #1e3a8a;
    margin: 0;
    line-height: 1.45;
}
.password-requirements-box {
    background: var(--card-subtle);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 0 0 24px;
}
.password-requirements-box h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.password-rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
@media (min-width: 580px) {
    .password-rules-list {
        grid-template-columns: 1fr 1fr;
    }
}
.rule-item {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color .15s ease;
}
.rule-item .rule-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    transition: all .15s ease;
    flex-shrink: 0;
}
.rule-item.valid {
    color: #15803d;
    font-weight: 600;
}
.rule-item.valid .rule-icon {
    background: #16a34a;
    color: #ffffff;
}
.password-field-wrapper {
    position: relative;
    width: 100%;
}
.password-field-wrapper input {
    padding-right: 46px;
    margin-bottom: 0;
}
.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    box-shadow: none !important;
    transition: color .15s ease;
}
.password-toggle-btn .material-symbols-outlined {
    color: #64748b !important;
}
.password-toggle-btn:hover {
    color: var(--primary) !important;
    background: transparent !important;
}
.password-toggle-btn:hover .material-symbols-outlined {
    color: var(--primary) !important;
}
[data-theme="dark"] .password-toggle-btn {
    color: #94a3b8 !important;
}
[data-theme="dark"] .password-toggle-btn .material-symbols-outlined {
    color: #94a3b8 !important;
}
[data-theme="dark"] .password-toggle-btn:hover {
    color: #38bdf8 !important;
}
[data-theme="dark"] .password-toggle-btn:hover .material-symbols-outlined {
    color: #38bdf8 !important;
}
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.tv-body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at 18% 18%, #19467a 0%, #0d284e 48%, #06152b 100%);
    color: #fff;
}
.tv-screen {
    width: 100vw;
    height: 100vh;
    padding: 48px 64px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 34px;
}
.tv-header { display: flex; justify-content: space-between; align-items: center; font-size: 32px; font-weight: 800; }
.tv-clock { color: #7dd3fc; }
.current-call {
    border: 2px solid rgba(56, 189, 248, 0.32);
    border-radius: 42px;
    background: linear-gradient(180deg, rgba(23, 62, 107, 0.5) 0%, rgba(10, 31, 59, 0.7) 100%);
    box-shadow: 0 30px 90px rgba(3, 11, 23, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 50px;
}
.current-label { font-size: 42px; color: #7dd3fc; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.current-name { font-size: clamp(72px, 8vw, 150px); font-weight: 900; margin: 28px 0; line-height: 1.03; text-transform: uppercase; text-shadow: 0 4px 24px rgba(0,0,0,.45); }
.current-room { font-size: clamp(48px, 5vw, 90px); font-weight: 900; color: #fef08a; text-shadow: 0 2px 16px rgba(254, 240, 138, 0.35); }
.current-time {
    margin-top: 24px;
    font-size: clamp(18px, 1.8vw, 28px);
    font-weight: 600;
    color: #9ec5e8;
    letter-spacing: 0.04em;
    background: rgba(6, 19, 37, 0.65);
    padding: 8px 22px;
    border-radius: 999px;
    display: inline-block;
    border: 1px solid rgba(56, 189, 248, 0.25);
}
.empty-message { font-size: 58px; color: #94b2d1; }
.history h2 { margin: 0 0 18px; color: #7dd3fc; font-size: 32px; text-transform: uppercase; letter-spacing: .08em; }
.history-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.history-item {
    min-height: 140px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(23, 62, 107, 0.38) 0%, rgba(10, 31, 59, 0.55) 100%);
    padding: 24px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    box-shadow: 0 8px 24px rgba(3, 11, 23, 0.3);
}
.history-name { font-size: 34px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.history-room { margin-top: 14px; font-size: 28px; color: #fef08a; font-weight: 800; }
.history-time { margin-top: 10px; font-size: 18px; font-weight: 600; color: #9ec5e8; letter-spacing: 0.02em; }
.audio-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(4, 12, 24, .88);
    z-index: 10;
}
.audio-overlay.hidden { display: none; }
.audio-box {
    text-align: center;
    max-width: 760px;
    padding: 36px;
    background: rgba(14, 38, 72, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.audio-box h1 { font-size: 56px; margin-bottom: 18px; color: #fff; }
.audio-box p { font-size: 26px; color: #cbd5e1; line-height: 1.4; }
.audio-box button { font-size: 28px; padding: 20px 32px; background: linear-gradient(135deg, #2499d3, #154e89); }

@media (max-width: 1024px) {
    .topbar {
        padding: 12px 18px;
        flex-wrap: wrap;
        gap: 12px;
    }
    .topbar-center {
        order: 3;
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 4px;
    }
    .topbar-clinic-badge {
        display: none;
    }
}

@media (max-width: 760px) {
    .profile-info {
        display: none;
    }
    .topbar-audio-indicator {
        display: none;
    }
    .tv-screen { padding: 24px; }
    .history-list { grid-template-columns: 1fr; }
}

.module-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e2eef7; color: #183e68; white-space: nowrap; }
.badge-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-muted { background: #eef3f7; color: #597390; }
.badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.form-submit-cell { align-self: end; margin-bottom: 16px; }
.small-text { font-size: 13px; }
.module-shortcuts { margin-top: 24px; }
.nav-tv {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(15, 55, 100, 0.25);
    transition: background .15s ease, transform .1s ease;
}
.nav-tv:hover { background: var(--primary-dark); color: #ffffff !important; text-decoration: none; transform: translateY(-1px); }
.tv-module-tag {
    font-size: 16px;
    font-weight: 700;
    background: rgba(36, 153, 211, 0.22);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #bae6fd;
    padding: 4px 10px;
    border-radius: 8px;
    vertical-align: middle;
    margin-left: 12px;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.mb-4 { margin-bottom: 24px; }
.room-input-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }

.badge-admin { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-local-admin { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.badge-operator { background: #e0f1fc; color: #0c4e88; border: 1px solid #b7dbf3; }
.badge-company-info { background: #f0f6fb; color: #153c69; border: 1px solid #ccdbe8; }

dialog::backdrop {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.user-identity { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.user-identity .badge { font-size: 11px; padding: 2px 7px; }

.user-operator-banner {
    background: var(--card-subtle);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.banner-title { font-size: 15px; color: var(--text); }
.banner-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }

/* ==========================================================================
   Tema Escuro (Dark Mode) - Estilos e Componentes
   ========================================================================== */

/* Botão de Alternância de Tema */
.theme-toggle-btn {
    border: 1.5px solid var(--border) !important;
    border-radius: 9px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: #ffffff !important;
    color: #0f172a !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.theme-toggle-btn .material-symbols-outlined {
    color: #0f172a !important;
    font-size: 18px;
    transition: color .15s ease;
}
.theme-toggle-btn:hover {
    background: #f1f5f9 !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(21, 78, 137, 0.15);
}
.theme-toggle-btn:hover .material-symbols-outlined {
    color: var(--primary) !important;
}
.theme-toggle-btn:active {
    transform: translateY(1px);
}
.theme-icon-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.theme-icon {
    display: inline-block;
    vertical-align: middle;
}
.theme-toggle-label {
    font-size: 13px;
    font-weight: 700;
}

/* Tipografia e Links em Modo Escuro */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3 {
    color: #f1f7fc;
}
[data-theme="dark"] .brand {
    color: #58a6ff;
}
[data-theme="dark"] .brand:hover {
    color: #79b8ff;
    text-decoration: none;
}
[data-theme="dark"] a {
    color: #58a6ff;
}
[data-theme="dark"] a:hover {
    color: #79b8ff;
}
[data-theme="dark"] a.button:not(.secondary):not(.danger),
[data-theme="dark"] button.button:not(.secondary):not(.danger),
[data-theme="dark"] button.small:not(.secondary):not(.danger),
[data-theme="dark"] .btn-primary,
[data-theme="dark"] a.button:not(.secondary):not(.danger):hover,
[data-theme="dark"] button.button:not(.secondary):not(.danger):hover,
[data-theme="dark"] button.small:not(.secondary):not(.danger):hover,
[data-theme="dark"] .btn-primary:hover {
    color: #ffffff !important;
}

/* Sombras e Cards no Modo Escuro */
[data-theme="dark"] .card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
[data-theme="dark"] .topbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}

/* Tabelas no Modo Escuro */
[data-theme="dark"] table {
    background: var(--card);
}
[data-theme="dark"] th {
    background: #0f1d2e !important;
    border-bottom: 2px solid #223752 !important;
    color: #f1f5f9 !important;
    font-weight: 800;
}
[data-theme="dark"] td {
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text);
}
[data-theme="dark"] tr:hover td {
    background: #18283e;
}

/* Badges e Tags no Modo Escuro */
[data-theme="dark"] .badge-admin {
    background: #3b2408;
    color: #fde047;
    border: 1px solid #713f12;
}
[data-theme="dark"] .badge-local-admin {
    background: #2e1065;
    color: #c4b5fd;
    border: 1px solid #6b21a8;
}
[data-theme="dark"] .badge-operator {
    background: #0c2b48;
    color: #7dd3fc;
    border: 1px solid #0369a1;
}
[data-theme="dark"] .badge-company-info {
    background: #162a40;
    color: #93c5fd;
    border: 1px solid #1e3a5f;
}
[data-theme="dark"] .badge-success {
    background: #0c2d18;
    color: #86efac;
    border: 1px solid #14532d;
}
[data-theme="dark"] .badge-muted {
    background: #172332;
    color: #94a3b8;
    border: 1px solid #283748;
}
[data-theme="dark"] .badge-warning {
    background: #362916;
    color: #fde68a;
    border: 1px solid #573e16;
}

/* Alertas no Modo Escuro */
[data-theme="dark"] .alert-success {
    background: #0c2d18;
    color: #86efac;
    border: 1px solid #14532d;
}
[data-theme="dark"] .alert-error {
    background: #451111;
    color: #fca5a5;
    border: 1px solid #7f1d1d;
}

/* Chamadas Recentes no Modo Escuro */
[data-theme="dark"] .recent-call-patient {
    color: #f1f7fc;
}
[data-theme="dark"] .recent-call-room {
    color: #58a6ff;
}
[data-theme="dark"] .recent-call-meta {
    color: var(--muted);
}
[data-theme="dark"] .recent-call-item {
    border-bottom: 1px solid var(--border-subtle);
}

/* Botão de Tema no Modo Escuro */
[data-theme="dark"] .theme-toggle-btn {
    background: #192a40 !important;
    border: 1.5px solid #263e5e !important;
    color: #e5edf7 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .theme-toggle-btn .material-symbols-outlined {
    color: #e5edf7 !important;
}
[data-theme="dark"] .theme-toggle-btn:hover {
    background: #233b5c !important;
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .theme-toggle-btn:hover .material-symbols-outlined {
    color: #38bdf8 !important;
}

/* Rodapé no Modo Escuro */
[data-theme="dark"] .app-footer {
    background: var(--card);
    border-top: 1px solid var(--border);
    color: var(--muted);
}
[data-theme="dark"] .app-footer-brand {
    color: #58a6ff;
}
[data-theme="dark"] .app-footer-tag {
    background: #192a40;
    color: #7dd3fc;
    border: 1px solid #263e5e;
}
[data-theme="dark"] .app-footer-login {
    background: rgba(19, 32, 50, 0.88);
    border-top: 1px solid rgba(34, 56, 84, 0.8);
}

/* Tela de Login no Modo Escuro */
[data-theme="dark"] .login-page {
    background: radial-gradient(circle at 80% 20%, #152438 0%, #0a121e 55%, #060c14 100%);
}
[data-theme="dark"] .login-card {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .5);
}

/* Menu de Perfil no Modo Escuro */
[data-theme="dark"] .profile-btn {
    background: #192a40 !important;
    border: 1.5px solid #263e5e !important;
    color: #e5edf7 !important;
}
[data-theme="dark"] .profile-btn .material-symbols-outlined {
    color: #94a3b8 !important;
}
[data-theme="dark"] .profile-btn:hover,
[data-theme="dark"] .profile-btn:focus-visible {
    background: #233b5c !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}
[data-theme="dark"] .profile-btn:hover .material-symbols-outlined,
[data-theme="dark"] .profile-btn:focus-visible .material-symbols-outlined {
    color: #38bdf8 !important;
}
[data-theme="dark"] .profile-dropdown {
    background: #132032;
    border-color: #223752;
    box-shadow: 0 14px 35px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .profile-dropdown-name {
    color: #f1f7fc;
}
[data-theme="dark"] .profile-dropdown-divider {
    background: #223752;
}
[data-theme="dark"] .profile-dropdown-item {
    color: #e6eef7;
}
[data-theme="dark"] .profile-dropdown-item:hover {
    background: #192a40;
    color: #38bdf8;
}
[data-theme="dark"] .profile-dropdown-item-danger {
    color: #fca5a5;
}
[data-theme="dark"] .profile-dropdown-item-danger:hover {
    background: #451111;
    color: #fca5a5;
}

/* Tela de Mudança de Senha no Modo Escuro */
[data-theme="dark"] .password-forced-banner {
    background: #142844;
    border-color: #1e3e6b;
}
[data-theme="dark"] .password-forced-banner svg {
    color: #60a5fa;
}
[data-theme="dark"] .password-forced-banner h2 {
    color: #93c5fd;
}
[data-theme="dark"] .password-forced-banner p {
    color: #bfdbfe;
}
[data-theme="dark"] .password-requirements-box {
    background: #0f1927;
    border-color: #223752;
}
[data-theme="dark"] .password-requirements-box h3 {
    color: #58a6ff;
}
[data-theme="dark"] .rule-item {
    color: var(--muted);
}
[data-theme="dark"] .rule-item .rule-icon {
    background: #1e293b;
    color: #94a3b8;
}
[data-theme="dark"] .rule-item.valid {
    color: #86efac;
}
[data-theme="dark"] .rule-item.valid .rule-icon {
    background: #15803d;
    color: #ffffff;
}
[data-theme="dark"] .password-toggle-btn {
    color: var(--muted);
}
[data-theme="dark"] .password-toggle-btn:hover {
    color: #38bdf8;
}

/* Configuração TTS */
.tts-config-box {
    box-shadow: 0 4px 15px rgba(12, 35, 64, 0.04);
}
[data-theme="dark"] .tts-config-box {
    background: #101c2c;
    border-color: #223752;
}
[data-theme="dark"] .tts-config-box h4 {
    color: #58a6ff;
}

/* ==========================================================================
   Painel do Operador (Operator Workspace - Clinical Clarity)
   ========================================================================== */

.op-sub-bar {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.op-sub-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.op-sub-bar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.op-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card-subtle);
    border: 1px solid var(--border-subtle);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.op-pill .material-symbols-outlined {
    font-size: 16px;
    color: var(--primary);
}

.op-shortcut-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
}
.op-kbd {
    background: var(--card-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 7px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Dual Workspace 5:7 Grid */
.op-workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}
@media (min-width: 1024px) {
    .op-workspace-grid {
        grid-template-columns: 5fr 7fr;
    }
}

.card-call-form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 30px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.card-call-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.card-call-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-call-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(21, 78, 137, 0.25);
}
.card-call-icon .material-symbols-outlined {
    font-size: 22px;
}
.card-call-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-dark);
}
[data-theme="dark"] .card-call-title {
    color: #e6eef7;
}

.input-icon-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}
.input-icon-wrapper .input-leading-icon {
    position: absolute;
    left: 14px;
    color: var(--muted);
    font-size: 20px;
    pointer-events: none;
    z-index: 2;
}
.input-icon-wrapper input,
.input-icon-wrapper select {
    padding-left: 44px;
    margin-bottom: 0;
    height: 48px;
}
.input-patient-name {
    font-family: var(--font-display);
    font-size: 17px !important;
    font-weight: 600;
    color: var(--primary-dark) !important;
}
[data-theme="dark"] .input-patient-name {
    color: #e6eef7 !important;
}

.input-clear-btn {
    position: absolute;
    right: 12px;
    background: transparent !important;
    border: none !important;
    color: var(--muted) !important;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: none;
    box-shadow: none !important;
}
.input-clear-btn .material-symbols-outlined {
    color: var(--muted) !important;
    font-size: 18px;
}
.input-clear-btn:hover {
    color: var(--primary) !important;
    background: rgba(21, 78, 137, 0.08) !important;
}
.input-clear-btn:hover .material-symbols-outlined {
    color: var(--primary) !important;
}
[data-theme="dark"] .input-clear-btn {
    color: #94a3b8 !important;
}
[data-theme="dark"] .input-clear-btn .material-symbols-outlined {
    color: #94a3b8 !important;
}
[data-theme="dark"] .input-clear-btn:hover {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.12) !important;
}
[data-theme="dark"] .input-clear-btn:hover .material-symbols-outlined {
    color: #38bdf8 !important;
}

.op-audio-info-card {
    background: var(--card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.op-audio-info-icon {
    color: var(--secondary);
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}
.op-audio-info-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.op-audio-info-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.btn-call-hero {
    width: 100%;
    height: 52px;
    border-radius: 14px;
    font-family: var(--font-display);
    font-size: 17px !important;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(21, 78, 137, 0.28);
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}
.btn-call-hero:hover {
    box-shadow: 0 6px 20px rgba(21, 78, 137, 0.4);
    transform: translateY(-1px);
}
.btn-call-hero:active {
    transform: translateY(1px) scale(0.99);
}
.btn-call-hero .material-symbols-outlined {
    font-size: 24px;
}
.btn-call-hero-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

/* Recent Calls Feed */
.card-recent-calls {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 30px;
    box-shadow: var(--card-shadow);
}
.recent-calls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.recent-call-item-modern {
    background: var(--card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    transition: all 0.15s ease;
}
.recent-call-item-modern:hover {
    border-color: var(--border);
    box-shadow: 0 4px 14px rgba(12, 35, 64, 0.04);
    transform: translateY(-1px);
}
.recent-call-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}
.recent-call-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(21, 78, 137, 0.2);
}
.recent-call-details {
    min-width: 0;
    flex: 1;
}
.recent-call-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    margin-bottom: 4px;
}
.recent-call-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
}
.recent-call-room-tag {
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-container);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
}
[data-theme="dark"] .recent-call-room-tag {
    background: rgba(37, 117, 197, 0.2);
    color: #7dd3fc;
}

.btn-repeat-call {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    background: #ffffff !important;
    border: 1.5px solid var(--primary) !important;
    color: var(--primary) !important;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(21, 78, 137, 0.08);
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.btn-repeat-call .material-symbols-outlined {
    color: var(--primary) !important;
    font-size: 18px;
    transition: transform 0.25s ease, color 0.15s ease;
}
.btn-repeat-call:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(21, 78, 137, 0.25) !important;
    transform: translateY(-1px);
}
.btn-repeat-call:hover .material-symbols-outlined {
    color: #ffffff !important;
    transform: rotate(180deg);
}
.btn-repeat-call:active {
    transform: translateY(0);
}

[data-theme="dark"] .btn-repeat-call {
    background: rgba(56, 189, 248, 0.08) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.4) !important;
    color: #38bdf8 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .btn-repeat-call .material-symbols-outlined {
    color: #38bdf8 !important;
}
[data-theme="dark"] .btn-repeat-call:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}
[data-theme="dark"] .btn-repeat-call:hover .material-symbols-outlined {
    color: #ffffff !important;
}

/* ==========================================================================
   Módulo TV (Clinical Clarity Waiting Display - Largura Total com Máximo Destaque)
   ========================================================================== */

.tv-body-modern {
    width: 100vw;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    background: #071322;
    background: radial-gradient(circle at 20% 20%, #0e294b 0%, #08172c 50%, #040c17 100%);
    color: #ffffff;
    font-family: var(--font-sans);
    user-select: none;
    -webkit-user-select: none;
}

.tv-screen-modern {
    width: 100vw;
    height: 100vh;
    padding: 22px 36px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

/* TV Header Moderno */
.tv-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(14, 34, 61, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 20px;
    padding: 12px 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}
.tv-brand-block {
    display: flex;
    align-items: center;
    gap: 16px;
}
.tv-clinic-name {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
}
.tv-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #34d399;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tv-clock-block {
    text-align: right;
    display: flex;
    flex-direction: column;
}
.tv-clock-time {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 800;
    color: #7dd3fc;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.tv-clock-date {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 3px;
    text-transform: capitalize;
}

/* Hero Current Call Section (Largura Total Máxima) */
.tv-hero-call {
    flex: 1;
    min-height: 0;
    width: 100%;
    background: rgba(15, 38, 70, 0.62);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(56, 189, 248, 0.3);
    border-radius: 28px;
    padding: 26px 44px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.tv-hero-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.tv-now-calling-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Equalizer de Síntese de Voz */
.tv-soundwave-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 24px;
    padding: 4px 10px;
    background: rgba(56, 189, 248, 0.12);
    border-radius: 999px;
}
.soundwave-bar {
    width: 4px;
    background: #38bdf8;
    border-radius: 2px;
    height: 6px;
    transition: height 0.2s ease;
}
.tv-soundwave-bars.active .soundwave-bar:nth-child(1) { animation: tvWaveBounce 0.8s infinite 100ms; }
.tv-soundwave-bars.active .soundwave-bar:nth-child(2) { animation: tvWaveBounce 0.8s infinite 300ms; }
.tv-soundwave-bars.active .soundwave-bar:nth-child(3) { animation: tvWaveBounce 0.8s infinite 200ms; }
.tv-soundwave-bars.active .soundwave-bar:nth-child(4) { animation: tvWaveBounce 0.8s infinite 400ms; }
.tv-soundwave-bars.active .soundwave-bar:nth-child(5) { animation: tvWaveBounce 0.8s infinite 150ms; }
.tv-soundwave-bars.active .soundwave-bar:nth-child(6) { animation: tvWaveBounce 0.8s infinite 350ms; }

@keyframes tvWaveBounce {
    0%, 100% { height: 6px; }
    50% { height: 22px; }
}

/* Área Central de Destaque Máximo ao Nome do Paciente */
.tv-patient-section {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex: 1;
    min-height: 0;
    width: 100%;
}
.tv-patient-label {
    font-size: 19px;
    font-weight: 800;
    color: #7dd3fc;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}
.tv-patient-name-display {
    font-family: var(--font-display);
    font-size: clamp(80px, 9.6vw, 156px);
    font-weight: 900;
    color: #ffffff;
    line-height: 1.03;
    text-transform: uppercase;
    letter-spacing: -0.025em;
    text-shadow: 0 6px 36px rgba(0, 0, 0, 0.7), 0 2px 16px rgba(56, 189, 248, 0.25);
    word-break: break-word;
    text-align: center;
    width: 100%;
}

/* Barra Inferior da Chamada Principal (Destino + Detalhes + Instrução) */
.tv-destination-box {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr 1.6fr;
    gap: 18px;
    align-items: stretch;
    flex-shrink: 0;
    margin-top: 8px;
}
.tv-room-card {
    background: rgba(21, 78, 137, 0.65);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    border-radius: 20px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    min-width: 0;
}
.tv-room-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(56, 189, 248, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7dd3fc;
    flex-shrink: 0;
}
.tv-room-icon-box .material-symbols-outlined {
    font-size: 34px;
}
.tv-room-label {
    font-size: 12px;
    font-weight: 800;
    color: #bae6fd;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.tv-room-name-display {
    font-family: var(--font-display);
    font-size: clamp(26px, 2.8vw, 44px);
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-info-badge-card {
    background: rgba(14, 34, 61, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}
.tv-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    color: #bae6fd;
    font-weight: 600;
    white-space: nowrap;
}
.tv-info-item .material-symbols-outlined {
    font-size: 18px;
    color: #38bdf8;
}

.tv-instruction-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.tv-instruction-text {
    font-size: 15px;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}
.tv-instruction-text .material-symbols-outlined {
    color: #38bdf8;
    font-size: 20px;
    flex-shrink: 0;
}
.tv-call-id-badge {
    font-size: 12px;
    font-weight: 800;
    color: #7dd3fc;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(56, 189, 248, 0.15);
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Seção Inferior: Histórico das 3 Últimas Chamadas (Largura Total) */
.tv-history-bottom {
    background: rgba(14, 34, 61, 0.58);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(56, 189, 248, 0.22);
    border-radius: 24px;
    padding: 14px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}
.tv-history-bottom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tv-history-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tv-history-title .material-symbols-outlined {
    color: #7dd3fc;
    font-size: 20px;
}
.tv-history-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 3px 10px;
    border-radius: 999px;
}

/* Grid com 3 Colunas para os 3 Últimos Pacientes */
.tv-history-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.tv-history-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(56, 189, 248, 0.16);
    border-radius: 16px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: background 0.2s ease, border-color 0.2s ease;
    min-width: 0;
}
.tv-history-card:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.3);
}
.tv-history-num-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.16);
    color: #7dd3fc;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tv-history-card-body {
    flex: 1;
    min-width: 0;
}
.tv-history-card-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    line-height: 1.2;
}
.tv-history-card-room {
    font-size: 13.5px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tv-history-card-time {
    font-size: 15px;
    font-weight: 700;
    color: #7dd3fc;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}
.tv-history-card-date {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    margin-top: 1px;
}
.tv-history-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    color: #64748b;
    font-size: 14px;
}

@media (max-width: 992px) {
    .tv-body-modern, .tv-screen-modern {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    .tv-destination-box {
        grid-template-columns: 1fr;
    }
    .tv-history-grid-3 {
        grid-template-columns: 1fr;
    }
    .tv-header-modern {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .tv-clock-block {
        text-align: left;
    }
}

/* ==========================================================================
   Etapa 3: Módulos Administrativos e Autenticação (Clinical Clarity)
   ========================================================================== */

/* Sub-header de Configurações */
.settings-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.settings-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.settings-breadcrumb .material-symbols-outlined {
    font-size: 14px;
}
.settings-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    line-height: 1.2;
}
.settings-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin: 4px 0 0 0;
    max-width: 720px;
}
.settings-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

/* Tabs de Navegação Segmentada */
.settings-tabs-nav {
    display: flex;
    gap: 6px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    padding: 6px;
    border-radius: 16px;
    margin-bottom: 24px;
    overflow-x: auto;
}
.settings-tab-btn {
    flex: 1;
    min-width: 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    color: #475569 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.settings-tab-btn .material-symbols-outlined {
    color: #475569 !important;
    font-size: 19px;
    transition: color 0.2s ease;
}
.settings-tab-btn .settings-tab-badge {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #334155 !important;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.settings-tab-btn:hover {
    color: var(--primary) !important;
    background: rgba(21, 78, 137, 0.08) !important;
    border-color: rgba(21, 78, 137, 0.15) !important;
}
.settings-tab-btn:hover .material-symbols-outlined {
    color: var(--primary) !important;
}
.settings-tab-btn:hover .settings-tab-badge {
    background: rgba(21, 78, 137, 0.14) !important;
    color: var(--primary) !important;
}
.settings-tab-btn.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 14px rgba(21, 78, 137, 0.3) !important;
}
.settings-tab-btn.active .material-symbols-outlined {
    color: #ffffff !important;
}
.settings-tab-btn.active .settings-tab-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

[data-theme="dark"] .settings-tab-btn {
    color: #94a3b8 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
}
[data-theme="dark"] .settings-tab-btn .material-symbols-outlined {
    color: #94a3b8 !important;
}
[data-theme="dark"] .settings-tab-btn .settings-tab-badge {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .settings-tab-btn:hover {
    background: rgba(56, 189, 248, 0.12) !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.25) !important;
}
[data-theme="dark"] .settings-tab-btn:hover .material-symbols-outlined {
    color: #38bdf8 !important;
}
[data-theme="dark"] .settings-tab-btn:hover .settings-tab-badge {
    background: rgba(56, 189, 248, 0.2) !important;
    color: #7dd3fc !important;
}
[data-theme="dark"] .settings-tab-btn.active {
    background: #2575c5 !important;
    color: #ffffff !important;
    border-color: #2575c5 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .settings-tab-btn.active .material-symbols-outlined {
    color: #ffffff !important;
}
[data-theme="dark"] .settings-tab-btn.active .settings-tab-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}
.settings-tab-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
}
.settings-tab-btn.active .settings-tab-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Painéis de Conteúdo das Abas */
.settings-tab-pane {
    display: none;
}
.settings-tab-pane.active {
    display: block;
    animation: fadeInTab 0.25s ease-out;
}
@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Radio Cards para Provedores de Voz */
.provider-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.provider-card {
    border: 1.5px solid var(--border-color);
    background: var(--surface-card);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}
.provider-card:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.provider-card.selected {
    border-color: var(--primary);
    background: rgba(0, 101, 143, 0.04);
    box-shadow: 0 0 0 1px var(--primary);
}
[data-theme="dark"] .provider-card.selected {
    background: rgba(56, 189, 248, 0.08);
}
.provider-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.provider-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.provider-tag-azure {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}
[data-theme="dark"] .provider-tag-azure {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}
.provider-tag-native {
    background: rgba(0, 101, 143, 0.12);
    color: var(--secondary);
}
.provider-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.provider-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}
.provider-meta {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

/* KPI Cards para Usuários */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.kpi-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.kpi-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kpi-icon-primary {
    background: rgba(0, 55, 104, 0.1);
    color: var(--primary);
}
.kpi-icon-secondary {
    background: rgba(0, 101, 143, 0.1);
    color: var(--secondary);
}
.kpi-icon-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}
.kpi-icon-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}
.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}
.kpi-number {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}
.kpi-subtext {
    font-size: 13px;
    color: var(--text-muted);
}
.kpi-progress {
    width: 100%;
    height: 5px;
    background: var(--surface-bg);
    border-radius: 999px;
    overflow: hidden;
}
.kpi-progress-bar {
    height: 100%;
    border-radius: 999px;
}

/* User Avatar & Table Elements */
.user-avatar-pill {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 55, 104, 0.2);
}

/* Toggle Switch */
.toggle-switch-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}
.toggle-switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--border-color);
    border-radius: 999px;
    transition: background 0.25s ease;
}
.toggle-switch-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch-input:checked + .toggle-switch-slider {
    background: var(--primary);
}
.toggle-switch-input:checked + .toggle-switch-slider::before {
    transform: translateX(22px);
}

/* Password Requirements Checklist */
.pwd-checklist-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px 30px;
    box-shadow: var(--card-shadow);
}
.pwd-checklist-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.pwd-rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--text-muted);
    padding: 6px 0;
    transition: color 0.2s ease;
}
.pwd-rule-item.valid {
    color: #059669;
    font-weight: 600;
}
[data-theme="dark"] .pwd-rule-item.valid {
    color: #34d399;
}
.pwd-rule-icon {
    font-size: 18px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.pwd-rule-item.valid .pwd-rule-icon {
    color: #059669;
}
[data-theme="dark"] .pwd-rule-item.valid .pwd-rule-icon {
    color: #34d399;
}

/* Modern Auth Layouts (Login & Password) */
.auth-page-modern {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--surface-bg);
    position: relative;
}
.auth-container-modern {
    max-width: 480px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
}
.auth-card-modern {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.auth-card-accent-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.auth-header-modern {
    text-align: center;
    margin-bottom: 28px;
}
.auth-logo-box {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(0, 55, 104, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.auth-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 6px 0;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}
.auth-ssl-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    margin-top: 12px;
}
[data-theme="dark"] .auth-ssl-badge {
    color: #34d399;
}
