/* ── Admin shared styles ──────────────────────────────────────────────────── */

.admin-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    font-family: 'Exo 2', sans-serif;
}

/* Header */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #3a2060;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #e8e0f0;
    margin: 0;
}

.admin-subtitle {
    font-size: 0.85rem;
    color: #9e8faf;
    margin: 0.25rem 0 0;
}

.admin-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(123, 31, 162, 0.2);
    border: 1px solid #7b1fa2;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    color: #ce93d8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.75rem;
    vertical-align: middle;
}

/* Breadcrumb */
.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6a5a7a;
    margin-bottom: 1.5rem;
}

.admin-breadcrumb a {
    color: #9e8faf;
    text-decoration: none;
}

.admin-breadcrumb a:hover { color: #ce93d8; }
.admin-breadcrumb .sep { color: #3a2060; }

/* Dashboard cards */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.admin-card {
    background: #100c18;
    border: 1px solid #2a1840;
    border-top: 3px solid #7b1fa2;
    border-radius: 6px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(123, 31, 162, 0.25);
    border-color: #7b1fa2;
}

.admin-card-icon {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.admin-card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e8e0f0;
    margin: 0 0 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-card-count {
    font-size: 2rem;
    font-weight: 700;
    color: #ce93d8;
    font-family: 'Orbitron', sans-serif;
    margin: 0.25rem 0;
}

.admin-card-desc {
    font-size: 0.8rem;
    color: #6a5a7a;
    margin: 0.25rem 0 0;
}

/* Split layout (master-detail) */
.admin-split {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .admin-split { grid-template-columns: 1fr; }
}

.admin-list-panel {
    background: #100c18;
    border: 1px solid #2a1840;
    border-radius: 6px;
    overflow: hidden;
}

.admin-list-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #2a1840;
    background: #0d0a14;
}

.admin-list-panel-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9e8faf;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}

/* Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6a5a7a;
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid #2a1840;
    background: #0d0a14;
    white-space: nowrap;
}

.admin-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #1a1228;
    color: #c8b8dc;
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr.row-selected td {
    background: rgba(123, 31, 162, 0.12);
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.admin-table tr.row-selected:hover td {
    background: rgba(123, 31, 162, 0.18);
}

/* Row actions */
.row-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

/* Edit panel */
.admin-edit-panel {
    background: #100c18;
    border: 1px solid #2a1840;
    border-radius: 6px;
    overflow: hidden;
    position: sticky;
    top: 1rem;
}

.admin-edit-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #2a1840;
    background: #0d0a14;
}

.admin-edit-panel-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9e8faf;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}

.admin-edit-panel-body {
    padding: 1.25rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9e8faf;
    margin-bottom: 0.4rem;
}

.form-label .optional {
    font-family: 'Exo 2', sans-serif;
    text-transform: none;
    letter-spacing: 0;
    color: #4a3a5a;
    font-size: 0.7rem;
    margin-left: 0.3rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: #0a0812;
    border: 1px solid #3a2060;
    border-radius: 4px;
    color: #e8e0f0;
    padding: 0.5rem 0.75rem;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #7b1fa2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(123, 31, 162, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #4a3a5a;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a5a7a' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.form-select option { background: #100c18; }

.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: 'Exo 2', sans-serif;
}

.form-textarea.code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    min-height: 320px;
    line-height: 1.5;
    color: #b8ffc8;
}

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

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border-radius: 4px;
    border: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
    background: #7b1fa2;
    color: #fff;
}

.btn-primary:hover { box-shadow: 0 2px 12px rgba(123, 31, 162, 0.5); opacity: 1; }

.btn-danger {
    background: #b71c1c;
    color: #fff;
}

.btn-danger:hover { box-shadow: 0 2px 8px rgba(183, 28, 28, 0.4); opacity: 1; }

.btn-ghost {
    background: transparent;
    border: 1px solid #3a2060;
    color: #9e8faf;
}

