.boost-gradient {
    background: linear-gradient(135deg, var(--color-primary-soft) 0%, var(--color-primary) 100%);
}

.page-hero {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0 0 var(--space-5);
    margin-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0 0 6px;
    font-family: Sora, Inter, sans-serif;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.page-hero p {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0;
    color: var(--color-muted);
    font-size: 14px;
    font-weight: 500;
}

.page-hero h1 .icon {
    display: none;
}

/*
 * Superficie com volume: degrade sutil de cima para baixo, linha de luz
 * na quina superior e sombra por baixo. E o que separa o cartao do fundo
 * sem precisar de cor.
 */
.card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #17171c 0%, var(--color-surface) 58%, #0f0f12 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--brilho-topo), var(--elevacao-1);
}

.modal-card {
    overflow: visible;
    background: var(--color-surface) !important;
}

.modal-card > .card-body {
    max-height: calc(100vh - 180px);
    overflow: auto;
}

.modal-card.modal-wide-compact .card-header {
    min-height: 54px;
}

.modal-card.modal-wide-compact > .card-body {
    padding: var(--space-4);
}

.stream-ticket-modal-table {
    max-height: 190px;
    overflow: auto;
    margin-bottom: 12px;
}

.card-accent {
    border-color: var(--color-border);
}

.card-body {
    padding: var(--space-5);
}

.card-header {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 0 var(--space-5);
    background: rgba(255, 255, 255, 0.035);
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: Sora, Inter, sans-serif;
    font-size: 18px;
    line-height: 1.25;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-block: var(--space-6) var(--space-3);
    color: var(--color-soft);
    font-family: Inter, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Fio que corre ate o fim da linha, dando ritmo entre as secoes */
.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--color-border), transparent);
}

.live-pulse {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-5);
    padding: 14px var(--space-5);
    background: linear-gradient(180deg, #17171c, #101013);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--brilho-topo), var(--elevacao-1);
}

.live-pulse-item {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
}

.live-pulse-item strong {
    font-family: Sora, Inter, sans-serif;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.live-pulse-item small {
    color: var(--color-soft);
    font-size: 12px;
}

.live-dot {
    align-self: center;
    width: 7px;
    height: 7px;
    margin-right: 2px;
    background: var(--color-live);
    border-radius: 999px;
    animation: livePulseBlink 2.4s ease-in-out infinite;
}

@keyframes livePulseBlink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot {
        animation: none;
    }
}

/* As telas disputadas da grade: Sorteio, Leilao e as duas da Agenda. Sao quatro
   por padrao, e o Admin pode mudar a conta, entao a linha se ajusta sozinha. */
.highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.highlight-card {
    position: relative;
    display: grid;
    gap: 14px;
    padding: 16px 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #17171c 0%, var(--color-surface) 60%, #0f0f12 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--brilho-topo), var(--elevacao-1);
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

/* Luz difusa no canto superior, como se algo la dentro estivesse aceso */
.highlight-card::before {
    content: "";
    position: absolute;
    top: -60%;
    right: -30%;
    width: 70%;
    height: 140%;
    background: radial-gradient(circle, var(--marca-vidro), transparent 62%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 260ms ease;
}

.highlight-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-surface-3);
    box-shadow: var(--brilho-topo), var(--elevacao-3);
}

.highlight-card:hover::before {
    opacity: 1;
}

.highlight-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.highlight-slot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-soft);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.highlight-slot .icon {
    font-size: 16px;
}

