@font-face {
    font-family: 'DSEG7 Classic';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/DSEG7Classic-Regular.woff2') format('woff2');
}

:root {
    --bg-color: #f0f2f5;
    --login-gate-bg: #e3e8ee;
    --card-bg: #ffffff;
    --border-color: #dde3ea;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --header-navy: #0a0a0a;
    --accent-blue: #000000;
    --accent-red: #c00000;
    --accent-orange: #ed7d31;
    --accent-warning: #F2FF00;
    --accent-green: #548235;
    --accent-gold: #ffc000;
    --chart-navy: #1a1a1a;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --glass-blur: 0;
    --site-header-height: 64px;
    --site-header-offset: calc(var(--site-header-height) + 3px);
    --sidebar-width: 248px;
    --workspace-bg: #f4f6f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.hidden {
    display: none !important;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(0, 0, 0, 0.12);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.charts-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.charts-loading.hidden {
    display: none;
}

body {
    background-color: var(--bg-color);
    background-image: none;
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0;
}

body:not(.app-locked) {
    background: var(--workspace-bg);
}

.container {
    max-width: none;
    margin: 0;
    width: 100%;
}

.app-shell {
    display: flex;
    min-height: calc(100vh - var(--site-header-height));
    background: var(--workspace-bg);
}

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--header-navy);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: var(--site-header-height);
    height: calc(100vh - var(--site-header-height));
    z-index: 100;
}

.sidebar-section {
    padding: 1.15rem 0.85rem 0.35rem;
}

.sidebar-section--admin:empty,
.sidebar-section--admin:not(:has(.tab-btn:not(.hidden))) {
    display: none;
}

.sidebar-section-label {
    margin: 0 0 0.5rem 0.65rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.62rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
}

.sidebar-nav-item.active {
    background: rgba(255, 192, 0, 0.14);
    color: #ffc000;
    box-shadow: inset 3px 0 0 #ffc000;
}

.sidebar-nav-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar-nav-item.active .sidebar-nav-icon {
    opacity: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 0.85rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-live {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-live .live-status {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.22);
    color: #6ee7b7;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar-bell-toggle {
    align-self: flex-start;
}

.app-workspace {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.workspace-topbar {
    padding: 0.75rem 1.75rem;
    background: var(--workspace-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: var(--site-header-height);
    z-index: 90;
}

.workspace-topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 3.1rem;
}

.workspace-topbar-left {
    flex: 0 0 auto;
    min-width: 0;
}

.workspace-topbar-kpis {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-width: 0;
}

.workspace-topbar:not(.workspace-topbar--with-kpis) .workspace-topbar-kpis {
    display: none;
}

.workspace-topbar-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.topbar-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    max-width: 5.75rem;
    padding: 0.45rem 0.7rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
}

.topbar-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
}

.topbar-stat.stat-card--open::before { background: #1a1a1a; }
.topbar-stat.stat-card--alert::before { background: var(--accent-warning); }
.topbar-stat.stat-card--lost::before { background: var(--accent-red); }
.topbar-stat.stat-card--resolved::before { background: var(--accent-green); }

.topbar-stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.topbar-stat.stat-card--lost .topbar-stat-value {
    color: var(--accent-red);
}

.topbar-stat.stat-card--resolved .topbar-stat-value {
    color: var(--accent-green);
}

.topbar-stat-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    white-space: nowrap;
}

.workspace-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.workspace-page-sub {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.workspace-topbar-actions {
    flex-shrink: 0;
}

.workspace-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.workspace-refresh-btn:hover:not(:disabled) {
    border-color: #cbd5e1;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.workspace-refresh-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.workspace-refresh-btn.is-spinning .dashboard-refresh-icon {
    animation: dashboard-refresh-spin 1.1s cubic-bezier(0.35, 0.05, 0.15, 1) forwards;
}

.workspace-body {
    flex: 1;
    padding: 1rem 1.75rem 2rem;
    overflow-x: hidden;
}

.stats-grid--workspace {
    margin-bottom: 1.25rem;
}

.stats-grid--topbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    margin: 0;
}

.stats-grid--topbar .stat-card {
    padding: 0.28rem 0.45rem;
    min-width: 3.75rem;
    max-width: 4.85rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.stats-grid--topbar .stat-value {
    font-size: 0.95rem;
    line-height: 1.1;
}

.stats-grid--topbar .stat-label {
    font-size: 0.52rem;
    letter-spacing: 0.04em;
    margin-top: 0.08rem;
    white-space: nowrap;
}

.stats-grid--dashboard {
    gap: 0.55rem;
    margin-bottom: 1.75rem;
    max-width: 720px;
}

.stats-grid--dashboard .stat-card {
    padding: 0.65rem 0.85rem;
}

.stats-grid--dashboard .stat-value {
    font-size: 1.35rem;
}

.stats-grid--dashboard .stat-label {
    font-size: 0.65rem;
}

.dashboard-columns {
    margin-top: 0.25rem;
}

.workspace-page-sub.hidden {
    display: none;
}

@media (max-width: 1200px) {
    .dashboard-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 960px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        padding-bottom: 0.5rem;
    }

    .sidebar-section {
        padding: 0.65rem 0.5rem;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-footer {
        width: 100%;
        margin-top: 0;
        padding-top: 0.5rem;
    }

    .sidebar-live {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .workspace-topbar-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .workspace-topbar-left,
    .workspace-topbar-actions {
        flex: 1 1 100%;
        justify-content: center;
        text-align: center;
    }

    .workspace-topbar-kpis {
        flex: 1 1 100%;
        order: 2;
    }
}

header.site-header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1100;
    background: var(--header-navy);
    border-bottom: 3px solid var(--accent-gold);
    box-shadow: var(--shadow-card);
    overflow: visible;
}

header.site-header::after {
    display: none;
}

.header-inner {
    max-width: none;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--site-header-height);
    padding: 0 1.5rem;
}

.header-left {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.header-left .stk-ai-root {
    margin-left: 4rem;
}

.header-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    border-radius: 6px;
    transition: opacity 0.2s;
}

.header-logo-link:hover {
    opacity: 0.85;
}

.header-logo-link:focus-visible {
    outline: 2px solid var(--accent-warning);
    outline-offset: 3px;
}

.header-logo {
    height: 44px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 1;
}

.header-title-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
    color: #ffffff;
}

.header-title-container h1 span {
    color: var(--accent-gold);
}

.header-right-group {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.25rem;
}

.header-title-container {
    display: flex;
    align-items: center;
    text-align: left;
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.2rem;
}

.header-text h1 span {
    color: var(--accent-blue);
}

.header-title span {
    color: var(--accent-blue);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
}

.stat-card--open::before { background: #1a1a1a; }
.stat-card--alert::before { background: var(--accent-warning); }
.stat-card--lost::before { background: var(--accent-red); }
.stat-card--resolved::before { background: var(--accent-green); }

.stat-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 0;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.stat-card--lost .stat-value {
    color: var(--accent-red);
}

.stat-card--resolved .stat-value {
    color: var(--accent-green);
}

.dashboard-content {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.nav-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.dashboard-refresh-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06);
}

.dashboard-refresh-btn:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
}

.dashboard-refresh-btn:disabled {
    opacity: 0.45;
    cursor: wait;
}

.dashboard-refresh-icon {
    width: 18px;
    height: 18px;
    color: #1a1a1a;
    display: block;
    transform-origin: center;
}

.dashboard-refresh-btn.is-spinning .dashboard-refresh-icon {
    animation: dashboard-refresh-spin 1.1s cubic-bezier(0.35, 0.05, 0.15, 1) forwards;
}

@keyframes dashboard-refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(630deg); }
}

.tab-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #f3f4f6;
    color: var(--accent-blue);
}

.tab-btn.active {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-card);
}

.app-sidebar .tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.62);
    padding: 0.62rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.84rem;
    letter-spacing: 0;
    box-shadow: none;
}

.app-sidebar .tab-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
}