.btn-ghost:hover { border-color: #7b1fa2; color: #ce93d8; }

.btn-outline {
    background: transparent;
    border: 1px solid #7b1fa2;
    color: #ce93d8;
}

.btn-outline:hover { background: rgba(123, 31, 162, 0.15); }

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.6rem;
}

.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.55rem;
}

/* Form actions footer */
.form-actions {
    display: flex;
    gap: 0.6rem;
    padding-top: 1rem;
    border-top: 1px solid #2a1840;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Rules / list editor */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rule-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.rule-row .form-input {
    flex: 1;
}

/* Alert / notification */
.admin-alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.admin-alert-success {
    background: rgba(46, 125, 50, 0.15);
    border: 1px solid #2e7d32;
    color: #81c784;
}

.admin-alert-error {
    background: rgba(183, 28, 28, 0.15);
    border: 1px solid #b71c1c;
    color: #ef9a9a;
}

/* Empty state */
.admin-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #6a5a7a;
}

.admin-empty h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    color: #4a3a5a;
}

/* Section headings within a class group */
.class-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: #0d0a14;
    border-bottom: 1px solid #2a1840;
}

.class-group-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9e8faf;
}

/* Stat bonus pairs */
.stat-bonus-row {
    display: grid;
    grid-template-columns: 1fr 80px auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.4rem;
}

/* JSON editor toolbar */
.json-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #0a0812;
    border: 1px solid #3a2060;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-size: 0.75rem;
    color: #6a5a7a;
}

.json-toolbar + .form-textarea {
    border-radius: 0 0 4px 4px;
    border-top: 1px solid #1a1228;
}

/* Nav admin link accent */
.void-nav-link-admin {
    color: #ce93d8 !important;
    border-bottom: 1px solid rgba(206, 147, 216, 0.3);
}

/* Access denied (Routes.razor) */
.access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1rem;
    text-align: center;
}

.access-denied h1 {
    font-family: 'Orbitron', sans-serif;
    color: #b71c1c;
    font-size: 2rem;
}

.access-denied p { color: #9e8faf; }

.btn-home {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: #7b1fa2;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Delete confirm */
.delete-confirm {
    background: rgba(183, 28, 28, 0.1);
    border: 1px solid #b71c1c;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #ef9a9a;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-bar {
    position: relative;
}

.search-bar .form-input {
    padding-left: 2rem;
}

.search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: #4a3a5a;
    font-size: 0.85rem;
    pointer-events: none;
}

/* ── Ability body-line editor ──────────────────────────────────────────────── */

.ability-lines-editor {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ability-line-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.ability-line-type {
    width: 7.75rem;
    flex-shrink: 0;
    font-size: 0.78rem;
    padding: 0.35rem 1.75rem 0.35rem 0.5rem;
}

.ability-line-lore {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    font-size: 0.75rem;
    color: #6a5a7a;
    cursor: pointer;
    flex-shrink: 0;
}

.ability-line-lore input[type="checkbox"] {
    accent-color: #7b1fa2;
}

/* ── Choice / path / ability accordion ────────────────────────────────────── */

.choice-accordion {
    border: 1px solid #2a1840;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.choice-accordion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #0d0a14;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

.choice-accordion-header:hover {
    background: rgba(123, 31, 162, 0.08);
}

.choice-accordion-title {
    flex: 1;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: #ce93d8;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.choice-accordion-chevron {
    color: #4a3a5a;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.choice-accordion-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid #2a1840;
}

/* ── Species level cards ───────────────────────────────────────────────────── */

.species-level-card {
    border: 1px solid #2a1840;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.species-level-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.875rem;
    background: #0d0a14;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

.species-level-header:hover {
    background: rgba(123, 31, 162, 0.08);
}

.species-level-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background: rgba(123, 31, 162, 0.25);
    border: 1px solid #7b1fa2;
    border-radius: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    color: #ce93d8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.species-level-subtitle {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.82rem;
    color: #c8b8dc;
    font-weight: 600;
}

.species-level-body {
    padding: 1rem;
    border-top: 1px solid #2a1840;
    display: flex;
    flex-direction: column;
    gap: 0;
}
