:root {
    --bg: #f5f7f9;
    --surface: #ffffff;
    --text: #1f2933;
    --muted: #617080;
    --line: #d9e1e8;
    --primary: #0a66c2;
    --primary-dark: #084c91;
    --success: #1d7a46;
    --warning: #9a6500;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

.topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 20px;
    justify-content: space-between;
    min-height: 64px;
    padding: 12px clamp(16px, 4vw, 40px);
}

.brand {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.container {
    margin: 0 auto;
    max-width: none;
    padding: 28px clamp(16px, 4vw, 40px);
    width: 100%;
}

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

.page-head h1 {
    font-size: 28px;
    line-height: 1.1;
    margin: 0;
}

.muted {
    color: var(--muted);
}

.panel,
.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}

.auth-wrap {
    display: grid;
    min-height: calc(100vh - 120px);
    place-items: center;
}

.auth-card {
    max-width: 420px;
    width: 100%;
}

.auth-card h1 {
    margin-top: 0;
}

.grid {
    display: grid;
    gap: 16px;
}

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

.dashboard-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    display: grid;
    gap: 10px;
    min-height: 180px;
    padding: 22px;
}

.dashboard-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 28px rgba(31, 41, 51, 0.08);
}

.dashboard-icon {
    align-items: center;
    background: #e6f1fb;
    border-radius: 8px;
    display: inline-flex;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.dashboard-icon.share::before {
    color: var(--primary);
    content: "\2197";
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}

.dashboard-icon.mail::before {
    color: var(--primary);
    content: "\2709";
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}

.dashboard-title {
    font-size: 20px;
    font-weight: 700;
}

.dashboard-description {
    color: var(--muted);
}

.filters {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    margin-bottom: 18px;
}

label {
    color: var(--muted);
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

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

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

.checkbox-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 14px;
}

.checkbox-group legend {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    padding: 0 6px;
}

.check-option {
    align-items: center;
    background: #f6f8fa;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    display: inline-flex;
    gap: 8px;
    margin: 0;
    min-height: 40px;
    padding: 8px 10px;
}

.check-option input {
    min-height: auto;
    width: auto;
}

.plain-check {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    gap: 8px;
    margin: 0;
}

.plain-check input {
    min-height: auto;
    width: auto;
}

.inline-form {
    margin: 0;
}

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

.button,
button {
    align-items: center;
    background: var(--primary);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
}

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

.button.secondary {
    background: #e9eef3;
    color: var(--text);
}

.button.secondary:hover {
    background: #d8e1ea;
}

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

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow-x: auto;
}

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

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

th {
    background: #eef3f7;
    color: #394957;
    font-size: 13px;
}

tr:last-child td {
    border-bottom: 0;
}

.post-text {
    max-width: 360px;
    white-space: pre-wrap;
}

.post-text-compact {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thumb {
    border: 1px solid var(--line);
    border-radius: 6px;
    height: 74px;
    object-fit: cover;
    width: 96px;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
}

.badge.pending {
    background: #fff4d6;
    color: var(--warning);
}

.badge.published {
    background: #ddf5e8;
    color: var(--success);
}

.badge.sent {
    background: #ddf5e8;
    color: var(--success);
}

.alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
}

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

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

.empty {
    color: var(--muted);
    padding: 28px;
    text-align: center;
}

@media (max-width: 800px) {
    .topbar,
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

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