/* Admin area. One set of building blocks so every admin page looks and behaves the same:
   page header, cards with a head and body, stat tiles, entity lists, empty states. */

.adm-layout { min-height: 100vh; }

/* ---------- App bar & navigation ---------- */
.adm-appbar.mud-appbar {
    border-bottom: 1px solid var(--blade-edge);
    background: rgba(12, 11, 9, .97) !important;
    backdrop-filter: blur(10px);
}
.adm-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--blade-text); text-decoration: none; }
.adm-brand img { height: 30px; width: auto; }
.adm-brand-tag {
    padding: 2px 8px; border: 1px solid var(--blade-edge-strong); border-radius: 4px;
    font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--blade-brass);
}
.adm-appbar-status { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--blade-muted); white-space: nowrap; }
.adm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mud-palette-success); box-shadow: 0 0 0 3px rgba(124, 150, 96, .2); }
.adm-dot.off { background: var(--mud-palette-error); box-shadow: 0 0 0 3px rgba(200, 74, 56, .2); }

@media (max-width: 640px) {
    .adm-brand-tag, .adm-appbar-status { display: none; }
    .adm-brand img { height: 26px; }
}

.adm-drawer.mud-drawer { border-right: 1px solid var(--blade-edge); background: #0f0e0c; }
.adm-nav { padding: 12px 8px 24px; }
.adm-nav-heading {
    display: block; padding: 18px 12px 6px; font-size: .68rem; font-weight: 800;
    letter-spacing: .14em; text-transform: uppercase; color: rgba(183, 170, 146, .7);
}
.adm-nav .mud-nav-link { border-radius: 6px; margin: 1px 0; padding: 7px 12px; font-weight: 600; font-size: .9rem; }
.adm-nav .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: rgba(201, 166, 106, .13) !important; color: var(--blade-brass-soft) !important;
    box-shadow: inset 3px 0 0 var(--blade-brass);
}
.adm-nav .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon { color: var(--blade-brass) !important; }
.adm-nav .mud-nav-link-text { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.adm-nav-count {
    min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--mud-palette-primary);
    color: #fff; font-size: .7rem; font-weight: 800; line-height: 18px; text-align: center;
}

.adm-main { padding: 28px clamp(16px, 3vw, 40px) 64px; }
.adm-container { max-width: 1480px; margin: 0 auto; }

/* ---------- Page ---------- */
.adm-page { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.adm-page-header {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding-bottom: 16px; border-bottom: 1px solid var(--blade-edge);
}
.adm-page-header h1 { margin: 0; font-family: Cinzel, Georgia, serif; font-size: clamp(1.4rem, 2vw, 1.85rem); font-weight: 800; color: var(--blade-text); }
.adm-page-header p { margin: 4px 0 0; color: var(--blade-muted); font-size: .9rem; max-width: 70ch; }

/* ---------- Cards ---------- */
.adm-card.mud-paper {
    min-width: 0; border: 1px solid var(--blade-edge); border-radius: 8px;
    background: linear-gradient(180deg, rgba(26, 23, 19, .96), rgba(17, 15, 13, .97));
}
.adm-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 14px 18px; border-bottom: 1px solid rgba(201, 166, 106, .14);
}
.adm-card-head-text { min-width: 0; }
.adm-card-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; font-weight: 700; color: var(--blade-text); }
.adm-card-title .mud-icon-root { color: var(--blade-brass); font-size: 1.15rem; }
.adm-card-sub { margin: 2px 0 0; color: var(--blade-muted); font-size: .82rem; }
.adm-card-body { padding: 16px 18px; }
.adm-card-body.flush { padding: 0; }
.adm-card-foot { padding: 10px 18px; border-top: 1px solid rgba(201, 166, 106, .14); color: var(--blade-muted); font-size: .8rem; }

