/* IVS LabDesk — тёмная тема. Цвета меняются в :root */
:root {
  --bg: #070d1c;
  --bg-2: #0b1430;
  --panel: rgba(17, 27, 52, .72);
  --panel-solid: #111b34;
  --row: #0d1630;
  --head-row: #16213f;
  --line: #1f2c4d;
  --line-soft: #18233f;
  --text: #e6ecf8;
  --muted: #8b97b3;
  --accent: #2f6df6;
  --accent-2: #1d5be6;
  --accent-glow: rgba(47, 109, 246, .35);
  --blue: #4f8cff;
  --green: #22c55e;
  --violet: #a78bfa;
  --sky: #38a3ff;
  --cyan: #22d3ee;
  --amber: #f5b544;
  --red: #f87171;
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font: 14px/1.45 Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(47, 109, 246, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(56, 163, 255, .07), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 70%);
  background-attachment: fixed;
}
a { color: inherit; }
.muted { color: var(--muted); }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(7, 12, 26, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-in {
  max-width: 1440px; margin: 0 auto; padding: 10px 28px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.brand .ico { width: 28px; height: 28px; color: var(--blue); }
.nav { display: flex; gap: 6px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 10px; border: 1px solid transparent;
  color: #c3cde2; text-decoration: none; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.nav a.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(47, 109, 246, .32), rgba(47, 109, 246, .16));
  border-color: rgba(79, 140, 255, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.account { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.account form { margin: 0; }

.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 6px 4px; color: #dfe6f5; user-select: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary .ico { width: 16px; height: 16px; transition: transform .15s; }
.menu[open] summary .ico { transform: rotate(180deg); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.menu-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 8px; }

/* ---------- Кнопки ---------- */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border: 1px solid rgba(120, 165, 255, .35); border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #3b7bff, var(--accent-2));
  color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 18px -6px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: filter .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover, button:hover { filter: brightness(1.1); }
.btn:active, button:active { transform: translateY(1px); }
.btn .ico { width: 16px; height: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-wide { width: 100%; padding: 11px; }
.btn-ghost { background: rgba(47, 109, 246, .12); box-shadow: none; color: #cfe0ff; }

/* ---------- Карточки ---------- */
main { max-width: 1180px; margin: 18px auto 48px; padding: 0 20px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .03);
}
.card-head { display: flex; align-items: center; gap: 12px; margin: 2px 4px 14px; }
.card-head .ico { width: 24px; height: 24px; color: var(--blue); }
.card-head h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.card-head .muted { margin-left: auto; font-size: 13px; }

/* ---------- Статистика ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  --c: var(--blue);
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 16%, transparent), color-mix(in srgb, var(--c) 5%, transparent));
}
.stat > .ico { width: 30px; height: 30px; color: var(--c); }
.stat span { display: block; color: #c7d0e4; font-size: 12.5px; }
.stat b { display: block; font-size: 23px; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; }
.c-blue { --c: var(--blue); }
.c-green { --c: var(--green); }
.c-violet { --c: var(--violet); }
.c-sky { --c: var(--sky); }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
  text-align: left; font-weight: 600; font-size: 13px; color: #c6cfe2;
  background: var(--head-row); padding: 9px 16px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
th:first-child { border-left: 1px solid var(--line); border-radius: 9px 0 0 9px; }
th:last-child { border-right: 1px solid var(--line); border-radius: 0 9px 9px 0; }
td { padding: 9px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }
td form { margin: 0; }
.right { text-align: right; }
.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); text-align: center; padding: 18px; }

/* ---------- Бейджи статусов ---------- */
.badge {
  --c: var(--muted);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; white-space: nowrap;
  color: #dbe3f3;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.st-new { --c: var(--violet); }
.st-waiting_payment { --c: var(--amber); }
.st-paid { --c: var(--cyan); }
.st-in_progress { --c: var(--blue); }
.st-completed { --c: var(--green); }
.st-cancelled { --c: var(--red); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px; background: rgba(255, 255, 255, .06); font-size: 12.5px; }
.tag .ico { width: 13px; height: 13px; }
.tag-hot { background: rgba(245, 181, 68, .14); color: var(--amber); }

/* ---------- Формы ---------- */
input {
  background: rgba(8, 14, 30, .7); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 14px; font: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #6f7b97; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 109, 246, .2); }
input[type=file] { padding: 7px; }
input[type=file]::file-selector-button {
  margin-right: 12px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--head-row); color: var(--text); cursor: pointer; font: inherit;
}
.inline-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 4px 4px; }
.inline-form input:not([type=hidden]) { flex: 1 1 120px; min-width: 0; }
.inline-form button { flex: none; padding-inline: 26px; }
.err { color: var(--red); font-weight: 600; }

/* ---------- Карточка заказа ---------- */
.back { display: inline-block; color: var(--muted); text-decoration: none; margin: 0 4px 10px; }
.back:hover { color: var(--text); }
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-head .card-head { margin-bottom: 14px; }
.order-head .badge { margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 4px 16px; }
.facts div { background: var(--row); border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 12px; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 2px 0 0; }
.files { list-style: none; margin: 0 4px; padding: 0; display: grid; gap: 8px; }
.files a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; text-decoration: none;
  background: var(--row); border: 1px solid var(--line-soft); border-radius: 10px;
}
.files a:hover { border-color: rgba(79, 140, 255, .45); }
.files .ico { color: var(--blue); }
.files .end { margin-left: auto; color: var(--muted); }
pre {
  margin: 0 4px; background: #060b18; color: #d5def0;
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  white-space: pre-wrap; overflow-x: auto; font: 13px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace;
}
.note { display: flex; align-items: center; gap: 10px; color: #cfe0ff; border-color: rgba(79, 140, 255, .3); }
.note .ico { color: var(--blue); }

/* ---------- Вход ---------- */
.login { max-width: 400px; margin: 70px auto; padding: 30px 28px; text-align: center; }
.login h2 { margin: 12px 0 4px; font-size: 22px; }
.login > .muted { margin: 0 0 22px; }
.login-logo .ico { width: 46px; height: 46px; color: var(--blue); filter: drop-shadow(0 0 14px var(--accent-glow)); }
.login form { display: grid; gap: 14px; text-align: left; }
.login label { display: grid; gap: 6px; color: #c6cfe2; font-size: 13px; }

/* ---------- Мобильные ---------- */
@media (max-width: 900px) {
  .topbar-in { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  main { padding: 0 10px; }
  .card { padding: 12px 10px; }
  .nav a { white-space: nowrap; padding: 7px 12px; }
  .table-wrap { margin: 0 -10px; padding: 0 10px; }
  table { min-width: 760px; }
  .stat { padding: 12px 14px; gap: 12px; }
  .stat > .ico { width: 24px; height: 24px; }
  .stat b { font-size: 20px; }
  .inline-form input:not([type=hidden]) { flex-basis: 100%; }
  .inline-form button { width: 100%; }
}
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; }
  .menu { display: none; }
}