.app-sidebar .tab-btn.active {
    background: rgba(255, 192, 0, 0.14);
    color: #ffc000;
    border: none;
    box-shadow: inset 3px 0 0 #ffc000;
}

.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
}

.charts-grid-full {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1rem 0;
}

.card-chart.full-width {
    grid-column: span 2;
}

.card-chart {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    height: 320px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.card-chart:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.card-chart-year {
    height: auto;
    min-height: 380px;
    grid-column: span 2;
}

.chart-body-year-only {
    width: 100%;
    height: 320px;
    position: relative;
}

#resolved-year-legend {
    display: none !important;
}

.chart-body {
    display: flex;
    flex-direction: row;
    /* Lado a lado */
    width: 100%;
    height: 100%;
    align-items: center;
    gap: 1.5rem;
    overflow: hidden;
}

.canvas-wrapper {
    flex: 1.5;
    /* Gráfico ganha mais destaque */
    height: 220px;
    /* REDUZIDO de 280px */
    position: relative;
    order: 2;
    /* Gráfico à direita */
}

.chart-legend {
    flex: 1;
    /* Legenda à esquerda */
    display: flex;
    flex-direction: column;
    /* Lista vertical */
    justify-content: center;
    align-items: flex-start;
    gap: 0.8rem;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 10px;
    order: 1;
    /* Legenda à esquerda */
}

/* Custom scrollbar para a legenda se crescer muito */
.chart-legend::-webkit-scrollbar {
    width: 4px;
}

.chart-legend::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.chart-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--header-navy);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    /* Título centralizado no topo */
}

