:root {
  --bg: #091223;
  --surface: #111b31;
  --surface-2: #162341;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f6ff;
  --muted: #97a5c8;
  --accent: #79a7ff;
  --danger: #ff7070;
  --success: #6be3b0;
  --shadow: 0 28px 64px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #162a53 0%, var(--bg) 56%);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

body {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.auth-shell,
.dashboard-shell {
  min-height: 100vh;
  padding: 24px;
}

.auth-shell {
  display: grid;
  place-items: center;
}

.dashboard-shell {
  display: block;
}

.auth-card,
.dashboard-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

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

.dashboard-card {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 28px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(121, 167, 255, 0.14);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.auth-title,
.dashboard-title {
  margin: 16px 0 8px;
  font-size: 30px;
  line-height: 1.06;
}

.auth-subtitle,
.dashboard-subtitle,
.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form,
.stack,
.side-stack {
  display: grid;
  gap: 14px;
}

.auth-form {
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  color: var(--muted);
}

.field input,
.field select,
.search-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.field input:focus,
.field select:focus,
.search-input:focus {
  border-color: rgba(121, 167, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(121, 167, 255, 0.15);
}

.compact-field select {
  min-height: 44px;
}

.primary-btn,
.ghost-btn {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.56;
  cursor: default;
  transform: none;
}

.primary-btn {
  border: 0;
  background: var(--accent);
  color: #0c1429;
}

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

.small-btn {
  min-height: 36px;
  padding: 0 12px;
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.status.is-error {
  color: var(--danger);
}

.status.is-success {
  color: var(--success);
}

.dashboard-head,
.toolbar,
.panel-head,
.pagination,
.head-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.head-actions {
  align-items: flex-end;
}

.admin-meta {
  display: grid;
  gap: 4px;
  text-align: right;
}

.admin-meta span {
  font-weight: 700;
}

.admin-meta small {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.info-card,
.panel-block,
.user-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.info-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.info-value {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

.toolbar {
  margin-top: 24px;
  align-items: flex-start;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input {
  width: min(420px, 100%);
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(340px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

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

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

.table th {
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  position: sticky;
  top: 0;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.empty-state {
  text-align: center;
  color: var(--muted);
}

.role-chip,
.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(121, 167, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  margin: 2px 6px 2px 0;
}

.priority-badge {
  background: rgba(107, 227, 176, 0.12);
}

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

.role-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.role-option input {
  margin: 0;
}

.user-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .dashboard-head,
  .toolbar,
  .panel-head,
  .pagination,
  .head-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-meta {
    text-align: left;
  }

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

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

  .ghost-btn,
  .primary-btn,
  .search-input {
    width: 100%;
  }
}
