:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #17202f;
  --muted: #6b7280;
  --line: #dfe4ef;
  --accent: #ed2b6c;
  --accent-2: #0b7482;
  --success: #0f9f6e;
  --danger: #cf233d;
  --shadow: 0 18px 44px rgba(21, 28, 42, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.admin-shell {
  min-height: 100vh;
}

.login-panel {
  display: grid;
  gap: 24px;
  width: min(440px, calc(100% - 36px));
  margin: 10vh auto 0;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-lock,
.admin-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-lock h1 {
  margin: 0;
  font-size: 28px;
}

.brand-lock p {
  margin: 4px 0 0;
  color: var(--muted);
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 28px;
  color: var(--accent-2);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  left: 0;
  display: block;
  width: 34px;
  height: 7px;
  background: currentColor;
  border-radius: 7px;
  content: "";
}

.brand-mark::before {
  top: 3px;
  box-shadow: 10px 9px 0 currentColor;
}

.brand-mark::after {
  bottom: 0;
  width: 27px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(237, 43, 108, 0.16);
}

.primary-btn,
.sidebar-actions button,
.password-box button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  color: #ffffff;
  font-weight: 850;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 22px;
  color: #ffffff;
  background: #131824;
}

.admin-brand {
  min-height: 44px;
  font-size: 20px;
  font-weight: 900;
}

.admin-brand .brand-mark {
  color: #ffffff;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav button,
.sidebar-actions a,
.sidebar-actions button {
  display: flex;
  justify-content: flex-start;
  min-height: 42px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.admin-nav button.is-active,
.admin-nav button:hover,
.sidebar-actions a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.sidebar-actions button {
  background: rgba(237, 43, 108, 0.22);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.workspace-head h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card,
.panel,
.table-wrap,
.password-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(21, 28, 42, 0.06);
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.panel {
  padding: 18px;
}

.panel h2,
.password-box h2 {
  margin: 0 0 12px;
}

.check-list {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td strong {
  display: block;
}

td small {
  color: var(--muted);
}

.thumb-cell {
  display: flex;
  gap: 10px;
  align-items: center;
}

.thumb-cell img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 8px;
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
  background: rgba(15, 159, 110, 0.12);
  border-radius: 8px;
}

.pill.off {
  color: var(--danger);
  background: rgba(207, 35, 61, 0.1);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions button,
.row-actions select {
  min-height: 34px;
  padding: 7px 10px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.row-actions button.danger {
  color: var(--danger);
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wide {
  grid-column: 1 / -1;
}

.password-box {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
}

.password-box button {
  justify-self: start;
  background: var(--accent-2);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 18px;
  overflow: auto;
  background: rgba(11, 15, 23, 0.62);
}

.modal.is-open {
  display: grid;
}

.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 22px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-panel h2 {
  margin: 0 42px 16px 0;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.check input {
  width: 18px;
  min-height: 18px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(380px, calc(100% - 44px));
  padding: 12px 14px;
  color: #ffffff;
  font-weight: 780;
  background: var(--accent-2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  transition: 0.18s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .admin-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

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

@media (max-width: 680px) {
  .workspace {
    padding: 18px 14px;
  }

  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .wide {
    grid-column: auto;
  }
}
