:root {
    --bg: #1f2328;
    --card: #06080c;
    --header: #071423;
    --text: #f5f7fb;
    --muted: #a9b3c1;
    --primary: #2f67ff;
    --primary-hover: #2555d8;
    --success-bg: #12331d;
    --success-text: #8ef0ad;
    --error-bg: #3a1515;
    --error-text: #ffb0b0;
    --input-bg: #0d1117;
    --input-line: #2b3646;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 1550px;
    margin: 0 auto;
    padding: 0 28px;
}

header {
    background: linear-gradient(180deg, #05111e 0%, var(--header) 100%);
    color: var(--white);
    padding: 40px 0 30px;
    border-bottom: 4px solid var(--primary);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.branding-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.logo-img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px;
    flex-shrink: 0;
}

.branding h1 {
    margin: 0;
    font-size: 2.8rem;
    line-height: 1.1;
}

.branding h1 a {
    text-decoration: none;
}

.branding p {
    margin: 10px 0 0;
    color: #c6d0dc;
    font-size: 1.08rem;
}

.admin-link {
    display: inline-block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: 0.2s ease;
    white-space: nowrap;
}

.admin-link:hover {
    background: var(--white);
    color: #101820;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.main-nav a {
    display: inline-block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    padding: 11px 16px;
    border-radius: 12px;
    font-weight: bold;
    transition: 0.2s ease;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.14);
}

.main-nav a.active {
    background: var(--primary);
    color: var(--white);
}

main {
    padding: 42px 0 60px;
}

.hero {
    padding: 0 0 24px;
}

.hero h2 {
    margin: 0 0 10px;
    font-size: 2.35rem;
    line-height: 1.2;
}

.hero p {
    margin: 0;
    color: #d6deea;
    font-size: 1.05rem;
    max-width: 980px;
}

.featured {
    margin-bottom: 32px;
}

