/* ============================================================
   Панель редакции «Подшивка» — светлая тема в стиле сайта.
   ============================================================ */

:root {
    --ink: #1a1a1a;
    --muted: #6b6b6b;
    --line: #e3e0da;
    --paper: #ffffff;
    --soft: #f6f4f0;
    --accent: #c2452d;
    --accent-dark: #a03722;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(26,26,26,.06), 0 8px 24px rgba(26,26,26,.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--soft);
    color: var(--ink);
    font-family: Manrope, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }

:root {
    --motion-fast: 180ms;
    --motion-base: 280ms;
    --motion-ease: cubic-bezier(.22, .8, .25, 1);
}

@keyframes admin-section-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes admin-grid-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.dashboard-section.is-entering { animation: admin-section-in var(--motion-base) var(--motion-ease) both; }
.dashboard-section.is-exiting { opacity: 0; transform: translateY(-5px); transition: opacity 140ms ease, transform 140ms ease; }
.materials-grid > *, .unified-feed-list > * { animation: admin-grid-in var(--motion-base) var(--motion-ease) both; animation-delay: calc(var(--motion-index, 0) * 40ms); }
.demo-menu { position: relative; }
.demo-menu summary { cursor: pointer; list-style: none; border: 1px solid var(--line); padding: 7px 10px; border-radius: 7px; font-size: 12px; font-weight: 700; background: #fff; }
.demo-menu summary::-webkit-details-marker { display: none; }
.demo-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 245px; padding: 10px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 9px; transform-origin: top right; animation: admin-section-in var(--motion-fast) var(--motion-ease) both; }
.demo-menu-panel button { display: block; width: 100%; padding: 9px; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 6px; font-weight: 700; }
.demo-menu-panel button:hover { background: var(--soft); }.demo-menu-panel .danger { color: #a03722; }.demo-menu-panel small { display: block; padding: 8px 9px 2px; color: var(--muted); font-size: 11px; }
.unified-feed-editor { margin-top: 22px; padding: 16px; border: 1px solid var(--line); background: var(--soft); border-radius: 9px; }
.unified-feed-heading { display: flex; justify-content: space-between; align-items: start; gap: 14px; }.unified-feed-heading h3 { font-size: 17px; }.unified-feed-list { display: grid; gap: 8px; margin-top: 12px; }.unified-feed-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; }.unified-feed-item strong { display: block; }.unified-feed-item small { color: var(--muted); }.unified-feed-item button { border: 0; background: none; color: var(--accent); cursor: pointer; font-weight: 700; }
@media (max-width: 760px) { .header-right { flex-wrap: wrap; }.unified-feed-heading { flex-direction: column; } }

.eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* ---------- Каркас ---------- */

