:root {
    --hbo-amber-900: #6b3f0f;
    --hbo-amber-800: #8a5210;
    --hbo-amber-700: #a8650f;
    --hbo-amber-500: #e8960f;
    --hbo-amber-400: #f2ab2e;
    --hbo-amber-300: #f7c359;
    --hbo-amber-100: #fff3d9;
    --hbo-ink-900: #241a0c;
    --hbo-ink-700: #4a3a22;
    --hbo-ink-500: #7a6b52;
    --hbo-white: #fffdf8;
    --hbo-danger: #c0392b;
    --hbo-radius: 14px;
    --hbo-shadow: 0 20px 45px rgba(107, 63, 15, 0.18);
    --hbo-dark-bg: #17110a;
    --hbo-dark-bg-soft: #1f1710;
    --hbo-dark-text: #fff3d9;
    --hbo-dark-text-muted: rgba(255, 243, 217, 0.68);
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    color: var(--hbo-ink-900);
    background:
        radial-gradient(circle at 15% 20%, rgba(247, 195, 89, 0.35), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(232, 150, 15, 0.25), transparent 45%),
        linear-gradient(160deg, #fff8e8 0%, #fdecc4 55%, #f8dca0 100%);
    min-height: 100vh;
}

a {
    color: inherit;
}

/* ---------- Honeycomb decorative background ---------- */
.hbo-honeycomb-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.35;
    background-image:
        linear-gradient(30deg, var(--hbo-amber-300) 12%, transparent 12.5%, transparent 87%, var(--hbo-amber-300) 87.5%, var(--hbo-amber-300)),
        linear-gradient(150deg, var(--hbo-amber-300) 12%, transparent 12.5%, transparent 87%, var(--hbo-amber-300) 87.5%, var(--hbo-amber-300)),
        linear-gradient(30deg, var(--hbo-amber-300) 12%, transparent 12.5%, transparent 87%, var(--hbo-amber-300) 87.5%, var(--hbo-amber-300)),
        linear-gradient(150deg, var(--hbo-amber-300) 12%, transparent 12.5%, transparent 87%, var(--hbo-amber-300) 87.5%, var(--hbo-amber-300));
    background-size: 64px 112px;
    background-position: 0 0, 0 0, 32px 56px, 32px 56px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.05));
}

/* ---------- Login page ---------- */
.hbo-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--hbo-dark-bg);
}

.hbo-login-card {
    width: 100%;
    max-width: 380px;
    background: var(--hbo-white);
    border-radius: var(--hbo-radius);
    box-shadow: var(--hbo-shadow);
    padding: 40px 32px 32px;
    border: 1px solid rgba(168, 101, 15, 0.15);
}

.hbo-brand {
    text-align: center;
    margin-bottom: 28px;
}

.hbo-brand__logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.hbo-brand__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--hbo-ink-900);
}

.hbo-brand__subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--hbo-ink-500);
    letter-spacing: 0.02em;
}

.hbo-field {
    margin-bottom: 18px;
}

.hbo-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--hbo-ink-700);
    margin-bottom: 6px;
}

.hbo-field input,
.hbo-field select {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1.5px solid #e8d6b0;
    border-radius: 10px;
    background: #fffaf0;
    color: var(--hbo-ink-900);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hbo-field input:focus,
.hbo-field select:focus {
    outline: none;
    border-color: var(--hbo-amber-500);
    box-shadow: 0 0 0 3px rgba(232, 150, 15, 0.18);
    background: #fff;
}

.hbo-field select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a5210' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* Garante que o atributo HTML "hidden" sempre esconda o elemento, mesmo
   quando uma classe (ex.: .hbo-form-grid com display:grid) define display
   explicitamente — sem isso, a regra da classe vence a do atributo. */
[hidden] {
    display: none !important;
}

.hbo-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--hbo-amber-500), var(--hbo-amber-700));
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(168, 101, 15, 0.3);
    transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.hbo-btn:hover,
.hbo-btn:focus,
.hbo-btn:visited {
    text-decoration: none;
}

.hbo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(168, 101, 15, 0.36);
}

