/* AAA admin dashboard — heatmap, contested ops, extension histograms. */

.aaa-dash-body { margin: 0; min-height: 100vh; }
.aaa-dash-shell {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 24px 40px;
    position: relative;
    z-index: 1;
}

.aaa-dash-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.aaa-dash-spec-pick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.45);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
}
.aaa-dash-spec-pick select {
    background: #ffffff;
    color: var(--aaa-ink);
    border: 0;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 600;
    cursor: pointer;
}

.aaa-dash-title {
    background: var(--aaa-panel-soft);
    border-radius: var(--aaa-radius);
    padding: 22px 28px;
    margin-bottom: 16px;
    box-shadow: var(--aaa-shadow);
}
.aaa-dash-title h1 { margin: 0 0 6px; font-size: 1.55rem; color: var(--aaa-ink); }
.aaa-dash-subtitle { margin: 0; color: var(--aaa-ink-soft); }

.aaa-dash-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.aaa-kpi {
    background: var(--aaa-panel);
    border-radius: var(--aaa-radius);
    padding: 18px 20px;
    box-shadow: var(--aaa-shadow-sm);
}
.aaa-kpi-label {
    color: var(--aaa-ink-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin: 0 0 8px;
}
.aaa-kpi-value {
    color: var(--aaa-ink);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}
.aaa-kpi-foot {
    color: var(--aaa-ink-muted);
    font-size: 0.78rem;
    margin: 6px 0 0;
}

.aaa-dash-block {
    background: var(--aaa-panel);
    border-radius: var(--aaa-radius);
    padding: 20px 24px;
    box-shadow: var(--aaa-shadow);
    margin-bottom: 18px;
}
.aaa-dash-block-title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: var(--aaa-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}
.aaa-dash-block-title i { color: var(--aaa-accent); }
.aaa-dash-block-sub {
    margin: 0 0 14px;
    color: var(--aaa-ink-muted);
    font-size: 0.85rem;
}

.aaa-dash-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}
@media (max-width: 900px) { .aaa-dash-grid-2 { grid-template-columns: 1fr; } }

/* Heatmap */
.aaa-heatmap-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 8px;
}
.aaa-heatmap-row-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--aaa-ink);
    font-size: 0.92rem;
}
.aaa-heatmap-cells {
    display: grid;
    gap: 4px;
}
.aaa-heat-cell {
    aspect-ratio: 2 / 1;
    border-radius: 6px;
    background: var(--aaa-accent-soft);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.95);
    font-weight: 600;
    cursor: help;
}
.aaa-heat-cell.outline { box-shadow: inset 0 0 0 2px #047857; }
.aaa-heat-cell .aaa-heat-label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, -4px);
    background: var(--aaa-ink);
    color: #ffffff;
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
    z-index: 10;
}
.aaa-heat-cell:hover .aaa-heat-label { opacity: 1; }

.aaa-dash-legend {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--aaa-ink-soft);
    flex-wrap: wrap;
}
.aaa-legend-swatch {
    display: inline-block;
    width: 18px;
    height: 14px;
    border-radius: 3px;
}
.aaa-legend-outline {
    background: transparent;
    box-shadow: inset 0 0 0 2px #047857;
}
.aaa-legend-divider {
    width: 1px;
    background: var(--aaa-line);
    height: 14px;
    margin: 0 8px;
}

