:root {
  --bg: #06060d;
  --panel: #101424;
  --ink: #f3f6ff;
  --muted: #afbad5;
  --line: #253255;
  --brand: #66ff00;
  --brand-hover: #57db00;
  --accent-blue: #224eff;
  --danger: #ff4444;
}

* {
  box-sizing: border-box;
}

body.admin-body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #0f1d45 0%, #06060d 50%, #000000 100%);
  min-height: 100vh;
}

.brand-logo {
  width: auto;
  max-height: 54px;
}

.auth-card {
  max-width: 440px;
  margin: 9vh auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
}

.header-brand {
  display: grid;
  gap: 0.45rem;
}

.admin-grid {
  display: grid;
  gap: 1rem;
  padding: 0 2rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

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

.stack {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

input,
select,
button,
textarea {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #0a0f1d;
  color: var(--ink);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

input[type="file"] {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.remember-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #0a1400;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.58rem 0.78rem;
  cursor: pointer;
}

button:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

button.secondary {
  background: #121a33;
  color: #d8e3ff;
  border-color: #3c4f85;
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.status {
  min-height: 1.2rem;
  color: var(--brand);
}

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

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

.muted-link {
  color: #c9d3ef;
}

.docs-list,
.users-list {
  display: grid;
  gap: 0.7rem;
}

.doc-row,
.user-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
}

.doc-row h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.row-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hidden {
  display: none;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  width: min(92vw, 400px);
  background: #0f1425;
  color: var(--ink);
}

#qrImage {
  width: 220px;
  height: 220px;
  display: block;
  margin: 0.8rem auto;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

@media (max-width: 760px) {
  .admin-header,
  .admin-grid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .doc-row,
  .user-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .row-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
