:root {
    --bg: #f5f7fb;
    --ink: #172033;
    --muted: #65728a;
    --line: #dbe2ee;
    --panel: #ffffff;
    --brand: #0f766e;
    --brand-2: #1d4ed8;
    --accent: #d97706;
    --danger: #b91c1c;
    --success: #15803d;
    --radius: 8px;
    --shadow: 0 18px 48px rgba(18, 32, 57, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

.site-shell {
    min-height: 100vh;
}

.topbar {
    height: 68px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 13px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.app-frame {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: calc(100vh - 68px);
}

.sidebar {
    background: #101827;
    color: #e8edf7;
    padding: 22px 16px;
}

.sidebar-title {
    color: #93a4bd;
    font-size: 12px;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.nav-list {
    display: grid;
    gap: 6px;
}

.nav-link {
    border-radius: 8px;
    color: #dce6f7;
    display: block;
    padding: 11px 12px;
}

.nav-link:hover,
.nav-link.is-active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.nav-toggle {
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    text-align: left;
}

.nav-toggle span,
.nav-sub span {
    color: #aebbd0;
    font-size: 12px;
}

.nav-sublist {
    display: none;
    gap: 4px;
    margin: 4px 0 8px 10px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .16);
}

.nav-sublist.is-open {
    display: grid;
}

.nav-link.nav-sub {
    min-height: 34px;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
}

.content {
    padding: 28px;
    min-width: 0;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.page-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
}

.page-kicker,
.muted {
    color: var(--muted);
}

.panel,
.item-card,
.stat-card,
.news-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
}

.panel-title {
    margin: 0 0 14px;
    font-size: 18px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 18px;
}

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

.stat-value {
    font-size: 26px;
    font-weight: 800;
    margin-top: 4px;
}

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

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

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

.filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) minmax(180px, .8fr) minmax(160px, .7fr) auto;
    gap: 14px;
    align-items: end;
}

.field {
    display: grid;
    gap: 6px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    color: #334155;
    font-weight: 700;
    font-size: 13px;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
}

.textarea {
    min-height: 160px;
    resize: vertical;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

.btn {
    border: 1px solid transparent;
    border-radius: 8px;
    min-height: 40px;
    padding: 9px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    background: #e7edf7;
    color: #1f2a44;
    font-weight: 800;
}

.btn.primary {
    background: var(--brand);
    color: #fff;
}

.btn.blue {
    background: var(--brand-2);
    color: #fff;
}

.btn.danger {
    background: var(--danger);
    color: #fff;
}

.btn.ghost {
    background: #fff;
    border-color: var(--line);
}

.btn.small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

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

.alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    background: #fff;
}

.alert.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.alert.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.table-news {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 260px;
}

.table-news img {
    width: 86px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    background: #e7edf7;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    min-height: 26px;
    padding: 4px 10px;
    background: #edf2f7;
    color: #334155;
    font-weight: 800;
    font-size: 12px;
}

.badge.green {
    background: #dcfce7;
    color: #166534;
}

.badge.orange {
    background: #ffedd5;
    color: #9a3412;
}