/* Contested list */
.aaa-dash-contested {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: row;
}
.aaa-dash-contested li {
    counter-increment: row;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: var(--aaa-line-soft);
    border-radius: 6px;
    margin-bottom: 6px;
}
.aaa-dash-contested li::before {
    content: counter(row);
    background: var(--aaa-accent);
    color: #ffffff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
}
.aaa-contested-label { color: var(--aaa-ink); font-size: 0.9rem; }
.aaa-contested-label small { color: var(--aaa-ink-muted); display: block; margin-top: 2px; }
.aaa-contested-pct {
    background: #fff7ed;
    color: #b45309;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Extension type bars */
.aaa-ext-activity {
    margin-bottom: 14px;
}
.aaa-ext-activity-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--aaa-ink);
    margin: 0 0 6px;
}
.aaa-ext-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.aaa-ext-bar {
    background: var(--aaa-line-soft);
    border-radius: 4px;
    text-align: center;
    padding: 6px 2px 4px;
    position: relative;
    overflow: hidden;
}
.aaa-ext-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #8b5cf6 0%, var(--aaa-accent) 100%);
    transition: height 0.3s ease;
}
.aaa-ext-bar-label, .aaa-ext-bar-count {
    position: relative;
    z-index: 1;
    font-size: 0.72rem;
    color: var(--aaa-ink);
    font-weight: 600;
}
.aaa-ext-bar-count { display: block; opacity: 0.8; }
.aaa-ext-bar.has-fill .aaa-ext-bar-label,
.aaa-ext-bar.has-fill .aaa-ext-bar-count { color: #ffffff; }

/* Submissions table */
.aaa-dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.aaa-dash-table th, .aaa-dash-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--aaa-line);
}
.aaa-dash-table th {
    color: var(--aaa-ink-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}
.aaa-dash-table tbody tr { cursor: pointer; transition: background 0.1s; }
.aaa-dash-table tbody tr:hover { background: var(--aaa-line-soft); }

/* Modal */
.aaa-dash-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.aaa-dash-modal-card {
    background: var(--aaa-panel);
    border-radius: var(--aaa-radius);
    max-width: 880px;
    width: 100%;
    max-height: 86vh;
    overflow: auto;
    padding: 22px 26px;
    position: relative;
    box-shadow: var(--aaa-shadow);
}
.aaa-dash-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: 0;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--aaa-ink-muted);
}
.aaa-dash-modal-card h3 { margin: 0 0 14px; color: var(--aaa-ink); }
.aaa-modal-activity {
    background: var(--aaa-line-soft);
    border-radius: var(--aaa-radius-sm);
    padding: 10px 14px;
    margin-bottom: 10px;
}
.aaa-modal-activity h4 { margin: 0 0 6px; font-size: 0.95rem; color: var(--aaa-accent-strong); }
.aaa-modal-op {
    font-size: 0.82rem;
    color: var(--aaa-ink);
    margin: 4px 0;
    padding: 4px 6px;
    background: #ffffff;
    border-radius: 4px;
    display: grid;
    grid-template-columns: 1.6fr 0.8fr 0.6fr 1fr;
    gap: 6px;
}
.aaa-modal-op strong { color: var(--aaa-ink); }
.aaa-modal-tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.aaa-modal-tag.agree { background: #d1fae5; color: #065f46; }
.aaa-modal-tag.disagree { background: var(--aaa-accent-soft); color: var(--aaa-accent-strong); }
.aaa-modal-tag.contested { background: #fed7aa; color: #9a3412; }

.aaa-dash-empty {
    background: var(--aaa-panel);
    border-radius: var(--aaa-radius);
    padding: 60px 20px;
    text-align: center;
    color: var(--aaa-ink-muted);
    box-shadow: var(--aaa-shadow-sm);
}
.aaa-dash-empty i { font-size: 2rem; opacity: 0.4; display: block; margin-bottom: 12px; }

/* v1.2.0 additions */
.aaa-schema-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.aaa-schema-v12 { background: #d1fae5; color: #065f46; }
.aaa-schema-legacy { background: #fef3c7; color: #92400e; }

.aaa-modal-subtasks {
    list-style: none;
    margin: 6px 0 12px 16px;
    padding: 0;
    font-size: 0.82rem;
    color: var(--aaa-ink-muted);
}
.aaa-modal-subtasks li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0;
    border-bottom: 1px dashed #e5e7eb;
}
.aaa-modal-subtask-label { flex: 1; }
.aaa-modal-subtask-nums {
    font-variant-numeric: tabular-nums;
    color: #4b5563;
    font-weight: 500;
}

.aaa-lang-select {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    font-size: 0.9rem;
}
