/* Ozon bJob — общие стили сайта, кабинета и панели владельца.
   Та же палитра, что в приложении: тёмный фон, карточки, золотой акцент. */
:root {
  --bg: #161616; --card: #1f1f1f; --card2: #262626; --field: #141414; --line: #2e2e2e; --line2: #444;
  --ink: #e8e8e4; --muted: #9a9a94; --gold: #c9a227; --gold-ink: #1a1a1a;
  --green: #9fd3a4; --green-bg: #1e2e1f; --green-line: #2f4a32;
  --red: #e8a0a0; --red-bg: #3a1f1f; --red-line: #5c2b2b;
  --gold-bg: #2a2412; --gold-line: #5a4a17;
  --blue: #b9c3e8; --blue-bg: #1d2233; --blue-line: #34405f;
  --mono: ui-monospace, Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, "Segoe UI", sans-serif; }
a { color: var(--gold); }
a:hover { color: #e0b93a; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 10px; }
h4 { font-size: 12.5px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 10px; }
.sub, .muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.lead { font-size: 17px; max-width: 640px; }
.nowrap { white-space: nowrap; }

/* ---------- каркас ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 18px 16px 48px; }
.wrap.narrow { max-width: 640px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
       padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.brand b { color: var(--gold); }
.brand span { font-weight: 400; font-size: 14px; }
.top nav a { color: var(--muted); text-decoration: none; margin-left: 14px; }
.top nav a:hover { color: var(--ink); }
footer { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- кнопки и поля ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--card2); color: var(--ink); cursor: pointer;
  text-decoration: none; font: inherit; line-height: 1.25; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--line2); color: var(--ink); }
button.primary, .btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: #d9b13a; border-color: #d9b13a; color: var(--gold-ink); }
button.danger { color: var(--red); border-color: var(--red-line); }
button.danger:hover { background: var(--red-bg); }
button.sm { padding: 5px 10px; font-size: 13px; }
button.link { background: none; border: 0; padding: 0; color: var(--gold); font-size: 13px; }
button.link:hover { text-decoration: underline; }
button:disabled, .btn.disabled { opacity: .5; cursor: default; pointer-events: none; }
button.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
button .count { font-weight: 400; opacity: .75; }

input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; padding: 10px 12px; background: var(--field); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font: inherit; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); }
textarea { min-height: 84px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=file] { color: var(--muted); font-size: 13px; max-width: 100%; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--gold); margin: 0; flex-shrink: 0; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
/* Срок требования версии: когда старые копии перестанут получать логику. */
.deadline { font-size: 13px; margin-top: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--gold-line); background: var(--gold-bg); }
.deadline.over { border-color: var(--red-line); background: var(--red-bg); color: #f0c4c4; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
::placeholder { color: #5e5e58; }

/* ---------- карточки, сетки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 8px 0; border-top: 1px solid var(--line); }
details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 0 16px; margin-bottom: 14px; }
details summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
details .body { padding-bottom: 14px; }
pre { background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0;
      font: 12.5px/1.5 var(--mono); overflow: auto; max-height: 460px; white-space: pre-wrap; overflow-wrap: anywhere; }
.keybig { font-family: var(--mono); font-size: 22px; letter-spacing: 1px; padding: 12px 16px; background: var(--field);
          border: 1px dashed var(--gold); border-radius: 10px; overflow-wrap: anywhere; user-select: all; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 28px 0 0; }
.step .num { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--gold-ink);
             font-weight: 700; align-items: center; justify-content: center; margin-bottom: 10px; }
.hero { padding: 16px 0 8px; }
.hero .row { margin: 18px 0 10px; }
.server-info { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }

/* ---------- значки состояний ---------- */
.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line);
         color: var(--muted); background: var(--card2); white-space: nowrap; line-height: 1.5; vertical-align: middle; }