.legend-swatch,
.legend-dot {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    border-radius: 50% !important;
    flex: 0 0 14px !important;
    align-self: center;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.legend-clickable {
    cursor: pointer;
    border-radius: 6px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.legend-clickable:hover {
    background: rgba(88, 166, 255, 0.12);
}

.legend-click-part {
    cursor: pointer;
}

.legend-click-part:hover {
    text-decoration: underline;
}

.canvas-wrapper canvas {
    cursor: pointer;
}

.chart-body-tall .canvas-wrapper-bar {
    height: 260px;
}

.chart-hint {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.5rem;
    padding: 0 0.5rem;
}

.resolved-tickets-list {
    max-height: 70vh;
    overflow-y: auto;
}

.resolved-ticket-row {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.2s, border-color 0.2s;
}

.resolved-ticket-row:hover {
    background: #f3f4f6;
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.resolved-ticket-key {
    font-weight: 800;
    color: var(--accent-blue);
}

.resolved-ticket-summary {
    color: var(--text-primary);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resolved-ticket-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.resolved-empty {
    padding: 1.5rem;
    color: var(--text-secondary);
    text-align: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Mais próximo das bolinhas */
    font-size: 0.72rem;
    color: var(--text-secondary);
    padding: 4px 8px;
    width: 100%;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.legend-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    /* Garante que os números fiquem alinhados em coluna */
}

.legend-value {
    font-weight: 800;
    color: var(--text-primary);
    opacity: 0.9;
    margin-left: auto;
    /* Alinha os números à direita da área da legenda, mas dentro do limite */
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.legend-item.active-filter {
    background: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.3);
    color: white;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot.green {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.dot.red {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.dot.yellow {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.dashboard-columns {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.column {
    background: var(--card-bg);
    padding: 1.15rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    height: fit-content;
}

.ticket-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ticket-grid.compact {
    grid-template-columns: 1fr;
    /* Stack vertical dentro da coluna */
    gap: 1rem;
}

.row-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding-bottom: 0.5rem;
}

.row-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    /* Começa do canto */
    width: 100%;
    /* De ponta a ponta */
    height: 3px;
    background: var(--accent-blue);
    /* Default */
    border-radius: 2px;
}

.row-header.warning::after {
    background: var(--accent-warning);
}

.row-header.critical::after {
    background: var(--accent-red);
}

.row-header.total::after {
    background: var(--accent-blue);
}

.row-header.primary::after {
    background: #000000;
}

.row-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.queue-header-title {
    gap: 0;
    flex: 1;
    min-width: 0;
}

.queue-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    outline: none;
    padding: 0 1.5rem 0 0;
    max-width: min(100%, 420px);
    line-height: 1.3;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
}

.queue-select:hover,
.queue-select:focus {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.queue-select option {
    text-transform: none;
    font-weight: 600;
    color: #1a1a1a;
    background: #ffffff;
}

.queue-select option:checked {
    background: #000000;
    color: #ffffff;
}

.chart-queue-short {
    color: var(--accent-blue);
    font-weight: 800;
    letter-spacing: 0.5px;
}

.row-count {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 1px 8px;
    border-radius: 12px;
    margin-left: 15px;
    font-weight: 500;
}

.row-count-clickable {
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.row-count-clickable:hover,
.row-count-clickable:focus-visible {
    background: rgba(0, 0, 0, 0.08);
    color: var(--accent-blue);
    outline: none;
}

.row-header span {
    color: var(--accent-blue);
}

.row-header.primary span {
    color: #000000;
}

.row-header.warning span {
    color: #5c5200;
}

.stat-card.stat-alert .stat-value {
    color: #1a1a1a;
}

.ticket-card.card-sla-warn {
    border: 2px solid var(--accent-warning);
    animation: sla-card-blink 1.2s ease-in-out infinite;
}

@keyframes sla-card-blink {
    0%, 100% { box-shadow: 0 0 0 0 rgba(242, 255, 0, 0.35); }
    50% { box-shadow: 0 0 10px 2px rgba(242, 255, 0, 0.85); }
}

.ticket-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.ticket-tags .priority-badge {
    font-size: 0.82rem;
    font-weight: 700;
}

.ticket-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 6px;
    border-radius: 3px;
    line-height: 1.25;
}

.ticket-tag.tag-priorizado {
    background: var(--accent-warning);
    color: #1a1a1a;
    text-transform: uppercase;
}

.ticket-tag.tag-sla {
    background: transparent;
    color: #1a1a1a;
    border: 2px solid var(--accent-warning);
    animation: sla-tag-blink 1s ease-in-out infinite;
}

@keyframes sla-tag-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.ticket-tag.tag-perdido {
    background: transparent;
    color: #1a1a1a;
    border: 1px solid var(--accent-red);
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-tag.tag-expirado {
    background: transparent;
    color: #1a1a1a;
    border: 1px solid var(--accent-red);
    font-weight: 600;
    text-transform: uppercase;
}

.sla-mini.claim-timer {
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #64748b;
    transition: color 0.3s, border-color 0.3s;
}

.sla-mini.claim-timer.claim-phase-green {
    border-color: #86a56e;
    color: #4a6b35;
    background: transparent;
}

.sla-mini.claim-timer.claim-phase-green-light {
    border-color: #9cb87a;
    color: #5a7a3a;
    background: transparent;
}

.sla-mini.claim-timer.claim-phase-yellow {
    border-color: #c9b800;
    color: #7a6f00;
    background: transparent;
}

.sla-mini.claim-timer.claim-phase-orange {
    border-color: #d97706;
    color: #b45309;
    background: transparent;
}

.sla-mini.claim-timer.claim-phase-red {
    border-color: #c00000;
    color: #c00000;
    background: transparent;
}

@keyframes claim-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.sla-mini.claim-timer.claim-urgent:not(.expired) {
    animation: claim-pulse 0.9s ease-in-out infinite;
    border-color: var(--accent-red);
    color: #c00000;
}

.claim-footer {
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.claim-footer .footer-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 6px;
    gap: 5px;
    transition: all 0.2s;
}

.sort-wrapper:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.06);
}

.api-error {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.9rem;
}

.api-error.hidden {
    display: none;
}

.live-status-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.alert-bell-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.alert-bell-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.bell-toggle-track {
    display: block;
    width: 54px;
    height: 30px;
    background: #e8ecf1;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.alert-bell-toggle:hover .bell-toggle-track {
    border-color: #94a3b8;
}

.alert-bell-toggle input:checked + .bell-toggle-track,
#alert-bell-switch:checked + .bell-toggle-track,
.bell-toggle-track.bell-toggle-track--on {
    background: #000000 !important;
    border-color: #000000 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}

.bell-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transition: transform 0.22s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-bell-toggle input:checked + .bell-toggle-track .bell-toggle-thumb,
#alert-bell-switch:checked + .bell-toggle-track .bell-toggle-thumb,
.bell-toggle-track--on .bell-toggle-thumb {
    transform: translateX(24px);
}

.bell-icon {
    width: 13px;
    height: 13px;
    color: #64748b;
    transition: color 0.2s ease;
}

.alert-bell-toggle input:checked + .bell-toggle-track .bell-icon,
#alert-bell-switch:checked + .bell-toggle-track .bell-icon,
.bell-toggle-track--on .bell-icon {
    color: #000000;
}

.alert-bell-toggle input:focus-visible + .bell-toggle-track {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.sla-n2-digital {
    font-family: 'DSEG7 Classic', ui-monospace, monospace;
    font-size: 0.68rem;
    font-weight: 400;
    font-style: normal;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    border-radius: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
}

.sla-n2-digital.dentro-sla {
    color: var(--accent-green);
}

.sla-n2-digital.perdido {
    color: var(--accent-red);
    background: none !important;
}

.sla-n2-digital.sla-paused {
    opacity: 0.72;
}

.sla-paused-tag {
    font-size: 0.46rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.38);
    opacity: 0.85;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    font-family: inherit;
}

.ticket-footer-sla-row .sla-paused-tag {
    align-self: center;
    margin: 0 0 0 0.12rem;
    transform: translateY(-0.5px);
}

.footer-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.8rem;
    margin-top: 0.8rem;
}

.ticket-assignee {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.15rem;
    line-height: 1.35;
}

.ticket-assignee span {
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
}

.arrival-log {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sla-mini {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

.chart-count-tag {
    background: #f3f4f6;
    color: var(--accent-blue);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
    vertical-align: middle;
}

.chart-count-clickable {
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.chart-count-clickable:hover {
    background: #e5e7eb;
    color: #000000;
}

.footer-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-timer {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.filter-icon {
    width: 14px;
    height: 14px;
    color: var(--accent-blue);
}

.sort-select {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    outline: none;
    padding: 2px 0;
    max-width: 0;
    /* Começa escondido */
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    white-space: nowrap;
}

.sort-wrapper:hover .sort-select {
    max-width: 100px;
    /* Expande ao passar o mouse */
    opacity: 1;
    margin-left: 5px;
}

.sort-select option {
    background: #1a1b26;
    color: var(--text-primary);
}

.ticket-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    padding: 0.8rem;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.ticket-grid.compact .ticket-card {
    padding: 0.75rem;
    border-radius: 6px;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-blue);
}

.ticket-id-link {
    text-decoration: none;
    transition: transform 0.2s;
}

.ticket-id-link:hover .ticket-id {
    text-decoration: underline;
    opacity: 0.8;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    /* REDUZIDO */
}

.ticket-id {
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 0.9rem;
}

.ticket-grid.compact .ticket-id {
    font-size: 0.75rem;
    /* ID menor */
}

.ticket-grid.compact .sla-badge {
    font-size: 0.65rem;
    /* Badge menor */
    padding: 0.15rem 0.5rem;
}

.sla-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.sla-critical {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid #ef4444;
}

.sla-atencao {
    background: rgba(255, 234, 0, 0.1);
    color: #FFEA00;
    border: 1px solid #FFEA00;
    box-shadow: 0 0 10px rgba(255, 234, 0, 0.2);
}

.sla-priorizado {
    background: rgba(255, 234, 0, 0.1);
    color: #FFEA00;
    border: 1px solid #FFEA00;
    box-shadow: 0 0 10px rgba(255, 234, 0, 0.2);
}

@keyframes led-blink-red {
    from {
        box-shadow: 0 0 2px rgba(239, 68, 68, 0.2);
    }

    to {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.9), inset 0 0 4px rgba(239, 68, 68, 0.5);
    }
}

.sla-ok {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid #10b981;
}

.ticket-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.6rem;
    /* REDUZIDO */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-grid.compact .ticket-title {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.ticket-grid.compact .timer {
    font-size: 1rem;
}

.ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    /* Margem em vez de borda */
}

.ticket-footer-sla {
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.ticket-footer-sla-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.28rem;
    width: 100%;
}

.ticket-footer-sla-row .footer-label {
    margin-bottom: 0;
    flex-shrink: 0;
    font-size: 0.68rem;
    letter-spacing: 0.35px;
}

.ticket-footer-sla-row .sla-n2-digital {
    flex-shrink: 0;
}

.ticket-footer-sla-row .info-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.footer-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sla-mini {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.3px;
}

.sla-mini.perdido {
    background: rgba(239, 68, 68, 0.2) !important;
    color: var(--accent-red) !important;
}

.footer-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-mini {
    text-align: center;
    background: #f8fafc;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-mini .label {
    display: block;
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-mini .value {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    margin-top: 2px;
}

.timer {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-access-admin {
    display: inline-block;
    flex-shrink: 0;
    padding: 0.45rem 1rem;
    background: transparent;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid #ffffff;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-access-admin--logged {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.tab-logged.hidden,
.tab-admin-only.hidden {
    display: none !important;
}

.btn-access-admin:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-gold);
    color: #fff;
}

.header-auth-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-user-menu-wrap {
    position: relative;
}

.header-user-menu-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    background: transparent;
    color: var(--accent-gold);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 8px;
    border: 1px solid var(--accent-gold);
    cursor: pointer;
    font-family: inherit;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-menu-btn:hover,
.header-user-menu-btn[aria-expanded="true"] {
    background: rgba(255, 192, 0, 0.12);
}

.header-user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: #111;
    border: 1px solid rgba(255, 192, 0, 0.35);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    z-index: 2000;
    overflow: hidden;
}

.header-user-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: #fff;
    text-align: left;
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.header-user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.header-user-dropdown-item--danger {
    color: #fca5a5;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.app-locked {
    overflow: hidden;
    background: var(--login-gate-bg);
}

body.app-locked header.site-header,
body.app-locked #app-main,
body.app-locked #loading-overlay,
body.app-locked #api-error {
    visibility: hidden !important;
    pointer-events: none !important;
}

.app-main--locked {
    display: none !important;
}

.login-gate-modal {
    display: flex;
    flex-direction: column;
    z-index: 5000;
    background: var(--login-gate-bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0;
}

.login-snowflakes-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.login-snowflakes-canvas--active {
    opacity: 1;
}

.turnstile-wrap--confirm.hidden {
    display: none !important;
}

.login-gate-layout {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.login-gate-layout > * {
    pointer-events: auto;
}

.login-gate-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 1.25rem 2.5rem 1.25rem 11.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.login-gate-topbar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.login-gate-topbar-brand span {
    color: var(--accent-gold);
}

.login-gate-topnav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-gate-topnav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    transition: color 0.2s;
}

.login-gate-topnav-link.active,
.login-gate-topnav-link:hover {
    color: var(--text-primary);
}

.login-gate-topnav-btn {
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 6px;
    background: var(--accent-gold);
    color: #111;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s;
}

.login-gate-topnav-btn:hover {
    filter: brightness(1.08);
}

.login-gate-topnav-btn.active {
    box-shadow: 0 0 0 2px rgba(255, 192, 0, 0.35);
}

.login-gate-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 3rem;
    gap: 2rem;
    background: transparent;
}

.login-gate-hero {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.login-gate-hero-logo {
    height: clamp(72px, 12vw, 110px);
    width: auto;
    filter: none;
    opacity: 1;
}

.login-gate-form-area {
    width: min(520px, 100%);
}

.login-gate-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.login-gate-form-title {
    margin: 0 0 0.85rem 0.15rem;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.login-gate-form-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.35rem 1.35rem 1.15rem;
    box-shadow: var(--shadow-card);
}

.login-gate-form input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-gate-form input::placeholder {
    color: #94a3b8;
}

.login-gate-form input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(255, 192, 0, 0.2);
}

.login-gate-invite-hint {
    margin: 0 0 0.25rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.login-gate-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
    padding-top: 0.35rem;
}

.login-gate-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    min-width: 140px;
    margin-top: 0;
    padding: 0.7rem 1.35rem;
    border: none;
    border-radius: 8px;
    background: var(--accent-gold);
    color: #111;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
}

.login-gate-submit:hover {
    filter: brightness(1.06);
}

.login-gate-submit:active {
    transform: scale(0.98);
}

.login-gate-switch {
    margin: 1rem 0 0 0.15rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.login-gate-switch-link {
    background: none;
    border: none;
    padding: 0;
    margin-left: 0.25rem;
    color: var(--accent-gold);
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.login-gate-switch-link:hover {
    color: var(--accent-gold);
    filter: brightness(1.08);
    text-decoration: underline;
}

.login-gate-footer {
    padding: 1.25rem 2rem 1.75rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.login-gate-form-card .admin-auth-error {
    margin-top: 0.85rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.65rem 0.75rem;
}

.login-gate-form-card .auth-turnstile-hint {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.login-gate-form-card .admin-turnstile-retry {
    margin-top: 0.75rem;
    width: 100%;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 8px;
    padding: 0.55rem;
    font-family: inherit;
    cursor: pointer;
}

.login-gate-form-card .turnstile-wrap--confirm {
    margin: 0.5rem 0 0;
    min-height: 65px;
    background: none;
    border: none;
    padding: 0;
    width: 100%;
}

.login-gate-form-card .turnstile-wrap--confirm > div {
    margin: 0;
}

@media (max-width: 640px) {
    .login-gate-topbar {
        padding: 1rem 1.25rem 1rem 4.25rem;
    }

    .login-gate-main {
        padding: 1.5rem 1rem 2rem;
    }

    .login-gate-form-card {
        padding: 1.1rem;
    }
}

.admin-light-panel {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem 2rem;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-card);
}

.admin-light-head h2 {
    margin: 0 0 0.35rem;
    color: var(--text-primary);
}

.admin-light-sub {
    margin: 0 0 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-invite-generator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.admin-invite-generator p {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.admin-invite-generate-btn {
    flex-shrink: 0;
    padding: 0.65rem 1.1rem;
    border: none;
    border-radius: 999px;
    background: var(--accent-gold);
    color: #111;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.admin-invite-generate-btn:hover {
    filter: brightness(1.05);
}

.admin-invite-table-wrap {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
}

.admin-invite-table-wrap h3 {
    margin: 0 0 0.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.admin-invite-table-scroll {
    overflow-x: auto;
}

.admin-invite-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.admin-invite-table th,
.admin-invite-table td {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}

.admin-invite-table th {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-invite-code {
    color: var(--text-primary);
    font-weight: 700;
}

.admin-invite-user {
    color: var(--header-navy);
    font-weight: 600;
}

.admin-invite-hwid {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.admin-invite-copy {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
}

.admin-invite-copy:hover {
    color: var(--text-primary);
}

.admin-invite-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.admin-invite-delete {
    background: transparent;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 6px;
    width: 1.75rem;
    height: 1.75rem;
    line-height: 1;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
}

.admin-invite-delete:hover {
    background: #fef2f2;
    border-color: #f87171;
}

.admin-access-panel {
    padding: 1.75rem 2rem 2.25rem;
}

.admin-access-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-access-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-gold);
}

.admin-access-header h2 {
    margin: 0 0 0.4rem;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.admin-access-sub {
    margin: 0;
    max-width: 52rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}

.admin-access-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .admin-access-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .admin-access-kpis {
        grid-template-columns: 1fr;
    }
}

.admin-access-kpi {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
}

.admin-access-kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
}

.admin-access-kpi--gold::before { background: linear-gradient(90deg, #ffc000, #e6ac00); }
.admin-access-kpi--navy::before { background: linear-gradient(90deg, #1e293b, #0f172a); }
.admin-access-kpi--slate::before { background: linear-gradient(90deg, #94a3b8, #64748b); }

.admin-access-kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.admin-access-kpi-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.admin-access-controls {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
}

.admin-access-controls-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.admin-access-controls-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.admin-access-controls-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.access-ctrl-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.access-ctrl-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.access-ctrl-btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}

.admin-access-day-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.admin-access-chips-empty {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.admin-access-day-chip {
    padding: 0.38rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.admin-access-day-chip:hover {
    border-color: #cbd5e1;
    color: var(--text-primary);
}

.admin-access-day-chip.is-active {
    background: var(--header-navy);
    border-color: var(--header-navy);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.admin-access-chart-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem 1.35rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.admin-access-chart-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
    flex-wrap: wrap;
}

.admin-access-chart-title {
    margin: 0 0 0.2rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-access-chart-desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.admin-access-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-access-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.admin-access-legend-swatch {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 2px;
}

.admin-access-legend-swatch--access {
    background: linear-gradient(180deg, #ffd24d, #ffc000);
}

.admin-access-legend-swatch--users {
    background: linear-gradient(180deg, #334155, #1e293b);
}

.admin-access-chart-body {
    position: relative;
    min-height: 260px;
}

.admin-access-chart-host {
    width: 100%;
}

.admin-access-chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-access-chart-empty-sub {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    opacity: 0.85;
}

.access-chart-frame {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: 0.5rem;
    align-items: stretch;
}

.access-chart-y-axis {
    position: relative;
    height: 220px;
}

.access-chart-y-tick {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--y);
    transform: translateY(50%);
    text-align: right;
    padding-right: 0.35rem;
}

.access-chart-y-tick span {
    font-size: 0.68rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.access-chart-plot {
    position: relative;
    height: 220px;
    border-left: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 0.25rem;
}

.access-chart-gridlines {
    position: absolute;
    inset: 0 0 0 0;
    pointer-events: none;
    z-index: 0;
}

.access-chart-gridline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--y);
    transform: translateY(50%);
    border-top: 1px dashed #e2e8f0;
}

.access-chart-columns {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    gap: 0.35rem;
    padding: 0 0.25rem;
}

.access-chart-col {
    flex: 1;
    min-width: 0;
    max-width: 5.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    cursor: default;
}

.access-chart-col.is-selected .access-chart-bar--access {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ffc000;
}

.access-chart-col-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    height: 100%;
}

.access-chart-bar {
    flex: 1;
    max-width: 1.65rem;
    height: var(--bar-h, 0%);
    min-height: 0;
    border-radius: 6px 6px 2px 2px;
    position: relative;
    transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.15s, transform 0.15s;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.access-chart-bar--access {
    background: linear-gradient(180deg, #ffd24d 0%, #ffc000 55%, #e6ac00 100%);
    cursor: pointer;
}

.access-chart-bar--access:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

.access-chart-bar--users {
    background: linear-gradient(180deg, #475569 0%, #1e293b 100%);
}

.access-chart-bar-val {
    position: absolute;
    top: -1.15rem;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s;
}

.access-chart-col:hover .access-chart-bar-val,
.access-chart-col.is-selected .access-chart-bar-val {
    opacity: 1;
}

.access-chart-col-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: capitalize;
    white-space: nowrap;
}

.admin-access-chart-tooltip {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    background: var(--header-navy);
    color: #fff;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.35;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    max-width: 220px;
}

.admin-access-chart-tooltip strong {
    display: block;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.admin-access-chart-tooltip span {
    opacity: 0.85;
}

.admin-access-chart-foot {
    margin: 0.85rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.admin-access-summary-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.admin-access-summary-sep {
    opacity: 0.5;
}

.admin-access-log-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.admin-access-log-head {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.admin-access-log-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-access-log-scroll {
    max-height: 420px;
    overflow: auto;
}

.admin-access-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.admin-access-log-table th,
.admin-access-log-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}

.admin-access-log-table th {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.admin-access-log-table tbody tr:hover {
    background: rgba(255, 192, 0, 0.04);
}

.admin-access-log-user {
    font-weight: 600;
    color: var(--text-primary);
}

.admin-access-log-queue {
    width: 2.5rem;
    color: var(--text-secondary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.admin-access-log-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 1rem;
}

.access-event-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.access-event-badge--login {
    background: #ecfdf5;
    color: #047857;
}

.access-event-badge--session {
    background: #eff6ff;
    color: #1d4ed8;
}

.access-event-badge--register {
    background: #fffbeb;
    color: #b45309;
}

.access-event-badge--password {
    background: #f1f5f9;
    color: #475569;
}

.access-event-badge--other {
    background: #f8fafc;
    color: #64748b;
}

.header-alert-wrap {
    position: relative;
    overflow: visible;
}

.header-alert-bell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
}

.header-alert-bell svg {
    width: 1.05rem;
    height: 1.05rem;
}

.header-alert-bell:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.header-alert-bell--open {
    border-color: #fff;
    color: #1a1a1a;
    background: #fff;
}

.header-alert-bell--pulse {
    animation: header-bell-pulse 0.5s ease 2;
}

@keyframes header-bell-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}

.header-alert-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
    color: #fff;
    background: #000;
    border: 1px solid #fff;
    border-radius: 999px;
}

.header-alert-panel {
    position: fixed;
    z-index: 1300;
    width: min(22rem, calc(100vw - 2rem));
    max-height: var(--header-alert-max-h, min(70vh, 28rem));
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.header-alert-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.header-alert-panel-head h3 {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-alert-clear {
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    color: #1a1a1a;
    cursor: pointer;
    font-family: inherit;
}

.header-alert-clear:hover {
    background: #1a1a1a;
    color: #fff;
}

.header-alert-empty {
    margin: 0;
    padding: 1rem 0.85rem;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.4;
}

.header-alert-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(var(--header-alert-max-h, 28rem) - 5rem);
}

.header-alert-item {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    border-left: 4px solid #cbd5e1;
}

.header-alert-item:last-child {
    border-bottom: none;
}

.header-alert-item--primary {
    border-left-color: var(--accent-blue);
}

.header-alert-item--prioritized {
    border-left-color: #1a1a1a;
}

.header-alert-item--warning {
    border-left-color: var(--accent-red);
}

.header-alert-item-reason {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1a1a1a;
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-bottom: 0.35rem;
}

.header-alert-item-key {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #1a1a1a;
    text-decoration: none;
}

.header-alert-item-key:hover {
    color: #000000;
    text-decoration: underline;
}

.header-alert-item-summary {
    display: none;
}

.header-alert-item-meta {
    font-size: 0.65rem;
    color: #94a3b8;
}

.live-status {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--accent-green);
    letter-spacing: 1px;
}

.nav-tabs {
    order: 1;
    /* Tabs na esquerda exatamente onde marcado */
    display: flex;
    gap: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    display: inline-block;
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(63, 185, 80, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(63, 185, 80, 0);
    }
}

.atencao-blink {
    border: 1px solid var(--accent-orange) !important;
    box-shadow: 0 0 8px rgba(255, 234, 0, 0.2);
}

.vencendo-blink-red {
    border: 2px solid var(--accent-red) !important;
    animation: blink-border-red 1.5s infinite;
    box-shadow: 0 0 15px rgba(255, 123, 114, 0.3);
}

@keyframes blink-border-yellow {
    0% {
        border-color: var(--accent-orange);
        box-shadow: 0 0 5px rgba(255, 166, 87, 0.2);
    }

    50% {
        border-color: transparent;
        box-shadow: 0 0 20px rgba(255, 166, 87, 0.5);
    }

    100% {
        border-color: var(--accent-orange);
        box-shadow: 0 0 5px rgba(255, 166, 87, 0.2);
    }
}

@keyframes blink-border-red {
    0% {
        border-color: var(--accent-red);
        box-shadow: 0 0 5px rgba(255, 123, 114, 0.2);
    }

    50% {
        border-color: transparent;
        box-shadow: 0 0 20px rgba(255, 123, 114, 0.5);
    }

    100% {
        border-color: var(--accent-red);
        box-shadow: 0 0 5px rgba(255, 123, 114, 0.2);
    }
}

.perdido-static {
    border: 2px solid var(--accent-red) !important;
    box-shadow: 0 0 10px rgba(255, 123, 114, 0.2);
}

.atencao-blink-white {
    border: 1px solid #ffffff !important;
    animation: blink-border-white 1.5s infinite;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.neutral-card {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: none !important;
    animation: none !important;
}

@keyframes blink-border-white {
    0% {
        border-color: #ffffff;
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    }

    50% {
        border-color: transparent;
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    }

    100% {
        border-color: #ffffff;
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    }
}

#total-container .sla-badge {
    display: none;
}

.blink-text {
    animation: blink-text-anim 0.5s ease-in-out 4;
    /* Pisca 4 vezes */
    color: var(--accent-blue) !important;
}

@keyframes blink-text-anim {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: #ffffff;
    margin: 5vh auto;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 1100px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.modal-header h2 span {
    color: var(--accent-gold);
}

.close {
    color: var(--text-secondary);
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.close:hover {
    color: var(--accent-red);
    background: #fef2f2;
    border-color: #fecaca;
}

.breached-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Estilos da Explicação do SLA */
#explanationModal .modal-content {
    max-width: 720px;
    width: 95%;
}

.exp-header-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.exp-ticket-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin: 0;
}

.exp-ticket-key {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0.15rem 0 0;
}

.exp-live-sla {
    text-align: right;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.35);
    min-width: 140px;
}

.exp-live-sla.exp-live-overdue {
    background: rgba(185, 28, 28, 0.12);
    border-color: rgba(185, 28, 28, 0.45);
}

.exp-live-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.exp-live-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.exp-live-hint {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.exp-state-banner {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    border-left: 4px solid;
}

.exp-state-banner.sla-state-running {
    background: rgba(22, 163, 74, 0.1);
    border-left-color: #16a34a;
}

.exp-state-banner.sla-state-paused {
    background: rgba(234, 179, 8, 0.12);
    border-left-color: #ca8a04;
}

.exp-state-banner.sla-state-stopped {
    background: rgba(100, 116, 139, 0.12);
    border-left-color: #64748b;
}

.exp-state-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.exp-state-banner strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.exp-jira-status {
    margin: 0 0 0.35rem !important;
    font-size: 0.82rem !important;
    color: var(--text-primary) !important;
    font-weight: 500;
}

.exp-jira-status strong {
    display: inline;
    font-size: inherit;
    margin: 0;
    color: var(--text-primary);
}

.exp-state-banner p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.exp-intro-box {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

.exp-intro-box h3,
.exp-rules-box h3,
.exp-timeline-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
    color: var(--text-secondary);
}

.exp-intro-box p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.exp-schedule-note {
    font-size: 0.8rem !important;
    color: var(--text-secondary) !important;
    font-style: italic;
}

.exp-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 560px) {
    .exp-metrics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.exp-metric {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
}

.exp-metric-lbl {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.exp-metric-val {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.3;
}

.exp-rules-box {
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.5rem;
}

.exp-rules-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.85rem;
    line-height: 1.55;
}

.exp-rules-list li {
    margin-bottom: 0.35rem;
}

.exp-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.exp-event {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.exp-event-period {
    border-left: 3px solid #000000;
}

.exp-event-pause {
    border-left: 3px solid #ca8a04;
    background: rgba(234, 179, 8, 0.06);
}

.exp-event-resume {
    border-left: 3px solid #16a34a;
}

.exp-event-queue_in,
.exp-event-queue_out {
    border-left: 3px solid #7c3aed;
}

.exp-event-info {
    border-left: 3px solid #64748b;
}

.exp-event-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    margin-bottom: 0.4rem;
}

.exp-event-icon {
    font-size: 1rem;
}

.exp-event-at {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.exp-event-status,
.exp-event-range,
.exp-event-mins {
    font-size: 0.82rem;
    margin: 0.25rem 0;
    line-height: 1.45;
}

.exp-event-detail {
    font-size: 0.84rem;
    margin: 0.5rem 0 0;
    line-height: 1.5;
    color: var(--text-secondary);
}

.exp-empty {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.explanation-summary {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-blue);
}

.explanation-summary p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item {
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 8px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 3.5px;
    top: 15px;
    width: 1px;
    height: calc(100% + 0.5rem);
    background: rgba(255, 255, 255, 0.1);
}

.timeline-item:last-child::after {
    display: none;
}

/* Botão de Info Discreto */
.info-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.info-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    transform: scale(1.1);
}

/* Admin embutido (mesma tela) */
.admin-panel-view {
    padding: 0 0.5rem 2rem;
}

.admin-panel-head h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.admin-panel-head p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.admin-panel-loading {
    color: var(--text-secondary);
    padding: 2rem;
}

.stats-loading-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 2.5rem 1.5rem;
}

.stats-loading-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.stats-loading-card--error {
    border-color: #fecaca;
    background: #fffbfb;
}

.stats-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 1.25rem;
    border: 3px solid #e2e8f0;
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: stats-loading-spin 0.85s linear infinite;
}

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

.stats-loading-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stats-loading-desc {
    margin: 0 0 1.35rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.stats-loading-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.stats-loading-step {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.stats-loading-step-icon {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}

.stats-loading-step.is-active {
    color: var(--text-primary);
    border-color: rgba(255, 192, 0, 0.45);
    background: rgba(255, 192, 0, 0.08);
}

.stats-loading-step.is-active .stats-loading-step-icon {
    background: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(255, 192, 0, 0.25);
    animation: stats-step-pulse 1.2s ease-in-out infinite;
}

.stats-loading-step.is-done {
    color: var(--text-primary);
    border-color: rgba(84, 130, 53, 0.35);
    background: rgba(84, 130, 53, 0.06);
}

.stats-loading-step.is-done .stats-loading-step-icon {
    background: var(--accent-green);
    box-shadow: none;
    animation: none;
}

.stats-loading-step.is-error {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.stats-loading-step.is-error .stats-loading-step-icon {
    background: #ef4444;
    animation: none;
}

@keyframes stats-step-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.admin-auth-content {
    max-width: 420px;
    padding: 1.5rem 2rem;
}

.admin-auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.admin-auth-tab {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
}

.admin-auth-tab.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.admin-auth-form label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0.75rem 0 0.35rem;
}

.admin-auth-form input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
}

.admin-submit-btn {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.admin-submit-btn:hover {
    background: #333;
}

.admin-auth-error {
    margin-top: 1rem;
    padding: 0.65rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 8px;
    font-size: 0.85rem;
}

.admin-gate-reverify,
.admin-turnstile-retry {
    display: block;
    width: 100%;
    margin-top: 0.65rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-primary);
}

.admin-gate-reverify:hover,
.admin-turnstile-retry:hover {
    background: #f3f4f6;
}

.admin-gate-reverify.hidden,
.admin-turnstile-retry.hidden {
    display: none !important;
}

.turnstile-wrap {
    margin: 0.85rem 0 0.5rem;
    min-height: 65px;
}

.turnstile-wrap-center {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.turnstile-export-content {
    max-width: 420px;
}

.turnstile-export-content .modal-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.turnstile-export-hint {
    margin: 0 0 0.75rem;
}

.turnstile-export-widget {
    margin: 0;
    display: block;
}

.turnstile-export-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.turnstile-export-actions .admin-submit-btn {
    width: auto;
    margin-top: 0;
    padding: 0.65rem 1.25rem;
}

.turnstile-export-actions .period-btn {
    margin-top: 0;
}

.admin-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.admin-hint-error {
    color: var(--accent-red);
}

.admin-banner {
    margin-bottom: 0.75rem;
    padding: 0.6rem 1rem;
    background: #fffbeb;
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #92400e;
}

.admin-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-stat-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow-card);
}

.admin-stat-box .val {
    font-size: 1.75rem;
    font-weight: 800;
}

.admin-stat-box .lbl {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stats-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.stats-table th,
.stats-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.stats-table th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
}

.inc-period-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.period-btn {
    padding: 0.45rem 1rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
}

.period-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.period-month-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#inc-month-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.inc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.inc-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow-card);
}

.inc-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 0.35rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
}

.bar-row.bar-clickable {
    cursor: pointer;
    border-radius: 6px;
    padding: 2px 4px;
    margin-left: -4px;
}

.bar-row.bar-clickable:hover {
    background: rgba(124, 58, 237, 0.12);
}

.bar-label {
    flex: 0 0 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.bar-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #7c3aed;
    border-radius: 4px;
}

.bar-val {
    flex: 0 0 36px;
    text-align: right;
    font-weight: 600;
}

.admin-section-title {
    margin-top: 2rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.samples-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.samples-table th,
.samples-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.samples-table tbody tr {
    cursor: pointer;
}

.samples-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.08);
}

.inc-tickets-content {
    max-width: 720px;
    padding: 0;
}

.inc-modal-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem 1rem 1rem;
}

.inc-ticket-link {
    display: block;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
}

.inc-ticket-link:hover {
    color: #7c3aed;
}

.inc-ticket-link strong {
    margin-right: 0.5rem;
}

.inc-ticket-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.modal-backdrop-click {
    position: absolute;
    inset: 0;
    z-index: -1;
}

/* Statistics — painel KPI */
.stats-panel-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.stats-panel-head h2 {
    margin: 0;
    flex: 0 0 auto;
}

.stats-panel-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.75rem;
    margin-left: auto;
}

.stats-period-toolbar {
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
}

.stats-picker {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.stats-picker-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.stats-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 9.5rem;
    max-width: 14rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.stats-picker-trigger::after {
    content: '';
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #64748b;
    margin-left: auto;
}

.stats-picker-trigger:hover,
.stats-picker-trigger[aria-expanded="true"] {
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.stats-picker-trigger[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.stats-picker-panel {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    min-width: 100%;
    max-width: 16rem;
    max-height: 240px;
    overflow-y: auto;
    margin-top: -1px;
    padding: 0.35rem 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stats-picker-panel:not(.hidden) {
    display: block;
}

.stats-picker-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.stats-picker-option:hover {
    background: #f1f5f9;
}

.stats-picker-option input {
    width: 1rem;
    height: 1rem;
    accent-color: #1a1a1a;
    cursor: pointer;
}

.stats-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .stats-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stats-kpi {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-card);
    border-top: 4px solid #1a1a1a;
}

.stats-kpi .kpi-val {
    display: block;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
}

.stats-kpi .kpi-lbl {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.stats-kpi.kpi-red { border-top-color: var(--accent-red); }
.stats-kpi.kpi-blue { border-top-color: #000000; }
.stats-kpi.kpi-purple { border-top-color: #7C3AED; }
.stats-kpi.kpi-dark { border-top-color: #1a1a1a; }

.stats-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stats-chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem 1.25rem;
    box-shadow: var(--shadow-card);
}

.stats-chart-card.stats-chart-wide {
    grid-column: span 1;
}

@media (min-width: 1100px) {
    .stats-charts-grid {
        grid-template-columns: 1.4fr 1fr;
    }
    .stats-chart-card.stats-chart-wide:first-child {
        grid-row: span 2;
    }
}

.stats-n2-charts-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 1100px) {
    .stats-n2-charts-grid {
        grid-template-columns: 1.4fr 1fr;
        grid-template-rows: auto auto;
    }
    .stats-n2-charts-grid .stats-chart-volume {
        grid-column: 1;
        grid-row: 1;
    }
    .stats-n2-charts-grid .stats-chart-participation {
        grid-column: 2;
        grid-row: 1;
    }
    .stats-n2-charts-grid .stats-chart-month-full {
        grid-column: 1;
        grid-row: 2;
    }
    .stats-n2-charts-grid .stats-chart-participados {
        grid-column: 2;
        grid-row: 2;
    }
}

.stats-chart-participados .stats-participados-canvas {
    height: 240px;
    min-height: 220px;
}

.stats-chart-month-full .stats-month-canvas {
    height: 240px;
}

.stats-chart-volume .stats-analyst-bar-wrap {
    height: 240px;
    min-height: 220px;
}

.stats-chart-card h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.stats-prio-hint {
    margin: 0 0 0.35rem;
    font-size: 0.7rem;
}

.stats-canvas-wrap {
    position: relative;
    height: 220px;
}

.stats-canvas-wrap.tall {
    height: 280px;
}

.stats-table-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
}

.stats-table-card h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stats-table tbody tr.stats-row-clickable {
    cursor: pointer;
}

.stats-table tbody tr.stats-row-clickable:hover {
    background: rgba(0, 0, 0, 0.06);
}

.stats-table td.stats-cell-clickable {
    cursor: pointer;
    font-weight: 600;
    color: #000000;
}

.stats-table td.stats-cell-clickable:hover {
    background: rgba(0, 0, 0, 0.08);
    text-decoration: underline;
}

.stats-unified-section-analysts {
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.stats-unified-section {
    margin-bottom: 2.5rem;
}

.stats-unified-section-inc {
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.stats-section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1e293b;
    margin: 0 0 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.stats-kpi-row-compact {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    margin-bottom: 1.25rem;
}

.stats-inc-charts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.stats-inc-charts-grid .stats-chart-card ul li,
.stats-charts-grid .stats-chart-card ul li {
    cursor: pointer;
}

.stats-export-btn {
    align-self: flex-end;
    margin: 0 1.25rem 0 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.stats-audit-section {
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
}

.stats-audit-header {
    margin-bottom: 1rem;
}

.stats-audit-sub {
    margin-top: 0.35rem;
}

.stats-audit-charts {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

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

.stats-chart-split {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.15fr);
    gap: 1rem;
    align-items: center;
    min-height: 220px;
}

.stats-chart-split-compact {
    grid-template-columns: minmax(140px, 0.9fr) minmax(180px, 1.1fr);
    min-height: 200px;
}

.stats-canvas-wrap-pie,
.stats-canvas-wrap-donut {
    height: 220px;
    max-height: 240px;
}

.inc-chart-legend-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.inc-legend-row {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.72rem;
    line-height: 1.25;
    border: 1px solid transparent;
}

.inc-legend-row:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.inc-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.inc-legend-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
    min-width: 0;
}

.inc-legend-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #111827;
    padding-left: 0.35rem;
}

.stats-lojas-card {
    margin-top: 1rem;
}

.stats-lojas-wrap {
    max-height: 420px;
    overflow-y: auto;
}

.stats-lojas-table .stats-loja-name {
    font-weight: 600;
    color: #1e293b;
    text-align: left;
}

.stats-lojas-table .stats-loja-qty,
.stats-lojas-th-qty {
    text-align: right;
    font-variant-numeric: tabular-nums;
    width: 6rem;
}

.stats-lojas-table .stats-loja-qty {
    font-weight: 700;
    color: #111827;
}

.stats-loja-row:hover td {
    background: #f8fafc;
}

@media (max-width: 700px) {
    .stats-chart-split,
    .stats-chart-split-compact {
        grid-template-columns: 1fr;
    }

    .stats-canvas-wrap-pie,
    .stats-canvas-wrap-donut {
        height: 200px;
    }

    .inc-chart-legend-grid {
        max-height: none;
    }
}

.stats-chart-total-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #1f2937;
    background: #f3f4f6;
    border-radius: 999px;
    vertical-align: middle;
}

.stats-audit-total-row td {
    border-top: 2px solid #e5e7eb;
    background: #f9fafb;
}

.stats-audit-table .audit-desc-cell {
    font-size: 0.75rem;
    color: #64748b;
    max-width: 280px;
}

.stats-complement-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1.5rem 0 0.75rem;
    color: #64748b;
}

.stats-complement-grid {
    margin-top: 0;
}


.samples-table tbody tr.inc-sample-row {
    cursor: pointer;
}

.samples-table tbody tr.inc-sample-row:hover {
    background: rgba(37, 99, 235, 0.08);
}

/* —— Manual STK Monitor —— */
.manual-view {
    max-width: 920px;
    margin: 0 auto 3rem;
    padding: 0 1rem 2rem;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--site-header-offset) + 5rem);
}

.manual-hero {
    position: sticky;
    top: var(--site-header-offset);
    z-index: 100;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--accent-blue);
}

.manual-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.manual-hero h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
}

.manual-lead {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 52rem;
}

.manual-toc {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

.manual-toc h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.manual-toc ol {
    margin: 0;
    padding-left: 1.25rem;
    columns: 1;
}

@media (min-width: 640px) {
    .manual-toc ol {
        columns: 2;
        column-gap: 2rem;
    }
}

.manual-toc li {
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
}

.manual-toc a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.manual-toc a:hover {
    text-decoration: underline;
}

.manual-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-card);
}

.manual-section h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.manual-section h4,
.manual-h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    margin: 1.1rem 0 0.5rem;
}

.manual-subsection {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--border-color);
}

.manual-subsection .manual-h4 {
    margin-top: 0;
}

.manual-table-compare th,
.manual-table-compare td {
    font-size: 0.8rem;
    vertical-align: top;
}

.manual-cell-merge {
    background: #f8fafc;
    line-height: 1.45;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.manual-section a {
    color: var(--accent-blue);
    font-weight: 500;
}

.manual-section p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.manual-list {
    margin: 0.5rem 0 0.85rem 1.1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.manual-list li {
    margin-bottom: 0.4rem;
}

.manual-list-ordered {
    list-style: decimal;
    padding-left: 1.25rem;
}

.manual-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: #f8fafc;
    border-left: 3px solid var(--accent-warning);
    padding: 0.65rem 0.85rem;
    border-radius: 0 6px 6px 0;
    margin-top: 0.75rem;
}

.manual-foot {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    margin-bottom: 0;
}

.manual-table-wrap {
    overflow-x: auto;
    margin: 0.75rem 0 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.manual-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.manual-table th,
.manual-table td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.manual-table th {
    background: #f1f5f9;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.manual-table tbody tr:last-child td {
    border-bottom: none;
}

.manual-table code {
    font-size: 0.8em;
    background: #f1f5f9;
    padding: 0.1em 0.35em;
    border-radius: 3px;
}

.manual-code {
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    background: #1a1a1a;
    color: #e2e8f0;
    padding: 1rem 1.1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.5rem 0 1rem;
}

.manual-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 0.75rem 0;
}

@media (min-width: 720px) {
    .manual-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.manual-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    background: #fafbfc;
}

.manual-card-stop {
    border-top: 3px solid var(--accent-red);
}

.manual-card-go {
    border-top: 3px solid var(--accent-green);
}

.manual-card h4 {
    margin-top: 0;
}

.manual-section .ticket-tag {
    vertical-align: middle;
    margin-right: 0.25rem;
}

/* ——— Assistente IA STK (chat moderno) ——— */
.stk-ai-root,
.stk-ai-panel {
    --stk-chat-font: 'Inter', system-ui, sans-serif;
    --stk-chat-bg: #ffffff;
    --stk-chat-surface: #f3f4f6;
    --stk-chat-fg: #1f2937;
    --stk-chat-muted: #6b7280;
    --stk-chat-accent: #000000;
    --stk-chat-border: #e5e7eb;
    --stk-chat-user-bg: #1f2937;
    --stk-chat-user-fg: #ffffff;
    --stk-chat-assist-bg: #ffffff;
    --stk-chat-header-bg: #ffffff;
}

.stk-ai-root.hidden {
    display: none !important;
}

.stk-ai-root {
    position: relative;
    flex-shrink: 0;
    z-index: 1200;
    pointer-events: auto;
}

.stk-ai-root--float {
    position: fixed;
    right: 1.125rem;
    top: 11.75rem;
    z-index: 1300;
    touch-action: none;
}

.stk-ai-root--float .stk-ai-fab-label {
    display: none;
}

.stk-ai-root--float .stk-ai-fab {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--border-color);
    cursor: grab;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.stk-ai-root--float .stk-ai-fab.stk-ai-fab--dragging {
    cursor: grabbing;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.28);
}

.stk-ai-root--float .stk-ai-fab:hover,
.stk-ai-root--float .stk-ai-fab[aria-expanded="true"] {
    transform: scale(1.06);
    border-color: var(--accent-gold);
}

.stk-ai-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.stk-ai-fab-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent-gold);
    white-space: nowrap;
    line-height: 1;
    pointer-events: none;
}

.stk-ai-fab-img {
    width: 2.15rem;
    height: 2.15rem;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.stk-ai-fab:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
}

.stk-ai-fab[aria-expanded="true"] {
    transform: scale(1.05);
    filter: drop-shadow(0 2px 8px rgba(255, 192, 0, 0.45));
}

.manual-open-assistant {
    margin-top: 0.5rem;
}

.stk-ai-panel,
.stk-ai-panel * {
    font-family: var(--stk-chat-font) !important;
    box-sizing: border-box;
}

.stk-ai-panel {
    position: fixed;
    z-index: 1300;
    width: min(440px, calc(100vw - 2rem));
    height: min(520px, var(--stk-ai-panel-max-h, calc(100vh - 6.5rem)));
    background: var(--stk-chat-bg) !important;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--stk-chat-border);
    border: 1px solid var(--stk-chat-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
    color: var(--stk-chat-fg) !important;
    color-scheme: light;
}

.stk-ai-panel.hidden {
    display: none;
}

.stk-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--stk-chat-header-bg);
    border-bottom: 1px solid var(--stk-chat-border);
    flex-shrink: 0;
}

.stk-ai-header-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.stk-ai-header-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.stk-ai-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--stk-chat-fg);
    letter-spacing: -0.02em;
}

.stk-ai-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.stk-ai-header-btn {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--stk-chat-border);
    border-radius: 6px;
    background: #fff;
    color: var(--stk-chat-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.stk-ai-header-btn:hover {
    background: var(--stk-chat-surface);
    color: var(--stk-chat-fg);
}

.stk-ai-header-close {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 1.15rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stk-ai-header-close:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.stk-ai-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem;
    background: var(--stk-chat-surface) !important;
    scrollbar-color: #c4c4c4 transparent;
    scrollbar-width: thin;
}

.stk-ai-messages::-webkit-scrollbar {
    width: 6px;
}

.stk-ai-messages::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 3px;
}

.stk-ai-panel p,
.stk-ai-panel ul,
.stk-ai-panel li,
.stk-ai-panel strong {
    background: transparent !important;
    color: inherit;
}

.stk-ai-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 0.75rem 1rem;
    color: var(--stk-chat-fg) !important;
}

.stk-ai-welcome-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.stk-ai-welcome-title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--stk-chat-fg) !important;
}

.stk-ai-welcome-lead {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--stk-chat-muted) !important;
    max-width: 28ch;
    line-height: 1.45;
}

