/* ============================================================
   ACX FLEET COMMAND — eDEX-UI Monochrome
   ============================================================ */

:root {
    --bg:           #080808;
    --bg-panel:     #0f0f0f;
    --bg-panel-alt: #141414;
    --bg-hover:     rgba(255,255,255,0.04);

    --accent:       #ffffff;
    --accent-dim:   rgba(255,255,255,0.35);
    --accent-glow:  rgba(255,255,255,0.06);

    --warn:         #c8c8c8;
    --warn-dim:     rgba(200,200,200,0.3);

    --text:         rgba(255,255,255,0.75);
    --text-dim:     rgba(255,255,255,0.3);
    --text-bright:  #ffffff;

    --border:       rgba(255,255,255,0.12);
    --border-bright:rgba(255,255,255,0.35);

    --font-mono:    'Share Tech Mono', 'Courier New', monospace;
    --font-display: 'Orbitron', sans-serif;
    --transition:   0.18s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.10) 0.8px, transparent 0.8px);
    background-size: 16px 16px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ── Scanlines overlay ── */
.scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0,0,0,0.12) 3px,
        rgba(0,0,0,0.12) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

/* Vignette — darkens edges to focus center */
.noise {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.7) 100%);
    pointer-events: none;
    z-index: 999;
}

/* ── Typography ── */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: 0.08em;
    color: var(--text-bright);
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-dim); }

.accent  { color: var(--text-bright); }
.accent2 { color: var(--warn); }
.green   { color: var(--text-bright); }
.dim     { color: var(--text-dim); }
.bracket { color: var(--accent-dim); }

/* ── Navigation ── */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
    height: 52px;
    background: rgba(8,8,8,0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(6px);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--text-bright);
    text-shadow: 0 0 18px rgba(255,255,255,0.4);
    letter-spacing: 0.15em;
}

.logo-sub {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.2em;
    margin-left: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    border: 1px solid transparent;
    transition: all var(--transition);
}

.nav-link .link-prefix { color: var(--accent-dim); margin-right: 0.25rem; }

.nav-link:hover,
.nav-link.active {
    color: var(--text-bright);
    border-color: var(--border);
    background: var(--accent-glow);
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.nav-admin { margin-left: auto; }
.nav-admin:hover, .nav-admin.active {
    color: var(--warn);
    border-color: var(--warn-dim);
    background: rgba(200,200,200,0.05);
    text-shadow: none;
}

.nav-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.65rem;
    white-space: nowrap;
}

.system-clock {
    color: var(--text-bright);
    letter-spacing: 0.1em;
    font-size: 0.8rem;
}

.system-status {
    color: var(--text-dim);
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ── Status dots ── */
.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-bright);
    box-shadow: 0 0 6px rgba(255,255,255,0.6);
    display: inline-block;
}
.status-dot.blink  { animation: blink 2s infinite; }
.status-dot.orange { background: var(--warn); box-shadow: 0 0 4px var(--warn); }
.status-dot.grey   { background: var(--text-dim); box-shadow: none; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.15; }
}

/* ── Layout ── */
.main-content {
    min-height: calc(100vh - 52px - 36px);
    padding: 1.5rem 2rem;
}

/* ── Panels ── */
.panel {
    background: rgba(15,15,15,0.85);
    border: 1px solid var(--border);
    position: relative;
    padding: 1.25rem 1.5rem;
    backdrop-filter: blur(2px);
}

.panel::before,
.panel::after {
    content: '';
    position: absolute;
    width: 10px; height: 10px;
    border-color: var(--accent);
    border-style: solid;
}
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.panel-title {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--text-bright);
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-title::before {
    content: '';
    display: inline-block;
    width: 3px; height: 12px;
    background: var(--text-bright);
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

/* ── Dashboard grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 1rem;
}

.col-left   { grid-column: 1; display: flex; flex-direction: column; gap: 1rem; }
.col-center { grid-column: 2; display: flex; flex-direction: column; gap: 1rem; }
.col-right  { grid-column: 3; display: flex; flex-direction: column; gap: 1rem; }

/* ── Stat blocks ── */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-block {
    background: rgba(20,20,20,0.85);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    position: relative;
}

.stat-block::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 8px; height: 8px;
    border-top: 2px solid var(--text-bright);
    border-left: 2px solid var(--text-bright);
}

