/* Те же цвета, что в окне TUO: сайт сервера — продолжение приложения */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7; --panel: #ffffff; --line: #d8d8de; --text: #1d1d1f; --muted: #6e6e73;
  --accent: #0a66d8; --accent-soft: #0a66d822; --green: #1e9e4a; --orange: #c9730a; --red: #d0342c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1c1e; --panel: #2a2a2d; --line: #3d3d42; --text: #f2f2f4; --muted: #a1a1a8; --accent: #4c9bff; --accent-soft: #4c9bff33; --green: #4ccb72; --orange: #f0a040; --red: #ff6b61; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
button, .button { display: inline-block; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 14px; cursor: pointer; text-decoration: none; color: var(--text); }
button:hover:not(:disabled), .button:hover { border-color: var(--accent); text-decoration: none; }
button:disabled { opacity: .45; cursor: default; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.danger { color: var(--red); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
input, select { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 7px 9px; width: 100%; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
input[type=checkbox] { width: auto; margin: 0; }

header.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
header.top .brand { font-weight: 700; }
header.top .brand small { color: var(--muted); font-weight: 400; }
header.top .spacer { flex: 1; }
main { max-width: 980px; margin: 0 auto; padding: 16px; }
main.narrow { max-width: 400px; padding-top: 48px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.problem { margin: 10px 0; padding: 9px 12px; border: 1px solid var(--red); border-radius: 8px; background: #d3303014; color: var(--red); }
.notice { margin: 10px 0; padding: 9px 12px; border: 1px solid var(--green); border-radius: 8px; background: #1e9e4a14; }
.hidden { display: none !important; }

form.card label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
form.card button[type=submit] { margin-top: 18px; width: 100%; padding: 9px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card h3 { margin: 0; font-size: 16px; }
.card .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.accounts { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; }
.accounts li { padding: 3px 0; border-top: 1px solid var(--line); }
.accounts li:first-child { border-top: 0; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--green); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: #8882; white-space: nowrap; }
.badge.pending { background: #c9730a33; color: var(--orange); }
.badge.approved { background: #1e9e4a26; color: var(--green); }
.badge.blocked { background: #d0342c26; color: var(--red); }
.badge.full { background: var(--accent-soft); color: var(--accent); }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border-radius: 18px; white-space: nowrap; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { border-top: 0; color: var(--muted); font-weight: 600; font-size: 13px; }
td .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
td select { width: auto; padding: 4px 6px; }
/* на телефоне таблица превращается в карточки */
@media (max-width: 700px) {
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  table { border: 0; background: none; }
  tr { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 0; }
  td { border-top: 0; padding: 4px 12px; }
  td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; }
}

dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); padding: 18px; width: min(620px, 94vw); max-height: 88vh; }
dialog::backdrop { background: #0006; }
dialog h2 { margin-top: 0; }
dialog fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; padding: 8px 12px 10px; }
dialog legend { color: var(--muted); font-size: 13px; padding: 0 4px; }
.checks { max-height: 190px; overflow-y: auto; }
.check { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
