:root {
  --paper: #EEF1F4; --surface: #FFFFFF; --ink: #16233A; --muted: #5E6B7E; --line: #D5DBE3;
  --post: #2B4EA2; --go: #1F8A4C; --wait: #B87A00; --stop: #C2362B;
  --font: "PT Sans", "Golos Text", "Segoe UI", "Noto Sans", "DejaVu Sans", "Liberation Sans", sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); line-height: 1.45; }
a { color: var(--post); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .4rem; }
h2 { font-size: 1.125rem; margin: 1.75rem 0 .6rem; }
.block > h2:first-child, .form > h2:first-child { margin-top: 0; }
p { margin: 0 0 .75rem; max-width: 72ch; }
code { background: var(--paper); padding: .05rem .3rem; border-radius: 3px; font-size: .95em; }
:focus-visible { outline: 3px solid var(--post); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 1.25rem 0 1rem; display: flex; flex-direction: column; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.375rem; padding: 0 1.25rem; }
.brand span { display: block; font-weight: 400; font-size: .8125rem; color: #AEB9CC; }
.side nav { display: flex; flex-direction: column; margin-top: .75rem; }
.side nav a { color: #DCE3EE; text-decoration: none; padding: .5rem 1.25rem; border-left: 4px solid transparent; }
.side nav a:hover { background: #1F3050; }
.side nav a.on { background: #223557; border-left-color: #fff; color: #fff; font-weight: 700; }
.side nav a.soon { color: #8C9AB3; }
.who { margin-top: auto; padding: 1rem 1.25rem 0; display: flex; justify-content: space-between; align-items: baseline; font-size: .875rem; color: #AEB9CC; }
.link { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.main { padding: 1.75rem 2rem 3rem; min-width: 0; }
.lead { color: var(--muted); margin-bottom: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* маленький светофор в боковой панели */
.mini { display: flex; align-items: center; gap: .5rem; margin: 1rem 1.25rem .25rem; padding: .45rem .6rem; border-radius: 6px; background: #0F1A2D; color: #fff; text-decoration: none; font-size: .875rem; }
.mini i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.mini--green i { background: #3DDC84; } .mini--yellow i { background: #FFC83D; } .mini--red i { background: #FF5A4F; }

/* большой светофор на сводке: единственная «громкая» вещь в панели */
.signal { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.5rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left-width: 8px; border-radius: 8px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.signal--green { border-left-color: var(--go); } .signal--yellow { border-left-color: var(--wait); } .signal--red { border-left-color: var(--stop); }
.signal__box { display: flex; gap: .5rem; background: var(--ink); padding: .6rem .7rem; border-radius: 28px; }
.l { width: 28px; height: 28px; border-radius: 50%; background: #2C3B57; }
.signal--red .l--red { background: #FF5A4F; box-shadow: 0 0 14px #FF5A4F; }
.signal--yellow .l--yellow { background: #FFC83D; box-shadow: 0 0 14px #FFC83D; }
.signal--green .l--green { background: #3DDC84; box-shadow: 0 0 14px #3DDC84; }
.signal__text h1 { font-size: 2rem; margin: 0; }
.signal__text p { margin: .2rem 0 0; color: var(--muted); }
.signal__act { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.block { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem 1.25rem; margin: 0 0 .5rem; }
.cols .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.block > .acts { margin-top: .9rem; }
.figures dt { color: var(--muted); font-size: .8125rem; }
.figures dd { margin: 0; font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.figures dd.small { font-size: 1.0625rem; font-weight: 400; padding-top: .45rem; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); margin-bottom: .75rem; font-size: .9375rem; }
.table th { text-align: left; font-weight: 700; font-size: .8125rem; color: var(--muted); padding: .5rem .7rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.acts form { margin: 0; }

.chip { display: inline-block; padding: .1rem .5rem; border-radius: 3px; font-size: .8125rem; background: var(--paper); border: 1px solid var(--line); white-space: nowrap; }
.chip--yes, .chip--sent, .chip--done { background: #E3F4EA; border-color: #A9D9BC; color: #14613A; }
.chip--no, .chip--closed, .chip--stopped { background: #FBF1D9; border-color: #E6CC8A; color: #6E4A00; }
.chip--error { background: #FBE4E1; border-color: #EDB1AA; color: #8E211A; }
.chip--waiting, .chip--inv-sent, .chip--inv-queued { background: #E4EAF8; border-color: #B4C3E6; color: #1E3A7E; }
.chip--inv-accepted { background: #E3F4EA; border-color: #A9D9BC; color: #14613A; }
.chip--inv-stale, .chip--inv-cancelled { background: #FBF1D9; border-color: #E6CC8A; color: #6E4A00; }
.chip--inv-failed { background: #FBE4E1; border-color: #EDB1AA; color: #8E211A; }
.of { font-size: 1rem; font-weight: 400; color: var(--muted); }
.form label.tick { display: flex; gap: .5rem; align-items: center; font-weight: 400; margin-bottom: .6rem; }
.figures--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.chip--sending, .chip--running, .chip--queued { background: #E4EAF8; border-color: #B4C3E6; color: #1E3A7E; }

.btn { font: inherit; font-size: .9375rem; padding: .45rem .9rem; border-radius: 6px; border: 1px solid #AEB9CC; background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.3; }
.btn:hover { border-color: var(--ink); }
.btn--main { background: var(--post); border-color: var(--post); color: #fff; font-weight: 700; }
.btn--main:hover { background: #223F86; border-color: #223F86; }
.btn--small { padding: .2rem .55rem; font-size: .8125rem; }

.form { display: grid; gap: .8rem; align-content: start; }
.form label, .gate__form label { display: grid; gap: .25rem; font-size: .875rem; font-weight: 700; }
input, select, textarea { font: inherit; font-weight: 400; padding: .45rem .6rem; border: 1px solid #AEB9CC; border-radius: 6px; background: #fff; color: var(--ink); max-width: 100%; }
textarea { resize: vertical; line-height: 1.4; }
fieldset { border: 0; border-top: 1px solid var(--line); padding: .8rem 0 0; margin: 0; }
legend { font-weight: 700; padding: 0 .5rem 0 0; }
.pair { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.pair label { grid-template-columns: auto 7rem; align-items: center; gap: .5rem; font-weight: 400; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filters input { min-width: 16rem; }

.alert { padding: .7rem 1rem; border-radius: 6px; border: 1px solid; margin-bottom: 1rem; max-width: none; }
.alert p { margin-bottom: .6rem; }
.alert--stop { background: #FBE4E1; border-color: #EDB1AA; color: #8E211A; }
.alert--go { background: #E3F4EA; border-color: #A9D9BC; color: #14613A; }
.alert--wait { background: #FBF1D9; border-color: #E6CC8A; color: #5A3D00; }
.empty { background: var(--surface); border: 1px dashed #AEB9CC; border-radius: 8px; padding: 1.25rem; color: var(--muted); max-width: none; }
.message { background: var(--paper); border-radius: 6px; padding: .8rem 1rem; }

.steps { margin: 0 0 1rem; padding-left: 1.25rem; max-width: 72ch; }
.steps li { margin-bottom: .3rem; }
.screen img { display: block; max-width: 100%; height: auto; border: 1px solid var(--ink); border-radius: 4px; background: #fff; cursor: crosshair; }
.screen { margin-bottom: .75rem; }

.gate { display: grid; place-items: center; min-height: 100vh; background: var(--ink); }
.gate__form { background: var(--surface); padding: 2rem; border-radius: 8px; width: min(22rem, 92vw); display: grid; gap: .9rem; }
.gate__form h1 { margin: 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { padding-bottom: .5rem; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side nav a { border-left: 0; border-bottom: 3px solid transparent; padding: .4rem .75rem; }
  .side nav a.on { border-bottom-color: #fff; }
  .who { margin-top: .5rem; }
  .main { padding: 1.25rem 1rem 2rem; }
  .cols { grid-template-columns: 1fr; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal { grid-template-columns: 1fr; }
  .signal__act { justify-content: flex-start; }
  .table { display: block; overflow-x: auto; }
}
.table td.acts { display: table-cell; white-space: nowrap; }
.table td.acts form { display: inline-block; margin: 0 .3rem 0 0; }
.btn { white-space: nowrap; }
.thumbs { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }

.chip--bday, .chip--bday_skip { background: #F6E6F4; border-color: #DDB3D8; color: #6E2466; }