/* Tables inside cards sit flush with the card edges. */
.adm-card .mud-table, .adm-card .mud-simple-table { background: transparent; }
.adm-card .mud-table-cell, .adm-card .mud-simple-table td, .adm-card .mud-simple-table th { padding-left: 18px; }
.adm-table .adm-mono { white-space: nowrap; }
.adm-table th { color: var(--blade-muted) !important; font-size: .74rem; font-weight: 800 !important; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Tabs ---------- */
.adm-tabs .mud-tabs-tabbar { border: 1px solid var(--blade-edge); border-radius: 8px; background: rgba(23, 21, 18, .9); }
.adm-tabs .mud-tab { min-height: 46px; text-transform: none; font-weight: 700; letter-spacing: 0; color: var(--blade-muted); }
.adm-tabs .mud-tab.mud-tab-active { color: var(--blade-brass-soft); }
.adm-tabs .mud-tab .mud-icon-root { font-size: 1.15rem; }
.adm-tabs .mud-tab-slider { background: var(--blade-brass) !important; }

/* ---------- Layout helpers ---------- */
.adm-grid { display: grid; gap: 20px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.adm-span-12 { grid-column: span 12; } .adm-span-8 { grid-column: span 8; } .adm-span-7 { grid-column: span 7; }
.adm-span-6 { grid-column: span 6; } .adm-span-5 { grid-column: span 5; } .adm-span-4 { grid-column: span 4; }
@media (max-width: 1100px) { .adm-span-8, .adm-span-7, .adm-span-6, .adm-span-5, .adm-span-4 { grid-column: span 12; } }

.adm-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.adm-row > .mud-input-control, .adm-row > .adm-grow { flex: 1 1 180px; min-width: 0; }
.adm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.adm-actions.end { justify-content: flex-end; }
.adm-stack { display: flex; flex-direction: column; gap: 14px; }
.adm-split { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .adm-split { grid-template-columns: 1fr; } }
.adm-sticky { position: sticky; top: 84px; }
@media (max-width: 1000px) { .adm-sticky { position: static; } }

.adm-muted { color: var(--blade-muted); }
.adm-small { font-size: .8rem; }
.adm-mono { font-family: Consolas, "JetBrains Mono", monospace; font-size: .82rem; overflow-wrap: anywhere; }
.adm-label { display: block; margin-bottom: 4px; color: var(--blade-muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.adm-divider { height: 1px; margin: 4px 0; background: rgba(201, 166, 106, .14); }

/* ---------- Stat tiles ---------- */
.adm-stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.adm-stat {
    display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; min-width: 0;
    border: 1px solid var(--blade-edge); border-radius: 8px; background: rgba(23, 21, 18, .9);
    color: inherit; text-decoration: none; transition: border-color .15s, background .15s;
}
a.adm-stat:hover { border-color: var(--blade-edge-strong); background: rgba(35, 30, 24, .95); }
.adm-stat-label { display: flex; align-items: center; gap: 6px; color: var(--blade-muted); font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.adm-stat-label .mud-icon-root { font-size: 1rem; color: var(--blade-brass); }
.adm-stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; color: var(--blade-text); }
.adm-stat-hint { color: var(--blade-muted); font-size: .78rem; }
.adm-stat.attention { border-color: rgba(200, 146, 69, .65); }
.adm-stat.attention .adm-stat-value { color: var(--mud-palette-warning); }

/* ---------- Entity lists (players, records) ---------- */
.adm-list { display: flex; flex-direction: column; }
.adm-list-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 18px; border: 0;
    border-bottom: 1px solid rgba(201, 166, 106, .08); background: transparent; color: inherit;
    text-align: left; font: inherit; cursor: pointer; text-decoration: none;
}
.adm-list-item:last-child { border-bottom: 0; }
.adm-list-item:hover { background: rgba(201, 166, 106, .06); }
.adm-list-item.active { background: rgba(201, 166, 106, .13); box-shadow: inset 3px 0 0 var(--blade-brass); }
.adm-list-item.static { cursor: default; }
.adm-list-item.static:hover { background: transparent; }
.adm-list-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.adm-list-title { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.adm-list-meta { overflow: hidden; color: var(--blade-muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.adm-list-side { flex: none; color: var(--blade-muted); font-size: .78rem; text-align: right; }
.adm-avatar {
    display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: rgba(201, 166, 106, .14); color: var(--blade-brass-soft); font-weight: 800; font-size: .85rem;
}
.adm-avatar.online { box-shadow: 0 0 0 2px var(--mud-palette-success); }
.adm-list-group { padding: 12px 18px 6px; color: rgba(183, 170, 146, .75); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Empty states ---------- */
.adm-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; color: var(--blade-muted); text-align: center; }
.adm-empty .mud-icon-root { font-size: 2.4rem; color: rgba(201, 166, 106, .55); }
.adm-empty strong { color: var(--blade-text); font-size: 1rem; text-transform: none; letter-spacing: 0; }
.adm-empty { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---------- Player header ---------- */
.adm-profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.adm-profile .adm-avatar { width: 56px; height: 56px; font-size: 1.3rem; }
.adm-profile-name { margin: 0; font-family: Cinzel, Georgia, serif; font-size: 1.5rem; font-weight: 800; overflow-wrap: anywhere; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ---------- Tiles of actions (inspect) ---------- */
.adm-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.adm-tile.mud-button-root { justify-content: flex-start; padding: 12px 14px; border-color: var(--blade-edge); }
.adm-tile .mud-button-label { justify-content: flex-start; }

/* ---------- Chat log ---------- */
.adm-chat { height: min(62vh, 640px); overflow-y: auto; font-size: .88rem; }
.adm-chat-line { display: grid; grid-template-columns: 70px 64px minmax(80px, 140px) minmax(0, 1fr); gap: 10px; padding: 6px 18px; border-bottom: 1px solid rgba(201, 166, 106, .06); }
.adm-chat-line:hover { background: rgba(201, 166, 106, .05); }
.adm-chat-time { color: var(--blade-muted); font-family: Consolas, monospace; font-size: .8rem; }
.adm-chat-channel { color: var(--blade-muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.adm-chat-channel.global { color: var(--blade-brass); }
.adm-chat-name { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.adm-chat-name a { color: inherit; text-decoration: none; }
.adm-chat-name a:hover { text-decoration: underline; }
.adm-chat-text { overflow-wrap: anywhere; }
.adm-chat-line.flagged { background: rgba(200, 146, 69, .1); box-shadow: inset 3px 0 0 var(--mud-palette-warning); }
@media (max-width: 700px) {
    .adm-chat-line { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Review cards ---------- */
.adm-review { padding: 14px 18px; border-bottom: 1px solid rgba(201, 166, 106, .1); }
.adm-review:last-child { border-bottom: 0; }
.adm-quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--mud-palette-warning); background: rgba(0, 0, 0, .25); border-radius: 0 4px 4px 0; overflow-wrap: anywhere; }
.adm-context { margin: 8px 0 0; padding: 10px 12px; max-height: 220px; overflow: auto; border-radius: 4px; background: rgba(0, 0, 0, .3); white-space: pre-wrap; overflow-wrap: anywhere; font-family: Consolas, monospace; font-size: .8rem; }

/* ---------- Login ---------- */
.adm-login { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.adm-login-card.mud-paper { width: min(420px, 100%); padding: 32px; border: 1px solid var(--blade-edge-strong); border-radius: 10px; background: linear-gradient(180deg, rgba(36, 29, 22, .98), rgba(12, 10, 8, .98)); box-shadow: var(--blade-card-shadow); }
.adm-login-card img { display: block; width: 220px; max-width: 80%; margin: 0 auto 18px; }
.adm-login-card h1 { margin: 0 0 4px; font-family: Cinzel, Georgia, serif; font-size: 1.4rem; text-align: center; }
.adm-login-card p { margin: 0 0 20px; color: var(--blade-muted); text-align: center; font-size: .88rem; }

/* Admin access: the add-login fields and buttons on one line, all the same height. */
.adm-login-add { align-items: center; }
.adm-login-add > .mud-input-control { margin: 0; }
.adm-login-add > .mud-button-root { height: 40px; white-space: nowrap; flex: none; }

/* Players page: account name, platform ID and Discord under the name. */
.adm-player-ids { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: flex-start; }
.adm-player-ids > div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.adm-player-id { display: inline-flex; align-items: center; gap: 2px; }

/* Chat log grid (16 Nov 2026): flagged rows tinted; time, channel, status and actions stay on one line. */
.adm-chat-grid .mud-table-row.flagged { background: rgba(255, 170, 0, .07); }
.adm-chat-grid .mud-table-cell { vertical-align: top; }
.adm-nowrap { white-space: nowrap; }
@media (max-width: 720px) { .adm-chat-grid .adm-nowrap { white-space: normal; } }
