/* =========================================================
   Autenticket – Painel do Organizador
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --ato-bg:          #0f1117;
    --ato-bg-card:     #1a1d27;
    --ato-bg-hover:    #22263a;
    --ato-border:      #2a2f45;
    --ato-accent:      #ff5c35;
    --ato-accent-2:    #ff8c42;
    --ato-green:       #22c55e;
    --ato-yellow:      #facc15;
    --ato-blue:        #3b82f6;
    --ato-text:        #e8eaf0;
    --ato-text-muted:  #8b90a8;
    --ato-radius:      14px;
    --ato-radius-sm:   8px;
    --ato-shadow:      0 4px 24px rgba(0,0,0,.4);
    --ato-font:        'Plus Jakarta Sans', system-ui, sans-serif;
    --ato-grad:        linear-gradient(135deg, var(--ato-accent) 0%, var(--ato-accent-2) 100%);
}

/* ---- Reset contextual ---- */
#ato-app, #ato-app * { box-sizing: border-box; }
#ato-app {
    font-family: var(--ato-font);
    color: var(--ato-text);
    background: var(--ato-bg);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* =========================================================
   Login / Acesso negado
   ========================================================= */
.ato-login-wall {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 24px;
}
.ato-login-card {
    background: var(--ato-bg-card);
    border: 1px solid var(--ato-border);
    border-radius: var(--ato-radius);
    padding: 48px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--ato-shadow);
}
.ato-brand { margin-bottom: 36px; }
.ato-brand-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.ato-brand h1 {
    font-size: 28px;
    font-weight: 800;
    background: var(--ato-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 8px;
}
.ato-brand p { color: var(--ato-text-muted); margin: 0; }

/* =========================================================
   Header
   ========================================================= */
.ato-header {
    background: var(--ato-bg-card);
    border-bottom: 1px solid var(--ato-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.ato-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.ato-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
}
.ato-ticket-icon { font-size: 22px; }
.ato-header__title {
    background: var(--ato-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ato-header__user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ato-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ato-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.ato-header__user-info { display: flex; flex-direction: column; line-height: 1.2; }
.ato-header__user-name { font-weight: 600; font-size: 14px; }
.ato-header__user-role { font-size: 11px; color: var(--ato-accent); text-transform: uppercase; letter-spacing: .06em; }

/* =========================================================
   Nav
   ========================================================= */
.ato-nav {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--ato-border);
    background: var(--ato-bg);
}
.ato-nav__tab {
    background: none;
    border: none;
    color: var(--ato-text-muted);
    font-family: var(--ato-font);
    font-size: 14px;
    font-weight: 600;
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color .2s, border-color .2s;
}
.ato-nav__tab:hover { color: var(--ato-text); }
.ato-nav__tab.is-active { color: var(--ato-accent); border-bottom-color: var(--ato-accent); }

/* =========================================================
   Tab content
   ========================================================= */
.ato-tab-content {
    display: none;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px;
}
.ato-tab-content.is-active { display: block; }

/* =========================================================
   KPIs
   ========================================================= */
.ato-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.ato-kpi-card {
    background: var(--ato-bg-card);
    border: 1px solid var(--ato-border);
    border-radius: var(--ato-radius);
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .2s, border-color .2s;
}
.ato-kpi-card:hover { transform: translateY(-2px); border-color: var(--ato-accent); }
.ato-kpi-icon { font-size: 32px; flex-shrink: 0; }
.ato-kpi-body { display: flex; flex-direction: column; gap: 4px; }
.ato-kpi-label { font-size: 12px; color: var(--ato-text-muted); text-transform: uppercase; letter-spacing: .06em; }
.ato-kpi-value { font-size: 26px; font-weight: 800; color: var(--ato-text); }

/* =========================================================
   Cards
   ========================================================= */
.ato-card {
    background: var(--ato-bg-card);
    border: 1px solid var(--ato-border);
    border-radius: var(--ato-radius);
    padding: 24px;
    margin-bottom: 20px;
}
.ato-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ato-text);
    margin: 0 0 20px;
}
.ato-card__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.ato-card__toolbar .ato-card__title { margin: 0; }

/* Chart row */
.ato-chart-row {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
}
.ato-chart-wrap { position: relative; height: 260px; }
.ato-card--rank { display: flex; flex-direction: column; }

.ato-rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ato-rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.ato-rank-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ato-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--ato-text-muted);
    flex-shrink: 0;
}
.ato-rank-item:first-child .ato-rank-num { background: var(--ato-grad); color: #fff; }
.ato-rank-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ato-rank-value { font-weight: 700; color: var(--ato-accent); white-space: nowrap; }

/* =========================================================
   Tabelas
   ========================================================= */
.ato-table-wrap { overflow-x: auto; }
.ato-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.ato-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--ato-bg);
    color: var(--ato-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--ato-border);
    white-space: nowrap;
}
.ato-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--ato-border);
    vertical-align: middle;
}
.ato-table tbody tr:hover { background: var(--ato-bg-hover); }
.ato-table .ato-empty { color: var(--ato-text-muted); text-align: center; padding: 40px; }