.hbo-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hbo-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fdecea;
    border: 1px solid #f3c2bc;
    color: var(--hbo-danger);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 18px;
}

.hbo-login-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 0.75rem;
    color: var(--hbo-ink-500);
}

/* ---------- App shell (home) ---------- */
.hbo-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hbo-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: rgba(255, 253, 248, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(168, 101, 15, 0.15);
    position: sticky;
    top: 0;
    z-index: 10;
}

.hbo-navbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--hbo-ink-900);
}

.hbo-navbar__brand .hbo-logo-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(145deg, var(--hbo-amber-400), var(--hbo-amber-700));
    box-shadow: 0 6px 14px rgba(168, 101, 15, 0.3);
}

.hbo-navbar__user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.88rem;
    color: var(--hbo-dark-text-muted);
}

.hbo-navbar__user strong {
    color: var(--hbo-dark-text);
}

.hbo-logout-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1.5px solid var(--hbo-amber-500);
    color: var(--hbo-amber-300);
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.hbo-logout-btn:hover {
    background: var(--hbo-amber-700);
    color: #fff;
}

.hbo-main {
    flex: 1;
    padding: 36px 28px 60px;
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
}

.hbo-welcome h1 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    color: var(--hbo-dark-text);
}

.hbo-welcome p {
    margin: 0 0 32px;
    color: var(--hbo-dark-text-muted);
    font-size: 0.95rem;
}

.hbo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.hbo-card {
    background: var(--hbo-white);
    border-radius: var(--hbo-radius);
    padding: 22px;
    border: 1px solid rgba(168, 101, 15, 0.12);
    box-shadow: 0 10px 26px rgba(107, 63, 15, 0.08);
    position: relative;
    overflow: hidden;
}

.hbo-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
    background: var(--hbo-amber-100);
}

.hbo-card h3 {
    margin: 0 0 6px;
    font-size: 1.02rem;
    color: var(--hbo-ink-900);
}

.hbo-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--hbo-ink-500);
}

.hbo-badge-soon {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hbo-amber-800);
    background: var(--hbo-amber-100);
    padding: 4px 8px;
    border-radius: 999px;
}

.hbo-footer {
    text-align: center;
    padding: 18px;
    font-size: 0.75rem;
    color: var(--hbo-ink-500);
}

@media (max-width: 560px) {
    .hbo-navbar {
        padding: 12px 16px;
    }
    .hbo-navbar__user span.hbo-user-label {
        display: none;
    }
    .hbo-main {
        padding: 24px 16px 40px;
    }
}

/* ================================================================
   App shell v2 — layout com menu lateral (dashboard + módulos)
   ================================================================ */

.hbo-shell {
    display: flex;
    min-height: 100vh;
}

.hbo-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--hbo-ink-900), #150f06);
    color: var(--hbo-amber-100);
    display: flex;
    flex-direction: column;
    padding: 22px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 20;
}

.hbo-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0 20px 22px;
    color: #fff;
}

.hbo-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hbo-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255, 243, 217, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.hbo-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.hbo-nav-item.is-active {
    background: rgba(232, 150, 15, 0.16);
    color: var(--hbo-amber-300);
    border-left-color: var(--hbo-amber-500);
}

.hbo-nav-item__icon {
    font-size: 1.05rem;
}

.hbo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--hbo-dark-bg);
}

.hbo-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 28px;
    background: rgba(31, 23, 16, 0.85);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255, 243, 217, 0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

.hbo-topbar__title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--hbo-dark-text);
    flex: 1;
}

.hbo-sidebar-toggle {
    display: none;
    border: none;
    background: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--hbo-dark-text);
}

/* ---------- Dashboard: cards de estatística ---------- */
.hbo-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.hbo-stat-card {
    background: var(--hbo-white);
    border-radius: var(--hbo-radius);
    border: 1px solid rgba(168, 101, 15, 0.12);
    box-shadow: 0 10px 26px rgba(107, 63, 15, 0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.hbo-stat-card__icon {
    font-size: 1.3rem;
}

.hbo-stat-card__label {
    font-size: 0.8rem;
    color: var(--hbo-ink-500);
    font-weight: 600;
}

.hbo-stat-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hbo-ink-900);
}

