/* ================================================
   WeHa Finance - Editorial Design Tokens
   Portado do padrao GetNuva Finance, paleta WeHa.
   Light, neutral, type-driven. Teal como unico acento.
   ================================================ */

/* ------------------ SURFACES ------------------ */
.surface {
    background: #ffffff;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.8), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.surface-lg {
    background: #ffffff;
    border-radius: 1rem; /* rounded-2xl */
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.8), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.surface-hover {
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.surface-hover:hover {
    box-shadow: inset 0 0 0 1px rgba(125, 216, 216, 0.7),
                0 8px 24px -8px rgba(2, 183, 183, 0.18);
    transform: translateY(-2px);
}

/* Subtle accent rail used on hero panels (single teal line on top) */
.surface-rail-top {
    position: relative;
    overflow: hidden;
}
.surface-rail-top::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(to right, #02B7B7, #3ec7c7, transparent);
}

/* ------------------ TYPE TOKENS ------------------ */
.eyebrow {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #94a3b8; /* slate-400 */
}
.eyebrow-weha {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #019C9C; /* weha-600 */
}
.num {
    font-family: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* ------------------ FUNDO DA APP ------------------ */
/* Lavagem teal quase imperceptivel no topo: atmosfera sem sujar a leitura. */
.app-bg {
    background-color: #f6f8f9;
    background-image:
        radial-gradient(1200px 420px at 18% -160px, rgba(2, 183, 183, 0.07), transparent 70%),
        radial-gradient(900px 380px at 95% -220px, rgba(237, 114, 80, 0.05), transparent 70%);
    background-repeat: no-repeat;
}

/* ------------------ A GRADE (planilha) ------------------ */
/* Linha inteira acende no hover: com 8+ colunas o olho precisa do trilho. */
.sheet tbody tr.sheet-row { transition: background-color 0.1s ease; }
.sheet tbody tr.sheet-row:hover { background: rgba(2, 183, 183, 0.035); }

/* Celula da grade: input que parece celula de planilha. */
.cell {
    width: 100%;
    padding: 0.3rem 0.4rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-family: "Spline Sans Mono", ui-monospace, Menlo, monospace;
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    text-align: right;
    color: #1e293b;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
    outline: none;
}
.cell::placeholder { color: #cbd5e1; }
.cell:hover:not(:disabled):not(:focus) { border-color: #aee7e7; }
.cell:focus {
    border-color: #02B7B7;
    box-shadow: 0 0 0 3px rgba(2, 183, 183, 0.14);
    background: #ffffff;
}
.cell--empty { background: rgba(248, 250, 252, 0.7); border-color: #eef2f6; }
.cell--neg { color: #e11d48; }
/* Semana paga: a grade vira documento, sem chrome de input. */
.cell:disabled {
    border-color: transparent;
    background: transparent;
    color: #334155;
    cursor: default;
}
.cell--empty:disabled { color: transparent; }

/* Marca de linha editada na mao (import nao sobrescreve). */
.dot-edited {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 9999px;
    background: #f59e0b;
    flex-shrink: 0;
}

/* Popover (equipe): abre com um respiro. Lista longa rola dentro do painel. */
.popover {
    transform-origin: top left;
    max-height: min(60vh, 460px);
    overflow-y: auto;
}
.popover::-webkit-scrollbar { width: 6px; }
.popover::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
details[open] > .popover { animation: popIn 0.14s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes popIn {
    from { opacity: 0; transform: scale(0.96) translateY(-2px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
/* Gatilho do popover: botao redondo discreto que acende no hover. */
.team-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s ease;
    list-style: none;
}
.team-trigger:hover { border-color: #7dd8d8; color: #017F7F; background: #e6f8f8; }
details[open] > .team-trigger { border-color: #02B7B7; color: #017F7F; background: #e6f8f8; }
.team-trigger::-webkit-details-marker { display: none; }

/* Estrela de leader */
.star-btn {
    transition: color 0.12s ease, transform 0.12s ease;
}
.star-btn:hover { transform: scale(1.25); }
.star-btn:focus-visible { outline: 2px solid #02B7B7; outline-offset: 1px; border-radius: 4px; }

/* Section divider with eyebrow heading */
.section-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.section-eyebrow > .eyebrow,
.section-eyebrow > .eyebrow-weha {
    flex-shrink: 0;
}
.section-eyebrow::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(226, 232, 240, 0.7);
}

/* ------------------ BUTTONS ------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 0.18s ease;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, #02B7B7 0%, #017F7F 100%);
    color: #ffffff;
}
.btn-primary:hover {
    box-shadow: 0 8px 20px -6px rgba(2, 183, 183, 0.45);
}
.btn-secondary {
    background: #ffffff;
    color: #475569; /* slate-600 */
    border-color: #e2e8f0; /* slate-200 */
}
.btn-secondary:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}
.btn-ghost {
    background: transparent;
    color: #64748b;
}
.btn-ghost:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1rem;
    border-radius: 0.375rem;
}

/* ------------------ INPUTS ------------------ */
.input {
    width: 100%;
    padding: 0.5rem 0.875rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #0f172a;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
}
.input::placeholder { color: #94a3b8; }
.input:focus {
    border-color: #02B7B7;
    box-shadow: 0 0 0 3px rgba(2, 183, 183, 0.12);
}

/* ------------------ BADGES ------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1rem;
    border: 1px solid transparent;
    letter-spacing: 0.01em;
}
.badge-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-danger  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-accent  { background: #fdefec; color: #d55a38; border-color: #f2937a; }
.badge-neutral { background: #f8fafc; color: #475569; border-color: #e2e8f0; }

/* ------------------ TABLES ------------------ */
.table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.8), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    background: #f8fafc;
    padding: 0.625rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #e2e8f0;
}
.table td {
    padding: 0.875rem 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.875rem;
    color: #1e293b;
    vertical-align: middle;
}
.table tbody tr { transition: background-color 0.12s ease; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:first-child td { border-top: 0; }
.table .td-num {
    font-family: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* ------------------ PAGE HEADER ------------------ */
.page-header { margin-bottom: 1.5rem; }
.page-header__kicker {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #019C9C; /* weha-600 */
    margin-bottom: 0.25rem;
}
.page-header__title {
    font-size: 1.75rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}
.page-header__lead {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.375rem;
    max-width: 56ch;
}

/* ------------------ STATS / KPI ------------------ */
.kpi { padding: 1.25rem; }
.kpi__label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}
.kpi__value {
    font-family: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    font-weight: 600;
    font-size: 1.875rem;
    line-height: 1;
    color: #0f172a;
}
.kpi__sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 0.5rem;
}

/* ------------------ TOOLTIPS ------------------ */
/* Uso: <span class="tip" tabindex="0" data-tip="Explicacao">...icone...</span>
   O balao e criado via JS no body (nunca e clipado por overflow dos cards). */
.tip {
    display: inline-flex;
    align-items: center;
    cursor: help;
    outline: none;
}
.tip-bubble {
    position: fixed;
    z-index: 100;
    background: #0f172a;
    color: #f1f5f9;
    font-size: 11px;
    line-height: 1.45;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    text-align: left;
    white-space: normal;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
}
.tip-bubble.is-visible {
    opacity: 1;
}
/* Icone de info padrao */
.tip-icon {
    width: 13px;
    height: 13px;
    color: #cbd5e1;
    transition: color 0.15s ease;
}
.tip:hover .tip-icon, .tip:focus .tip-icon {
    color: #02B7B7;
}
.tip-icon--light {
    color: rgba(255, 255, 255, 0.5);
}
.tip:hover .tip-icon--light, .tip:focus .tip-icon--light {
    color: rgba(255, 255, 255, 0.9);
}

/* ------------------ SCROLLBAR ------------------ */
.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ------------------ DRILL-DOWN ------------------ */
/* Numero clicavel que abre o detalhamento. Precisa parecer clicavel sem
   virar botao pesado: sublinhado pontilhado que acende no hover. */
.drill {
    cursor: pointer;
    border-radius: 10px;
    margin: -4px -6px;
    padding: 4px 6px;
    transition: background-color 0.15s ease;
}
.drill:hover {
    background: rgba(2, 183, 183, 0.06);
}
.drill:focus-visible {
    outline: 2px solid #02B7B7;
    outline-offset: 1px;
}
.drill .drill__count {
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    text-decoration-color: #cbd5e1;
}
.drill:hover .drill__count {
    color: #017F7F;
    text-decoration-color: #02B7B7;
}

/* Link pro registro no Jobber, dentro do detalhamento */
.drill-link {
    text-decoration: underline;
    text-decoration-color: #cbd5e1;
    text-underline-offset: 2px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.drill-link:hover {
    color: #017F7F;
    text-decoration-color: #02B7B7;
}