.admin-container { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 24px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header { padding: 0 10px 20px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.sidebar-header h2 { font-size: 17px; letter-spacing: .06em; }
.sidebar-header span { color: var(--muted); font-size: 12px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.sidebar-link:hover { background: var(--soft); color: var(--ink); }
.sidebar-link.active { background: var(--ink); color: #fff; }
.nav-icon { width: 20px; text-align: center; }
.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    padding: 1px 8px;
}
.sidebar-link-external { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }

.main-content { flex: 1; padding: 28px 36px 60px; min-width: 0; }

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}
.admin-header h1 { font-size: 24px; letter-spacing: -.01em; }
.header-right { display: flex; align-items: center; gap: 14px; }
.user-name { color: var(--muted); font-size: 13px; font-weight: 600; }
.btn-logout {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.btn-logout:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Кнопки ---------- */

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-light { border-color: var(--line); background: #fff; color: var(--ink); }
.btn-light:hover { border-color: var(--ink); }
.btn-primary.is-saved { background: #1c7c46; }
.btn-primary.is-error { background: var(--accent-dark); }

.text-button { background: none; border: none; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; }
.text-button:hover { text-decoration: underline; }

/* ---------- Обзор ---------- */

.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.welcome-row h2 { font-size: 22px; letter-spacing: -.01em; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 32px; }

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: center;
}
.stat-icon { font-size: 24px; }
.stat-info h3 { font-size: 26px; line-height: 1.1; }
.stat-info p { color: var(--muted); font-size: 12px; }

.recent-actions { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { font-size: 17px; }

.action-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.action-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.action-table td { padding: 10px; border-bottom: 1px solid var(--soft); }

.status {
    display: inline-block;
    background: #e7f3ec;
    color: #1c7c46;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
}
.status.draft { background: var(--soft); color: var(--muted); }
.featured-mark { display: inline-block; color: var(--accent); font-size: 11px; font-weight: 800; margin-left: 6px; }

/* ---------- Сетки карточек ---------- */

.materials-heading { margin-bottom: 14px; }
.content-help { color: var(--muted); font-size: 13px; margin-bottom: 18px; max-width: 640px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar input[type="search"], .toolbar select {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    background: #fff;
}
.toolbar input[type="search"] { flex: 1; min-width: 200px; }

.materials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.material-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s;
}
.material-card:hover { box-shadow: var(--shadow); }

.material-image {
    height: 140px;
    background: var(--soft);
    display: grid;
    place-items: center;
    font-size: 34px;
    overflow: hidden;
}
.material-image img { width: 100%; height: 100%; object-fit: cover; }

.material-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.material-body h3 { font-size: 16px; }
.material-body p { color: var(--muted); font-size: 13px; flex: 1; }
.material-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }

.card-actions { display: flex; gap: 8px; margin-top: 6px; }
.card-actions button {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.card-actions button:hover { border-color: var(--ink); }
.card-actions button.delete:hover { border-color: var(--accent); color: var(--accent); }

.empty-state {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 44px 20px;
    text-align: center;
    color: var(--muted);
}

/* ---------- Сообщения ---------- */

.messages-list { display: grid; gap: 14px; }
.message-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.message-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.message-head h3 { font-size: 15px; }
.message-head a { color: var(--accent); font-size: 13px; }
.message-head span { color: var(--muted); font-size: 12px; }
.message-card p { color: var(--muted); font-size: 14px; margin-bottom: 10px; }

/* ---------- Редактор текстов ---------- */

.content-page-select {
    width: 100%;
    max-width: 360px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 20px;
    background: #fff;
}
.content-fields { display: grid; gap: 14px; max-width: 760px; }
.content-field span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.content-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}
.content-empty, .content-loading, .content-error { color: var(--muted); padding: 20px 0; }
.content-error { color: var(--accent); }

/* ---------- Конструктор газет ---------- */
.newspaper-settings { display: grid; gap: 14px; max-width: 840px; }
.newspaper-setting-card { background: #fff; border: 1px solid #c3c4c7; padding: 18px 20px; border-radius: 3px; }
.newspaper-setting-card > div:first-child { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; }
.newspaper-setting-card h3 { font-size: 16px; font-weight: 600; }
.newspaper-setting-card a { color: #2271b1; font-size: 13px; }
.newspaper-setting-card > p { margin: 7px 0 14px; color: #646970; font-size: 13px; }
.setting-toggles { display: flex; gap: 20px; flex-wrap: wrap; }
.setting-toggles label { color: #2c3338; font-size: 13px; font-weight: 600; cursor: pointer; }
.setting-toggles input { margin-right: 5px; accent-color: #2271b1; }
.publication-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.publication-fields label { color: #50575e; font-size: 12px; font-weight: 700; }
.publication-fields label:nth-child(n+3) { grid-column: 1 / -1; }
.publication-fields input, .publication-fields textarea { display: block; width: 100%; margin-top: 5px; padding: 8px 10px; border: 1px solid #8c8f94; border-radius: 3px; color: #1d2327; font: inherit; }
.publication-fields textarea { resize: vertical; }
.publication-image-preview, .publication-document-preview { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 10px; border: 1px solid #dcdcde; background: #f6f7f7; color: #646970; font-size: 12px; }
.publication-document-preview { display: grid; gap: 8px; }
.publication-document-preview > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border-radius: 3px; background: #fff; }
.publication-document-preview button { padding: 4px 7px; border: 1px solid #d63638; border-radius: 3px; background: #fff; color: #b32d2e; font: inherit; font-size: 12px; cursor: pointer; }
.reference-editor { grid-column: 1 / -1; display: grid; gap: 10px; padding: 12px; border: 1px solid #dcdcde; border-radius: 3px; background: #f6f7f7; }
.reference-editor > b { color: #2c3338; font-size: 13px; }
.reference-editor label { display: grid; gap: 5px; }
.reference-remove, .reference-add { justify-self: start; padding: 5px 8px; border: 1px solid #8c8f94; border-radius: 3px; background: #fff; color: #2c3338; font: inherit; font-size: 12px; cursor: pointer; }
.reference-remove { border-color: #d63638; color: #b32d2e; }
.reference-add { color: #2271b1; border-color: #2271b1; }
.publication-image-preview img { display: block; width: 110px; height: 140px; object-fit: contain; background: #fff; border: 1px solid #c3c4c7; }
.publication-image-preview figure { display: grid; gap: 7px; margin: 0; }
.publication-image-preview figure img { width: 150px; height: 120px; }
.publication-image-preview button { padding: 5px 8px; border: 1px solid #d63638; border-radius: 3px; background: #fff; color: #b32d2e; font: inherit; font-size: 12px; cursor: pointer; }
.publication-delete { margin-top: 16px; padding: 7px 10px; border: 1px solid #d63638; border-radius: 3px; background: #fff; color: #b32d2e; font: inherit; font-size: 13px; cursor: pointer; }
.publication-delete:hover { background: #fcf0f1; }
.publication-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.publication-remove { margin-top: 16px; padding: 7px 10px; border: 1px solid #d63638; border-radius: 3px; background: #d63638; color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.publication-remove:hover { background: #b32d2e; }
.section-heading-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.newspaper-setting-card.is-deleted { border-left: 4px solid #d63638; opacity: .75; }
@media (max-width: 700px) { .publication-fields { grid-template-columns: 1fr; } }

/* ---------- Модальные окна ---------- */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, .45);
    display: flex;
    align-items: start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    z-index: 100;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-base) var(--motion-ease), visibility 0s linear var(--motion-base);
}
.modal.open { visibility: visible; opacity: 1; pointer-events: auto; transition-delay: 0s; }

.modal-card {
    background: #fff;
    border-radius: 14px;
    width: min(680px, 100%);
    padding: 28px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px) scale(.985);
    transition: opacity var(--motion-base) var(--motion-ease), transform var(--motion-base) var(--motion-ease);
}
.modal.open .modal-card { opacity: 1; transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-header h2 { font-size: 20px; }
.modal-close {
    border: none;
    background: var(--soft);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--muted);
}
.modal-close:hover { color: var(--accent); }

.related-box {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    background: #f6f7f7;
}
.related-box legend { padding: 0 4px; color: #2c3338; font-size: 13px; font-weight: 600; }
.related-list { display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.related-list small { color: #646970; font-weight: 400; }
.card-link {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 8px 10px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    color: #2271b1;
    font-size: 12px;
    font-weight: 700;
}
.card-link:hover { border-color: #2271b1; background: #f0f6fc; }

#post-form label, #feed-form label, #category-form label, #media-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 14px;
}
#post-form input:not([type="checkbox"]):not([type="file"]),
#post-form select, #post-form textarea,
#feed-form input:not([type="checkbox"]):not([type="file"]),
#feed-form select, #feed-form textarea,
#category-form input:not([type="checkbox"]):not([type="file"]), #category-form textarea,
#media-form input:not([type="checkbox"]):not([type="file"]),
#media-form select, #media-form textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    background: #fff;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.favorite-check { display: flex !important; align-items: center; gap: 10px; color: var(--ink) !important; }
.favorite-check input { width: auto !important; }

.upload-box {
    border: 1px dashed var(--line) !important;
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s;
}
.upload-box:hover { border-color: var(--accent) !important; }
.upload-box input { display: none; }
.upload-box span { display: block; color: var(--ink); font-weight: 700; }
.upload-box small { color: var(--muted); }

.image-preview { margin-bottom: 14px; }
.image-preview img { max-width: 220px; border-radius: 8px; border: 1px solid var(--line); }
.media-file-preview { margin: 0 0 14px; display: grid; gap: 8px; }
.media-file-preview video,
.media-file-preview audio { width: 100%; max-width: 360px; border-radius: 8px; background: #111; }
.media-file-preview small { color: var(--muted); }

.form-actions { display: flex; justify-content: end; gap: 10px; margin-top: 8px; }

/* ---------- Тост ---------- */

.admin-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: var(--ink);
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 200;
}
.admin-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.admin-toast.is-error { background: var(--accent-dark); }
.admin-toast.is-success { background: #1c7c46; }

@media (prefers-reduced-motion: reduce) {
    .dashboard-section.is-entering, .materials-grid > *, .unified-feed-list > *, .demo-menu-panel { animation: none; }
    .modal, .modal-card, .btn, .sidebar-link { transition: none; }
}

/* ---------- Администрирование в эстетике WordPress ---------- */

body { background: #f0f0f1; color: #1d2327; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; }
.admin-container { min-height: 100vh; }
.sidebar { width: 252px; padding: 0; background: #1d2327; border: 0; color: #f0f0f1; }
.wp-admin-brand { height: 46px; display: flex; align-items: center; gap: 9px; padding: 0 18px; background: #101517; color: #fff; font-size: 14px; font-weight: 600; }
.wp-mark { position: relative; display: block; width: 38px; height: 32px; flex: 0 0 38px; }
.wp-mark i { position: absolute; display: block; width: 27px; height: 20px; border: 2px solid currentColor; background: #fff; box-shadow: inset 0 -4px 0 var(--accent, #c2452d); }
.wp-mark i:nth-child(1) { left: 0; top: 8px; transform: rotate(-8deg) skewY(-4deg); }
.wp-mark i:nth-child(2) { left: 5px; top: 5px; transform: rotate(3deg) skewY(-4deg); }
.wp-mark i:nth-child(3) { left: 9px; top: 1px; transform: rotate(-2deg) skewY(-4deg); }
.wp-mark::after { content: ""; position: absolute; z-index: 2; left: 14px; top: 8px; width: 14px; height: 2px; background: currentColor; box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor; }
.wp-mark.has-logo { width: auto; min-width: 28px; height: 28px; flex: 0 0 auto; }
.wp-mark.has-logo::after { content: none; }
.wp-mark.has-logo img { display: block; height: 28px; width: auto; max-width: 132px; object-fit: contain; }
.logo-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.logo-card { background: #fff; border: 1px solid #c3c4c7; border-radius: 3px; padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.logo-card h3 { font-size: 16px; font-weight: 600; }
.logo-card p { color: #646970; font-size: 13px; }
.logo-card .btn { justify-self: start; }
.logo-preview { min-height: 88px; display: grid; place-items: center; gap: 8px; background: #f6f7f7; border: 1px dashed #c3c4c7; border-radius: 3px; padding: 14px; }
.logo-preview img { max-height: 64px; max-width: 180px; object-fit: contain; }
.logo-preview small { color: #646970; font-size: 12px; }
.logo-preview .logo-fallback { color: #1d2327; }
.sidebar-header { padding: 18px 18px 15px; margin: 0; border-bottom: 1px solid #3c434a; }
.sidebar-header h2 { font-size: 14px; color: #fff; letter-spacing: 0; }
.sidebar-header span { color: #a7aaad; }
.sidebar-nav { gap: 0; padding: 10px 0; }
.sidebar-link { min-height: 39px; padding: 9px 18px; border-radius: 0; color: #c3c4c7; font-weight: 400; font-size: 14px; }
.sidebar-link:hover { background: #2c3338; color: #72aee6; }
.sidebar-link.active { background: #2271b1; color: #fff; }
.nav-icon { font-size: 15px; opacity: .9; }
.nav-badge { background: #d63638; }
.sidebar-link-external { margin-top: 10px; padding-top: 12px; border-top-color: #3c434a; }
.main-content { padding: 30px 36px 60px; max-width: 1480px; }
.admin-header { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid #c3c4c7; }
.admin-header h1 { font-size: 23px; font-weight: 400; }
.view-site { color: #2271b1; font-size: 13px; }
.view-site:hover { color: #135e96; }
.btn-logout { border-radius: 3px; padding: 6px 10px; color: #50575e; }
.btn { border-radius: 3px; padding: 7px 12px; font-size: 13px; }
.btn-primary { background: #2271b1; border-color: #2271b1; }
.btn-primary:hover { background: #135e96; border-color: #135e96; }
.btn-light { border-radius: 3px; background: #f6f7f7; color: #2271b1; border-color: #2271b1; }
.welcome-row h2 { font-size: 20px; font-weight: 400; }
.stat-card, .recent-actions, .material-card, .message-card { border-color: #c3c4c7; border-radius: 3px; box-shadow: none; }
.stat-card { padding: 17px; }
.stat-info h3 { font-size: 26px; font-weight: 400; color: #2271b1; }
.recent-actions { padding: 0; overflow: hidden; }
.recent-actions .section-heading { padding: 16px 20px; margin: 0; border-bottom: 1px solid #c3c4c7; }
.action-table th { background: #f6f7f7; color: #2c3338; }
.action-table td { border-bottom-color: #dcdcde; }
.toolbar input[type="search"], .toolbar select, .content-page-select { border-color: #8c8f94; border-radius: 3px; }
.materials-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.material-card:hover { box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.material-image { height: 130px; background: #f6f7f7; }
.material-body h3 { font-size: 15px; color: #2271b1; }
.card-actions button { border-radius: 3px; color: #2271b1; border-color: #8c8f94; }
.card-actions button:hover { border-color: #2271b1; background: #f0f6fc; }
.visibility-mark { display: inline-block; width: max-content; background: #f0f0f1; color: #646970; border-radius: 2px; padding: 2px 6px; font-size: 11px; font-weight: 600; }
.modal { background: rgba(29,35,39,.65); }
.modal-card { border-radius: 3px; box-shadow: 0 5px 20px rgba(0,0,0,.3); }
.modal-close { border-radius: 3px; }
.form-hint { margin: -4px 0 14px; color: #646970; font-size: 12px; }

/* ---------- Адаптивность ---------- */

@media (max-width: 900px) {
    .admin-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .sidebar-nav { display: grid; grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .main-content { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .sidebar-nav { grid-template-columns: 1fr 1fr; }
    .main-content { padding: 14px; min-width: 0; }
    .admin-header, .section-heading, .toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
    .header-right { width: 100%; align-items: stretch; flex-direction: column; }
    .header-right > * { width: 100%; }
    .stats-grid { grid-template-columns: 1fr; }
    .dashboard-card { overflow-x: auto; }
    .data-table { min-width: 620px; }
    .materials-grid { grid-template-columns: 1fr; }
    .modal-card { width: calc(100% - 20px); max-height: calc(100vh - 20px); padding: 16px; }
    .form-actions { position: sticky; bottom: -16px; padding: 12px 0 0; background: #fff; }
}