.hbo-stat-card__value--ok {
    color: #2e7d32;
}

.hbo-stat-card__value--pending {
    color: var(--hbo-amber-700);
}

/* ---------- Cards de atalho (agora funcionam como links) ---------- */
.hbo-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hbo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(107, 63, 15, 0.14);
}

/* ---------- Painéis, formulários e tabelas (módulos) ---------- */
.hbo-panel {
    background: var(--hbo-white);
    border-radius: var(--hbo-radius);
    border: 1px solid rgba(168, 101, 15, 0.12);
    box-shadow: 0 10px 26px rgba(107, 63, 15, 0.06);
    padding: 24px;
    margin-bottom: 24px;
}

.hbo-panel h2 {
    margin: 0 0 16px;
    font-size: 1.05rem;
    color: var(--hbo-ink-900);
}

.hbo-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.hbo-panel__header h2 {
    margin: 0;
}

.hbo-field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--hbo-ink-700);
    margin-bottom: 6px;
}

.hbo-panel__hint {
    margin: -8px 0 16px;
    font-size: 0.82rem;
    color: var(--hbo-ink-500);
    font-weight: 400;
}

.hbo-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.hbo-field--full {
    grid-column: 1 / -1;
}

.hbo-form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
}

.hbo-btn--sm {
    width: auto;
    padding: 10px 22px;
}

.hbo-btn--secondary {
    background: none;
    color: var(--hbo-ink-700);
    border: 1.5px solid #e8d6b0;
    box-shadow: none;
}

.hbo-btn--secondary:hover {
    background: #fff3d9;
    transform: none;
    box-shadow: none;
}

.hbo-table-wrap {
    overflow-x: auto;
}

/* Limita a tabela a ~20 linhas visíveis, com rolagem pro resto. */
.hbo-table-wrap--scroll {
    max-height: 740px;
    overflow-y: auto;
}

.hbo-table-wrap--scroll thead th {
    position: sticky;
    top: 0;
    background: var(--hbo-white);
    z-index: 1;
}

.hbo-panel__footer-action {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.hbo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.hbo-table th,
.hbo-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #f0e2c0;
    white-space: nowrap;
}

.hbo-table td.hbo-truncate {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hbo-table th {
    color: var(--hbo-ink-500);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hbo-table__actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.hbo-table__actions form {
    display: inline;
}

.hbo-link {
    color: var(--hbo-amber-800);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.hbo-link:hover {
    text-decoration: underline;
}

.hbo-link--danger {
    color: var(--hbo-danger);
}

.hbo-empty {
    color: var(--hbo-ink-500);
    font-size: 0.9rem;
}

/* ---------- Variações do alerta (sucesso/erro) ---------- */
.hbo-alert--success {
    background: #e8f5e9;
    border-color: #b9dfb9;
    color: #2e7d32;
}

.hbo-alert--error {
    background: #fdecea;
    border-color: #f3c2bc;
    color: var(--hbo-danger);
}

/* ---------- Sidebar responsiva ---------- */
@media (max-width: 860px) {
    .hbo-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    }

    .hbo-sidebar.is-open {
        transform: translateX(0);
    }

    .hbo-sidebar-toggle {
        display: block;
    }

    .hbo-topbar {
        padding: 14px 16px;
    }

    .hbo-main {
        padding: 20px 16px 40px;
    }
}

/* ---------- Alerta informativo (ex.: nenhum evento encontrado) ---------- */
.hbo-alert--info {
    background: #eaf2fb;
    border-color: #bcd7f3;
    color: #1a5c9e;
}

/* ---------- Lista de seleção (clientes no Novo Registro) ---------- */
.hbo-checklist {
    max-height: 260px;
    overflow-y: auto;
    border: 1.5px solid #e8d6b0;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fffaf0;
}

.hbo-checklist__item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--hbo-ink-900);
}

.hbo-checklist__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--hbo-amber-800);
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e8d6b0;
    cursor: pointer;
}

/* ---------- Badges de status (ex.: conexão com o Google) ---------- */
.hbo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
}

