/* NewsFaker admin panel */
:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --ink: #1c2333;
    --muted: #6b7488;
    --line: #dfe3ea;
    --brand: #2f6feb;
    --brand-dark: #1f57c7;
    --ok: #17864b;
    --ok-bg: #e3f6ec;
    --warn: #a8690b;
    --warn-bg: #fdf1dc;
    --danger: #c0392b;
    --danger-bg: #fbe9e7;
    --pin: #8a5cf6;
    --pin-bg: #efe8ff;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 6px 20px rgba(20, 30, 60, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eceff3; padding: 1px 5px; border-radius: 4px; font-size: .9em; }

/* ---------- header ---------- */
.topbar {
    display: flex; align-items: center; gap: 24px;
    background: #131a29; color: #fff;
    padding: 0 24px; height: 56px;
    position: sticky; top: 0; z-index: 20;
}
.topbar__brand { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.topbar__brand span { color: #8b96ad; font-weight: 400; font-size: 13px; margin-left: 6px; }
.topbar__nav { display: flex; gap: 4px; }
.topbar__nav--right { margin-left: auto; }
.topbar__nav a {
    color: #c7cede; padding: 7px 13px; border-radius: 8px; font-size: 14px; text-decoration: none;
}
.topbar__nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.topbar__nav a.is-active { background: rgba(255, 255, 255, .14); color: #fff; }
.topbar__new { background: var(--brand) !important; color: #fff !important; }
.topbar__new:hover { background: var(--brand-dark) !important; }

/* ---------- layout ---------- */
.wrap { max-width: 1400px; margin: 0 auto; padding: 24px 20px 60px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }

.page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 { margin: 0; font-size: 24px; }
.page-head__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- flash ---------- */
.flash {
    padding: 11px 15px; border-radius: var(--radius); margin-bottom: 16px;
    font-size: 14px; border: 1px solid transparent;
}
.flash--ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe6d1; }
.flash--error { background: var(--danger-bg); color: var(--danger); border-color: #f2c4bf; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; color: var(--ink); border: 1px solid var(--line);
    padding: 8px 14px; border-radius: 8px; font-size: 14px; cursor: pointer;
    text-decoration: none; white-space: nowrap; font-family: inherit;
}
.btn:hover { border-color: #c3cad6; text-decoration: none; background: #fbfcfd; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn--danger { background: #fff; border-color: #eab8b1; color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: #eceff3; }
.btn--small { padding: 4px 9px; font-size: 13px; }

/* ---------- cards & boxes ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card__num { display: block; font-size: 26px; font-weight: 700; }
.card__label { color: var(--muted); font-size: 13px; }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.box h2 { margin: 0 0 14px; font-size: 17px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- forms ---------- */
.filters {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px; margin-bottom: 16px;
}
.filters__wide { min-width: 260px; flex: 1; }
input[type=text], input[type=search], input[type=datetime-local], input[type=file], select, textarea {
    font: inherit; color: inherit; background: #fff;
    border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47, 111, 235, .25); border-color: var(--brand); }
textarea { width: 100%; resize: vertical; font-family: inherit; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.field > input, .field > select { width: 100%; }
.field--inline { display: inline-block; margin: 0 16px 0 0; }
.radio-row { display: flex; gap: 16px; font-size: 14px; margin-bottom: 6px; }
.radio-row label { display: flex; align-items: center; gap: 5px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; font-size: 14px; }
.check-grid label { display: flex; align-items: center; gap: 6px; }

.preview { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.preview img { max-width: 220px; max-height: 130px; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- visual editor (Quill) ---------- */
.is-hidden { display: none !important; }
.editor { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.editor .ql-toolbar.ql-snow { border: none; border-bottom: 1px solid var(--line); background: #f7f8fa; }
.editor .ql-container.ql-snow { border: none; font-size: 15px; }
.editor .ql-editor { min-height: 320px; max-height: 60vh; overflow-y: auto; }
.editor .ql-editor img { max-width: 100%; height: auto; }
.editor-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- bulk bar ---------- */
.bulk {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #eef1f6; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 10px 12px; margin-bottom: 12px;
}
.bulk label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #eef0f4; }
.table thead th { background: #f7f8fa; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); white-space: nowrap; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: none; }
.table--compact td, .table--compact th { padding: 7px 10px; }
.table .check { width: 34px; }
.table .thumb { width: 64px; }
.table .thumb img { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; background: #eceff3; display: block; }
.news-title { font-weight: 600; color: var(--ink); }
.news-title:hover { color: var(--brand); }
.actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-form { display: flex; align-items: center; gap: 6px; }
.row-form--wide { flex-wrap: wrap; align-items: flex-end; }
.row-form__name { min-width: 180px; }
.row-form__check { display: flex; align-items: center; gap: 6px; font-size: 13.5px; white-space: nowrap; }
.row-state { min-width: 130px; }
.row-pin { max-width: 190px; }

/* ---------- badges ---------- */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 12px; font-weight: 600; background: #eef0f4; color: var(--muted); white-space: nowrap;
}
.badge--published, .badge--on { background: var(--ok-bg); color: var(--ok); }
.badge--draft { background: var(--warn-bg); color: var(--warn); }
.badge--hidden, .badge--off { background: var(--danger-bg); color: var(--danger); }
.badge--pin { background: var(--pin-bg); color: var(--pin); }

/* ---------- pager ---------- */
.pager { display: flex; gap: 6px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager__current {
    padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; font-size: 14px; color: var(--ink);
}
.pager a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pager__current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager__info { color: var(--muted); font-size: 13px; margin-right: 6px; }

/* ---------- form page ---------- */
.form__actions { display: flex; align-items: center; gap: 12px; margin: 4px 0 30px; }
.form__delete { margin-left: auto; }
.more { margin: 12px 0 0; font-size: 14px; }
