/* front-new/web/app.css — the admin panel's one stylesheet. Colours are the site's own (ugcswarm.net): warm paper, dark ink, a crimson mark. */
:root {
  --bg: #F8F5F3; --surface: #FFFDFC; --sunken: #F3EDEE; --ink: #181518; --ink2: #4A434B; --ink3: #6B6470; --line: #E2DADD; --line2: #C9BEC3;
  --accent: #181518; --accent-soft: #EBE3E6; --on-accent: #FFFDFC; --ok: #41493B; --ok-soft: #E3EAD9; --warn: #8A4A0B; --warn-soft: #F9E9D4;
  --bad: #C2153D; --bad-soft: #FBE6EC; --idle: #6B6470; --idle-soft: #EFE9EA; --device: #181518; --screen: #FCFAF8; --brand: #D91A46;
  --display: 'Bricolage Grotesque', 'DM Sans', sans-serif; --body: 'DM Sans', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171317; --surface: #211C21; --sunken: #2B242B; --ink: #FFFDFC; --ink2: #D2C9CF; --ink3: #A79EA6; --line: #372F37; --line2: #4D434D;
    --accent: #FFFDFC; --accent-soft: #352D35; --on-accent: #171317; --ok: #C3D0B3; --ok-soft: #2B3226; --warn: #F0B15C; --warn-soft: #3B2B15;
    --bad: #FF6384; --bad-soft: #40182A; --idle: #A79EA6; --idle-soft: #2B242B; --device: #5A4F5A; --screen: #1C171C; --brand: #FE2C55;
  }
}
:root[data-theme="dark"] {
  --bg: #171317; --surface: #211C21; --sunken: #2B242B; --ink: #FFFDFC; --ink2: #D2C9CF; --ink3: #A79EA6; --line: #372F37; --line2: #4D434D;
  --accent: #FFFDFC; --accent-soft: #352D35; --on-accent: #171317; --ok: #C3D0B3; --ok-soft: #2B3226; --warn: #F0B15C; --warn-soft: #3B2B15;
  --bad: #FF6384; --bad-soft: #40182A; --idle: #A79EA6; --idle-soft: #2B242B; --device: #5A4F5A; --screen: #1C171C; --brand: #FE2C55;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--body); -webkit-text-size-adjust: 100%; }
a { color: var(--ink); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.15; }
h1 { font-size: 20px; } h2 { font-size: 26px; } h3 { font-size: 17px; }
p { margin: 0; text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink2); } .faint { color: var(--ink3); } .small { font-size: 12.5px; }
.ru { hyphens: auto; }

/* the frame: sections on the left, the page on the right */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 10px; text-decoration: none; font: 700 17px var(--display); letter-spacing: 0.06em; }
.brand svg { width: 22px; height: 22px; stroke: var(--brand); }
.side-head { padding: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); }
.side a.item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; text-decoration: none; font-weight: 500; }
.side a.item[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
.side a.item:hover { background: var(--sunken); }
.side a.item span.n { margin-left: auto; font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; padding: 14px 10px 4px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink3); }
.live { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ok); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.live.stale { color: var(--warn); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 500 20px var(--display); }
.crumbs a { color: var(--ink3); } .crumbs i { color: var(--ink3); font-style: normal; }
.top .tools { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search { flex: 1 1 260px; max-width: 440px; height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); }
main.page { padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* pieces */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.btn.big { min-height: 44px; padding: 0 16px; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--sunken); border-color: var(--line); color: var(--ink3); cursor: default; }
.btn.menu-btn { display: none; }
.btn .count { padding: 1px 7px; border-radius: 10px; background: var(--sunken); color: var(--ink2); font-size: 12px; }
.btn .count.warn { background: var(--warn-soft); color: var(--warn); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.card.pad { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.strong { border: 1.5px solid var(--ink); border-radius: 12px; }
.card > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 12px 14px; }
.card > header h3 { font: 600 15px var(--body); }
.card > footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 13px; color: var(--ink2); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.row.end { align-items: flex-end; justify-content: space-between; }
.split { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.split > .wide { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.split > .narrow { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; min-width: 0; }
.row > .tiles { flex-basis: 280px !important; }
.tile { padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.tile.soft { background: var(--sunken); border: 0; }
.tile b { font: 600 21px var(--display); } .tile span { font-size: 12px; color: var(--ink3); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--sunken); color: var(--ink2); }
a.pill { text-decoration: none; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.idle { background: var(--idle-soft); color: var(--idle); }
.pill.dark { background: var(--accent-soft); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 10px; border-radius: 12px; background: var(--accent-soft); font-size: 12.5px; }
.chip.line { background: transparent; border: 1px solid var(--line2); color: var(--ink2); }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; background: var(--sunken); border-radius: 9px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--ink2); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(24, 21, 24, 0.2); }
.seg button .n { font-weight: 500; color: var(--ink3); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border: 1px solid var(--line2); border-radius: 18px; background: var(--surface); font-weight: 600; }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
select, input[type="text"], textarea { min-height: 40px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); }
textarea { padding: 10px 12px; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink2); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ink2); font-weight: 500; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.tabs button .n { font-size: 12px; color: var(--ink3); }

/* tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 0 10px; height: 38px; background: var(--sunken); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink2); text-align: left; white-space: nowrap; }
td { padding: 6px 10px; height: 50px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 14px; } th:last-child, td:last-child { padding-right: 14px; }
th.r, td.r { text-align: right; }
th.num, td.num, td.nw { white-space: nowrap; }
tr.on td { background: var(--accent-soft); }
tr.pick { cursor: pointer; }
td .sub { display: block; font-size: 12px; color: var(--ink3); }
td.name a, td.name button { font-weight: 600; text-decoration: none; padding: 0; border: 0; background: none; text-align: left; }
td.warn { color: var(--warn); font-weight: 600; }
.clip { max-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 28px 14px; text-align: center; color: var(--ink2); }
dl.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; font-size: 13px; }
dl.facts dt { color: var(--ink3); } dl.facts dd { margin: 0; text-align: right; text-wrap: pretty; }

/* the phone farm's own shapes */
.nets { display: flex; gap: 4px; }
.net { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; font: 700 9.5px var(--display); border: 1.5px dashed var(--line2); color: var(--ink3); }
.net.live { background: var(--ok-soft); border: 1.5px solid var(--ok); color: var(--ok); }
.net.setup { background: var(--idle-soft); border: 1.5px solid var(--idle); color: var(--idle); }
.net.blocked { border: 1.5px dashed var(--bad); color: var(--bad); }
.nets.big { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.nets.big .net { width: auto; height: auto; aspect-ratio: 1 / 1; border-radius: 14px; flex-direction: column; gap: 1px; font-size: 15px; }
.nets.big .net small { font: 400 11.5px var(--body); }
.slots { display: inline-flex; gap: 3px; vertical-align: middle; }
.slots i { width: 9px; height: 14px; border-radius: 3px; border: 1.5px dashed var(--line2); }
.slots i.full { background: var(--ink); border: 1.5px solid var(--ink); }
.phone { align-self: center; width: 100%; max-width: 300px; padding: 14px 12px 16px; border: 5px solid var(--device); border-radius: 34px; background: var(--screen); display: flex; flex-direction: column; gap: 8px; }
.phone::before { content: ''; align-self: center; width: 9px; height: 9px; border-radius: 50%; background: var(--device); }
.phone .slot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 3px 10px; border-radius: 10px; background: var(--accent-soft); text-decoration: none; }
.phone .slot.free { background: transparent; border: 1.5px dashed var(--line2); color: var(--ink3); }
.phone .slot b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glyph { display: inline-block; width: 13px; height: 22px; border: 2px solid var(--device); border-radius: 4px; vertical-align: middle; margin-right: 10px; }
.bar { display: flex; gap: 2px; height: 8px; }
.bar span { min-width: 4px; border-radius: 4px; background: var(--accent); }
.bar span.ok { background: var(--ok); } .bar span.rest { background: var(--line2); } .bar span.bad { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--accent); }
.legend i.ok { background: var(--ok); } .legend i.rest { background: var(--line2); } .legend i.bad { background: var(--bad); }
.spark { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; align-items: end; height: 92px; border-bottom: 1px solid var(--line2); }
.spark span { min-height: 3px; border-radius: 4px 4px 0 0; background: var(--accent); }
.note { padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.plain { background: var(--sunken); color: var(--ink2); font-weight: 400; }
.wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 60vh; text-align: center; color: var(--ink2); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.step { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; }
.toggle { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 60px; padding: 8px 4px; border-radius: 12px; border: 1.5px dashed var(--line2); background: transparent; color: var(--ink3); }
.toggle[aria-checked="true"] { border: 1.5px solid var(--accent); background: var(--accent); color: var(--on-accent); }
.toggle b { font: 700 15px var(--display); } .toggle span { font-size: 12px; }
.toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 8px; }
.check { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 4px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; }
.check[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.check i { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line2); }
.check[aria-checked="true"] i { background: var(--accent); border-color: var(--accent); }
iframe.lab { width: 100%; height: calc(100vh - 130px); min-height: 640px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tree { display: flex; flex-direction: column; gap: 2px; }
.tree button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-weight: 500; }
.tree button[aria-pressed="true"] { background: var(--accent-soft); font-weight: 600; }
.subnav { flex: 1 1 200px; max-width: 250px; display: flex; flex-direction: column; gap: 2px; }
.subnav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 4px 10px; border-radius: 8px; text-decoration: none; font-weight: 500; }
.subnav a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }

/* the sign-in page */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; padding: 28px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.login input { min-height: 46px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform 0.18s; box-shadow: 0 0 40px rgba(0, 0, 0, 0.25); }
  .shell.open .side { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; } main.page { padding: 16px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)) !important; }
  .crumbs { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