.stat-label {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-bright);
    text-shadow: 0 0 12px rgba(255,255,255,0.3);
    line-height: 1;
}

.stat-value.orange { color: var(--warn); text-shadow: none; }
.stat-value.green  { color: var(--text-bright); }

/* ── Faction card ── */
.faction-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
}

.faction-insignia {
    width: 100px; height: 100px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    background: var(--bg-panel-alt);
    box-shadow: 0 0 24px rgba(255,255,255,0.06), inset 0 0 16px rgba(255,255,255,0.04);
}

.faction-insignia img { width: 80%; height: 80%; object-fit: contain; }

.faction-insignia-placeholder {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-bright);
    text-shadow: 0 0 16px rgba(255,255,255,0.4);
}

.faction-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-bright);
    text-align: center;
}

.faction-meta {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.faction-meta-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.3rem;
}

.faction-meta-row span:last-child { color: var(--text); }

/* ── Branch list ── */
.branch-list { display: flex; flex-direction: column; gap: 0.5rem; }

.branch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    background: rgba(20,20,20,0.7);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
}

.branch-row:hover {
    border-color: var(--border-bright);
    background: var(--accent-glow);
    transform: translateX(3px);
    color: var(--text-bright);
}

.branch-name {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-bright);
}

.branch-count {
    font-size: 0.65rem;
    color: var(--text-dim);
    background: rgba(255,255,255,0.05);
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--border);
}

/* ── Recent units table ── */
.unit-table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }

.unit-table th {
    text-align: left;
    padding: 0.4rem 0.6rem;
    color: var(--text-dim);
    font-family: var(--font-display);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    border-bottom: 1px solid var(--border);
    font-weight: 400;
}

.unit-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text);
    vertical-align: middle;
}

.unit-table tr:hover td { background: var(--accent-glow); }
.unit-table td:first-child { color: var(--text-bright); }

/* ── Status badge ── */
.badge {
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    padding: 0.1rem 0.4rem;
    border: 1px solid;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-active     { color: var(--text-bright); border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.06); }
.badge-prototype  { color: var(--warn);        border-color: rgba(200,200,200,0.3); background: rgba(200,200,200,0.05); }
.badge-retired    { color: var(--text-dim);    border-color: rgba(255,255,255,0.1); background: transparent; }
.badge-classified { color: var(--text-dim);    border-color: rgba(255,255,255,0.1); background: transparent; letter-spacing: 0.3em; }

/* ── Terminal / log panel ── */
.terminal-log {
    font-size: 0.68rem;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 180px;
    overflow-y: auto;
}

.terminal-log::-webkit-scrollbar { width: 3px; }
.terminal-log::-webkit-scrollbar-track { background: transparent; }
.terminal-log::-webkit-scrollbar-thumb { background: var(--border-bright); }

.log-line { display: flex; gap: 0.75rem; }
.log-time { color: var(--accent-dim); white-space: nowrap; flex-shrink: 0; }
.log-msg       { color: var(--text-dim); }
.log-msg.ok    { color: var(--text); }
.log-msg.warn  { color: var(--warn); }
.log-msg.info  { color: var(--text-bright); }

/* ── Progress / fill bars ── */
.bar-wrap { display: flex; flex-direction: column; gap: 0.5rem; }

.bar-row { display: flex; flex-direction: column; gap: 0.2rem; }
.bar-label {
    font-size: 0.62rem;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    letter-spacing: 0.08em;
}
.bar-label span:last-child { color: var(--text); }

.bar-track {
    height: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--text-bright);
    box-shadow: 0 0 6px rgba(255,255,255,0.3);
    transition: width 1s ease;
}

