:root {
    --bg: #f3f6fb;
    --card: #ffffff;
    --line: #d9e1ef;
    --text: #17202f;
    --muted: #5d697d;
    --primary: #005ecb;
    --primary-dark: #01479a;
    --danger: #a91833;
    --success: #047857;
    --shadow: 0 8px 24px rgba(19, 35, 66, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: radial-gradient(circle at top right, #dfefff, transparent 42%), var(--bg);
    color: var(--text);
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0;
}

.topbar h1 {
    font-size: 1.1rem;
    margin: 0;
}

.brand-link {
    color: inherit;
    text-decoration: none;
}

.hero {
    background: linear-gradient(135deg, #0a63cb, #0b84f3);
    color: #fff;
    padding: 2rem 0;
    margin-bottom: 1.6rem;
}

.hero h2 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.35rem, 2.5vw, 1.9rem);
}

.hero p {
    margin: 0 0 1rem;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.66rem 0.8rem;
    background: #fff;
}

button,
.button {
    border: 0;
    border-radius: 10px;
    padding: 0.66rem 0.95rem;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--primary-dark);
}

.button.danger,
.delete-btn {
    background: var(--danger);
}

.layout,
.admin-layout,
.single-page {
    padding-bottom: 2rem;
}

.posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

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

.meta {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.read-more,
.table-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.read-more:hover,
.table-link:hover {
    text-decoration: underline;
}

.footer {
    border-top: 1px solid var(--line);
    background: #fff;
    margin-top: 2rem;
}

.footer p {
    margin: 0;
    padding: 1rem 0;
    color: var(--muted);
}

.admin-form {
    display: grid;
    gap: 0.75rem;
}

.admin-form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500 !important;
}

.checkbox-row input {
    width: auto;
}

.alert {
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    margin: 0 0 0.8rem;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

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

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 0.55rem;
    text-align: left;
    vertical-align: top;
}

.inline-form {
    display: inline-block;
    margin-left: 0.35rem;
}

.delete-btn {
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    font-size: 0.85rem;
}

.hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.article-card .summary {
    font-size: 1.05rem;
    color: #344054;
}

.article-body {
    line-height: 1.7;
    white-space: pre-wrap;
}

@media (max-width: 740px) {
    .search-form {
        grid-template-columns: 1fr;
    }
}