.hbo-badge--ok {
    background: #e8f5e9;
    color: #2e7d32;
}

.hbo-badge--pending {
    background: var(--hbo-amber-100);
    color: var(--hbo-amber-800);
}

/* ---------- Pastas de arquivos (uma por cliente + Geral) ---------- */
.hbo-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.hbo-folder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 22px 14px;
    background: #fffaf0;
    border: 1.5px solid #e8d6b0;
    border-radius: var(--hbo-radius);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.hbo-folder-card:hover {
    transform: translateY(-2px);
    border-color: var(--hbo-amber-500);
    box-shadow: 0 10px 22px rgba(107, 63, 15, 0.12);
}

.hbo-folder-card__icon {
    font-size: 34px;
    line-height: 1;
    margin-bottom: 4px;
}

.hbo-folder-card__name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--hbo-ink-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.hbo-folder-card__count {
    font-size: 0.76rem;
    color: var(--hbo-ink-500);
}

/* ---------- Trilha (breadcrumb) ---------- */
.hbo-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--hbo-dark-text-muted);
    margin-bottom: 16px;
}

.hbo-breadcrumb a {
    color: var(--hbo-dark-text-muted);
    text-decoration: none;
    font-weight: 600;
}

.hbo-breadcrumb a:hover {
    color: var(--hbo-dark-text);
    text-decoration: underline;
}

.hbo-breadcrumb span:last-child {
    color: var(--hbo-dark-text);
    font-weight: 700;
}

/* ---------- Modal (pop-up de cadastro/edição, ex.: Nova despesa) ---------- */
.hbo-modal {
    border: none;
    border-radius: var(--hbo-radius);
    padding: 28px;
    max-width: 480px;
    width: calc(100% - 40px);
    box-shadow: var(--hbo-shadow);
    background: var(--hbo-white);
}

.hbo-modal h2 {
    margin: 0 0 18px;
    font-size: 1.05rem;
    color: var(--hbo-ink-900);
}

.hbo-modal--wide {
    max-width: 640px;
}

/* Linha com vários campos lado a lado dentro de um modal (ex.: Nome da
   Empresa | Meu ID | ID do Gestor). Ocupa a largura toda do form-grid e
   quebra pra menos colunas em telas estreitas. */
.hbo-form-row-3 {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.hbo-modal .hbo-form-actions {
    justify-content: center;
}

/* ---------- Campo de arquivo customizado ---------- */
.hbo-file-upload {
    position: relative;
}

.hbo-file-upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hbo-file-upload__label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px dashed #d9bd85;
    border-radius: 10px;
    background: #fffaf0;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.hbo-file-upload__label:hover {
    border-color: var(--hbo-amber-500);
    background: #fff3d9;
}

.hbo-file-upload__input:focus + .hbo-file-upload__label {
    outline: none;
    border-color: var(--hbo-amber-500);
    box-shadow: 0 0 0 3px rgba(232, 150, 15, 0.18);
}

.hbo-file-upload__icon {
    font-size: 20px;
    flex-shrink: 0;
}

.hbo-file-upload__text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--hbo-ink-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hbo-file-upload--has-file .hbo-file-upload__label {
    border-style: solid;
    border-color: var(--hbo-amber-500);
    background: #fff;
}

.hbo-file-upload--has-file .hbo-file-upload__text {
    color: var(--hbo-ink-900);
}

.hbo-modal::backdrop {
    background: rgba(23, 16, 9, 0.55);
    backdrop-filter: blur(2px);
}

/* ---------- Overlay de carregamento (ex.: lançando apontamentos) ---------- */
.hbo-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 248, 232, 0.94);
    backdrop-filter: blur(2px);
}

.hbo-loading-overlay__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 320px;
    padding: 36px 40px;
    text-align: center;
    background: var(--hbo-white);
    border-radius: var(--hbo-radius);
    box-shadow: var(--hbo-shadow);
    border: 1px solid rgba(168, 101, 15, 0.15);
}

.hbo-loading-overlay__icon {
    font-size: 34px;
    line-height: 1;
    animation: hbo-bounce 1s ease-in-out infinite;
}