/* Contagem regressiva de quem esta em destaque agora */
.highlight-timer {
    padding: 3px 10px;
    color: var(--color-text);
    background: var(--color-surface-2);
    border: 1px solid var(--accent-burnt);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Frente vaga: e uma oportunidade, entao chama atencao */
.highlight-timer.is-idle {
    color: var(--color-brand-ink);
    background: var(--accent-core);
    border-color: var(--accent-deep);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.highlight-card-body {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.highlight-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
}

.highlight-avatar img,
.highlight-avatar i {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    object-fit: cover;
    color: var(--color-soft);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-family: Sora, Inter, sans-serif;
    font-size: 18px;
    font-style: normal;
}

.highlight-live {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    background: var(--color-live);
    border: 2px solid var(--color-surface);
    border-radius: 999px;
    animation: livePulseBlink 2.4s ease-in-out infinite;
}

.highlight-identity {
    min-width: 0;
}

.highlight-identity strong,
.highlight-identity small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.highlight-identity strong {
    font-size: 15px;
    font-weight: 600;
}

.highlight-identity small {
    color: var(--color-soft);
    font-size: 12px;
}

.highlight-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.highlight-viewers {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-soft);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.highlight-viewers .icon {
    font-size: 17px;
}

.highlight-card-foot .button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .highlights {
        grid-template-columns: 1fr;
    }
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.stat-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
    overflow: visible;
    z-index: 1;
    min-height: 96px;
    padding: 16px 18px;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--marca-linha), transparent);
    opacity: 0;
    transition: opacity 180ms ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-surface-3);
    box-shadow: var(--brilho-topo), var(--elevacao-2);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card:hover,
.stat-card:focus-within {
    z-index: 60;
}

.stat-card small {
    display: block;
    margin-bottom: 12px;
    color: var(--color-soft);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    font-family: Sora, Inter, sans-serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-card .stat-icon {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--color-soft);
}

.stat-help {
    position: absolute;
    top: 14px;
    right: 54px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--color-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: help;
}

.stat-help-mark {
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.stat-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 90;
    width: min(260px, calc(100vw - 48px));
    padding: 12px 14px;
    color: var(--color-text);
    background: rgba(9, 9, 11, 0.98);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
    pointer-events: none;
}

.stat-help:hover .stat-tooltip,
.stat-help:focus-visible .stat-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.stat-help:hover,
.stat-help:focus-visible {
    color: var(--color-brand-ink);
    background: linear-gradient(135deg, var(--color-primary-soft) 0%, var(--color-primary) 100%);
    outline: 0;
}

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 800;
    color: var(--color-text);
    transition: transform 150ms ease, filter 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover {
    filter: brightness(1.08);
}

.button:active {
    transform: translateY(1px);
}

.button-primary,
.button-boost {
    color: var(--color-brand-ink);
    background: linear-gradient(180deg, var(--accent-bright) 0%, var(--accent-core) 52%, var(--accent-deep) 100%);
    border-color: var(--accent-burnt);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 4px 14px rgba(0, 0, 0, 0.45);
    font-weight: 700;
}

.button-primary:hover,
.button-boost:hover {
    filter: none;
    background: linear-gradient(180deg, var(--accent-glint) 0%, var(--accent-bright) 52%, var(--accent-core) 100%);
}

/* Nivel 2: contorno visivel, fundo transparente */
.button-outline {
    color: var(--color-text);
    background: transparent;
    border-color: var(--accent-burnt);
    font-weight: 600;
}

.button-outline:hover {
    filter: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-soft);
}

/* Nivel 3: discreto, sem contorno */
.button-ghost {
    color: var(--color-muted);
    background: var(--color-surface-2);
    border-color: transparent;
    font-weight: 500;
}

.button-ghost:hover {
    filter: none;
    color: var(--color-text);
    background: var(--color-surface-3);
}

.button-danger {
    color: #fff;
    background: var(--color-danger);
}


.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--accent-bright);
    background: var(--accent-ash);
    border: 1px solid var(--accent-burnt);
    font-size: 12px;
    font-weight: 700;
}

.badge-yellow {
    color: var(--color-neon-green);
    background: rgba(27, 27, 31, 0.58);
    border-color: rgba(255, 255, 255, 0.34);
    box-shadow: none;
}

.notice {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    color: var(--color-text);
}

.notice-success {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(27, 27, 31, 0.36);
}

.notice-warning {
    border-color: rgba(244, 244, 245, 0.34);
    background: rgba(244, 244, 245, 0.12);
}

.notice-error {
    border-color: rgba(239, 71, 87, 0.34);
    background: rgba(239, 71, 87, 0.12);
}

