:root {
    --bg: #f5f7fc;
    --surface: #fff;
    --ink: #101a2e;
    --muted: #5d6b84;
    --line: #e3e9f5;
    --brand: #2f5bff;
    --brand-dark: #1e43d6;
    --success: #e8f7ee;
    --error: #fdecec;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
h1,h2,h3 { line-height: 1.15; margin: 0 0 12px; }
p { margin: 0 0 12px; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; }

.container {
    width: min(1200px, 100% - 32px);
    margin: 0 auto;
}

.section { padding: 48px 0; }
.muted { color: var(--muted); }
.lead { font-size: 20px; color: var(--muted); }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    flex-wrap: wrap;
    padding: 12px 0;
}

.logo {
    font-weight: 800;
    font-size: 20px;
}

nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

nav a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

nav a:hover { color: var(--brand); }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
}

.grid-2, .grid-3 {
    display: grid;
    gap: 18px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover { background: var(--brand-dark); }
.btn.ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}
.btn.ghost:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: #fff;
}
.btn.danger {
    background: #d13438;
}

.hero {
    padding: 72px 0 36px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

label {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcff;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    background: #fff;
}

.checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 500;
}

.checkbox input {
    width: auto;
    margin-top: 3px;
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin: 18px 0;
}

.alert.success {
    background: var(--success);
    color: #146c43;
}

.alert.error {
    background: var(--error);
    color: #b02a30;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.filters input,
.filters select {
    width: auto;
    margin-top: 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

.table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr .8fr;
    gap: 24px;
    padding: 36px 0;
}

.footer-grid ul li {
    margin: 8px 0;
}

.footer-grid a:hover {
    color: var(--brand);
}

.admin-body {
    background: #eef2f9;
}

.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 24px 18px;
}

.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.admin-sidebar a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 600;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
    background: #eef3ff;
    color: var(--brand);
}

.admin-main {
    padding: 28px;
}

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

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

.link {
    background: none;
    border: 0;
    color: var(--brand);
    cursor: pointer;
    padding: 0;
}

.link.danger,
.btn.danger {
    color: #fff;
}

.link.danger {
    color: #d13438;
}

.stat strong {
    display: block;
    font-size: 34px;
    margin-bottom: 4px;
}

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

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

    .admin-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}