/* ============================================================
   ASCLEPI TELEMEDICINA — Design System
   Alinhado à plataforma Asclepi (public/assets/css/app.css do
   ecossistema): mesma marca, mesma tipografia, mesma sidebar,
   mesmos KPI cards. Um usuário que transita entre os módulos
   deve sentir que é o mesmo produto.
   ============================================================ */

:root {
    /* Marca — idêntica à da plataforma */
    --sidebar-w:   248px;
    --brand:       #1668b3;   /* azul Asclepi */
    --brand-2:     #14b3cf;   /* teal */
    --brand-3:     #52c98a;   /* verde */
    --brand-soft:  #e7f1fb;
    --brand-dark:  #0d4f8c;
    --page-bg:     #f5f8fc;
    --line:        #e7ecf3;

    /* Texto */
    --ink:    #414a59;
    --ink-2:  #56617a;
    --muted:  #7a8698;
    --faint:  #a7b0be;
    --heading:#1c2b38;

    /* Semânticas */
    --ok:        #198754;
    --ok-soft:   #e6f4ec;
    --warn:      #fd7e14;
    --warn-soft: #fff2e6;
    --err:       #dc3545;
    --err-soft:  #fbe9eb;
    --info:      #0aa2c0;
    --info-soft: #e5f6fa;

    /* Prioridade do chamado */
    --pri-emergencia: #dc3545;
    --pri-urgente:    #fd7e14;
    --pri-eletivo:    #6c757d;

    /* Layout */
    --header-height: 62px;
    --radius:    .7rem;
    --radius-sm: .55rem;
    --radius-lg: .85rem;

    --shadow-sm: 0 1px 2px rgba(16,24,40,.03);
    --shadow:    0 4px 14px rgba(16,24,40,.08);
    --shadow-lg: 0 12px 26px rgba(16,24,40,.16);

    /* Compatibilidade com estilos inline antigos das views */
    --primary-50:#f5f9fd;  --primary-100:#e7f1fb; --primary-200:#c7dff5;
    --primary-300:#95c3ea; --primary-400:#4e97d1; --primary-500:#1668b3;
    --primary-600:#125a9c; --primary-700:#0d4f8c; --primary-800:#0a3d6d;
    --primary-900:#072b4d;
    --accent-400:#2ee6d6;  --accent-500:#14b3cf;  --accent-600:#0aa2c0;
    --neutral-50:#f5f8fc;  --neutral-100:#eef3f9; --neutral-200:#e7ecf3;
    --neutral-300:#d6dde7; --neutral-400:#a7b0be; --neutral-500:#7a8698;
    --neutral-600:#56617a; --neutral-700:#414a59; --neutral-800:#2b3444;
    --neutral-900:#1c2b38;
    --success-500:#198754; --success-600:#146c43;
    --warning-500:#fd7e14; --warning-600:#e8590c;
    --danger-500:#dc3545;  --danger-600:#b02a37;
    --info-500:#0aa2c0;    --info-600:#0884a0;
    --border-radius:.7rem; --border-radius-sm:.55rem; --border-radius-lg:.85rem;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; }

body {
    margin: 0;
    font-family: 'Figtree Variable', 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: .92rem;
    background: var(--page-bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Escala compacta da plataforma: nada muito grande, para aproveitar a tela. */
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -.01em; color: var(--heading); margin-top: 0; }
h1, .h1 { font-size: 1.4rem; }
h2, .h2 { font-size: 1.25rem; }
h3, .h3 { font-size: 1.12rem; }
h4, .h4 { font-size: 1.02rem; }
h5, .h5 { font-size: .94rem; }
h6, .h6 { font-size: .86rem; }
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; }
.fs-1 { font-size: 1.35rem !important; }
.fs-2 { font-size: 1.2rem  !important; }
.fs-3 { font-size: 1.08rem !important; }
.fs-4 { font-size: 1rem    !important; }
.lead { font-size: 1rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
small, .small { font-size: .82rem; }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--brand) !important; }
strong, b, .fw-bold, .fw-semibold { font-weight: 600; }
hr { border-color: var(--line); opacity: 1; }

td, th, .stat-value, .queue-number, .table { font-variant-numeric: tabular-nums; }