.hbo-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid var(--hbo-amber-100);
    border-top-color: var(--hbo-amber-500);
    border-radius: 50%;
    animation: hbo-spin 0.8s linear infinite;
}

.hbo-loading-overlay__text {
    margin: 4px 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--hbo-ink-900);
}

.hbo-loading-overlay__hint {
    margin: 0;
    font-size: 0.78rem;
    color: var(--hbo-ink-500);
}

@keyframes hbo-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes hbo-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes hbo-sway {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(-6px, -6px) rotate(-8deg);
    }
    50% {
        transform: translate(0, -9px) rotate(0deg);
    }
    75% {
        transform: translate(6px, -6px) rotate(8deg);
    }
}

/* ---------- Dashboard de horas (tela Início) ---------- */
.hbo-dashboard-filter {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}

.hbo-dashboard-filter .hbo-field {
    margin-bottom: 0;
    min-width: 180px;
}

.hbo-dashboard-filter__range {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hbo-dashboard__subtitle {
    margin: 0 0 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--hbo-ink-700);
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.04em;
}

/* ---------- Gráfico de pizza (donut) — horas por empresa ---------- */
.hbo-piechart-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.hbo-piechart {
    position: relative;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(168, 101, 15, 0.08);
}

.hbo-piechart__hole {
    position: absolute;
    inset: 26px;
    background: var(--hbo-white);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(107, 63, 15, 0.1);
}

.hbo-piechart__hole-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hbo-ink-900);
}

.hbo-piechart__hole-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--hbo-ink-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hbo-piechart__legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 1 auto;
    width: 260px;
    min-width: 220px;
}

.hbo-piechart__legend li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.87rem;
}

.hbo-piechart__swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.hbo-piechart__legend-name {
    flex: 1;
    min-width: 0;
    color: var(--hbo-ink-700);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hbo-piechart__legend-value {
    color: var(--hbo-ink-900);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- "Mostrar dados utilizados" (tabela retrátil) ---------- */
.hbo-detalhes-horas {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #f0e2c0;
}

.hbo-panel--nested {
    background: #fffaf0;
    border: 1.5px solid #e8d6b0;
    box-shadow: none;
    padding: 18px;
    margin-bottom: 20px;
}

/* ---------- Campo de texto longo (ex.: descrição de um card do CRM) ---------- */
.hbo-field textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1.5px solid #e8d6b0;
    border-radius: 10px;
    background: #fffaf0;
    color: var(--hbo-ink-900);
    resize: vertical;
}

.hbo-field textarea:focus {
    outline: none;
    border-color: var(--hbo-amber-500);
    box-shadow: 0 0 0 3px rgba(232, 150, 15, 0.18);
}

/* Páginas que precisam da largura toda (ex.: kanban do CRM). */
.hbo-main--wide {
    max-width: none;
}

/* ================================================================
   CRM — abas, barra de ações e kanban
   ================================================================ */
.hbo-crm-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.hbo-crm-tabs {
    display: flex;
    gap: 4px;
    background: var(--hbo-dark-bg-soft);
    border: 1px solid rgba(255, 243, 217, 0.08);
    border-radius: 10px;
    padding: 4px;
}

.hbo-crm-tab {
    padding: 8px 18px;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--hbo-dark-text-muted);
}

.hbo-crm-tab:hover {
    color: var(--hbo-dark-text);
}

.hbo-crm-tab.is-active {
    background: var(--hbo-amber-500);
    color: #fff;
}

.hbo-crm-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid rgba(255, 243, 217, 0.14);
    border-radius: 10px;
    background: var(--hbo-dark-bg-soft);
    color: var(--hbo-dark-text);
}

.hbo-crm-search:focus {
    outline: none;
    border-color: var(--hbo-amber-500);
}

.hbo-crm-toolbar__actions {
    display: flex;
    gap: 8px;
}

.hbo-crm-toolbar__actions .hbo-btn--secondary {
    color: var(--hbo-dark-text);
    border-color: rgba(255, 243, 217, 0.2);
}

.hbo-crm-toolbar__actions .hbo-btn--secondary:hover {
    background: rgba(255, 243, 217, 0.08);
}

