:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #131722;
  --muted: #6b7280;
  --border: #d9deea;
  --primary: #1047d1;
  --danger: #b42318;
  --ok: #027a48;
  --shadow: 0 14px 32px rgba(11, 19, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  background: #f6f7fb;
  color: var(--text);
}

.login-page {
  min-height: 100vh;
  padding: 1.25rem;
  display: grid;
  place-items: center;
  background: #020304;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
}

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

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

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

.grid-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  color: #2f3645;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

button {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.62rem 0.9rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

button.danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status {
  font-size: 0.92rem;
  min-height: 1.4rem;
}

.status.ok {
  color: var(--ok);
}

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

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

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

th,
td {
  border-bottom: 1px solid #ebeff7;
  padding: 0.6rem 0.65rem;
  text-align: left;
  font-size: 0.92rem;
}

th {
  background: #f8faff;
  color: #253046;
}

.kpi {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fcfdff;
}

.kpi b {
  font-size: 1.1rem;
}

.pin-minimal-card {
  width: min(610px, calc(100% - 1.5rem));
  min-height: 300px;
  border-radius: 34px;
  border: 1px solid rgba(43, 55, 97, 0.45);
  background: linear-gradient(140deg, rgba(3, 8, 28, 0.95), rgba(1, 6, 22, 0.96));
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(84, 104, 188, 0.15);
  padding: 3.6rem 2.8rem 2.6rem;
  display: grid;
  align-content: center;
  gap: 1rem;
}

.pin-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.9rem;
  justify-content: center;
}

.pin-slot {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  border: 1px solid rgba(108, 121, 160, 0.36);
  background: radial-gradient(circle at 30% 20%, rgba(7, 13, 38, 0.95), rgba(2, 8, 26, 0.99));
  color: #f2f8ff;
  text-align: center;
  font-size: 2rem;
  letter-spacing: 0;
  padding: 0;
  caret-color: #7f40ff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.pin-slot:focus {
  outline: none;
  border-color: rgba(127, 64, 255, 0.95);
  box-shadow:
    0 0 0 2px rgba(127, 64, 255, 0.22),
    inset 0 0 22px rgba(127, 64, 255, 0.1);
}

.pin-slot.filled {
  border-color: rgba(127, 64, 255, 0.6);
}

.login-page .status {
  text-align: center;
  color: #92a2cf;
}

.login-page .status.err {
  color: #ff7e8d;
}

.login-page .meta {
  text-align: center;
  color: #51618d;
  font-size: 0.8rem;
}

.ghost-login {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

hr {
  border: 0;
  border-top: 1px solid #ebeff7;
  margin: 0.75rem 0;
}

.meta {
  font-size: 0.84rem;
  color: var(--muted);
}

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

  .container {
    width: calc(100% - 1rem);
    margin: 1rem auto;
  }

  .card {
    border-radius: 14px;
  }

  .pin-minimal-card {
    width: min(420px, calc(100% - 0.5rem));
    border-radius: 26px;
    padding: 2.2rem 1.3rem;
  }

  .pin-slots {
    gap: 0.65rem;
  }

  .pin-slot {
    border-radius: 18px;
    font-size: 1.45rem;
  }
}
