:root {
  --blue: #1F4E79; --blue-l: #2d6da8; --bg: #f4f6f9; --line: #d7dee7;
  --text: #1a2433; --muted: #6b7684; --err: #b3372f; --ok: #21713d;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--blue-l); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

.topbar { display: flex; align-items: center; gap: 24px; background: var(--blue); color: #fff; padding: 10px 20px; flex-wrap: wrap; }
.topbar .brand { font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar nav a { color: #dbe6f2; }
.topbar nav a:hover { color: #fff; text-decoration: none; }
.topbar .userbox { color: #dbe6f2; font-size: 13px; }
.topbar .userbox a { color: #fff; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.container-bare { max-width: 420px; margin: 10vh auto; padding: 0 16px; }

h1 { font-size: 22px; margin: 0 0 12px; color: var(--blue); }
h2 { font-size: 17px; margin: 24px 0 8px; color: var(--blue); }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.flash-ok { background: #e2f2e7; color: var(--ok); border: 1px solid #b9dcc5; }
.flash-err { background: #fbe4e2; color: var(--err); border: 1px solid #efc0bc; }

.login-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.login-card h1 { text-align: center; }
.login-card p { text-align: center; margin-top: -6px; }
label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
button { margin-top: 14px; width: 100%; padding: 10px; background: var(--blue); color: #fff; border: 0; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; }
button:hover { background: var(--blue-l); }
button.link { width: auto; margin: 0; padding: 2px 6px; background: none; color: var(--blue-l); font-weight: 400; }
button.link:hover { text-decoration: underline; background: none; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 18px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; text-align: center; }
.tile-num { font-size: 34px; font-weight: 700; color: var(--blue); }

table.grid { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.grid th { background: var(--blue); color: #fff; text-align: left; padding: 8px 10px; font-size: 13px; }
table.grid td { border-top: 1px solid var(--line); padding: 7px 10px; font-size: 14px; }
table.grid tr.inactive td { color: var(--muted); background: #fafbfc; }
.row-actions form.inline { display: inline-flex; gap: 6px; align-items: center; margin-right: 12px; }
.row-actions input { width: 140px; padding: 4px 8px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; max-width: 520px; }
.form-grid label { margin-top: 8px; }

/* --- дроп 2 --- */
.crumbs { margin: 0 0 6px; font-size: 13px; }
.funnel { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.funnel-step { flex: 1; min-width: 120px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: center; color: var(--text); }
.funnel-step:hover { text-decoration: none; border-color: var(--blue-l); }
.funnel-step.active { border-color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }
.funnel-num { font-size: 22px; font-weight: 700; color: var(--blue); }
.funnel-name { font-size: 12px; color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filters input, .filters select { width: auto; min-width: 130px; }
.filters button.slim, .toolbar .btn { margin: 0; width: auto; padding: 8px 14px; }
.btn { display: inline-block; background: var(--blue); color: #fff; border-radius: 6px; padding: 8px 14px; font-weight: 600; }
.btn:hover { background: var(--blue-l); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #e8eef5; color: var(--blue); }
.tag.warn { background: #fdeeea; color: var(--err); }
.tag.ok { background: #e2f2e7; color: var(--ok); }
.pager { margin: 14px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.pager a { padding: 4px 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.pager a.cur { background: var(--blue); color: #fff; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.two-col .card { margin-bottom: 16px; max-width: none; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .row3 { grid-template-columns: 1fr; } }
.quick-act button { width: auto; padding: 8px 22px; }
.feed-item { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.feed-head { font-size: 13px; }
.feed-head .muted { float: right; font-size: 12px; }
.feed-body { margin-top: 6px; font-size: 14px; }
.contact-row { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
details summary { cursor: pointer; color: var(--blue-l); margin: 8px 0; }
label.check { display: flex; gap: 8px; align-items: center; }
