/* =============================================
   Mangalarga — CSS Base (offline, sem CDN)
   ============================================= */

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

:root {
    --primary:   #1a6fc4;
    --primary-d: #155da0;
    --success:   #198754;
    --warning:   #e6a817;
    --danger:    #dc3545;
    --neutral:   #6c757d;
    --bg:        #f0f2f5;
    --sidebar-w: 220px;
    --sidebar-bg:#1c2a3a;
    --sidebar-tx:#cdd6e0;
    --header-h:  56px;
}

html, body {
    margin: 0; padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    background: var(--bg);
    color: #212529;
}

/* Disable transitions during load to prevent layout flashing/FOUC */
.preload,
.preload *,
.preload *::before,
.preload *::after {
    transition: none !important;
}

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

/* ---- Sidebar ---- */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-w); height: 100vh;
    background: var(--sidebar-bg);
    overflow-y: auto; overflow-x: hidden;
    z-index: 100;
    display: flex; flex-direction: column;
    transition: width .2s ease;
}
.sidebar.collapsed { width: 0; }

.sidebar-brand {
    padding: 12px 10px 12px 20px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex; align-items: center; gap: 6px;
    min-height: 56px; overflow: hidden;
}
.sidebar-brand-text { flex: 1; min-width: 0; }
.sidebar-brand-label {
    font-size: .62rem; font-weight: 400; color: #5a7a99;
    text-transform: uppercase; letter-spacing: .06em; line-height: 1;
}
.sidebar-brand-name {
    font-size: .9rem; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-collapse-btn {
    background: none; border: none; cursor: pointer;
    color: #5a7a99; font-size: 1.2rem; line-height: 1;
    padding: 4px 6px; border-radius: 4px;
    transition: color .15s, background .15s;
    flex-shrink: 0;
}
.sidebar-collapse-btn:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Nav items */
.sidebar-nav { list-style: none; margin: 0; padding: 6px 0; flex: 1; }
.sidebar-nav > li > a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 20px;
    color: var(--sidebar-tx); font-size: .88rem;
    transition: background .15s;
    white-space: nowrap;
}
.sidebar-nav > li > a:hover,
.sidebar-nav > li > a.active {
    background: rgba(255,255,255,.08); color: #fff; text-decoration: none;
}

/* Nav groups */
.nav-group-btn {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 16px 9px 20px;
    background: none; border: none; cursor: pointer;
    color: var(--sidebar-tx); font-size: .88rem;
    text-align: left; white-space: nowrap;
    transition: background .15s, color .15s;
}
.nav-group-btn:hover,
.nav-group-btn.open { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .bi, .nav-group-btn .bi {
    width: 16px; text-align: center; flex-shrink: 0; font-size: 1rem;
}
.nav-arrow {
    margin-left: auto; font-size: .6rem; opacity: .6;
    transition: transform .2s;
}
.nav-group-btn.open .nav-arrow { transform: rotate(180deg); }

.nav-sub {
    list-style: none; margin: 0; padding: 0;
    display: none;
    background: rgba(0,0,0,.18);
}
.nav-sub.open { display: block; }
.nav-sub li a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 20px 8px 28px;
    color: #99b0c4; font-size: .84rem;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.nav-sub li a:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
    text-decoration: none;
}
.nav-sub li a.active {
    background: rgba(26, 111, 196, 0.2) !important;
    color: #4da3ff !important;
    font-weight: 600 !important;
    border-left: 3px solid #1a6fc4 !important;
    padding-left: 25px !important;
    text-decoration: none;
}

/* ---- Main wrapper ---- */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left .2s ease;
}
.main-wrapper.sidebar-collapsed { margin-left: 0; }