.bar-fill.orange { background: var(--warn); box-shadow: none; }
.bar-fill.green  { background: rgba(255,255,255,0.7); box-shadow: none; }

/* ── Page header ── */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.page-header h1 {
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    color: var(--text-bright);
}

.page-header h1 .accent { text-shadow: 0 0 20px rgba(255,255,255,0.4); }

.breadcrumb {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--text-bright); }

/* ── Footer ── */
.bottom-bar {
    height: 36px;
    background: rgba(8,8,8,0.96);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    font-size: 0.62rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}

/* ── Glitch animation ── */
@keyframes glitch {
    0%   { clip-path: inset(40% 0 61% 0); transform: translate(-2px, 0); }
    20%  { clip-path: inset(92% 0 1%  0); transform: translate(2px,  0); }
    40%  { clip-path: inset(43% 0 1%  0); transform: translate(1px,  0); }
    60%  { clip-path: inset(25% 0 58% 0); transform: translate(-1px, 0); }
    80%  { clip-path: inset(54% 0 7%  0); transform: translate(2px,  0); }
    100% { clip-path: inset(58% 0 43% 0); transform: translate(-2px, 0); }
}

.glitch-text { position: relative; }

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: var(--text-bright);
}

.glitch-text::before {
    animation: glitch 3s infinite linear alternate-reverse;
    opacity: 0.25;
}

.glitch-text::after {
    animation: glitch 2s infinite linear alternate;
    opacity: 0.15;
}

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Search bar ── */
.search-wrap {
    margin-bottom: 1.5rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    background: rgba(15,15,15,0.9);
    position: relative;
    max-width: 100%;
}

.search-box::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 10px; height: 10px;
    border-top: 2px solid var(--text-bright);
    border-left: 2px solid var(--text-bright);
}

.search-box::after {
    content: '';
    position: absolute;
    bottom: -1px; right: -1px;
    width: 10px; height: 10px;
    border-bottom: 2px solid var(--text-bright);
    border-right: 2px solid var(--text-bright);
}

.search-prefix {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
    letter-spacing: 0.12em;
    padding: 1rem 1rem 1rem 1.5rem;
    white-space: nowrap;
    border-right: 1px solid var(--border);
    user-select: none;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-bright);
    letter-spacing: 0.06em;
    padding: 1rem 1.25rem;
    caret-color: var(--text-bright);
}

.search-input::placeholder {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.search-count {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    padding: 1rem 1.5rem;
    border-left: 1px solid var(--border);
    white-space: nowrap;
    font-family: var(--font-mono);
}

/* ── Faction scroll list (Landing_Page.php) ── */
.faction-scroll {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    max-height: calc(100vh - 52px - 36px - 120px - 54px);
    padding-right: 2px;
}

.faction-scroll::-webkit-scrollbar { width: 4px; }
.faction-scroll::-webkit-scrollbar-track { background: var(--bg); }
.faction-scroll::-webkit-scrollbar-thumb { background: var(--border-bright); }

.faction-row {
    display: flex;
    align-items: center;
    height: 5cm;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.45);
    margin-bottom: 6px;
    background: rgba(15,15,15,0.85);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
    gap: 0;
}

.faction-row:last-child { margin-bottom: 0; }

.faction-row:hover {
    border-color: var(--text-bright);
    box-shadow: 0 0 12px rgba(255,255,255,0.08);
}

.faction-row::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: transparent;
    transition: background var(--transition);
}

.faction-row:hover {
    background: rgba(255,255,255,0.04);
}

.faction-row:hover::before {

    background: var(--text-bright);
}

/* Insignia */
.fr-insignia {
    width: 3cm;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    background: rgba(10,10,10,0.4);
}

.fr-insignia img {
    width: 2.4cm;
    height: 2.4cm;
    object-fit: contain;
    border-radius: 50%;
}

.fr-insignia-letter {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--text-bright);
    text-shadow: 0 0 12px rgba(255,255,255,0.3);
}

/* ID tag */
.fr-id {
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    padding: 0 1rem;
    flex-shrink: 0;
    width: 4rem;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.05);
}

