:root {
  color-scheme: dark;
  --bg: #050708;
  --panel: rgba(18, 20, 22, 0.92);
  --panel-strong: rgba(22, 25, 27, 0.96);
  --line: rgba(231, 237, 234, 0.14);
  --line-strong: rgba(231, 237, 234, 0.22);
  --ink: #f3f5f4;
  --muted: rgba(243, 245, 244, 0.58);
  --muted-strong: rgba(243, 245, 244, 0.74);
  --accent: #22c780;
  --accent-strong: #5ee7ae;
  --accent-soft: rgba(34, 199, 128, 0.16);
  --danger: #ff6d63;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --radius-panel: 18px;
  --radius-control: 12px;
  --font-ui: "Avenir Next", "IBM Plex Sans", "Aptos", Inter, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(34, 199, 128, 0.08), transparent 30%),
    linear-gradient(145deg, #050708 0%, #111416 58%, #060809 100%);
  color: var(--ink);
  font-family: var(--font-ui);
}

body {
  min-width: 320px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.admin-shell {
  width: min(100%, 1720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 48px);
}

.login-screen {
  min-height: calc(100vh - clamp(48px, 6vw, 96px));
  display: grid;
  place-items: center;
}

.login-panel,
.account-list-panel,
.account-detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(100%, 480px);
  padding: clamp(26px, 4vw, 42px);
}

.app-domain {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 28px;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 6px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.1;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

.login-form,
.account-form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

label > span,
.search-field span {
  color: var(--muted-strong);
  font-size: 0.8rem;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: rgba(5, 7, 8, 0.76);
  color: var(--ink);
  padding: 0 16px;
  font-weight: 800;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 199, 128, 0.18);
}

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: var(--radius-control);
  padding: 0 20px;
  border: 1px solid transparent;
  color: #04100c;
  font-weight: 950;
  text-align: center;
}

.primary-action {
  background: linear-gradient(135deg, #28d28a, #17af72);
}

.secondary-action {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.compact-action {
  min-width: 154px;
  white-space: nowrap;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.success-message {
  color: var(--accent-strong);
}

.admin-header {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.admin-header h1 {
  margin-bottom: 0;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.72fr);
  gap: 22px;
  margin-top: 24px;
}

.account-list-panel,
.account-detail-panel {
  padding: clamp(20px, 2vw, 28px);
}

.panel-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-heading p {
  margin-bottom: 0;
}

.count-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid rgba(34, 199, 128, 0.34);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 950;
  white-space: nowrap;
}

.search-field {
  margin-bottom: 18px;
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

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

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted-strong);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  font-weight: 850;
}

tr:last-child td {
  border-bottom: 0;
}

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

tbody tr:hover,
tbody tr.is-selected {
  background: rgba(34, 199, 128, 0.11);
}

.row-action-cell {
  width: 148px;
  text-align: right;
}

.row-action {
  min-height: 40px;
}

.empty-state {
  display: grid;
  min-height: 320px;
  place-content: center;
  text-align: center;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 940px) {
  .admin-header,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .account-detail-panel {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .admin-shell {
    padding: 18px;
  }

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

  .primary-action,
  .secondary-action {
    width: 100%;
  }
}
