/* EdgeOwl admin. Classes and tokens from the Admin component of the canvas "EdgeOwl Admin" (see DESIGN.md); the artboard's
   inline styles became classes here, because the strict CSP forbids inline styles. No build step. */

@font-face {
  font-family: "Onest";
  src: url("/fonts/Onest-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Tokens: light on :root; dark by prefers-color-scheme unless data-theme="light"; data-theme="dark" forces dark. Same as the app. */
:root {
  color-scheme: light;
  --c-bg: #ffffff; --c-surface: #ffffff; --c-mist: #f5f5f5;
  --c-text: #000000; --c-muted: #6b7075;
  --c-border: #e6e6e6; --c-border-strong: #c9cccf;
  --c-danger: #b42318; --c-danger-hover: #8f1d13; --c-amber: #f2a900;
  --c-auth-bg: #f5f5f5;
  --sh-btn: 2px 2px 0 rgba(0, 0, 0, .16); --sh-btn-pressed: 1px 1px 0 rgba(0, 0, 0, .16); --sh-card: 4px 4px 0 rgba(0, 0, 0, .12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --c-bg: #101113; --c-surface: #17181a; --c-mist: #1f2124;
    --c-text: #f2f2f2; --c-muted: #9aa0a6;
    --c-border: #2b2d30; --c-border-strong: #45484c;
    --c-danger: #e5484d; --c-danger-hover: #f06a6e;
    --c-auth-bg: #0b0c0d;
    --sh-btn: 2px 2px 0 rgba(0, 0, 0, .55); --sh-btn-pressed: 1px 1px 0 rgba(0, 0, 0, .55); --sh-card: 4px 4px 0 rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --c-bg: #101113; --c-surface: #17181a; --c-mist: #1f2124;
  --c-text: #f2f2f2; --c-muted: #9aa0a6;
  --c-border: #2b2d30; --c-border-strong: #45484c;
  --c-danger: #e5484d; --c-danger-hover: #f06a6e;
  --c-auth-bg: #0b0c0d;
  --sh-btn: 2px 2px 0 rgba(0, 0, 0, .55); --sh-btn-pressed: 1px 1px 0 rgba(0, 0, 0, .55); --sh-card: 4px 4px 0 rgba(0, 0, 0, .45);
}

html, body { margin: 0; background: var(--c-bg); }
a { color: inherit; }
a:hover { color: inherit; }
.app { font-family: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; line-height: 1.5; color: var(--c-text); background: var(--c-bg); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; min-height: 100vh; }
.app * { box-sizing: border-box; }
.app h1, .app h2, .app h3, .app p { margin: 0; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline-form { display: inline-flex; margin: 0; }

/* Topbar: black in both themes; the admin wordmark carries a grey "admin" tag. */
.topbar { background: #000000; color: #ffffff; }
.topbar a { color: #a6abb3; text-decoration: none; }
.topbar a:hover { color: #ffffff; }
.topbar .inner { display: flex; align-items: center; gap: 16px; min-height: 52px; flex-wrap: wrap; padding-block: 8px; }
.topbar .brand { color: #ffffff; font-size: 16px; font-weight: 800; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 8px; }
.topbar .brand img { width: 24px; height: 24px; }
.topbar .brand .tag { font-size: 11px; font-weight: 600; letter-spacing: 0; color: #000000; background: #a6abb3; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.topbar .nav { display: flex; gap: 6px; align-items: center; list-style: none; margin: 0; padding: 0; flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.topbar .nav::-webkit-scrollbar { display: none; }
.topbar .nav a { display: inline-block; padding: 4.8px 11px; font-size: 14px; border: 1px solid transparent; border-radius: 6px; white-space: nowrap; }
.topbar .nav a.is-active { color: #ffffff; font-weight: 600; border-color: #ffffff; box-shadow: 2px 2px 0 rgba(255, 255, 255, .25); }
.topbar .right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar .who { font-size: 12.5px; color: #a6abb3; white-space: nowrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: #a6abb3; cursor: pointer; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); color: #ffffff; }
.icon-btn.is-active { background: #ffffff; color: #000000; }
.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; }
.theme-switch .icon-btn { width: 26px; height: 26px; border-radius: 999px; }

/* Page */
.page { padding-block: 24px 48px; display: flex; flex-direction: column; gap: 24px; flex: 1; }
.page-flash { padding-top: 16px; }
.head-text { display: flex; flex-direction: column; gap: 4px; }
.head-text.wide-gap { gap: 6px; }
.page-title { font-size: 21.6px; font-weight: 700; letter-spacing: -.015em; overflow-wrap: anywhere; }
.page-subtitle { color: var(--c-muted); font-size: 14.4px; }
.crumbs { font-size: 12.8px; color: var(--c-muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; font-weight: 600; color: var(--c-text); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.one-col { display: flex; flex-direction: column; gap: 24px; }
.panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel.tight { gap: 12px; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.panel-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.panel-desc { color: var(--c-muted); font-size: 13px; max-width: 60ch; margin-top: 2px; }
.panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 12.8px; font-weight: 600; }
.hint { font-size: 12.5px; color: var(--c-muted); }
.input { padding: 8px 10px; border: 1px solid var(--c-border-strong); border-radius: 6px; font-size: 14px; font-family: inherit; background: var(--c-surface); color: var(--c-text); width: 100%; }
.input:focus-visible { outline: 2px solid var(--c-text); outline-offset: 1px; border-color: var(--c-text); }
.input:disabled { opacity: .6; }
.select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7075' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
.select.auto { width: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6.4px 14.4px; border: 1px solid var(--c-border-strong); border-radius: 6px; font-size: 13.6px; font-family: inherit; font-weight: 600; line-height: 1.5; cursor: pointer; text-decoration: none; background: var(--c-surface); color: var(--c-text); box-shadow: var(--sh-btn); transition: background .12s, color .12s, box-shadow .12s, transform .12s; white-space: nowrap; }
.btn:hover { transform: translate(1px, 1px); box-shadow: var(--sh-btn-pressed); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-primary { border-color: var(--c-text); }
.btn-primary:hover { background: var(--c-text); color: var(--c-bg); }
.btn-secondary { color: var(--c-muted); }
.btn-secondary:hover { color: var(--c-text); }
.btn-danger { border-color: var(--c-danger); color: var(--c-danger); }
.btn-danger:hover { background: var(--c-danger); color: #ffffff; }
.btn-sm { padding: 3.5px 9.6px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary:disabled:hover { background: var(--c-surface); color: var(--c-text); }
.btn-danger:disabled:hover { background: var(--c-surface); color: var(--c-danger); }
.btn svg { width: 14px; height: 14px; }
.btn-google { gap: 10px; }
.btn-google img { width: 20px; height: 20px; flex: none; }
.badge { display: inline-block; padding: 1.6px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge-ok { background: var(--c-text); color: var(--c-bg); }
.badge-attention { border-color: var(--c-text); }
.badge-error { border-color: var(--c-danger); color: var(--c-danger); }
.badge-none { border-color: var(--c-border-strong); color: var(--c-muted); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 0; font-size: 14px; }
.kv dt { color: var(--c-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.sub { font-size: 12.5px; color: var(--c-muted); }
.linkish { font-weight: 600; text-decoration: none; font-size: 13.6px; }
.linkish:hover { text-decoration: underline; }
.flash { padding: 8px 16px; border: 1px solid var(--c-border); border-left: 3px solid var(--c-text); border-radius: 6px; font-size: 14px; background: var(--c-surface); }
.flash-danger { border-left-color: var(--c-danger); }

/* Attention lists, action rows */
.attn { display: flex; flex-direction: column; }
.attn.top-line { border-top: 1px solid var(--c-border); padding-top: 4px; }
.attn .line { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--c-border); }
.attn .line:first-child { border-top: 0; }
.attn .t { font-weight: 600; overflow-wrap: anywhere; }
.attn .d { font-size: 12.5px; color: var(--c-muted); overflow-wrap: anywhere; }
.acts { display: flex; flex-direction: column; }
.acts .line { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--c-border); }
.acts .line:first-child { border-top: 0; }
.acts .t { font-weight: 600; }
.acts .d { font-size: 12.5px; color: var(--c-muted); max-width: 60ch; }
.acts .ctl { display: flex; gap: 8px; align-items: center; flex: none; }
.acts .ctl .input { width: 150px; }
.note-row { display: flex; gap: 8px; }
/* Подтверждение действия (T-044): кнопка раскрывает строку с причиной и кнопкой подтверждения, как в Security приложения. */
.acts .ctl .confirm { display: flex; flex-direction: column; align-items: flex-end; }
.confirm summary { list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm[open] summary { opacity: .6; }
/* Раскрытая строка уходит под описание на всю ширину, описание не сжимается. */
@media (min-width: 761px) {
  .acts .line:has(details[open]) { flex-wrap: wrap; }
  .acts .line:has(details[open]) > .ctl { flex-basis: 100%; justify-content: flex-end; }
}
.confirm-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; justify-content: flex-end; }
.acts .ctl .confirm-form .input { width: 220px; }
.acts .ctl .confirm-form .input.days { width: 80px; }
.acts .ctl .confirm-form .input.date { width: 160px; }
.banner .confirm { display: flex; flex-direction: column; align-items: flex-end; }
.banner .confirm-form .input { width: 220px; }
.acts .cmd { font-size: 12.5px; color: var(--c-muted); margin-top: 2px; }
.acts .cmd.failed { color: var(--c-danger); }

/* Stat tiles on Overview and Jobs (T-045) */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .n { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.stat .l { font-size: 12.8px; color: var(--c-muted); }
.stat .n .d { font-size: 14px; font-weight: 600; color: var(--c-muted); margin-left: 6px; letter-spacing: 0; }
.text-danger { color: var(--c-danger); }
.linkish.small { font-size: 13px; }

/* Tables: wide ones scroll in a box on the phone */
.tbl-wrap { overflow-x: auto; margin-inline: -24px; padding-inline: 24px; scrollbar-width: thin; min-width: 0; max-width: calc(100% + 48px); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.table th { color: var(--c-muted); font-size: 12.8px; font-weight: 600; border-bottom-color: var(--c-text); white-space: nowrap; }
.table td:first-child, .table th:first-child { padding-left: 0; }
.table td:last-child, .table th:last-child { padding-right: 0; }
.table tr:last-child td { border-bottom: 0; }
.table .main { font-weight: 600; }
.table .num { text-align: right; white-space: nowrap; }
.table .nw { white-space: nowrap; }
.table a.main { text-decoration: none; }
.table a.main:hover { text-decoration: underline; }
.table .empty { color: var(--c-muted); padding-block: 24px; }
.search-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-row .input { max-width: 360px; }
.search-row .input.narrow { max-width: 260px; }
.search-row .select.auto { max-width: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--c-border-strong); border-radius: 999px; font-size: 12.8px; font-weight: 600; cursor: pointer; background: var(--c-surface); color: var(--c-muted); text-decoration: none; white-space: nowrap; }
.chip .c { font-weight: 400; }
.chip.on { background: var(--c-text); color: var(--c-bg); border-color: var(--c-text); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.8px; color: var(--c-muted); }
.pager .btns { display: flex; gap: 8px; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--c-danger); border-left: 4px solid var(--c-danger); border-radius: 10px; background: var(--c-surface); }
.banner .t { font-weight: 600; }
.banner .d { font-size: 12.8px; color: var(--c-muted); }
.head-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Footer */
.foot-bar { border-top: 1px solid var(--c-border); padding: 16px; text-align: center; font-size: 12.5px; color: var(--c-muted); }
.foot-bar a { text-decoration: none; }
.foot-bar a:hover { text-decoration: underline; }

/* Standalone sign-in card, like the app's auth screens */
.auth { background: var(--c-auth-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px; gap: 24px; min-height: 100vh; }
.card { background: var(--c-surface); border: 1px solid var(--c-text); border-radius: 10px; box-shadow: var(--sh-card); padding: 32px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.card .brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; text-decoration: none; }
.card .brand img { width: 28px; height: 28px; }
.mark-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark-dark { display: inline; }
  :root:not([data-theme="light"]) .mark-light { display: none; }
}
:root[data-theme="dark"] .mark-dark { display: inline; }
:root[data-theme="dark"] .mark-light { display: none; }
.card .brand .tag { font-size: 11px; font-weight: 600; letter-spacing: 0; color: var(--c-bg); background: var(--c-muted); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.card .title { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.card .title h1 { font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.card .title p { color: var(--c-muted); font-size: 13.5px; }
.card .small { font-size: 12.5px; color: var(--c-muted); text-align: center; }
.card .btn { width: 100%; }
.auth .foot { font-size: 12.5px; color: var(--c-muted); display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.auth .foot a { text-decoration: none; }
.auth .foot a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .topbar .nav { order: 3; flex-basis: 100%; gap: 2px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .15); }
  .topbar .nav a { font-size: 13.5px; padding: 4px 8px; }
  .topbar .who { display: none; }
}
@media (max-width: 760px) {
  .panel { padding: 20px 16px; }
  .tbl-wrap { margin-inline: -16px; padding-inline: 16px; max-width: calc(100% + 32px); }
  .table { min-width: 640px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attn .line { grid-template-columns: 1fr; gap: 4px; }
  .attn .line .badge, .attn .line .btn { justify-self: start; }
  .acts .line { flex-direction: column; align-items: flex-start; gap: 8px; }
  .acts .ctl { flex-wrap: wrap; }
  .acts .ctl .confirm, .banner .confirm { align-items: flex-start; }
  .confirm-form { justify-content: flex-start; }
  .acts .ctl .confirm-form .input, .banner .confirm-form .input { width: 100%; }
  .search-row .input, .search-row .input.narrow { max-width: none; }
}