.badge.red {
    background: #fee2e2;
    color: #991b1b;
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tab {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 13px;
    background: #fff;
    color: #334155;
    font-weight: 800;
}

.tab.is-active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.item-list {
    display: grid;
    gap: 12px;
}

.item-card {
    padding: 16px;
}

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

.category-card {
    min-height: 74px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 800;
}

.category-card:hover,
.category-card.is-active {
    border-color: var(--brand);
    background: #effaf7;
}

.category-card strong {
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #101827;
    color: #fff;
    display: grid;
    place-items: center;
}

.row-form {
    display: grid;
    grid-template-columns: 1.2fr .7fr .5fr .4fr auto;
    gap: 10px;
    align-items: end;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.news-card {
    overflow: hidden;
}

.news-card-body {
    padding: 16px;
}

.thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #e7edf7;
}

.article {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.article h1 {
    margin-top: 0;
}

.article-body {
    color: #263247;
}

.article-body img {
    border-radius: 8px;
    margin: 16px auto;
}

.hero {
    min-height: calc(100vh - 120px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 410px;
    gap: 28px;
    align-items: center;
    padding: 28px;
}

.hero-copy {
    max-width: 760px;
}

.hero h1 {
    font-size: 56px;
    line-height: 1.02;
    margin: 0 0 16px;
}

.hero p {
    color: var(--muted);
    font-size: 18px;
    margin: 0 0 22px;
}

.hero-image {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-image img {
    width: 100%;
    min-height: 420px;
    object-fit: cover;
}

.panel .item-card,
.panel .stat-card {
    box-shadow: none;
    background: #f8fafc;
}

.login-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.login-option {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.pagination {
    margin-top: 16px;
}

.pagination nav {
    display: flex;
    gap: 8px;
}

.entry-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(rgba(8, 14, 24, .45), rgba(8, 14, 24, .45)),
        url("../images/bg-entry-news.png") center / cover no-repeat;
}

.entry-content {
    width: min(1080px, 100%);
    display: grid;
    gap: 22px;
    justify-items: center;
}

.entry-boxes {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 280px));
    gap: 18px;
}

.entry-box {
    min-height: 150px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    color: #101827;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
    transition: transform .16s ease, background .16s ease;
}

.entry-box:hover {
    transform: translateY(-3px);
    background: #fff;
}

.entry-categories {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.entry-category {
    min-height: 76px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px;
    background: rgba(255, 255, 255, .9);
    color: #101827;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 800;
    box-shadow: 0 18px 52px rgba(0, 0, 0, .2);
}

.entry-category strong {
    min-width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #101827;
    color: #fff;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(rgba(7, 15, 29, .55), rgba(7, 15, 29, .55)),
        url("../images/bg-advertiser-news.png") center / cover no-repeat;
}

.login-admin {
    background:
        linear-gradient(rgba(7, 15, 29, .58), rgba(7, 15, 29, .58)),
        url("../images/bg-admin-news.png") center / cover no-repeat;
}

.login-advertiser {
    background:
        linear-gradient(rgba(7, 15, 29, .54), rgba(7, 15, 29, .54)),
        url("../images/bg-advertiser-news.png") center / cover no-repeat;
}

.login-publisher {
    background:
        linear-gradient(rgba(7, 15, 29, .56), rgba(7, 15, 29, .56)),
        url("../images/bg-publisher-news.png") center / cover no-repeat;
}

.login-card {
    width: min(420px, 100%);
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 26px 90px rgba(0, 0, 0, .3);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(6, 12, 24, .62);
    z-index: 100;
}

.modal-backdrop.is-open {
    display: grid;
}

.modal-box {
    width: min(680px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--line);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
    padding: 22px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

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

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    font-weight: 900;
}

@media (max-width: 1024px) {
    .app-frame,
    .hero {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .stat-grid,
    .grid-3,
    .news-grid,
    .login-options,
    .category-grid,
    .entry-categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero h1 {
        font-size: 42px;
    }
}

@media (max-width: 720px) {
    .topbar,
    .content,
    .hero {
        padding-left: 16px;
        padding-right: 16px;
    }

    .topbar {
        height: auto;
        min-height: 68px;
        gap: 12px;
        align-items: flex-start;
        padding-top: 14px;
        padding-bottom: 14px;
        flex-direction: column;
    }

    .app-frame {
        min-height: auto;
    }

    .sidebar {
        padding: 14px 16px;
    }

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

    .page-head,
    .grid-2,
    .form-grid,
    .form-grid.two,
    .filter-grid,
    .stat-grid,
    .grid-3,
    .news-grid,
    .login-options,
    .category-grid,
    .entry-categories,
    .row-form {
        grid-template-columns: 1fr;
    }

    .page-head {
        display: grid;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero-image img {
        min-height: 260px;
    }

    .entry-boxes {
        grid-template-columns: 1fr;
        width: min(320px, 100%);
    }
}
