﻿:root {
    --admin-bg: #05070b;
    --admin-panel: #0d1118;
    --admin-panel-soft: #111826;
    --admin-line: rgba(255, 255, 255, 0.12);
    --admin-line-strong: rgba(255, 255, 255, 0.24);
    --admin-text: #f3f5f8;
    --admin-muted: #9aa3b2;
    --admin-accent: #7ee7ff;
    --admin-danger: #ff6b7a;
    --admin-ok: #8af7c8;
    --admin-radius: 14px;
}

.admin-body {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(circle at 10% -20%, rgba(126, 231, 255, 0.12), transparent 40%), var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Manrope', 'Segoe UI', sans-serif;
}

.admin-body [hidden] {
    display: none !important;
}

.admin-shell {
    width: min(100% - 32px, 1220px);
    margin: 24px auto 60px;
}

.admin-auth,
.admin-topbar,
.admin-tabs {
    border: 1px solid var(--admin-line);
    border-radius: var(--admin-radius);
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.005));
    backdrop-filter: blur(8px);
    padding: 20px;
}

.admin-auth {
    max-width: 520px;
    margin: 60px auto;
}

.admin-auth h1,
.admin-topbar h1,
.tab-panel h2,
.panel-soft h3 {
    margin: 0;
    font-family: 'Jura', 'Segoe UI', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-auth p,
.admin-topbar p {
    color: var(--admin-muted);
    margin: 8px 0 0;
}

.admin-dashboard {
    display: grid;
    gap: 14px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    border: 1px solid var(--admin-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 14px;
}

.stat-card p {
    margin: 0;
    color: var(--admin-muted);
    font-size: 0.85rem;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-family: 'Jura', 'Segoe UI', sans-serif;
    letter-spacing: 0.06em;
    font-size: 1.4rem;
}

.tab-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--admin-line);
    padding-bottom: 12px;
}

.tab-btn {
    border: 1px solid var(--admin-line);
    color: var(--admin-text);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
    padding: 8px 14px;
    font-family: 'Jura', 'Segoe UI', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
    cursor: pointer;
}

.tab-btn.active {
    border-color: var(--admin-line-strong);
    box-shadow: 0 0 0 1px rgba(126, 231, 255, 0.25), 0 0 22px rgba(126, 231, 255, 0.16);
    color: #fff;
}

.tab-panel {
    display: none;
    margin-top: 16px;
}

.tab-panel.active {
    display: block;
}

.panel-subhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.helper-text {
    margin: 0 0 12px 0;
    color: var(--admin-muted);
    font-size: 0.9rem;
}

.admin-soft-hint {
    border: 1px dashed rgba(126, 231, 255, 0.35);
    border-radius: 12px;
    padding: 12px;
    color: rgba(214, 224, 239, 0.92);
    background: rgba(18, 35, 59, 0.35);
    font-size: 0.86rem;
    line-height: 1.45;
}

.category-preview-thumb {
    width: 84px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--admin-line);
}

.admin-form {
    display: grid;
    gap: 12px;
}

.admin-form.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form label {
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--admin-muted);
}

.field-hint {
    display: block;
    margin-top: 2px;
    font-size: 0.76rem;
    line-height: 1.4;
    color: rgba(214, 224, 239, 0.72);
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--admin-line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--admin-text);
    padding: 10px 12px;
    font: inherit;
    outline: none;
    box-sizing: border-box;
}

.admin-form input[readonly],
.admin-form textarea[readonly] {
    background: rgba(255, 255, 255, 0.06);
    color: #d8e0eb;
    border-color: rgba(255, 255, 255, 0.2);
}

.admin-form select option,
.admin-form select optgroup {
    background: #0b111c;
    color: #f3f5f8;
}

.admin-form select {
    color: #f3f5f8 !important;
    -webkit-text-fill-color: #f3f5f8;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    border-color: rgba(126, 231, 255, 0.55);
    box-shadow: 0 0 0 1px rgba(126, 231, 255, 0.28);
}

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

.publish-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    color: var(--admin-text);
}

.publish-toggle input {
    width: auto;
}

.admin-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.panel-soft {
    border: 1px solid var(--admin-line);
    border-radius: 12px;
    background: var(--admin-panel-soft);
    padding: 14px;
}

.admin-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--admin-line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--admin-muted);
    font-family: 'Jura', 'Segoe UI', sans-serif;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-body .btn {
    font-family: 'Jura', 'Segoe UI', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.74rem;
    padding: 0.75rem 1rem;
}

.admin-body .btn-primary {
    background: linear-gradient(140deg, #4d6dff, #56c8ff);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 18px rgba(86, 200, 255, 0.25);
}

.btn-ghost {
    border: 1px solid var(--admin-line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--admin-text);
}

.btn-ghost:hover {
    border-color: rgba(126, 231, 255, 0.5);
    background: rgba(126, 231, 255, 0.08);
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.media-path-ellipsis {
    display: inline-block;
    max-width: 440px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: top;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--admin-line);
    padding: 2px 8px;
    font-size: 0.78rem;
}

.badge.ok {
    border-color: rgba(138, 247, 200, 0.55);
    color: var(--admin-ok);
}

.badge.muted {
    color: var(--admin-muted);
}

.badge.danger {
    border-color: rgba(255, 107, 122, 0.55);
    color: var(--admin-danger);
}

.status-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.2s ease;
    background: #131b28;
    border: 1px solid var(--admin-line-strong);
    border-radius: 10px;
    color: #fff;
    padding: 10px 12px;
    z-index: 20000;
    max-width: 340px;
}

.status-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.status-toast.success {
    border-color: rgba(138, 247, 200, 0.6);
}

.status-toast.error {
    border-color: rgba(255, 107, 122, 0.6);
}

@media (max-width: 980px) {
    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-form.two-cols,
    .split-grid {
        grid-template-columns: 1fr;
    }

    .admin-topbar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .admin-shell {
        width: calc(100% - 20px);
        margin-top: 12px;
    }

    .tab-list {
        gap: 6px;
    }

    .tab-btn {
        width: 100%;
        justify-content: center;
    }
}
