:root {
    --dm-primary: #1456d8;
    --dm-primary-dark: #103f9d;
    --dm-primary-soft: #edf4ff;
    --dm-bg: #f6f8fc;
    --dm-surface: #ffffff;
    --dm-border: #d9e2f1;
    --dm-text: #11213b;
    --dm-muted: #5f708f;
    --dm-accent: #0e8ba8;
    --dm-success: #16805d;
    --dm-shadow: 0 22px 45px rgba(17, 33, 59, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--dm-text);
    background:
        radial-gradient(circle at top right, rgba(20, 86, 216, 0.08), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(217, 226, 241, 0.8);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.875rem;
    color: var(--dm-text);
    text-decoration: none;
}

.brand-logo-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.brand-logo-svg {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.brand-text {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--dm-text);
    line-height: 1;
}

.brand-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(20, 86, 216, 0.14);
    background: rgba(20, 86, 216, 0.08);
    color: var(--dm-primary-dark);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-section {
    padding: 3.25rem 0 2rem;
}

.hero-card,
.category-hero,
.search-hero,
.content-panel,
.article-shell,
.feedback-card,
.cta-inline,
.footer-panel,
.cta-banner,
.empty-state,
.admin-login-card {
    background: var(--dm-surface);
    border: 1px solid rgba(217, 226, 241, 0.9);
    box-shadow: var(--dm-shadow);
    border-radius: 28px;
}

.hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
    gap: 2rem;
    padding: 2rem;
    background:
        radial-gradient(circle at top left, rgba(14, 139, 168, 0.18), transparent 35%),
        linear-gradient(135deg, #0f4fc7 0%, #155fdb 52%, #123ca4 100%);
    color: #fff;
}

.hero-copy h1,
.category-hero h1,
.search-hero h1,
.article-header h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.05;
    margin-bottom: 1rem;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.77rem;
    font-weight: 700;
    color: var(--dm-accent);
}

.hero-copy .eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

.hero-copy p,
.hero-panel,
.article-summary,
.category-hero p,
.search-hero p,
.cta-banner p,
.footer-panel p {
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.05rem;
}

.hero-search {
    margin: 1.75rem 0 1rem;
}