/* Name + description */
.fr-main {
    flex: 1;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.05);
    min-width: 0;
}

.fr-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fr-desc {
    font-size: 0.65rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.02em;
}

/* Meta */
.fr-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    padding: 0 1.5rem;
    flex-shrink: 0;
    width: 220px;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.fr-meta-item {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.fr-meta-key {
    font-size: 0.52rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    flex-shrink: 0;
}

.fr-meta-val {
    font-size: 0.65rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Stats */
.fr-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0 1.5rem;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.fr-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
}

.fr-stat-val {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1;
}

.fr-stat-label {
    font-size: 0.5rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

/* Enter button */
.fr-action {
    padding: 0 1.5rem;
    flex-shrink: 0;
}

.fr-btn {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 0.3rem 0.8rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.faction-row:hover .fr-btn {
    color: var(--text-bright);
    border-color: var(--border-bright);
    background: rgba(255,255,255,0.05);
}

.faction-no-results {
    padding: 3rem;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    border: 1px solid var(--border);
    background: rgba(15,15,15,0.5);
}

.faction-empty {
    padding: 3rem;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Galactic map ── */
.map-layout {
    display: flex;
    gap: 1rem;
    height: calc(100vh - 52px - 36px - 90px);
    min-height: 500px;
}

.map-canvas-wrap {
    flex: 1;
    border: 1px solid var(--border);
    background: #050508;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.map-canvas-wrap::before,
.map-canvas-wrap::after {
    content: '';
    position: absolute;
    width: 12px; height: 12px;
    border-color: var(--text-bright);
    border-style: solid;
    z-index: 10;
}
.map-canvas-wrap::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.map-canvas-wrap::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

#galactic-map {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.zone-fill {
    cursor: pointer;
    transition: opacity 0.15s;
}
.zone-fill:hover { opacity: 1.4; }

.map-label {
    font-family: 'Share Tech Mono', monospace;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
}

.map-coords {
    position: absolute;
    bottom: 0.6rem;
    left: 0.8rem;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.25);
    font-family: 'Share Tech Mono', monospace;
    pointer-events: none;
}

/* Info panel */
.map-panel {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

.map-panel::-webkit-scrollbar { width: 3px; }
.map-panel::-webkit-scrollbar-thumb { background: var(--border-bright); }

.map-panel-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    position: relative;
}

.map-panel-section::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 8px; height: 8px;
    border-top: 2px solid var(--text-bright);
    border-left: 2px solid var(--text-bright);
}

/* Legend */
.legend-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.45rem 0.5rem;
    margin: 0 -0.5rem;
    cursor: pointer;
    transition: background var(--transition);
    border: 1px solid transparent;
}

.legend-row:hover,
.legend-row.active {
    background: var(--accent-glow);
    border-color: var(--border);
}

.legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}

.legend-text { display: flex; flex-direction: column; gap: 0.1rem; }

.legend-label {
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    color: var(--text-bright);
}

.legend-short {
    font-size: 0.58rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Zone detail */
.zone-info-block { display: none; }

.zi-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    margin-bottom: 0.6rem;
}

.zi-body {
    font-size: 0.68rem;
    color: var(--text);
    line-height: 1.7;
}

.zi-default {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    padding: 0.5rem 0;
}

/* ── Faction row background image ── */
.fr-bg {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 55%;
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 45%);
    mask-image: linear-gradient(to right, transparent 0%, black 45%);
    z-index: 0;
    pointer-events: none;
}

.faction-row > *:not(.fr-bg) { position: relative; z-index: 1; }

/* ── Admin layout ── */
.admin-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 52px - 36px);
    margin: -1.5rem -2rem;
}