.hbo-crm-resumo {
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: var(--hbo-dark-text-muted);
}

.hbo-crm-resumo strong {
    color: var(--hbo-amber-300);
}

.hbo-kanban {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 12px;
    min-height: 60vh;
}

.hbo-kanban__col {
    flex: 0 0 272px;
    display: flex;
    flex-direction: column;
    background: var(--hbo-dark-bg-soft);
    border: 1px solid rgba(255, 243, 217, 0.06);
    border-radius: 12px;
    max-height: calc(100vh - 230px);
}

/* Cabeçalho da etapa no formato "seta" na cor da etapa (inspirado no Bitrix). */
.hbo-kanban__head {
    position: relative;
    padding: 10px 26px 10px 14px;
    background: var(--etapa-cor, var(--hbo-amber-500));
    color: #fff;
    border-radius: 12px 12px 0 0;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.hbo-kanban__title {
    display: flex;
    gap: 6px;
    font-weight: 700;
    font-size: 0.88rem;
}

.hbo-kanban__title span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hbo-kanban__count {
    opacity: 0.85;
    font-weight: 600;
}

.hbo-kanban__sum {
    margin-top: 2px;
    font-size: 0.8rem;
    opacity: 0.95;
}

.hbo-kanban__add {
    margin: 8px 8px 0;
    padding: 6px;
    border: 1.5px dashed rgba(255, 243, 217, 0.18);
    border-radius: 8px;
    background: none;
    color: var(--hbo-dark-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
}

.hbo-kanban__add:hover {
    border-color: var(--etapa-cor, var(--hbo-amber-500));
    color: var(--hbo-dark-text);
}

.hbo-kanban__list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    min-height: 80px;
    overflow-y: auto;
    border-radius: 0 0 12px 12px;
    transition: background 0.15s ease;
}

.hbo-kanban__list.is-drop-target {
    background: rgba(232, 150, 15, 0.08);
}

.hbo-kanban__card {
    background: var(--hbo-white);
    border-radius: 9px;
    border-left: 4px solid var(--etapa-cor, var(--hbo-amber-500));
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: grab;
}

.hbo-kanban__card.is-dragging {
    opacity: 0.45;
}

.hbo-kanban__card-title {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--hbo-ink-900);
    text-decoration: none;
    word-break: break-word;
}

.hbo-kanban__card-title:hover {
    color: var(--hbo-amber-700);
    text-decoration: underline;
}

.hbo-kanban__card-valor {
    margin-top: 4px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--hbo-amber-800);
}

.hbo-kanban__card-meta {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--hbo-ink-500);
}

.hbo-kanban__card-meta.is-late {
    color: var(--hbo-danger);
    font-weight: 600;
}

.hbo-crm-excluir {
    margin-top: 14px;
    text-align: center;
}

/* ---------- Editor de etapas (modal "⚙️ Etapas") ---------- */
.hbo-etapas-editor {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hbo-etapas-editor__row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hbo-etapas-editor__row input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 2px;
    border: 1.5px solid #e8d6b0;
    border-radius: 8px;
    background: #fffaf0;
    cursor: pointer;
    flex-shrink: 0;
}

.hbo-etapas-editor__row input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 0.92rem;
    font-family: inherit;
    border: 1.5px solid #e8d6b0;
    border-radius: 8px;
    background: #fffaf0;
    color: var(--hbo-ink-900);
}

.hbo-etapas-editor__row input[type="text"]:focus {
    outline: none;
    border-color: var(--hbo-amber-500);
}

.hbo-etapas-editor__btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 1.5px solid #e8d6b0;
    border-radius: 8px;
    background: none;
    color: var(--hbo-ink-700);
    cursor: pointer;
}

.hbo-etapas-editor__btn:hover {
    background: #fff3d9;
}

.hbo-etapas-editor__btn--danger {
    color: var(--hbo-danger);
}

@media (max-width: 860px) {
    .hbo-kanban__col {
        flex-basis: 240px;
        max-height: none;
    }

    .hbo-crm-toolbar__actions {
        width: 100%;
    }

    .hbo-crm-toolbar__actions .hbo-btn {
        flex: 1;
    }
}
