/*
   AduoraSecurityPanel admin theme.

   Served from the application itself rather than a CDN, which is what lets the Content-Security-
   Policy stay at style-src 'self' with no unsafe-inline. Layered on top of the local Bootstrap
   build that ships in wwwroot/lib.
*/

:root {
    --aduora-bg: #f4f6fa;
    --aduora-surface: #ffffff;
    --aduora-sidebar: #16213a;
    --aduora-sidebar-hover: #223055;
    --aduora-border: #dfe4ee;
    --aduora-text: #1d2433;
    --aduora-muted: #6b7488;
    --aduora-accent: #2a63d9;
    --aduora-radius: 10px;
}

body {
    background: var(--aduora-bg);
    color: var(--aduora-text);
    font-size: 0.925rem;
}

/* ---------- shell ---------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 246px;
    flex-shrink: 0;
    background: var(--aduora-sidebar);
    color: #cdd5e6;
    padding: 18px 0 32px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 20px 22px;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--aduora-accent);
    color: #fff;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.brand-text {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.nav-heading {
    padding: 18px 20px 6px;
    font-size: 0.7rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #7c88a5;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 20px;
    color: #cdd5e6;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--aduora-sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background: var(--aduora-sidebar-hover);
    border-left-color: var(--aduora-accent);
    color: #fff;
}

.badge-pill {
    background: #d9534f;
    color: #fff;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 600;
}

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

.app-topbar {
    background: var(--aduora-surface);
    border-bottom: 1px solid var(--aduora-border);
    padding: 14px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    color: var(--aduora-muted);
    font-size: 0.85rem;
}

.app-content {
    padding: 24px 26px 48px;
    flex: 1;
}

/* ---------- cards and stats ---------- */

.card {
    border: 1px solid var(--aduora-border);
    border-radius: var(--aduora-radius);
    box-shadow: 0 1px 2px rgba(20, 30, 60, 0.04);
}

.card-header {
    background: var(--aduora-surface);
    border-bottom: 1px solid var(--aduora-border);
    font-weight: 600;
    font-size: 0.9rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--aduora-surface);
    border: 1px solid var(--aduora-border);
    border-radius: var(--aduora-radius);
    padding: 16px 18px;
}

.stat-label {
    color: var(--aduora-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 650;
    line-height: 1.3;
}

.stat-card.is-warning { border-left: 4px solid #e0a800; }
.stat-card.is-danger { border-left: 4px solid #d9534f; }
.stat-card.is-good { border-left: 4px solid #2f9e5f; }

/* ---------- tables ---------- */

.table {
    background: var(--aduora-surface);
    margin-bottom: 0;
}

.table > thead > tr > th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--aduora-muted);
    border-bottom: 1px solid var(--aduora-border);
    font-weight: 600;
}

.table > tbody > tr > td {
    vertical-align: middle;
}

.table-wrap {
    background: var(--aduora-surface);
    border: 1px solid var(--aduora-border);
    border-radius: var(--aduora-radius);
    overflow: hidden;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
    font-size: 0.84rem;
}

/* ---------- status pills ---------- */

.status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.status-active { background: #e6f5ec; color: #1d7a45; border-color: #bfe4cd; }
.status-pending { background: #fdf3e0; color: #8a5b00; border-color: #f3dfb6; }
.status-expired { background: #eef0f4; color: #5a6274; border-color: #dadfe8; }
.status-suspended { background: #fdeee0; color: #97521a; border-color: #f5d6b8; }
.status-revoked { background: #fbe9e9; color: #a32a2a; border-color: #f0c6c6; }
.status-blocked { background: #fbe9e9; color: #a32a2a; border-color: #f0c6c6; }
.status-inactive { background: #eef0f4; color: #5a6274; border-color: #dadfe8; }

.sev-info, .sev-low { background: #eef0f4; color: #5a6274; }
.sev-medium { background: #fdf3e0; color: #8a5b00; }
.sev-high { background: #fdeee0; color: #97521a; }
.sev-critical { background: #fbe9e9; color: #a32a2a; }

/* ---------- one-time secret display ---------- */

.secret-box {
    background: #101828;
    color: #e8edf7;
    border-radius: var(--aduora-radius);
    padding: 16px 18px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.02rem;
    letter-spacing: 0.04em;
    word-break: break-all;
}

/* ---------- sign-in ---------- */

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(160deg, #16213a 0%, #223055 100%);
}

.auth-card {
    width: 100%;
    max-width: 410px;
    background: var(--aduora-surface);
    border-radius: 14px;
    padding: 30px 30px 26px;
    box-shadow: 0 18px 50px rgba(10, 18, 40, 0.35);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.filters {
    background: var(--aduora-surface);
    border: 1px solid var(--aduora-border);
    border-radius: var(--aduora-radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--aduora-muted);
}

@media (max-width: 900px) {
    .app-sidebar {
        width: 64px;
    }

    .brand-text,
    .nav-heading,
    .nav-item span:not(.badge-pill) {
        display: none;
    }
}