.badge.active { color: var(--green); border-color: var(--green-line); background: var(--green-bg); }
.badge.expired { color: var(--muted); border-color: var(--line); background: #222; }
.badge.blocked { color: var(--red); border-color: var(--red-line); background: var(--red-bg); }
.badge.new { color: var(--gold); border-color: var(--gold-line); background: var(--gold-bg); }
.badge.trial { color: var(--blue); border-color: var(--blue-line); background: var(--blue-bg); }

/* ---------- сообщения ---------- */
.notice { padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 12px 0 0; border: 1px solid var(--line); background: var(--card2); overflow-wrap: anywhere; }
.notice.err { background: var(--red-bg); border-color: var(--red-line); color: #f0c4c4; }
.notice.ok { background: var(--green-bg); border-color: var(--green-line); }
.notice.info { background: var(--gold-bg); border-color: var(--gold-line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px);
         background: #2a2a2a; border: 1px solid var(--line2); color: var(--ink); padding: 10px 16px; border-radius: 10px;
         font-size: 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .55); overflow-wrap: anywhere; }
.toast.ok { border-color: var(--green-line); background: var(--green-bg); }
.toast.err { border-color: var(--red-line); background: var(--red-bg); }
.progress { height: 8px; background: var(--field); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0 0; }
.progress > i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .15s linear; }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs button { flex-shrink: 0; padding: 6px 13px; font-size: 14px; }
.tabs button.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
table.list tbody tr:hover td { background: #212121; }
table.list td.actions { white-space: nowrap; }
table.list td.actions button { margin: 2px 4px 2px 0; }
table.list .key { cursor: pointer; border-bottom: 1px dotted var(--muted); white-space: nowrap; }
.server-info .warn { color: var(--red); }
.badge.warn { color: var(--red); border-color: var(--red-line); background: var(--red-bg); }
table.list .key:hover { color: var(--gold); border-color: var(--gold); }
table.list td.note { cursor: text; min-width: 140px; max-width: 260px; overflow-wrap: anywhere; }
table.list td.note:hover { color: var(--gold); }
table.list td.note input { padding: 4px 8px; font-size: 13px; min-width: 140px; }

/* ---------- телефон ---------- */
@media (max-width: 760px) {
  h1 { font-size: 22px; }
  .grid2, .steps { grid-template-columns: 1fr; }
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 6px 12px; background: var(--card); }
  table.list tbody tr:hover td { background: transparent; }
  table.list td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; }
  table.list td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; flex-shrink: 0; }
  table.list td.actions { white-space: normal; flex-wrap: wrap; justify-content: flex-start; padding-top: 8px; }
  table.list td.actions::before { width: 100%; }
  table.list td.note { max-width: none; }
}
@media (max-width: 480px) {
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .keybig { font-size: 17px; }
}

/* Отчёты: строка-заголовок группы (клиент) */
table.list tr.group td { background: #1b1b1b; border-top: 1px solid var(--line2); padding-top: 10px; }
table.list tr.group td button { margin-right: 4px; min-width: 28px; }

/* ---------- карточки ключей ---------- */
/* Раньше ключи были таблицей на десять колонок: на широком экране половина
   пустовала, на узком всё уезжало под полосу прокрутки. Карточка кладёт
   главное наверх, подробности — сеткой, действия — внизу. */
.keys { display: grid; gap: 10px; }
.keycard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.keycard.blocked { border-color: var(--red-line); }
.keycard-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.keycard-head .key { cursor: pointer; border-bottom: 1px dotted var(--muted); white-space: nowrap; font-size: 15px; letter-spacing: .5px; }
.keycard-head .key:hover { color: var(--gold); border-color: var(--gold); }
.badge.online { color: var(--green); border-color: var(--green-line); background: var(--green-bg); }
/* Пометка — имя клиента, поэтому вправо и заметнее прочего. */
.keycard-note { margin-left: auto; min-width: 120px; text-align: right; cursor: text; }
.keycard-note input { width: 100%; max-width: 220px; }
.keycard-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; margin: 10px 0 12px; }
.fact { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fact-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.fact-v { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keycard-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .keycard-note { margin-left: 0; width: 100%; text-align: left; }
  .keycard-facts { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}
