* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: radial-gradient(1200px 800px at 10% -10%, #1a2140 0%, #0f1117 45%, #0b0d14 100%);
    color: #f5f7ff;
}
a { color: inherit; text-decoration: none; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: linear-gradient(180deg, rgba(23,26,36,0.95), rgba(16,19,29,0.85));
    border-bottom: 1px solid #2a2f3d;
}
.brand { font-weight: 700; letter-spacing: 0.5px; }
.user { color: #9aa4c7; }

.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(12,15,22,0.85);
    border-bottom: 1px solid rgba(56,64,90,0.6);
    flex-wrap: wrap;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.35);
}
.nav a {
    position: relative;
    padding: 10px 14px 10px 36px;
    border-radius: 14px;
    background: rgba(22,28,42,0.75);
    border: 1px solid rgba(90,110,160,0.2);
    transition: all 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.nav a::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: rgba(130,150,220,0.7);
    box-shadow: 0 0 10px rgba(130,150,220,0.7);
}
.nav a:hover {
    transform: translateY(-1px);
    border-color: rgba(120,150,255,0.6);
    background: rgba(76,111,255,0.16);
}
.nav a.active {
    background: linear-gradient(135deg, #4c6fff, #7c5cff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 20px rgba(76,111,255,0.45);
}
.nav a.active::before {
    background: #fff;
    box-shadow: 0 0 12px rgba(255,255,255,0.9);
}
.nav a.logout {
    margin-left: auto;
    background: rgba(255,77,109,0.16);
    border-color: rgba(255,77,109,0.5);
    color: #ffd2db;
}

.container {
    padding: 28px 24px 48px;
    max-width: 1200px;
    margin: 0 auto;
}
.narrow { max-width: 520px; }

.card {
    background: linear-gradient(180deg, rgba(24,28,40,0.95), rgba(16,19,28,0.95));
    border: 1px solid rgba(70,82,120,0.35);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: 0 18px 30px rgba(0,0,0,0.35);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat h3 { margin: 0 0 8px; font-size: 16px; color: #9aa4c7; }
.stat p { margin: 0; font-size: 28px; font-weight: 600; }

.section-title {
    margin: 8px 0 12px;
    font-size: 16px;
    color: #cbd3f5;
}
.muted { color: #9aa4c7; }

label {
    margin-top: 10px;
    display: block;
    font-size: 13px;
    color: #9aa4c7;
}
input, select, button {
    width: 100%;
    margin-top: 6px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid rgba(90,110,160,0.35);
    background: rgba(12,14,22,0.9);
    color: #f5f7ff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}
input:focus, select:focus {
    outline: none;
    border-color: rgba(120,150,255,0.75);
    box-shadow: 0 0 0 3px rgba(76,111,255,0.15);
}
button {
    cursor: pointer;
    margin-top: 16px;
}
button.primary {
    background: linear-gradient(135deg, #4c6fff, #7c5cff);
    border-color: transparent;
    color: #fff;
}
button.danger {
    background: #ff4d6d;
    border-color: #ff4d6d;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 16px;
}
.grid-form button { grid-column: 1 / -1; }

.inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.inline input, .inline select, .inline button { width: auto; }

.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid rgba(60,70,100,0.5);
}
thead th {
    color: #cdd6f8;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.6px;
}
tbody tr:hover {
    background: rgba(76,111,255,0.08);
}
tr.subtle td {
    color: #9aa4c7;
    font-size: 12px;
}

.media-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.media-card {
    background: #141825;
    border: 1px solid #2a2f3d;
    border-radius: 16px;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}
.media-card:hover {
    transform: translateY(-4px) rotateX(2deg) rotateY(-2deg);
    box-shadow: 0 18px 30px rgba(0,0,0,0.45);
}
.media-image {
    position: relative;
    height: 200px;
    background: #0f1117;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-placeholder {
    color: #7f89ad;
    font-size: 12px;
}
.media-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(76,111,255,0.9);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.3px;
}
.media-body {
    padding: 12px;
}
.media-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}
.media-meta {
    color: #9aa4c7;
    font-size: 12px;
}
.media-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.media-tags span {
    background: rgba(76,111,255,0.15);
    border: 1px solid rgba(76,111,255,0.3);
    color: #cbd3f5;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.alert.info { background: #1b2030; }
.alert.success { background: #183324; color: #b2ffcb; }
.alert.error { background: #3a1f28; color: #ffb0bd; }

@media (max-width: 768px) {
    .nav { gap: 8px; padding: 10px 16px; }
    .container { padding: 16px; }
    .inline { flex-direction: column; align-items: stretch; }
    .inline input, .inline select, .inline button { width: 100%; }
}
