:root {
  --bg: #050810;
  --panel: #111827cc;
  --panel-2: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1f2937;
  --primary: #2563eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.10), transparent 28%),
    linear-gradient(180deg, #020617, #050810 45%, #020617);
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(14px);
}

.brand {
  font-size: 20px;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.center {
  text-align: center;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  color: white;
  background: #1f2937;
  cursor: pointer;
  font: inherit;
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn.primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.btn.success {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.small {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(2, 6, 23, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(560px, 100%);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0;
}

.tab {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.tab.active {
  color: white;
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.45);
}

.stack {
  display: grid;
  gap: 12px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
  resize: vertical;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 18px;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
}

h2 {
  font-size: 28px;
}

h3 {
  margin: 24px 0 12px;
  font-size: 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.55);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(15, 23, 42, 0.7);
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.06);
}

.clickable {
  cursor: pointer;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-new {
  background: rgba(37, 99, 235, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(37, 99, 235, 0.35);
}

.badge-accepted {
  background: rgba(14, 165, 233, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.badge-progress {
  background: rgba(217, 119, 6, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.35);
}

.badge-done {
  background: rgba(22, 163, 74, 0.16);
  color: #86efac;
  border: 1px solid rgba(22, 163, 74, 0.4);
}

.badge-closed {
  background: rgba(100, 116, 139, 0.18);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.done-row {
  background: rgba(22, 163, 74, 0.09);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, #111827, #050810);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #111827;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.prewrap {
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 14px;
  }
}

/* Scrollbar под цвет интерфейса */
* {
  scrollbar-width: thin;
  scrollbar-color: #334155 #0f172a;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: #0f172a;
}
*::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 6px;
  border: 2px solid #0f172a;
}
*::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}
*::-webkit-scrollbar-corner {
  background: #0f172a;
}

/* Scrollbar светлой темы */
html[data-theme="light"] * {
  scrollbar-color: #c9d3e0 #f1f4f9;
}
html[data-theme="light"] *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
html[data-theme="light"] *::-webkit-scrollbar-track {
  background: #f1f4f9;
}
html[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: #c9d3e0;
  border-radius: 6px;
  border: 2px solid #f1f4f9;
}
html[data-theme="light"] *::-webkit-scrollbar-thumb:hover {
  background: #2f5fc4;
}
html[data-theme="light"] *::-webkit-scrollbar-corner {
  background: #f1f4f9;
}