.hero-search .input-group-text,
.search-form .input-group-text {
    background: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.hero-panel {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.hero-stat,
.hero-note {
    padding: 1.2rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-stat strong {
    display: block;
    font-size: 2rem;
    color: #fff;
}

.hero-note {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}

.hero-note i {
    font-size: 1.35rem;
}

.section-block {
    padding: 1rem 0 2rem;
}

.section-soft {
    background: linear-gradient(180deg, rgba(237, 244, 255, 0.65), rgba(246, 248, 252, 0));
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-heading h2 {
    margin: 0.35rem 0 0;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.category-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    text-decoration: none;
    height: 100%;
    padding: 1.4rem;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(217, 226, 241, 0.95);
    box-shadow: 0 16px 34px rgba(17, 33, 59, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card:hover,
.article-link-card:hover {
    transform: translateY(-3px);
    border-color: rgba(20, 86, 216, 0.28);
    box-shadow: 0 20px 38px rgba(17, 33, 59, 0.12);
}

.category-icon {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 20px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--dm-primary);
    background: var(--dm-primary-soft);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.category-card h3,
.article-link-card h3,
.footer-panel h3,
.cta-banner h2,
.article-shell h2 {
    margin: 0 0 0.45rem;
    font-size: 1.18rem;
}

.category-card p,
.article-link-card p,
.search-hero p,
.content-panel p,
.empty-state p,
.category-meta,
.article-meta,
.feedback-card p,
.cta-inline p {
    color: var(--dm-muted);
}

.article-list {
    display: grid;
    gap: 1rem;
}

.article-link-card {
    display: block;
    text-decoration: none;
    padding: 1.2rem 1.3rem;
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(217, 226, 241, 0.92);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-link-card small {
    color: var(--dm-muted);
}

.article-link-card-wide {
    padding: 1.35rem 1.45rem;
}

.article-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--dm-primary-soft);
    color: var(--dm-primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.content-panel {
    padding: 1.5rem;
}

.cta-banner {
    padding: 1.8rem;
    background: linear-gradient(135deg, #133d9d 0%, #1456d8 52%, #0d88a5 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-panel {
    padding: 1.8rem;
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.site-footer {
    padding: 0 0 2rem;
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    color: var(--dm-muted);
    font-size: 0.95rem;
}

.breadcrumb-wrap {
    margin-bottom: 1rem;
}

.breadcrumb {
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--dm-primary);
    text-decoration: none;
}

.category-hero,
.search-hero {
    padding: 1.75rem;
    display: flex;
    gap: 1.3rem;
    align-items: flex-start;
    justify-content: space-between;
}

.category-hero-icon {
    width: 4rem;
    height: 4rem;
    flex-shrink: 0;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dm-primary-soft);
    color: var(--dm-primary);
    font-size: 1.5rem;
}

.category-meta,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.95rem;
}

.sticky-panel {
    position: sticky;
    top: 6.5rem;
}

.article-shell {
    padding: 1.8rem;
}

.article-header {
    padding-bottom: 1.4rem;
    border-bottom: 1px solid var(--dm-border);
    margin-bottom: 1.4rem;
}

.article-summary {
    font-size: 1.08rem;
}

.article-content {
    font-size: 1.02rem;
    line-height: 1.8;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
}

.article-content a {
    color: var(--dm-primary);
}

.article-content pre,
.article-content code {
    background: #f3f6fb;
    border-radius: 12px;
}

.article-content pre {
    padding: 1rem;
    overflow: auto;
}

.feedback-card,
.cta-inline {
    margin-top: 1.6rem;
    padding: 1.3rem;
}

.feedback-card {
    display: grid;
    gap: 1rem;
}

.feedback-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.feedback-result {
    min-height: 1.2rem;
}

.compact-list .article-link-card.compact {
    padding: 1rem 1.1rem;
}

.cta-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.empty-state {
    padding: 2rem;
    text-align: center;
}

.empty-state-small {
    padding: 1.6rem;
}

.empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dm-primary-soft);
    color: var(--dm-primary);
    font-size: 1.45rem;
}

.search-form {
    width: min(100%, 580px);
}

.admin-body {
    background: #eef2f8;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    padding: 1.5rem;
    background: linear-gradient(180deg, #102d70 0%, #133c97 55%, #0f66b4 100%);
    color: #fff;
}

.admin-logo {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
    margin-bottom: 2rem;
}

.admin-logo i {
    width: 2.6rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
}

.admin-nav {
    display: grid;
    gap: 0.35rem;
}

.admin-nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.8rem 0.95rem;
    border-radius: 16px;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.admin-main {
    padding: 1.5rem;
}

.admin-topbar {
    margin-bottom: 1.4rem;
}

.admin-topbar h1 {
    margin-bottom: 0.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1.25rem;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--dm-border);
    box-shadow: 0 16px 28px rgba(17, 33, 59, 0.08);
}

.stat-card span {
    display: block;
    color: var(--dm-muted);
    margin-bottom: 0.4rem;
}

.stat-card strong {
    font-size: 1.85rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.table-panel,
.form-panel {
    background: #fff;
    border: 1px solid var(--dm-border);
    border-radius: 24px;
    box-shadow: 0 16px 28px rgba(17, 33, 59, 0.08);
    padding: 1.25rem;
}

.admin-login-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.admin-login-card {
    width: min(100%, 480px);
    padding: 2rem;
}

.form-hint {
    color: var(--dm-muted);
    font-size: 0.92rem;
}

.ai-writer-panel {
    padding: 1.35rem;
    border: 1px solid rgba(20, 86, 216, 0.16);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(237, 244, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.ai-writer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.table-responsive {
    border-radius: 18px;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-soft.success {
    background: rgba(22, 128, 93, 0.12);
    color: var(--dm-success);
}

.badge-soft.warning {
    background: rgba(255, 193, 7, 0.15);
    color: #946200;
}

.fade-in-up {
    animation: fadeInUp 0.45s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1199.98px) {
    .hero-card,
    .cta-banner,
    .footer-panel,
    .cta-inline,
    .search-hero,
    .category-hero {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

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

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

    .admin-sidebar {
        padding-bottom: 1rem;
    }

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

    .sticky-panel {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .hero-card,
    .article-shell,
    .content-panel,
    .feedback-card,
    .cta-inline,
    .footer-panel,
    .cta-banner,
    .category-hero,
    .search-hero {
        padding: 1.25rem;
        border-radius: 22px;
    }

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

    .footer-meta,
    .feedback-form {
        flex-direction: column;
    }

    .hero-actions .btn,
    .cta-inline .btn,
    .cta-banner .btn,
    .footer-actions .btn {
        width: 100%;
    }
}