/* ---- Topbar ---- */
.topbar {
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px 0 16px;
    position: sticky; top: 0; z-index: 50;
}
.topbar-menu-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; color: #555; padding: 6px 8px;
    border-radius: 4px; transition: background .15s;
    line-height: 1;
}
.topbar-menu-btn:hover { background: #f0f2f5; color: #333; }
.topbar-title { font-weight: 600; font-size: 1rem; color: #333; }
.topbar-user { font-size: .85rem; color: #555; display: flex; align-items: center; gap: 16px; }

/* Atalhos da barra superior */
.topbar-atalhos { display: flex; align-items: center; gap: 4px; margin: 0 16px; flex-wrap: nowrap; overflow: hidden; }
.topbar-atalhos a {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 999px; border: none;
    font-size: .76rem; font-weight: 600; color: #fff; background: #64748b;
    text-decoration: none; white-space: nowrap;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .18);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.topbar-atalhos a i { font-size: .85rem; }
.topbar-atalhos a:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 23, 42, .25); filter: brightness(1.07); color: #fff; }
/* tela atual: contorno escuro por fora */
.topbar-atalhos a.ativo { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0f172a; }
.topbar-atalhos .g-azul    { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.topbar-atalhos .g-verde   { background: linear-gradient(135deg, #34d399, #059669); }
.topbar-atalhos .g-petroleo { background: linear-gradient(135deg, #14b8a6, #0f4c5c); }
.topbar-atalhos .g-ouro     { background: linear-gradient(135deg, #eab308, #a16207); }
.topbar-atalhos .g-violeta { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.topbar-atalhos .g-ambar   { background: linear-gradient(135deg, #fbbf24, #f97316); }
.topbar-atalhos .g-rosa    { background: linear-gradient(135deg, #f472b6, #d946ef); }
.topbar-atalhos .g-grafite { background: linear-gradient(135deg, #475569, #1e293b); }
.topbar-atalhos .g-coral   { background: linear-gradient(135deg, #fb7185, #ef4444); }
.topbar-atalhos .g-ceu     { background: linear-gradient(135deg, #38bdf8, #6366f1); }
/* telas estreitas: só os ícones; celular: esconde */
@media (max-width: 1100px) { .topbar-atalhos a span { display: none; } .topbar-atalhos a { padding: 5px 8px; } }
@media (max-width: 640px)  { .topbar-atalhos { display: none; } }
.topbar-user a { color: var(--danger); font-size: .85rem; }

/* ---- Content ---- */
.content { padding: 24px; flex: 1; }

/* ---- Page header ---- */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.page-header h2 { margin: 0; font-size: 1.3rem; }

/* ---- Cards ---- */
.card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8f9fa; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: none; border-radius: 6px;
    font-size: .875rem; font-weight: 500;
    cursor: pointer; transition: opacity .15s;
    text-decoration: none;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--primary);  color: #fff; }
.btn-success   { background: var(--success);  color: #fff; }
.btn-warning   { background: var(--warning);  color: #fff; }
.btn-danger    { background: var(--danger);   color: #fff; }
.btn-neutral   { background: var(--neutral);  color: #fff; }
.btn-outline   { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-sm        { padding: 5px 10px; font-size: .8rem; }
.btn-lg        { padding: 14px 28px; font-size: 1.1rem; }
.btn-block     { width: 100%; justify-content: center; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 5px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: .9rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,111,196,.15); }
select.form-control { background: #fff; }

/* ---- Campo colete (operacional) ---- */
.colete-input {
    width: 100%;
    padding: 20px;
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    border: 3px solid #ced4da;
    border-radius: 12px;
    letter-spacing: .1em;
    transition: border-color .15s, box-shadow .15s;
}
.colete-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26,111,196,.2);
}
.colete-label {
    display: block;
    text-align: center;
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--neutral);
    margin-bottom: 8px;
}

/* ---- Desvio / resultado operacional ----
   Painel FIXO: sempre visível (nunca display:none), altura mínima estável
   pra não empurrar o resto da tela quando o conteúdo muda. Fica ao lado do
   campo de colete e mostra sempre a última batida registrada — o operador
   não precisa esperar nem procurar a mensagem em lugar nenhum. */
.resultado-pc {
    box-sizing: border-box;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 1.05rem;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #f8fafc;
    border: 1.5px dashed #d0d9e8;
    color: #9aa5b8;
    transition: background-color .12s, border-color .12s;
}
.resultado-pc:empty::before { content: 'Aguardando próxima batida…'; font-size: .85rem; }
.resultado-pc.ok      { background: #d1e7dd; border: 1px solid #a3cfbb; color: #0a3622; }
.resultado-pc.alerta  { background: #fff3cd; border: 1px solid #ffecb5; color: #664d03; }
.resultado-pc.critico { background: #f8d7da; border: 1px solid #f1aeb5; color: #58151c; }
.resultado-pc .atleta { font-weight: 700; font-size: 1.2rem; }
.resultado-pc .desvio { font-size: 1.4rem; font-weight: 700; margin: 6px 0; }
.resultado-pc .pontos { font-size: 1rem; }

/* Linha [form] + [resultado fixo] lado a lado — usada nas telas de batida
   que não têm layout próprio (Chegada, Entrada Vet, Saída Vet passo 1). */
.op-row {
    display: flex;
    align-items: stretch;
    gap: 20px;
    flex-wrap: wrap;
}
.op-row .op-form-wrap { margin: 0; flex: none; }
.op-row .resultado-pc { flex: 1; min-width: 240px; }

/* ---- Countdown ---- */
.countdown {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #f8f9fa;
}
.countdown.verde   { background: #d1e7dd; color: #0a3622; }
.countdown.amarelo { background: #fff3cd; color: #664d03; }
.countdown.laranja { background: #ffe5d0; color: #6e2d00; }
.countdown.vermelho{ background: #f8d7da; color: #58151c; }

/* ---- Fila VetCheck ---- */
.fila-vet { list-style: none; padding: 0; margin: 0; }
.fila-vet li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-left: 4px solid var(--neutral);
    font-size: .95rem;
}
.fila-vet li.verde   { border-left-color: var(--success); background: #f0faf4; }
.fila-vet li.amarelo { border-left-color: var(--warning); background: #fffbf0; }
.fila-vet li.laranja { border-left-color: #fd7e14;        background: #fff4ec; }
.fila-vet li.vermelho{ border-left-color: var(--danger);  background: #fff5f5; }
.fila-vet .tempo-vet { font-weight: 700; font-size: 1rem; min-width: 60px; text-align: right; }

/* ---- Alertas flash ---- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: .9rem;
}
.alert-success { background: #d1e7dd; color: #0a3622; }
.alert-error,
.alert-danger  { background: #f8d7da; color: #58151c; }
.alert-warning { background: #fff3cd; color: #664d03; }
.alert-info    { background: #cff4fc; color: #055160; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}
.badge-success { background: #d1e7dd; color: #0a3622; }
.badge-danger  { background: #f8d7da; color: #58151c; }
.badge-warning { background: #fff3cd; color: #664d03; }
.badge-neutral { background: #e2e3e5; color: #41464b; }

/* ---- Login ---- */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--sidebar-bg);
}
.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 36px;
    width: 100%; max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.login-box h1 { text-align: center; font-size: 1.3rem; margin: 0 0 8px; }
.login-box .subtitle { text-align: center; color: var(--neutral); font-size: .85rem; margin-bottom: 28px; }

/* ---- Sidebar Backdrop ---- */
.sidebar-backdrop {
    display: none;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 990;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }
    .sidebar {
        width: var(--sidebar-w) !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: none;
    }
    .sidebar:not(.collapsed) {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    }
    .main-wrapper {
        margin-left: 0 !important;
    }
    .colete-input { font-size: 2rem; padding: 14px; }
    .countdown { font-size: 1.8rem; }
}

/* ---- Telas operacionais ---- */
.op-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 0 18px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
    font-size: 1rem;
    font-weight: 600;
}
.op-form-wrap {
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
}
.relogio {
    font-size: 3.5rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: .05em;
    color: #1c2a3a;
    margin: 12px 0 20px;
    font-variant-numeric: tabular-nums;
}

/* Trote radio buttons */
.trote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    transition: border-color .15s, background .15s;
}
.trote-btn:has(input:checked) { border-color: var(--primary); background: #e8f0fb; }
.trote-c:has(input:checked)   { border-color: var(--danger);  background: #fde; }
.trote-btn input[type=radio]  { display: none; }

.acao-vet-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    transition: border-color .15s, background .15s;
}
.acao-vet-btn:has(input:checked)          { border-color: var(--primary); background: #e8f0fb; }
.acao-vet-penalizar:has(input:checked)    { border-color: var(--danger);  background: #fde8e8; }
.acao-vet-btn input[type=radio]           { display: none; }

/* ---- Card extensions ---- */
.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    font-size: .9rem;
}
.card.mb-4 { margin-bottom: 24px; }
.card-body  { padding: 16px; }
.card-body.p-0 { padding: 0; }

/* ---- Grid simples ---- */
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.col { flex: 1; min-width: 120px; }
.col-auto { flex: 0 0 auto; }

/* ---- Botões extras ---- */
.btn-secondary { background: #6c757d; color: #fff; }
.btn-info      { background: #0dcaf0; color: #000; }

/* ---- Badges extras ---- */
.badge-ok   { background: #d1e7dd; color: #0a3622; }
.badge-info { background: #cff4fc; color: #055160; }

/* ---- Número de colete na listagem ---- */
.colete-num {
    font-size: 1.3rem;
    font-weight: 700;
    background: #1c2a3a;
    color: #fff;
    padding: 2px 10px;
    border-radius: 6px;
}

/* ---- Utilities ---- */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--neutral); font-size: .875rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 24px; }
.me-2 { margin-right: 8px; }
.d-flex          { display: flex; }
.flex-column     { flex-direction: column; }
.gap-1  { gap: 6px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 16px; }
.align-items-center      { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end     { justify-content: flex-end; }
.align-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100  { width: 100%; }
.pb-1   { padding-bottom: 6px; }

/* ---- Table dentro de card ---- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
.table tbody td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8f9fa; }
.table.mb-0 { margin-bottom: 0; }

/* ---- Hub (seleção de prova) ---- */
.hub-wrap { min-height: 100vh; background: #f0f4f8; }
.hub-header {
    background: #1c2a3a;
    color: #fff;
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hub-brand { font-size: 1.1rem; font-weight: 600; letter-spacing: .02em; }
.hub-user  { font-size: .875rem; color: #b0c4d8; }
.hub-user a { color: #b0c4d8; text-decoration: none; }
.hub-user a:hover { color: #fff; }
.hub-content {
    max-width: 940px;
    margin: 48px auto;
    padding: 0 24px;
}
.hub-subtitle { font-size: 1rem; color: #6b7d8f; margin-bottom: 24px; }
.hub-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.prova-card {
    display: block;
    background: #fff;
    border: 1px solid #dde5ee;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s, border-color .15s;
}
.prova-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    border-color: #2d72d2;
}
.prova-card-nome {
    font-size: 1rem;
    font-weight: 600;
    color: #1c2a3a;
    margin-bottom: 6px;
}
.prova-card-meta {
    font-size: .8rem;
    color: #6b7d8f;
    margin-bottom: 10px;
}
.prova-card-stats {
    display: flex;
    gap: 12px;
    font-size: .8rem;
    color: #8a9bb0;
    margin-bottom: 12px;
}
.prova-card-action { font-size: .85rem; font-weight: 600; color: #2d72d2; }

/* ---- Premium Custom Tooltips ---- */
.custom-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.custom-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%) translateY(8px) scale(0.92);
    background: rgba(28, 42, 58, 0.98);
    color: #fff;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    width: 220px;
    white-space: normal;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-tooltip::after {
    content: "";
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(28, 42, 58, 0.98) transparent transparent transparent;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
    pointer-events: none;
}

.custom-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

.custom-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ---- Custom Premium Modal ---- */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}
.custom-modal.show {
    display: flex;
}
.custom-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.custom-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 540px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 2010;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.custom-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}
.custom-modal-header h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #212529;
}
.custom-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    line-height: 1;
}
.custom-modal-close:hover {
    color: #212529;
}
.custom-modal-body {
    padding: 24px;
}
.custom-modal-body p {
    margin: 0 0 20px;
    font-size: 0.95rem;
    color: #495057;
}
.delete-options-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.delete-option-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px 16px 56px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    text-align: left;
}
.delete-option-btn i {
    position: absolute;
    top: 18px;
    left: 20px;
    font-size: 1.3rem;
}
.delete-option-btn strong {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #212529;
}
.delete-option-btn span {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.4;
}

.delete-option-btn.option-zerar:hover {
    border-color: var(--primary);
    background: rgba(26, 111, 196, 0.04);
}
.delete-option-btn.option-zerar i {
    color: var(--primary);
}
.delete-option-btn.option-apagar:hover {
    border-color: var(--danger);
    background: rgba(220, 53, 69, 0.04);
}
.delete-option-btn.option-apagar i {
    color: var(--danger);
}

.custom-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}



/* ---- Botões em degradê (Apuração e onde mais quiser) ---- */
.btn-grad {
    display: inline-flex; align-items: center; gap: 5px;
    border: none; color: #fff !important; font-weight: 600; letter-spacing: .01em;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .15);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
    text-decoration: none;
}
.btn-grad:hover  { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 23, 42, .22); filter: brightness(1.06); }
.btn-grad:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(15, 23, 42, .18); }
.btn-grad-ciano   { background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%); }
.btn-grad-roxo    { background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); }
.btn-grad-laranja { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); }
.btn-grad-verde   { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
