/* Пульт — каркас стилей до макетов S34-1304. Без внешних шрифтов и CDN. */
:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #1d2433; --muted: #6b7385; --line: #e3e6ec;
  --accent: #2563eb; --accent-ink: #ffffff; --side: #111827; --side-ink: #d1d5db; --side-active: #1f2937;
  --warn: #b45309; --warn-bg: #fff7ed; --err: #b91c1c; --err-bg: #fef2f2; --ok-bg: #ecfdf5; --ok: #047857;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 28px 0 12px; }

.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 16px; }
.brand.big { color: var(--ink); font-size: 24px; padding: 0 0 8px; }
.menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu-title { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: #8b93a3; padding: 14px 10px 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 8px 10px; border-radius: 8px; }
.menu-item:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.menu-item.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.ico { display: inline-block; width: 18px; text-align: center; }
.submenu { display: flex; flex-direction: column; margin: 2px 0 6px 38px; gap: 2px; }
.submenu a { color: #aab1bf; padding: 4px 6px; border-radius: 6px; font-size: 13px; }
.submenu a.active, .submenu a:hover { color: #fff; background: var(--side-active); text-decoration: none; }
.badge { font-size: 10.5px; background: #374151; color: #e5e7eb; border-radius: 999px; padding: 1px 7px; margin-left: auto; }
.sidebar-foot { font-size: 11px; color: #6b7280; padding: 8px 10px 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 20px; background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 24px; position: sticky; top: 0; z-index: 2; }
.shop-picker label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.shop-picker select { min-width: 220px; }
.asof { color: var(--muted); font-size: 13px; }
.user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 600; }
.role { font-size: 12px; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 1px 8px; }
.link-muted { color: var(--muted); font-size: 13px; }
.content { padding: 24px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile, .card, .widget { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile-label { color: var(--muted); font-size: 12.5px; }
.tile-value { font-size: 26px; font-weight: 700; margin: 2px 0; }
.tile-sub { color: var(--muted); font-size: 12px; }
.tile-warn { border-color: #fdba74; background: var(--warn-bg); }
.widgets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.widget.w2 { grid-column: span 2; }
.widget-head { font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mini-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #f9fafb; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.table.small td, .table.small th { padding: 6px 8px; font-size: 12.5px; }
.table td.params { max-width: 360px; overflow-wrap: anywhere; color: var(--muted); }
.row-off td { color: #9ca3af; }
.row-err td { background: var(--err-bg); }
.pill { display: inline-block; font-size: 11.5px; background: #f3f4f6; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.pill-warn { background: var(--warn-bg); border-color: #fdba74; color: var(--warn); }

.form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.form label, .login-card label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.form ul { list-style: none; padding: 0; margin: 4px 0; font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid #cfd4dc; border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.btn { display: inline-block; font: inherit; border: 1px solid #cfd4dc; background: #fff; color: var(--ink); padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.btn:hover { text-decoration: none; background: #f3f4f6; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #1d4ed8; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-link { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.btn-link.danger { color: var(--err); }
.wide { width: 100%; }
.inline { display: inline; }
.actions { display: flex; gap: 12px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.pager { margin-top: 12px; color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.err { color: var(--err); font-weight: 400; font-size: 12.5px; }
.messages { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.msg { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.msg-success { background: var(--ok-bg); border-color: #a7f3d0; color: var(--ok); }
.msg-warning { background: var(--warn-bg); border-color: #fdba74; color: var(--warn); }
.msg-error { background: var(--err-bg); border-color: #fecaca; color: var(--err); }
.secret { background: #111827; color: #a7f3d0; padding: 12px; border-radius: 8px; overflow-x: auto; user-select: all; }

.login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, #111827 0%, #1e293b 55%, #2563eb 160%); }
.login-card { width: 360px; background: var(--panel); border-radius: 14px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 12px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .tiles, .widgets, .mini-tiles { grid-template-columns: 1fr 1fr; }
  .widget.w2 { grid-column: span 2; }
  .topbar { flex-wrap: wrap; }
}
