/* База ПТО — общий стиль. Без сборки: обычный CSS. */
:root {
  --bg: #f4f5f7; --panel: #fff; --text: #1d2430; --muted: #667085; --line: #dde1e7;
  --accent: #1f5fbf; --accent-hover: #174a96; --ok-bg: #e7f5ec; --ok: #1d6b3a;
  --err-bg: #fdecec; --err: #a12626; --warn-bg: #fff6e0; --mark: #fff3c4;
  --radius: 8px; --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }

.topbar { display: flex; align-items: center; gap: 1.2rem; background: #1d2a3a; color: #fff; padding: .55rem 1.2rem; }
.topbar a { color: #dfe7f3; }
.topbar .brand { font-weight: 600; color: #fff; margin-right: .5rem; }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.topbar nav a.active { color: #fff; font-weight: 600; }
.topbar .me { display: flex; align-items: center; gap: .8rem; font-size: .93rem; color: #b9c4d3; }
.topbar form { margin: 0; }
.linkbtn { background: none; border: 0; color: #dfe7f3; cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { text-decoration: underline; }

main { max-width: 1180px; margin: 1.4rem auto; padding: 0 1.2rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.msg { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; }
.msg.success { background: var(--ok-bg); color: var(--ok); }
.msg.error { background: var(--err-bg); color: var(--err); }
.msg.warning, .msg.info { background: var(--warn-bg); }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 6px;
       padding: .45rem 1rem; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--accent); }
.btn.secondary:hover { background: #eef3fb; }
.actions { display: flex; gap: .6rem; align-items: center; margin-top: 1.2rem; flex-wrap: wrap; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

table.list { width: 100%; border-collapse: collapse; background: var(--panel); }
table.list th, table.list td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-weight: 600; font-size: .88rem; color: var(--muted); background: #fafbfc; }
table.list tr:hover td { background: #f8fafc; }
tr.inactive td { color: var(--muted); }

form.stack p, .field { margin: 0 0 .9rem; }
label { display: block; font-weight: 500; margin-bottom: .25rem; }
input[type=text], input[type=password], input[type=date], input[type=search], select {
  font: inherit; padding: .42rem .55rem; border: 1px solid #c5ccd6; border-radius: 6px; width: 100%; max-width: 360px; background: #fff; }
input:focus, select:focus { outline: 2px solid #b8d0f5; border-color: var(--accent); }
.helptext, .field .help { display: block; font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.errorlist { color: var(--err); margin: .2rem 0; padding-left: 1.1rem; font-size: .9rem; }
.checkbox label { display: inline; font-weight: normal; }

.filters { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.filters .f { display: flex; flex-direction: column; }
.filters label { font-size: .85rem; color: var(--muted); font-weight: normal; }
.filters input, .filters select { width: auto; min-width: 140px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--text); }
a.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile .t { font-weight: 600; margin-bottom: .3rem; }
.tile.soon { color: var(--muted); background: #fafbfc; }

.rights td.c { text-align: center; width: 7rem; }
.rights tr.changed td { background: var(--mark); }
.badge { display: inline-block; font-size: .78rem; padding: .05rem .45rem; border-radius: 10px; background: #e9edf3; color: #3d4756; }
.badge.admin { background: #dbe7fb; color: #1f4f9a; }
.badge.off { background: #f1e3e3; color: #8a2b2b; }

.changes { margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.changes b { font-weight: 500; }
.pager { display: flex; gap: .8rem; align-items: center; margin-top: 1rem; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login { width: 100%; max-width: 360px; }
.login h1 { text-align: center; }
.login input { max-width: none; }
.login .btn { width: 100%; }
.htmx-request { opacity: .6; transition: opacity .2s; }