.ato-table-footer { font-size: 13px; color: var(--ato-text-muted); padding: 12px 0 0; }

/* Badges */
.ato-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ato-badge--green  { background: rgba(34,197,94,.15); color: var(--ato-green); }
.ato-badge--red    { background: rgba(239,68,68,.15);  color: #ef4444; }
.ato-badge--yellow { background: rgba(250,204,21,.15); color: var(--ato-yellow); }
.ato-badge--blue   { background: rgba(59,130,246,.15); color: var(--ato-blue); }
.ato-badge--gray   { background: rgba(139,144,168,.15);color: var(--ato-text-muted); }

/* =========================================================
   Buttons & Inputs
   ========================================================= */
.ato-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--ato-radius-sm);
    font-family: var(--ato-font);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: opacity .2s, transform .15s;
    white-space: nowrap;
}
.ato-btn:hover { opacity: .85; transform: translateY(-1px); }
.ato-btn--primary  { background: var(--ato-grad); color: #fff; }
.ato-btn--secondary{ background: var(--ato-bg-hover); color: var(--ato-text); border: 1px solid var(--ato-border); }
.ato-btn--ghost    { background: transparent; color: var(--ato-text-muted); border: 1px solid var(--ato-border); }
.ato-btn--sm       { padding: 6px 12px; font-size: 12px; }
.ato-btn--full     { width: 100%; justify-content: center; }
.ato-btn--link     { background: none; color: var(--ato-accent); padding: 0; border: none; font-size: 13px; }

.ato-input {
    background: var(--ato-bg);
    border: 1px solid var(--ato-border);
    border-radius: var(--ato-radius-sm);
    color: var(--ato-text);
    font-family: var(--ato-font);
    font-size: 13.5px;
    padding: 8px 12px;
    outline: none;
    transition: border-color .2s;
    min-width: 0;
}
.ato-input:focus { border-color: var(--ato-accent); }

.ato-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}
.ato-select-wrap select { min-width: 240px; }
.ato-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* =========================================================
   Loader
   ========================================================= */
.ato-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    gap: 16px;
    color: var(--ato-text-muted);
}
.ato-loader.is-visible { display: flex; }
.ato-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ato-border);
    border-top-color: var(--ato-accent);
    border-radius: 50%;
    animation: ato-spin .8s linear infinite;
}
@keyframes ato-spin { to { transform: rotate(360deg); } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
    .ato-chart-row { grid-template-columns: 1fr; }
    .ato-card--rank { order: -1; }
}
@media (max-width: 640px) {
    .ato-kpi-grid { grid-template-columns: 1fr 1fr; }
    .ato-header__user-info { display: none; }
    .ato-nav__tab { padding: 14px 12px; font-size: 13px; }
}