.form-grid {
    display: grid;
    gap: var(--space-4);
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: var(--color-muted);
    font-size: 14px;
    font-weight: 800;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--color-text);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    outline: 0;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.field-hint {
    margin: 0;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.5;
}

.auction-picker-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(180px, 0.9fr);
    gap: var(--space-3);
}

.field input[type="date"],
.field input[type="time"],
.field input[type="datetime-local"] {
    color-scheme: dark;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--color-primary-soft);
    box-shadow: var(--shadow-glow);
}

@media (max-width: 720px) {
    .auction-picker-grid {
        grid-template-columns: 1fr;
    }
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 13px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.data-table th {
    color: var(--color-muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 13px;
    font-weight: 800;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.progress {
    height: 10px;
    overflow: hidden;
    background: var(--color-surface-3);
    border: 1px solid var(--color-border);
    border-radius: 999px;
}

.progress > span {
    display: block;
    height: 100%;
    background: var(--color-primary-soft);
    border-radius: inherit;
    box-shadow: var(--shadow-glow);
}

.progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin: 14px 0 10px;
    font-size: 13px;
}

.progress-meta strong {
    color: var(--color-text);
    font-weight: 800;
}

.progress-meta span {
    color: var(--color-secondary);
    font-weight: 800;
    text-align: right;
}

.profile-trigger {
    display: inline-flex;
    align-items: center;
    padding: 0;
    color: var(--color-secondary);
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.profile-trigger:hover,
.profile-trigger:focus-visible {
    color: var(--color-secondary);
    text-decoration: underline;
    outline: 0;
}

.card-help {
    position: relative;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--color-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: help;
}

.card-help-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 50;
    width: 240px;
    padding: 12px 14px;
    color: var(--color-text);
    background: rgba(9, 9, 11, 0.98);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    font-size: 12px;
    line-height: 1.45;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
    pointer-events: none;
}

.card-help:hover .card-help-tooltip,
.card-help:focus-visible .card-help-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-modal {
    display: grid;
    gap: 12px;
}

.profile-modal-row {
    display: grid;
    gap: 6px;
}

.profile-modal-row strong {
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-link-anchor {
    color: var(--color-secondary);
    word-break: break-all;
}

.toast-stack {
    position: fixed;
    right: var(--space-5);
    bottom: var(--space-5);
    z-index: 100;
    display: grid;
    gap: var(--space-3);
}

.toast {
    width: min(380px, calc(100vw - 32px));
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.toast.is-success {
    border-color: rgba(244, 244, 245, 0.48);
}

.toast.is-error {
    border-color: rgba(239, 71, 87, 0.55);
}

.skeleton {
    min-height: 18px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.1), rgba(255,255,255,0.04));
    background-size: 220% 100%;
    animation: skeleton 1.4s infinite;
}

@keyframes skeleton {
    to {
        background-position: -220% 0;
    }
}

@media (max-width: 1180px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .page-hero {
        padding: var(--space-5);
    }

    .page-hero h1 {
        font-size: 25px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Janela sobre a tela
   Cabecalho com titulo e o X, corpo rolavel e o fundo desfocado atras.
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(4, 4, 6, 0.66);
    backdrop-filter: blur(3px);
    animation: modalFundo 0.18s ease-out;
}

@keyframes modalFundo {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay .modal-card {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
        var(--color-surface) !important;
    box-shadow:
        0 40px 90px -30px rgba(0, 0, 0, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: modalEntra 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes modalEntra {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.modal-topo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 16px 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-titulo { flex: 1; min-width: 0; }

.modal-close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-close svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    fill: none;
}

.modal-close:hover {
    color: var(--color-text);
    border-color: var(--accent-core);
    background: var(--color-surface-2);
}

.modal-corpo {
    padding: 22px 24px 24px;
    overflow: auto;
}

.modal-acoes {
    padding: 0 24px 22px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* A pagina atras nao rola enquanto a janela esta aberta */
body.tem-modal { overflow: hidden; }

@media (max-width: 560px) {
    .modal-topo { padding: 18px 16px 14px 18px; }
    .modal-corpo { padding: 18px; }
    .modal-acoes { padding: 0 18px 18px; }
}