::selection { background: var(--brand-soft); color: var(--brand-dark); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-sm); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd6e3; border-radius: 99px; border: 3px solid var(--page-bg); }
::-webkit-scrollbar-thumb:hover { background: #b3bfd0; }

/* ---- Ícones ----
   Bootstrap Icons não traz os modificadores de tamanho do Font Awesome;
   estes utilitários repõem os quatro que o sistema usava. */
.bi { display: inline-block; vertical-align: -.125em; line-height: 1; }
.bi-lg { font-size: 1.25em; }
.bi-2x { font-size: 2em; }
.bi-3x { font-size: 3em; }
.bi-fw { width: 1.25em; text-align: center; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w); flex-shrink: 0;
    background: linear-gradient(180deg, #f4f8fd 0%, #eef4fb 100%);
    border-right: 1px solid var(--line);
    color: var(--ink-2);
    display: flex; flex-direction: column;
    overflow-y: auto;
    z-index: 1030;
    transition: transform .2s ease;
}

.sidebar-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid rgba(22,104,179,.12);
    color: #143a63;
    font-weight: 500; font-size: 1.2rem;
}
.brand-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: .7rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    display: grid; place-items: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 10px rgba(22,104,179,.22);
}
.brand-text { line-height: 1.05; font-weight: 600; color: #143a63; }
.brand-version {
    display: block; font-size: .6rem; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--brand-2);
}

.sidebar-nav { flex: 1; padding: .75rem .5rem 2rem; }

.nav-section {
    text-transform: uppercase; font-size: .66rem; letter-spacing: .09em;
    color: var(--faint); font-weight: 600;
    padding: 1rem .85rem .35rem;
}

.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem .85rem; margin: .12rem 0;
    border-radius: var(--radius-sm);
    color: #5c6675; font-size: .9rem; font-weight: 450;
}
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #97a1b0; }
.sidebar-nav .nav-link:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.sidebar-nav .nav-link:hover i { color: var(--brand); }
.sidebar-nav .nav-link.active {
    background: var(--brand-soft); color: var(--brand); font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand);
}
.sidebar-nav .nav-link.active i { color: var(--brand); }
.sidebar-nav .nav-link .badge { margin-left: auto; font-size: .68rem; font-weight: 700; }

.sidebar-user {
    display: flex; align-items: center; gap: .6rem;
    padding: .8rem 1.15rem;
    border-top: 1px solid rgba(22,104,179,.12);
    background: rgba(255,255,255,.5);
}
.user-avatar {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--brand); color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: .74rem; text-transform: uppercase;
}
.user-info { min-width: 0; flex: 1; line-height: 1.1; }
.user-name { font-size: .85rem; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .72rem; color: var(--muted); }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 1029; }
.sidebar-overlay.show { display: block; }

/* ============================================================
   CONTEÚDO E TOPBAR
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column; min-width: 0;
}

.top-header {
    height: var(--header-height);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 1020;
}
.page-title { font-weight: 600; font-size: 1.05rem; color: var(--heading); }
.breadcrumb-text {
    display: inline-block; margin-left: .6rem; padding-left: .65rem;
    border-left: 1px solid var(--line);
    font-size: .8rem; font-weight: 400; color: var(--muted);
    vertical-align: middle;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.sidebar-toggle {
    display: none; background: transparent; border: 1px solid var(--line);
    border-radius: var(--radius-sm); color: var(--ink);
    padding: .3rem .55rem; cursor: pointer;
}

.page-content { padding: 1.5rem; flex: 1; }

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem;
}
.page-header h1 { font-size: 1.25rem; font-weight: 600; margin: 0; }

.section-label {
    text-transform: uppercase; font-size: .66rem; letter-spacing: .09em;
    color: var(--faint); font-weight: 600;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-sm); transform: none; }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--line);
    padding: .8rem 1.1rem;
    font-size: .92rem; font-weight: 600; color: var(--heading);
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.card-header h5, .card-header h6 { margin: 0; font-size: .95rem; font-weight: 600; }
.card-body { padding: 1.1rem; }

/* ============================================================
   KPI CARDS  (.stat-card do telemedicina = .kpi-card da plataforma)
   ============================================================ */
.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--shadow-sm);
    height: 100%;
}
.stat-card::after { display: none; }
.stat-card:hover { transform: none; box-shadow: var(--shadow-sm); }