.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: rgba(10,10,10,0.9);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-title {
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    color: var(--text-dim);
    padding: 0 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.admin-nav-item {
    display: block;
    padding: 0.6rem 1.25rem;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    text-decoration: none;
    transition: all var(--transition);
    border-left: 2px solid transparent;
}

.admin-nav-item .ani-prefix { color: var(--accent-dim); margin-right: 0.4rem; font-size: 0.6rem; }

.admin-nav-item:hover {
    color: var(--text-bright);
    background: var(--accent-glow);
    border-left-color: var(--border-bright);
}

.admin-nav-item.active {
    color: var(--text-bright);
    border-left-color: var(--text-bright);
    background: rgba(255,255,255,0.04);
}

.admin-sidebar-sep {
    margin: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.admin-content {
    flex: 1;
    padding: 1.5rem 2rem;
    min-width: 0;
    overflow-x: auto;
}

/* ── Admin dashboard cards ── */
.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.admin-dash-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    position: relative;
    transition: border-color var(--transition), background var(--transition);
}

.admin-dash-card::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 10px; height: 10px;
    border-top: 2px solid var(--text-bright);
    border-left: 2px solid var(--text-bright);
}

.admin-dash-card:hover {
    border-color: var(--border-bright);
    background: var(--accent-glow);
}

.adc-count {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1;
}

.adc-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--text-bright);
}

.adc-desc {
    font-size: 0.65rem;
    color: var(--text-dim);
    line-height: 1.5;
    flex: 1;
}

.adc-action {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

.admin-dash-card:hover .adc-action { color: var(--text-bright); }

/* ── Admin table ── */
.admin-table-wrap { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.admin-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-display);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    font-weight: 400;
    white-space: nowrap;
}

.admin-table td {
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: var(--text);
    vertical-align: middle;
}

.admin-table tr:hover td { background: var(--accent-glow); }

.admin-link {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    text-decoration: none;
    margin-right: 0.75rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.admin-link:hover { color: var(--text-bright); border-color: var(--border-bright); }

.admin-link-danger {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    font-family: var(--font-mono);
    transition: all var(--transition);
}

.admin-link-danger:hover { color: #ff6b6b; border-color: rgba(255,107,107,0.4); }

/* ── Admin forms ── */
.admin-form { max-width: 900px; }

.admin-form-section-title {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    color: var(--text-dim);
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.admin-field.full-width { grid-column: 1 / -1; }

.admin-field label {
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    color: var(--text-dim);
}

.admin-field .required { color: var(--warn); }

.admin-field input[type="text"],
.admin-field input[type="number"],
.admin-field input[type="url"],
.admin-field textarea,
.admin-field select {
    background: rgba(15,15,15,0.9);
    border: 1px solid var(--border);
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    outline: none;
    transition: border-color var(--transition);
    width: 100%;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus { border-color: var(--border-bright); }

.admin-field textarea { resize: vertical; }

.admin-field input[type="file"] {
    font-size: 0.68rem;
    color: var(--text-dim);
    padding: 0.4rem 0;
    cursor: pointer;
}

.admin-field select option { background: #111; }

.admin-current-img {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.admin-current-img img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.admin-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ── Admin buttons ── */
.admin-btn {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    color: var(--text-bright);
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-bright);
    padding: 0.45rem 1.1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    display: inline-block;
}

.admin-btn:hover { background: rgba(255,255,255,0.14); border-color: var(--text-bright); }

.admin-btn-ghost {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.45rem 1.1rem;
    text-decoration: none;
    transition: all var(--transition);
    display: inline-block;
}

.admin-btn-ghost:hover { color: var(--text-bright); border-color: var(--border-bright); }

/* ── Admin doctrine note ── */
.admin-doctrine-note {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    padding: 0.5rem 0.75rem;
    border-left: 2px solid var(--border);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.admin-doctrine-note .dim { color: var(--text-dim); margin-right: 0.4rem; }

/* ── Admin notices ── */
.admin-notice {
    padding: 0.5rem 0.9rem;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    border: 1px solid;
}

.admin-notice.ok   { color: var(--text-bright); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.04); }
.admin-notice.warn { color: #ff6b6b;             border-color: rgba(255,107,107,0.3); background: rgba(255,107,107,0.05); }

/* ── Utility ── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.text-right { text-align: right; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.full-width { width: 100%; }
