:root {
  --bg: #f2f4f8;
  --panel: #ffffff;
  --panel-alt: #e8eef5;
  --text: #18212b;
  --muted: #586574;
  --line: #d7dee7;
  --accent: #0f5ea8;
  --accent-dark: #08457c;
  --danger: #c53939;
  --warning: #a86800;
  --success: #157347;
  --shadow: 0 18px 50px rgba(10, 31, 68, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(15, 94, 168, 0.09), transparent 28%),
    linear-gradient(180deg, #fbfcfe 0%, #eef3f8 100%);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__brand a {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.container {
  width: min(1360px, calc(100% - 2rem));
  margin: 2rem auto;
}

.auth-shell {
  width: 100vw;
  min-height: calc(100vh - 4rem);
  margin-left: calc(50% - 50vw);
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: stretch;
}

.auth-card,
.panel {
  background: var(--panel);
  border: 1px solid rgba(215, 222, 231, 0.85);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(460px, 100%);
  padding: 2rem;
  display: grid;
  gap: 1rem;
}

.auth-stage {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 1rem;
}

.auth-card__intro {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1rem;
}

.auth-logo {
  display: block;
  width: 150px;
  max-width: 150px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.auth-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-footer-band {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 1rem 2rem;
}

.stack,
.user-form,
.inline-reset,
.actions {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font: inherit;
  background: #fff;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  font: inherit;
}

.button:hover {
  background: var(--accent-dark);
}

.button--ghost {
  background: var(--panel-alt);
  color: var(--text);
}

.button--ghost:hover {
  background: #dbe6f0;
}

.alert {
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
}

.alert--error {
  background: #fdecec;
  color: var(--danger);
}

.alert--warning {
  background: #fff3db;
  color: var(--warning);
}

.alert--success {
  background: #e8f5ee;
  color: var(--success);
}

.admin-grid {
  display: grid;
  gap: 1.25rem;
}

.panel {
  padding: 1.5rem;
}

.panel--full {
  grid-column: 1 / -1;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0.75rem;
  font-size: 0.93rem;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.ua,
.details {
  word-break: break-word;
  max-width: 320px;
}

.narrow {
  max-width: 520px;
  margin: 3rem auto;
}

@media (max-width: 900px) {
  .container {
    width: min(100% - 1rem, 100%);
    margin: 1rem auto;
  }

  .panel,
  .auth-card {
    border-radius: 16px;
    padding: 1rem;
  }

  .panel__header,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}
