:root {
    --bg: #090d14;
    --panel: #101826;
    --panel-2: #162033;
    --line: #27344a;
    --text: #e7eefc;
    --muted: #95a7c5;
    --blue: #6ea8ff;
    --blue-strong: #4f7fe8;
    --violet: #7b61ff;
    --violet-soft: #9f8cff;
    --cyan: #5dc7ff;
    --green: #2f9d6b;
    --red: #b94a64;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background:
        radial-gradient(circle at top, #131c2e 0%, #090d14 46%),
        linear-gradient(180deg, #090d14 0%, #070a10 100%);
    color: var(--text);
    font-family: Inter, system-ui, Arial, sans-serif;
    min-height: 100%;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(9, 13, 20, 0.88);
    border-bottom: 1px solid rgba(110, 168, 255, 0.14);
}

.topbar-inner,
.main-shell,
.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 78px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(110, 168, 255, 0.22);
    box-shadow: var(--shadow);
    background: #0d1220;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title {
    font-weight: 700;
    letter-spacing: 0.03em;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
}

.nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.nav a {
    color: var(--text);
    font-size: 14px;
    opacity: 0.94;
}

.nav a:hover {
    color: var(--blue);
    text-decoration: none;
}

.main-shell {
    flex: 1;
    padding: 28px 0 40px;
}

.footer {
    border-top: 1px solid rgba(110, 168, 255, 0.10);
    margin-top: auto;
    background: rgba(10, 15, 24, .75);
}

.footer-inner {
    min-height: 84px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.flash {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.flash-success {
    background: rgba(47, 157, 107, .12);
    border-color: rgba(47, 157, 107, .35);
    color: #b2ecd0;
}

.flash-error {
    background: rgba(185, 74, 100, .14);
    border-color: rgba(185, 74, 100, .35);
    color: #ffc2cf;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 22px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.card {
    background: linear-gradient(180deg, rgba(22, 32, 51, .96), rgba(16, 24, 38, .97));
    border: 1px solid rgba(110, 168, 255, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

.card + .card {
    margin-top: 18px;
}

.hero {
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(123, 97, 255, .12), rgba(93, 199, 255, .08)),
        linear-gradient(180deg, rgba(22, 32, 51, .96), rgba(16, 24, 38, .97));
}

.hero h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.05;
}

.hero p {
    color: var(--muted);
    margin: 0;
    max-width: 760px;
}

.page-title {
    margin: 0 0 8px;
    font-size: 30px;
}

.page-subtitle {
    margin: 0;
    color: var(--muted);
}

.section-title {
    margin: 0 0 16px;
    font-size: 20px;
}

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

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(110, 168, 255, .10);
    border: 1px solid rgba(110, 168, 255, .16);
    color: var(--blue);
    font-size: 12px;
}

.badge-red {
    background: rgba(185, 74, 100, .14);
    border-color: rgba(185, 74, 100, .34);
    color: #ffc2cf;
}

.badge-green {
    background: rgba(47, 157, 107, .15);
    border-color: rgba(47, 157, 107, .35);
    color: #b7efd1;
}

.badge-neutral {
    background: rgba(149, 167, 197, .08);
    border-color: rgba(149, 167, 197, .16);
    color: #c7d6ea;
}

.btn,
button,
input[type="submit"] {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 11px 14px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(180deg, #6ea8ff, #4f7fe8);
    color: #07101b;
    transition: transform .12s ease, opacity .12s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    text-decoration: none;
    opacity: .96;
}

.btn-secondary {
    background: linear-gradient(180deg, #1f2b42, #182338);
    color: var(--text);
    border: 1px solid rgba(110, 168, 255, .12);
}

.btn-danger {
    background: linear-gradient(180deg, #b94a64, #97384f);
    color: #fff;
}

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid rgba(149, 167, 197, .16);
    background: rgba(8, 12, 19, .88);
    color: var(--text);
    outline: none;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: #dbe7fb;
}

.form-group {
    margin-bottom: 16px;
}

.form-help {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
}

.table-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.row-card {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) 110px 90px 190px;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-radius: 14px;
    background: rgba(8, 12, 19, .38);
    border: 1px solid rgba(149, 167, 197, .07);
}

.row-main {
    min-width: 0;
}

.row-main h3,
.row-main h4 {
    margin: 0 0 8px;
    font-size: 17px;
}

.row-main p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.row-stat {
    text-align: center;
}

.row-stat strong {
    display: block;
    font-size: 18px;
}

.row-stat span {
    color: var(--muted);
    font-size: 12px;
}

.row-last {
    font-size: 13px;
    color: var(--muted);
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 16px;
}

.breadcrumbs span {
    color: var(--muted);
}

.post {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    border-radius: 16px;
    background: rgba(8, 12, 19, .38);
    border: 1px solid rgba(149, 167, 197, .07);
}

.post + .post {
    margin-top: 14px;
}

.post-sidebar {
    text-align: center;
}

.avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(180deg, #26344f, #1a2437);
    color: var(--blue);
    border: 1px solid rgba(110, 168, 255, .16);
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-large {
    width: 88px;
    height: 88px;
    font-size: 30px;
}

.post-author {
    margin-top: 10px;
    font-size: 13px;
}

.post-author strong {
    display: block;
    color: var(--text);
}

.post-author span {
    color: var(--muted);
}

.post-body {
    min-width: 0;
}

.post-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
}

.post-content {
    color: #e7eefc;
    line-height: 1.65;
    font-size: 15px;
    word-break: break-word;
}

.post-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.inline-form {
    display: inline;
}

.inline-form button {
    padding: 9px 12px;
}

.search-grid {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 20px;
}

.sidebar-stack > * + * {
    margin-top: 18px;
}

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

.stat-box {
    padding: 14px;
    border-radius: 14px;
    background: rgba(8, 12, 19, .38);
    border: 1px solid rgba(149, 167, 197, .07);
}

.stat-box strong {
    display: block;
    font-size: 24px;
    margin-bottom: 6px;
}

.stat-box span {
    color: var(--muted);
    font-size: 13px;
}

.profile-head {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.empty-state {
    padding: 22px;
    border-radius: 16px;
    border: 1px dashed rgba(149, 167, 197, .16);
    color: var(--muted);
    text-align: center;
}

.pagination {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

@media (max-width: 980px) {
    .grid-2,
    .search-grid {
        grid-template-columns: 1fr;
    }

    .row-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .topbar-inner,
    .footer-inner {
        width: min(100% - 20px, 1180px);
    }

    .main-shell {
        width: min(100% - 20px, 1180px);
    }

    .brand-subtitle {
        display: none;
    }

    .post {
        grid-template-columns: 1fr;
    }

    .profile-head {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}