.stk-ai-welcome-list {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
    width: 100%;
    max-width: 320px;
    font-size: 0.8125rem;
    color: var(--stk-chat-muted) !important;
}

.stk-ai-welcome-list li {
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.35rem;
    background: #fff;
    border: 1px solid var(--stk-chat-border);
    border-radius: 8px;
}

.stk-ai-welcome-list em {
    color: var(--stk-chat-accent);
    font-style: normal;
    font-weight: 600;
}

.stk-ai-msg {
    display: flex;
    margin-bottom: 0.85rem;
    animation: stk-ai-msg-in 0.2s ease;
}

@keyframes stk-ai-msg-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.stk-ai-msg-user {
    justify-content: flex-end;
}

.stk-ai-msg-assistant {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.5rem;
}

.stk-ai-avatar {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.stk-ai-bubble {
    max-width: 88%;
    border-radius: 12px;
    word-break: break-word;
}

.stk-ai-bubble-user {
    background: var(--stk-chat-user-bg);
    color: var(--stk-chat-user-fg) !important;
    padding: 0.6rem 0.85rem;
    border-bottom-right-radius: 4px;
    font-size: 0.875rem;
    line-height: 1.45;
}

.stk-ai-bubble-assistant {
    background: var(--stk-chat-assist-bg);
    color: var(--stk-chat-fg) !important;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--stk-chat-border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex: 1;
    min-width: 0;
}

.stk-ai-bubble-body {
    font-size: 0.875rem;
    line-height: 1.5;
}

.stk-ai-para {
    margin: 0 0 0.5rem;
}

.stk-ai-para:last-child {
    margin-bottom: 0;
}

.stk-ai-bubble-body strong {
    font-weight: 700;
    color: var(--stk-chat-fg);
}

.stk-ai-bubble-body em {
    color: var(--stk-chat-muted);
    font-style: italic;
}

.stk-ai-result-list {
    margin: 0.35rem 0 0.5rem;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--stk-chat-border);
    padding-top: 0.5rem;
}

