/* ── Admin Dashboard — BE2 ──────────────────────────────────────────────── */
/* Inherits variables from main.css (loaded first in index.html)             */

/* ── Top bar ────────────────────────────────────────────────────────────── */

#admin-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 14px;
    z-index: 100;
}

#admin-wordmark {
    font-size: 21px;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
    flex-shrink: 0;
}
#admin-wordmark:hover { color: var(--text-bright); }

#admin-title {
    font-size: 14px;
    color: var(--text-dim);
    flex: 1;
}

#admin-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
}

.adm-role-badge {
    font-size: 10px;
    padding: 1px 5px;
    border: 1px solid var(--accent-dim);
    border-radius: 2px;
    color: var(--accent);
}

/* ── Main layout ────────────────────────────────────────────────────────── */

#admin-main {
    margin-top: var(--topbar-h);
    padding: 20px 24px;
    max-width: 960px;
}

.adm-denied-msg {
    color: var(--text-dim);
    margin-top: 40px;
    font-size: 15px;
}
.adm-denied-msg a { color: var(--accent); text-decoration: none; }
.adm-denied-msg a:hover { text-decoration: underline; }

/* ── Sections ───────────────────────────────────────────────────────────── */

.adm-section {
    margin-bottom: 36px;
}

.adm-section-hdr {
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    padding-bottom: 4px;
}

.adm-section-hdr h2 {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-bright);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.adm-count {
    font-size: 11px;
    background: var(--accent);
    color: #000;
    border-radius: 10px;
    padding: 1px 7px;
    font-weight: bold;
}

.adm-empty {
    color: var(--text-dim);
    font-size: 13px;
    padding: 6px 0;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */

.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.adm-table th {
    text-align: left;
    color: var(--text-dim);
    font-weight: normal;
    padding: 4px 10px 4px 0;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.adm-table td {
    padding: 6px 10px 6px 0;
    color: var(--text);
    border-bottom: 1px solid #1e1e1e;
    vertical-align: middle;
}

.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: var(--bg2); }

/* Role badges in table */
.adm-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 2px;
    border: 1px solid;
    white-space: nowrap;
}
.adm-badge.role-user      { color: var(--badge-coll);  border-color: #3a5f8a; }
.adm-badge.role-admin     { color: var(--accent);       border-color: var(--accent-dim); }
.adm-badge.role-suspended { color: #a04040;             border-color: #6a2020; }
.adm-badge.role-unverified{ color: var(--text-dim);     border-color: #444; }

/* Action buttons in table */
.adm-action-btns { display: flex; gap: 6px; flex-wrap: nowrap; }

.adm-btn {
    background: var(--btn-bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 11px;
    padding: 3px 9px;
    cursor: pointer;
    border-radius: 2px;
    white-space: nowrap;
    transition: background 0.1s, color 0.1s;
}
.adm-btn:hover          { background: var(--btn-hover); color: var(--text-bright); }
.adm-btn:disabled       { opacity: 0.35; cursor: not-allowed; }
.adm-btn-primary        { border-color: var(--accent-dim); color: var(--accent); }
.adm-btn-primary:hover  { background: #1e1700; }
.adm-btn-danger         { border-color: #6a2020; color: #c05050; }
.adm-btn-danger:hover   { background: #1a0808; }
.adm-btn-warn           { border-color: #7a6425; color: #c8a84b; }
.adm-btn-warn:hover     { background: #1e1700; }

/* ── Library stat tiles ─────────────────────────────────────────────────── */

.adm-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.adm-stat {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 12px 16px;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.adm-stat span {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-bright);
}

.adm-stat label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Maintenance ────────────────────────────────────────────────────────── */

.adm-maint-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.adm-maint-status {
    font-size: 12px;
    color: var(--text-dim);
}
.adm-maint-status.running { color: var(--accent); }

.adm-maint-actions {
    margin: 8px 0 0 0;
    padding-left: 18px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.8;
    list-style: disc;
}

.adm-maint-last {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.6;
}