.featured-card,
.card,
.box,
.empty {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.featured-card {
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(340px, 0.95fr) minmax(0, 1.05fr);
}

.featured-cover {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
    display: block;
    background: #1d2633;
}

.featured-body {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-body h2 {
    margin: 0 0 14px;
    font-size: 2.35rem;
    line-height: 1.15;
}

.featured-body p {
    margin: 0;
    font-size: 1.06rem;
    color: #eff3fa;
}

.articles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 28px;
    padding-bottom: 10px;
}

.card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.card-image {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    background: #1d2633;
}

.card-content {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.category-badge {
    display: inline-block;
    background: rgba(47, 103, 255, 0.14);
    color: #9fb8ff;
    font-size: 0.84rem;
    font-weight: bold;
    padding: 6px 11px;
    border-radius: 999px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.category-badge:hover {
    background: rgba(47, 103, 255, 0.24);
}

.pin-badge {
    display: inline-block;
    background: rgba(255, 193, 7, 0.18);
    color: #ffd88a;
    font-size: 0.84rem;
    font-weight: bold;
    padding: 6px 11px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.card h3,
.box h2,
.box h3 {
    margin-top: 0;
}

.card h3 {
    margin-bottom: 12px;
    font-size: 1.55rem;
    line-height: 1.3;
}

.card h3 a {
    text-decoration: none;
    color: var(--white);
}

.card h3 a:hover,
.featured-body h2 a:hover {
    color: #a9beff;
}

.featured-body h2 a {
    text-decoration: none;
    color: var(--white);
}

.meta {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 16px;
}

.card p {
    margin: 0;
    font-size: 1rem;
    color: #f0f4fa;
}

.read-more,
button,
.button-link {
    display: inline-block;
    text-decoration: none;
    background: var(--primary);
    color: var(--white);
    padding: 11px 18px;
    border-radius: 10px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.read-more {
    margin-top: 18px;
    align-self: flex-start;
}

.read-more:hover,
button:hover,
.button-link:hover {
    background: var(--primary-hover);
}

.button-link.secondary {
    background: #4b5563;
}

.button-link.secondary:hover {
    background: #374151;
}

.empty {
    padding: 24px;
}

.box {
    padding: 28px;
}

.admin-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(340px, 0.9fr);
    gap: 24px;
}

.message {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: bold;
}

.message.success {
    background: var(--success-bg);
    color: var(--success-text);
}

.message.error {
    background: var(--error-bg);
    color: var(--error-text);
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--input-line);
    border-radius: 12px;
    font: inherit;
    background: var(--input-bg);
    color: var(--white);
}

input[type="file"] {
    width: 100%;
    padding: 12px 0;
    color: var(--white);
    font: inherit;
}

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

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

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

.check-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0d1520;
    border: 1px solid #243041;
    color: var(--white);
    border-radius: 999px;
    padding: 9px 14px;
    cursor: pointer;
    user-select: none;
}

.check-pill input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.current-image img {
    width: 240px;
    max-width: 100%;
    border-radius: 14px;
    display: block;
    border: 1px solid #263444;
    margin-top: 12px;
}

.gallery-admin-grid,
.article-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.gallery-admin-item,
.gallery-item {
    background: #0d1117;
    border: 1px solid #263444;
    border-radius: 14px;
    overflow: hidden;
}

.gallery-admin-item img,
.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #1d2633;
}

.gallery-admin-item .gallery-admin-body {
    padding: 12px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

th {
    color: #cfdae7;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
}

td {
    color: var(--white);
}

.status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: bold;
}

.status.published {
    background: rgba(40, 167, 69, 0.18);
    color: #9af0b0;
}

.status.draft {
    background: rgba(255, 193, 7, 0.18);
    color: #ffd88a;
}

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

.actions a,
.actions button {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 9px;
}

.actions .edit {
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    border: none;
    font-weight: bold;
}

.actions .edit:hover {
    background: var(--primary-hover);
}

.actions .view {
    background: #0d8a78;
    color: var(--white);
    text-decoration: none;
    border: none;
    font-weight: bold;
}

.actions .view:hover {
    background: #0a6d5f;
}

.actions .delete {
    background: #b42318;
    color: var(--white);
    border: none;
    font-weight: bold;
}

.actions .delete:hover {
    background: #8f1a11;
}

.small-muted {
    color: var(--muted);
    font-size: 0.95rem;
}

.article-shell {
    max-width: 1250px;
    margin: 0 auto;
}

.article-cover {
    width: 100%;
    max-height: 620px;
    object-fit: cover;
    border-radius: 18px;
    display: block;
    margin: 0 0 28px;
    background: #1d2633;
}

.article-intro {
    font-size: 1.08rem;
    margin-top: 0;
    margin-bottom: 24px;
    color: #eef3fb;
    line-height: 1.7;
}

.article-body {
    max-width: 1050px;
    font-size: 1.06rem;
}

.article-body p {
    margin: 0 0 18px;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    margin-top: 28px;
    margin-bottom: 14px;
    line-height: 1.25;
}

.article-gallery {
    margin-top: 34px;
    margin-bottom: 10px;
}

.article-gallery h3 {
    margin-bottom: 16px;
}

.article-actions {
    margin-top: 28px;
}

footer {
    background: #0b1016;
    color: #c9d2dc;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

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

    .featured-card {
        grid-template-columns: 1fr;
    }

    .featured-cover {
        min-height: 320px;
    }
}

@media (max-width: 900px) {
    .container {
        padding: 0 20px;
    }

    .branding h1 {
        font-size: 2.2rem;
    }

    .hero h2,
    .featured-body h2 {
        font-size: 2rem;
    }

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

    .article-body {
        font-size: 1rem;
    }
}

@media (max-width: 700px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-link {
        align-self: flex-end;
    }

    .box {
        padding: 22px;
    }

    .branding-wrap {
        align-items: flex-start;
    }

    .logo-img {
        width: 54px;
        height: 54px;
    }
}