.stk-ai-result-list li {
    padding: 0.45rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--stk-chat-fg);
}

.stk-ai-result-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stk-ai-msg-pending .stk-ai-bubble-assistant {
    opacity: 0.75;
}

.stk-ai-export-link {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--stk-chat-border);
}

.stk-ai-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    background: var(--stk-chat-accent);
    color: #fff !important;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s;
}

.stk-ai-export-btn:hover {
    background: #333333;
    text-decoration: none;
}

.stk-ai-export-meta {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--stk-chat-muted);
}

.stk-ai-typing {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--stk-chat-surface) !important;
    border-top: 1px solid var(--stk-chat-border);
    min-height: 2.25rem;
}

.stk-ai-typing.hidden {
    display: none;
}

.stk-ai-typing-dots {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.stk-ai-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--stk-chat-muted);
    animation: stk-ai-dot 1.2s ease-in-out infinite;
}

.stk-ai-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.stk-ai-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes stk-ai-dot {
    0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
    40% { opacity: 1; transform: scale(1); }
}

.stk-ai-typing-text {
    font-size: 0.8125rem;
    color: var(--stk-chat-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stk-ai-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--stk-chat-bg) !important;
    border-top: 1px solid var(--stk-chat-border);
}

.stk-ai-input-wrap {
    flex: 1;
    min-width: 0;
    background: var(--stk-chat-surface);
    border: 1px solid var(--stk-chat-border);
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.stk-ai-input-wrap:focus-within {
    border-color: var(--stk-chat-accent);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.stk-ai-input {
    display: block;
    width: 100%;
    resize: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    font-family: var(--stk-chat-font);
    line-height: 1.45;
    min-height: 1.45em;
    background: transparent !important;
    color: var(--stk-chat-fg) !important;
    outline: none;
    overflow-x: hidden;
    overflow-y: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    -webkit-text-fill-color: var(--stk-chat-fg);
    caret-color: var(--stk-chat-accent);
}

.stk-ai-input::placeholder {
    color: #9ca3af;
}

.stk-ai-input:disabled {
    opacity: 0.55;
}

.stk-ai-send,
.stk-ai-cancel {
    flex-shrink: 0;
    height: 40px;
    min-width: 40px;
    padding: 0 0.65rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}

.stk-ai-send {
    background: var(--stk-chat-accent);
    color: #fff;
}

.stk-ai-send:hover {
    background: #333333;
}

.stk-ai-send:active {
    transform: scale(0.96);
}

.stk-ai-cancel {
    background: #fee2e2;
    color: #dc2626;
    min-width: auto;
    padding: 0 0.75rem;
}

.stk-ai-cancel:hover {
    background: #fecaca;
}

.stk-ai-send.hidden,
.stk-ai-cancel.hidden {
    display: none;
}

.stk-ai-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .stk-ai-panel {
        width: calc(100vw - 1.5rem);
        left: 0.75rem !important;
        right: auto;
        border-radius: 10px;
    }

    .stk-ai-bubble {
        max-width: 92%;
    }
}