.stat-icon {
    width: 48px; height: 48px; flex-shrink: 0;
    border-radius: var(--radius-sm);
    display: grid; place-items: center;
    font-size: 1.4rem; color: #fff;
    background: var(--brand);
}
.stat-value { font-size: 1.4rem; font-weight: 600; line-height: 1; color: var(--heading); }
.stat-value small, .stat-value .unit { font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat-label { font-size: .82rem; color: var(--muted); margin-top: .2rem; }

/* Cores dos ícones de KPI — mesmas classes utilitárias da plataforma */
.bg-brand   { background: var(--brand)  !important; color: #fff !important; }
.bg-teal    { background: #0aa2c0       !important; color: #fff !important; }
.bg-green   { background: #198754       !important; color: #fff !important; }
.bg-warn    { background: #fd7e14       !important; color: #fff !important; }
.bg-danger2 { background: #dc3545       !important; color: #fff !important; }
.bg-purple  { background: #6f42c1       !important; color: #fff !important; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn { font-size: .9rem; font-weight: 500; border-radius: var(--radius-sm); padding: .42rem .85rem; }
.btn-sm { font-size: .82rem; padding: .3rem .65rem; }
.btn-lg { font-size: 1rem; padding: .6rem 1.3rem; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-outline-primary { color: var(--brand); border-color: var(--brand); background: transparent; }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.btn-light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-light:hover { background: var(--brand-soft); border-color: #cfe0f2; color: var(--brand); }

.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { background: #146c43; border-color: #146c43; color: #fff; }
.btn-warning { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-warning:hover { background: #e8590c; border-color: #e8590c; color: #fff; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { background: #b02a37; border-color: #b02a37; color: #fff; }
.btn-icon { border: 1px solid var(--line); background: transparent; color: var(--ink); }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-label { font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }
.form-control, .form-select {
    font-size: .9rem;
    border-color: var(--line);
    border-radius: var(--radius-sm);
    padding: .45rem .7rem;
    color: var(--ink);
}
/* O .form-select do Bootstrap desenha a seta como background à direita e
   reserva o espaço dela no padding-right. A regra acima (shorthand) apagava
   esse espaço e a seta ficava por cima do texto. */
.form-select { padding-right: 2.1rem; background-position: right .65rem center; }
.form-select-sm { padding-right: 2rem; }
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(22,104,179,.14);
    color: var(--ink);
}
textarea.form-control { line-height: 1.6; min-height: 92px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(22,104,179,.14); }
.input-group-text { background: #f7fafd; border-color: var(--line); color: var(--muted); font-size: .88rem; }
.form-floating > label { color: var(--muted); font-size: .88rem; }

/* ============================================================
   TABELAS
   ============================================================ */
.table { font-size: .9rem; color: var(--ink); margin-bottom: 0; border-color: var(--line); }
.table > thead > tr > th {
    font-size: .72rem; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted);
    background: #f8fafd;
    border-bottom: 1px solid var(--line);
    padding: .6rem .8rem;
    white-space: nowrap;
}
.table > tbody > tr > td {
    padding: .65rem .8rem;
    border-bottom: 1px solid var(--line);
    border-top: 0;
    vertical-align: middle;
}
.table > tbody > tr:hover > td { background: #f7fbff; }
.table > :not(:first-child) { border-top: 0; }
.table a { font-weight: 600; }
.table td a[href*="action=ver"], .table .chamado-num { white-space: nowrap; }

.pg-bar {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
    gap: .75rem; padding: .55rem .9rem; border-top: 1px solid var(--line); font-size: .84rem;
}

/* ============================================================
   BADGES — prioridade e situação
   ============================================================ */
.badge { font-weight: 600; border-radius: 99px; font-size: .7rem; padding: .3em .65em; }

.badge-status {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .7rem; font-weight: 600;
    border-radius: 99px; padding: .25rem .6rem;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-status i { display: none; }

.badge-emergencia { background: var(--err-soft);  color: var(--err);  border-color: rgba(220,53,69,.22); }
.badge-urgente    { background: var(--warn-soft); color: #c2570d;     border-color: rgba(253,126,20,.24); }
.badge-eletivo    { background: #eef1f5;          color: #5a6572;     border-color: rgba(108,117,125,.2); }

.badge-aberto          { background: var(--brand-soft); color: var(--brand); border-color: rgba(22,104,179,.2); }
.badge-em_atendimento  { background: var(--info-soft);  color: #08788f;      border-color: rgba(10,162,192,.22); }
.badge-aguardando_info { background: var(--warn-soft);  color: #c2570d;      border-color: rgba(253,126,20,.24); }
.badge-parecer_emitido { background: var(--ok-soft);    color: var(--ok);    border-color: rgba(25,135,84,.22); }
.badge-encerrado       { background: #eef1f5;           color: #5a6572;      border-color: rgba(108,117,125,.2); }
.badge-cancelado       { background: #f4f5f7;           color: #98a1ad;      border-color: rgba(108,117,125,.16); }

.badge-ativo     { background: var(--ok-soft);  color: var(--ok);  border-color: rgba(25,135,84,.22); }
.badge-inativo   { background: #f4f5f7;         color: #98a1ad;    border-color: rgba(108,117,125,.16); }
.badge-bloqueado { background: var(--err-soft); color: var(--err); border-color: rgba(220,53,69,.22); }
.badge-suspenso  { background: var(--warn-soft);color: #c2570d;    border-color: rgba(253,126,20,.24); }

.badge.bg-primary { background: var(--brand) !important; }
.badge.bg-light   { background: #eef2f7 !important; color: var(--ink-2) !important; }

/* Especialidade: rótulo neutro — a cor da tela significa prioridade */
.esp-chip {
    display: inline-block; font-size: .72rem; font-weight: 600;
    color: var(--ink-2); background: #eef2f7;
    border-radius: 99px; padding: .2rem .55rem; white-space: nowrap;
}

/* ============================================================
   FILA DO ESPECIALISTA
   ============================================================ */
.queue-card {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    margin-bottom: .6rem;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
}
.queue-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.queue-card.prioridade-emergencia { border-left-color: var(--pri-emergencia); }
.queue-card.prioridade-urgente    { border-left-color: var(--pri-urgente); }
.queue-card.prioridade-eletivo    { border-left-color: var(--pri-eletivo); }
.queue-number { font-size: .82rem; font-weight: 700; color: var(--brand); }
.queue-card.new-entry { animation: novoChamado 2.4s ease-out; }
@keyframes novoChamado {
    0%, 30% { background: #fff6e0; }
    100%    { background: #fff; }
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before {
    content: ""; position: absolute; left: .32rem; top: .4rem; bottom: .4rem;
    width: 2px; background: var(--line);
}
.timeline-item { position: relative; padding-bottom: 1.4rem; }
.timeline-item::before {
    content: ""; position: absolute; left: -1.6rem; top: .3rem;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; box-shadow: 0 0 0 2px var(--faint);
}
.timeline-item:last-child { padding-bottom: .25rem; }
.timeline-item.tipo-parecer::before          { background: var(--ok);    box-shadow: 0 0 0 2px var(--ok); }
.timeline-item.tipo-solicitacao_info::before { background: var(--warn);  box-shadow: 0 0 0 2px var(--warn); }
.timeline-item.tipo-complemento::before      { background: var(--info);  box-shadow: 0 0 0 2px var(--info); }
.timeline-item.tipo-encerramento::before     { background: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.timeline-item.tipo-cancelamento::before     { background: var(--err);   box-shadow: 0 0 0 2px var(--err); }
.timeline-item.tipo-sistema::before          { background: #fff;         box-shadow: 0 0 0 2px var(--faint); }
.timeline-item.tipo-info::before             { background: #fff;         box-shadow: 0 0 0 2px var(--brand); }

/* O parecer é a peça assinada do atendimento: ganha destaque. */
.timeline-item.tipo-parecer {
    background: var(--ok-soft);
    border: 1px solid rgba(25,135,84,.18);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    margin-bottom: 1.4rem;
}
.timeline-item.from-especialista .timeline-author { color: var(--brand); }
.timeline-author { font-weight: 600; font-size: .88rem; color: var(--heading); }
.timeline-time { font-size: .76rem; color: var(--muted); }

/* ============================================================
   SEÇÕES CLÍNICAS
   ============================================================ */
.clinical-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.clinical-section:hover { box-shadow: var(--shadow-sm); }
.clinical-section > h6, .clinical-section > .clinical-title {
    font-size: .95rem; font-weight: 600; color: var(--heading);
    margin-bottom: .9rem; padding-bottom: .55rem;
    border-bottom: 1px solid var(--line);
}
.medication-row { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.atendimento-grid { display: grid; gap: 1rem; }

/* ============================================================
   NOTIFICAÇÕES
   ============================================================ */
.notification-bell {
    position: relative;
    width: 34px; height: 34px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: transparent; color: var(--ink);
    display: grid; place-items: center; cursor: pointer;
}
.notification-bell:hover { background: var(--brand-soft); color: var(--brand); border-color: #cfe0f2; }
.notif-count {
    position: absolute; top: -6px; right: -6px;
    min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--err); color: #fff;
    border-radius: 99px; border: 2px solid #fff;
    font-size: .6rem; font-weight: 700; line-height: 15px; text-align: center;
}
.notif-dropdown {
    width: 358px; max-width: calc(100vw - 24px); padding: 0;
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.notif-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1rem; border-bottom: 1px solid var(--line);
    font-weight: 600; font-size: .9rem;
}

/* ============================================================
   LOGIN — split-screen, igual ao da plataforma
   ============================================================ */
.login-wrapper { min-height: 100vh; margin: 0; display: flex; }

.login-hero {
    flex: 1 1 56%; position: relative; overflow: hidden; color: #fff;
    display: flex; align-items: center; padding: 3rem 3.25rem;
    background:
        radial-gradient(ellipse 60% 50% at 28% 24%, rgba(46,230,214,.10), transparent 70%),
        linear-gradient(150deg, #05090f 0%, #081420 45%, #0b2231 78%, #0d3040 100%);
}
.login-aurora {
    position: absolute; border-radius: 50%; filter: blur(90px);
    pointer-events: none; opacity: .55; will-change: transform;
}
.login-aurora--1 {
    width: 620px; height: 620px; left: -160px; top: -180px;
    background: radial-gradient(circle, rgba(46,230,214,.28), rgba(20,104,143,.14) 55%, transparent 72%);
    animation: login-drift 26s ease-in-out infinite alternate;
}
.login-aurora--2 {
    width: 560px; height: 560px; right: -180px; bottom: -220px;
    background: radial-gradient(circle, rgba(22,104,179,.24), rgba(29,78,216,.16) 55%, transparent 72%);
    animation: login-drift 32s ease-in-out infinite alternate-reverse;
}
@keyframes login-drift {
    from { transform: translate3d(0,0,0) scale(1); }
    to   { transform: translate3d(90px,60px,0) scale(1.15); }
}
.login-hero-grid {
    position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 40% 40%, #000 30%, transparent 75%);
            mask-image: radial-gradient(ellipse 75% 70% at 40% 40%, #000 30%, transparent 75%);
}
.login-hero-inner { position: relative; z-index: 1; max-width: 560px; margin: auto; }
.login-hero-brand {
    display: flex; align-items: center; gap: 1rem;
    font-size: 2rem; font-weight: 500; margin-bottom: 1.6rem;
    animation: login-fadeup .6s .05s both;
}
.login-hero-brand .brand-icon {
    width: 68px; height: 68px; font-size: 1.9rem; border-radius: 1rem;
    box-shadow: 0 0 26px rgba(46,230,214,.28);
}
.login-hero-brand small {
    display: block; font-size: .78rem; font-weight: 400;
    letter-spacing: .06em; text-transform: uppercase; opacity: .65;
}
.login-hero h2 {
    font-size: 1.85rem; font-weight: 600; line-height: 1.25;
    color: #fff; margin-bottom: .8rem;
    animation: login-fadeup .6s .12s both;
}
.login-hero .lead { opacity: .9; font-size: .98rem; margin-bottom: 1.7rem; animation: login-fadeup .6s .2s both; }
.login-hl { color: #2ee6d6; white-space: nowrap; }

.login-feats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: 1.4rem; }
.login-feat {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .7rem;
    border: 1px solid rgba(255,255,255,.10); border-radius: .8rem;
    background: rgba(255,255,255,.055);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: login-fadeup .55s both; animation-delay: calc(.28s + var(--d, 0ms));
}
.login-feat i {
    width: 1.85rem; height: 1.85rem; flex-shrink: 0;
    border-radius: .55rem; display: grid; place-items: center;
    font-size: .9rem; color: #fff;
    background: linear-gradient(135deg, var(--mc, #1668b3), rgba(0,0,0,.25));
}
.login-feat span { font-size: .74rem; font-weight: 600; line-height: 1.15; }

.login-hero-foot {
    display: flex; flex-wrap: wrap; gap: .4rem 1.4rem;
    font-size: .76rem; opacity: .72;
    animation: login-fadeup .6s .9s both;
}
.login-hero-foot i { margin-right: .3rem; }
@keyframes login-fadeup {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-form-side {
    flex: 1 1 44%; display: flex; align-items: center; justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse 70% 55% at 70% 20%, rgba(20,179,207,.07), transparent 70%),
        var(--page-bg);
}
.login-card {
    width: 100%; max-width: 390px;
    background: #fff; border: 1px solid var(--line);
    border-radius: 1.1rem; padding: 2.25rem 2rem;
    box-shadow: var(--shadow);
    animation: login-fadeup .55s .15s both;
}
.login-logo {
    display: block; height: 40px; width: auto;
    max-width: 100%; margin: 0 auto 1.4rem;
}
.login-card .logo { margin-bottom: 1.5rem; }
.login-card .logo-icon { display: none; }
.login-card h1 { font-size: 1.6rem; font-weight: 600; margin: 0; letter-spacing: -.01em; color: var(--heading); }
.login-card .tagline { color: var(--muted); font-size: .88rem; margin: .3rem 0 0; text-transform: none; letter-spacing: 0; }
.login-card .btn-primary {
    background: linear-gradient(135deg, var(--brand), #0d9488);
    border: 0; font-weight: 500;
    position: relative; overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.login-card .btn-primary:hover {
    transform: translateY(-1px); filter: brightness(1.06);
    box-shadow: 0 8px 20px -8px rgba(22,104,179,.55);
}
.login-mobile-brand { display: none; }

/* ============================================================
   v1.4 — SLA, cronometria clínica, escalas, acessos, vídeo
   ============================================================ */
.sla-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .68rem; font-weight: 700; letter-spacing: .02em;
    border-radius: 99px; padding: .18rem .55rem; white-space: nowrap;
    border: 1px solid transparent;
}
.sla-ok       { background: var(--info-soft); color: #08788f; border-color: rgba(10,162,192,.25); }
.sla-critico  { background: var(--warn-soft); color: #c2570d; border-color: rgba(253,126,20,.3); animation: slaPulse 1.6s ease-in-out infinite; }
.sla-estourado{ background: var(--err-soft);  color: var(--err); border-color: rgba(220,53,69,.3); }
.sla-cumprido { background: var(--ok-soft);   color: var(--ok);  border-color: rgba(25,135,84,.25); }
@keyframes slaPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(253,126,20,.35); } 50% { box-shadow: 0 0 0 4px rgba(253,126,20,0); } }

.crono-faixa { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .75rem; }
.crono-item {
    background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--line);
    border-radius: var(--radius); padding: .75rem 1rem;
}
.crono-rotulo { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.crono-valor  { font-size: 1.15rem; line-height: 1.3; margin: .15rem 0; }
.crono-valor strong { font-size: 1.35rem; font-weight: 700; }
.crono-sub    { font-size: .78rem; color: var(--muted); }
.crono-ok      { border-left-color: var(--ok); }
.crono-ok .crono-valor strong { color: var(--ok); }
.crono-critico { border-left-color: var(--warn); background: #fffaf3; }
.crono-critico .crono-valor strong { color: #c2570d; }
.crono-fora    { border-left-color: var(--err); background: #fff5f5; }
.crono-fora .crono-valor strong { color: var(--err); }

.escala-tile { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); padding: .6rem .8rem; background: #fff; }
.escala-nome  { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.escala-score { font-size: 1.7rem; font-weight: 700; line-height: 1.1; color: var(--heading); }
.escala-score small { font-size: .85rem; font-weight: 500; color: var(--muted); }
.escala-faixa { font-size: .82rem; font-weight: 600; }
.escala-meta  { font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.escala-item  { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.escala-item:last-child { border-bottom: 0; }
.escala-item-titulo { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.escala-opcoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .35rem; }
.escala-opcao {
    display: flex; align-items: flex-start; gap: .5rem; font-size: .82rem; line-height: 1.25;
    border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .4rem .55rem; cursor: pointer;
}
.escala-opcao:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.escala-opcao input { margin-top: .15rem; }
.escala-valor { font-weight: 700; color: var(--brand); min-width: 1ch; }
.escala-total { font-size: .95rem; }

.acessos-lista { max-height: 260px; overflow: auto; }
.acesso-linha { display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-bottom: 1px solid var(--line); }
.acesso-linha:last-child { border-bottom: 0; }

.consentimento { border-color: rgba(22,104,179,.35); background: var(--brand-soft); }
.consentimento .form-check-label { font-size: .88rem; line-height: 1.45; }

.video-body { background: #0b1114; }

@media print {
    .crono-faixa { break-inside: avoid; }
    .sla-badge, .escala-tile { border-color: #999 !important; }
    #modalVideo, #modalEscala, #modalReabrir, #cardEscalas .btn-group { display: none !important; }
}

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
    display: flex; align-items: center; gap: .6rem;
    border: 1px solid transparent; border-radius: var(--radius);
    padding: .7rem 1rem; font-size: .88rem;
}
.alert-success { background: var(--ok-soft);   color: #12653f; border-color: rgba(25,135,84,.2); }
.alert-danger  { background: var(--err-soft);  color: #a32330; border-color: rgba(220,53,69,.2); }
.alert-warning { background: var(--warn-soft); color: #a8480a; border-color: rgba(253,126,20,.24); }
.alert-info    { background: var(--info-soft); color: #086b81; border-color: rgba(10,162,192,.22); }

/* ============================================================
   GRÁFICOS E ESTADOS
   ============================================================ */
.chart-container { position: relative; height: 240px; }

.empty-state { text-align: center; padding: 3rem 1.25rem; color: var(--muted); }
.empty-state i { font-size: 1.8rem; color: var(--faint); margin-bottom: .75rem; display: block; }
.empty-state p, .empty-state div { font-size: .9rem; }

.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.page-loader, .spinner-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(245,248,252,.85);
    display: grid; place-items: center; backdrop-filter: blur(2px);
}
.spinner-border { color: var(--brand); }

.star-rating, .star-rating-input { display: inline-flex; gap: .2rem; color: #f0ad20; }
.star-rating-input input { display: none; }
.star-rating-input label { cursor: pointer; color: #dde3ec; transition: color .12s ease; }
.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label { color: #f0ad20; }

.parecer-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--ok-soft); color: var(--ok);
    border: 1px solid rgba(25,135,84,.22); border-radius: 99px;
    padding: .22rem .6rem; font-size: .7rem; font-weight: 600;
}

.dropdown-menu {
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); font-size: .88rem; padding: .35rem;
}
.dropdown-item { border-radius: var(--radius-sm); padding: .45rem .7rem; color: var(--ink); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--brand-soft); color: var(--brand); }
.dropdown-divider { border-color: var(--line); }

.modal-content { border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-weight: 600; font-size: 1.02rem; }

.pagination { font-size: .85rem; }
.page-link { border-color: var(--line); color: var(--ink); border-radius: var(--radius-sm) !important; margin: 0 2px; }
.page-link:hover { background: var(--brand-soft); border-color: #cfe0f2; color: var(--brand); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }

.progress { background: #e9eef5; border-radius: 99px; }
.progress-bar { background: var(--brand); }
.tooltip-inner { background: #1c2b38; border-radius: var(--radius-sm); font-size: .76rem; }

/* ---- Animações ---- */
.animate-fade-in { animation: fadeIn .28s ease; }
.animate-slide-up { animation: slideUp .28s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    .login-aurora { animation: none; }
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show, .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .top-header { padding: 0 1rem; }
    .page-content { padding: 1rem; }
}

@media (max-width: 860px) {
    .login-hero { display: none; }
    .login-form-side {
        flex: 1;
        background: linear-gradient(150deg, #05090f, #081420 45%, #0b2231 80%, #0d3040);
    }
    .login-mobile-brand {
        display: flex; align-items: center; justify-content: center; gap: .6rem;
        color: #fff; font-size: 1.6rem; font-weight: 500; margin-bottom: 1.25rem;
    }
}

@media (max-width: 640px) {
    .breadcrumb-text { display: none; }
    .stat-card { padding: .9rem 1rem; gap: .8rem; }
    .stat-icon { width: 42px; height: 42px; font-size: 1.2rem; }
    .table { font-size: .84rem; }
    .login-feats { grid-template-columns: 1fr; }
}

/* ---- Impressão ---- */
@media print {
    .sidebar, .top-header, .header-actions, .notification-bell,
    .btn, .sidebar-overlay, .page-loader { display: none !important; }
    .main-content { margin-left: 0; }
    .page-content { padding: 0; }
    body { background: #fff; font-size: 11pt; }
    .card, .stat-card { break-inside: avoid; box-shadow: none; }
    a { color: var(--ink); text-decoration: none; }
}
