* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0b0e14;
    color: #e0e6ed;
    height: 100vh;
    overflow: hidden;
}
.admin-container {
    display: flex;
    height: 100vh;
}
.sidebar {
    width: 250px;
    background-color: #151a24;
    border-right: 1px solid #2a313e;
    display: flex;
    flex-direction: column;
}
.sidebar-title {
    padding: 20px;
    text-align: center;
    color: #4da6ff;
    border-bottom: 1px solid #2a313e;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.nav-links {
    list-style: none;
    margin-top: 10px;
}
.nav-links li {
    padding: 0;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}
.nav-links li a {
    padding: 15px 20px;
    display: block;
    color: inherit;
    text-decoration: none;
}
.nav-links li:hover {
    background-color: #1e2532;
}
.nav-links li.active {
    background-color: #1e2532;
    border-left-color: #4da6ff;
    color: #4da6ff;
    font-weight: bold;
}
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.topbar {
    background-color: #151a24;
    padding: 15px 20px;
    border-bottom: 1px solid #2a313e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn {
    background-color: #0055aa;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
.btn:hover { background-color: #0077cc; }
.btn-danger {
    background-color: #aa2222;
    padding: 5px 10px;
    font-size: 12px;
}
.btn-danger:hover { background-color: #cc3333; }
.tabs-container {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}
.tab-content { display: block; }

/* Filter bars */
.admin-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.admin-filter-select,
.admin-filter-input {
    background: #151a24;
    border: 1px solid #2a313e;
    color: #e0e6ed;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}
.admin-filter-input { min-width: 250px; }

/* Effects / unlock tags */
.effects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.effect-tag {
    background: #1e2532;
    border: 1px solid #2a313e;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    color: #88dd88;
}
.unlock-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.unlock-tag {
    display: inline-block;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    width: fit-content;
}
.unlock-tag.building { background: rgba(77, 166, 255, 0.15); border: 1px solid rgba(77, 166, 255, 0.3); color: #4da6ff; }
.unlock-tag.component { background: rgba(136, 221, 136, 0.15); border: 1px solid rgba(136, 221, 136, 0.3); color: #88dd88; }
.unlock-tag.ship { background: rgba(255, 170, 0, 0.15); border: 1px solid rgba(255, 170, 0, 0.3); color: #ffaa00; }
.unlock-tag.raw { background: #1e2532; border: 1px solid #2a313e; color: #aaa; }

/* Ship tabs */
.ship-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.ship-tabs .ship-tab {
    background: #151a24;
    border: 1px solid #2a313e;
    color: #e0e6ed;
    padding: 10px 18px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}
.ship-tabs .ship-tab:hover { background: #1e2532; }
.ship-tabs .ship-tab.active {
    background: #1e2532;
    border-color: #4da6ff;
    color: #4da6ff;
    font-weight: bold;
}

/* Races grid */
.races-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}
.race-card-admin {
    background: #151a24;
    border: 1px solid #2a313e;
    border-radius: 6px;
    padding: 15px;
}

/* Code spans */
code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #aaa;
}

h2 { margin-bottom: 15px; color: #aeb3bd; }

.table-wrapper {
    background: #151a24;
    border: 1px solid #2a313e;
    border-radius: 6px;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #2a313e;
}
th {
    background-color: #1e2532;
    color: #aeb3bd;
    text-transform: uppercase;
    font-size: 12px;
}
tr:hover { background-color: rgba(255, 255, 255, 0.03); }

/* Galaxy Stats */
.stats-cards {
    display: flex;
    gap: 20px;
}
.stat-card {
    background: #151a24;
    border: 1px solid #2a313e;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    flex: 1;
}
.stat-value {
    font-size: 32px;
    color: #4da6ff;
    font-weight: bold;
    margin-top: 10px;
}

/* Error Overlay */
#error-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
.error-box {
    background: #aa2222;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #ff5555;
}
.error-box h2 { color: white; margin-bottom: 10px; }
.error-box p { margin-bottom: 20px; }
.hidden { display: none !important; }
