/* Admin panel styles — extends the dark theme from /styles.css */

.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.admin-sidebar {
    background: var(--panel);
    border-right: 1px solid var(--border);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 4px 8px;
    text-decoration: none;
    color: inherit;
}

.admin-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    object-fit: cover;
}

.admin-brand strong {
    font-size: 14px;
    display: block;
    font-weight: 700;
}

.admin-brand span {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.admin-nav a, .admin-nav button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.admin-nav a:hover, .admin-nav button:hover {
    background: var(--panel-hover);
    color: var(--text);
}

.admin-nav a.active {
    background: var(--orange-glow);
    color: var(--orange);
}

.admin-nav .nav-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.admin-nav .nav-spacer {
    flex: 1;
}

.admin-main {
    padding: 32px 40px 64px;
    max-width: 1200px;
    width: 100%;
    animation: fadeUp 0.3s ease-out;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 32px;
}

.admin-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.admin-header p {
    color: var(--text-dim);
    font-size: 14px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.15s, transform 0.15s;
}

.stat-card:hover {
    border-color: var(--border-bright);
    transform: translateY(-2px);
}

.stat-card .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-card .hint {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.data-table th, .data-table td {
    padding: 14px 18px;
    text-align: left;
    font-size: 14px;
}

.data-table thead th {
    background: var(--panel-elevated);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr {
    border-top: 1px solid var(--border);
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--panel-hover);
}

.data-table tbody tr:first-child {
    border-top: none;
}

.data-table .row-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    object-fit: cover;
    display: block;
}

.data-table .actions {
    text-align: right;
    white-space: nowrap;
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--panel-elevated);
    color: var(--text-dim);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-sm:hover {
    background: var(--panel-hover);
    color: var(--text);
    border-color: var(--border-bright);
}

.btn-sm.danger:hover {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.08);
}

.btn-sm.primary {
    background: var(--orange-glow);
    color: var(--orange);
    border-color: rgba(255, 138, 61, 0.35);
}

.btn-sm.primary:hover {
    background: rgba(255, 138, 61, 0.22);
    color: var(--orange);
    border-color: rgba(255, 138, 61, 0.55);
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid.two {
    grid-template-columns: 1fr 1fr;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.field input, .field textarea, .field select {
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

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

.field textarea {
    min-height: 220px;
    line-height: 1.6;
    resize: vertical;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13.5px;
}

.field .hint {
    font-size: 12px;
    color: var(--text-muted);
}

.bonus-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bonus-row {
    display: flex;
    gap: 8px;
}

.bonus-row input {
    flex: 1;
}

.image-upload {
    display: flex;
    gap: 14px;
    align-items: center;
}

.image-upload .preview {
    width: 84px;
    height: 84px;
    border-radius: 10px;
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    object-fit: cover;
    flex-shrink: 0;
}

.image-upload .preview.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
    padding: 6px;
}

.image-upload .actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.empty-card {
    background: var(--panel);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.empty-card p {
    font-size: 14px;
    margin-top: 8px;
}

.banner {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 13px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.banner.error {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.08);
    color: #fca5a5;
}

.banner.success {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.08);
    color: #86efac;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--panel);
    border: 1px solid var(--border-bright);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13.5px;
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 200;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.5);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--panel);
    border: 1px solid var(--border-bright);
    border-radius: 16px;
    padding: 32px;
    animation: fadeUp 0.3s ease-out;
}

.login-card .brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.login-card .brand-row img {
    width: 42px;
    height: 42px;
    border-radius: 9px;
    border: 1px solid var(--border);
}

.login-card h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.login-card p.sub {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 2px;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-card .btn-primary {
    justify-content: center;
    padding: 12px 20px;
}

.login-card .footer-link {
    margin-top: 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
}

.login-card .footer-link a {
    color: var(--text-dim);
}

.guide-content-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guide-row-admin {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.15s, background 0.15s;
}

.guide-row-admin:hover {
    border-color: var(--border-bright);
    background: var(--panel-hover);
}

.guide-row-admin img {
    width: 80px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--panel-elevated);
    border: 1px solid var(--border);
}

.guide-row-admin .body strong {
    font-size: 15px;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.guide-row-admin .body span {
    font-size: 12.5px;
    color: var(--text-dim);
}

.status-pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-pill.published {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}

.status-pill.draft {
    background: rgba(154, 154, 158, 0.12);
    color: var(--text-dim);
}

.stats-admin-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.stats-admin-group {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

.stats-admin-group header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
}

.stats-admin-group header h3 {
    font-size: 17px;
    color: var(--orange);
    font-weight: 700;
}

.stats-admin-entries {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-admin-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13.5px;
}

.stats-admin-entry .entry-text {
    flex: 1;
    color: var(--text-dim);
}

.stats-admin-entry .actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s;
}

.stats-admin-entry:hover .actions {
    opacity: 1;
}

.subrune-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.subrune-admin-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.15s;
}

.subrune-admin-card:hover {
    border-color: var(--border-bright);
}

.subrune-admin-card img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    align-self: center;
}

.subrune-admin-card .name {
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.subrune-admin-card .rate {
    text-align: center;
    font-size: 12px;
    color: var(--orange);
}

.subrune-admin-card .bonus-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.subrune-admin-card .bonus-tags span {
    font-size: 10.5px;
    padding: 2px 7px;
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-family: 'Consolas', 'Monaco', monospace;
}

.subrune-admin-card footer {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 4px;
}

.loading {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 18px;
    transition: color 0.15s;
}

.back-link:hover {
    color: var(--orange);
}

@media (max-width: 860px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    .admin-brand {
        flex: 1 0 100%;
        margin-bottom: 6px;
    }
    .admin-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }
    .admin-nav .nav-spacer, .admin-nav .nav-divider { display: none; }
    .admin-main {
        padding: 24px 20px 48px;
    }
    .form-grid.two {
        grid-template-columns: 1fr;
    }
    .guide-row-admin {
        grid-template-columns: 1fr;
    }
    .guide-row-admin img {
        width: 100%;
        height: 140px;
    }
}
