:root {
  --ink: #111418;
  --paper: #f7f7f2;
  --surface: #ffffff;
  --line: #d6ded8;
  --green: #00B5BF;
  --green-dark: #007982;
  --cyan-soft: #e8f8f9;
  --gold: #d69b2d;
  --muted: #5c6872;
  --danger: #b9503d;
  --radius: 8px;
  --font: Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(0, 181, 191, 0.08), transparent 260px),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}

a {
  color: var(--green);
  font-weight: 700;
}

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

.login-wrap {
  min-height: 100svh;
  display: grid;
  place-items: center;
}

.login-card,
.panel,
.row-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(17, 20, 24, 0.08);
}

.login-card {
  width: min(100%, 460px);
  padding: 1.4rem;
}

.admin-top {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

.admin-top-inner {
  width: min(calc(100% - 2rem), 1120px);
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.admin-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 0.75rem;
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease;
}

.admin-nav a:hover {
  border-color: rgba(0, 181, 191, 0.5);
  background: var(--cyan-soft);
}

.admin-wrap {
  padding: 2rem 0 4rem;
}

.panel {
  margin-bottom: 1rem;
  padding: 1.1rem;
}

.panel h2,
.login-card h1 {
  margin: 0 0 0.8rem;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.1rem;
  border: 1px solid rgba(0, 181, 191, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff, var(--cyan-soft));
  box-shadow: 0 18px 45px rgba(0, 121, 130, 0.12);
}

.admin-hero p,
.panel-head p {
  margin: 0;
  color: var(--muted);
}

.admin-hero h1 {
  margin: 0.15rem 0 0;
  font-size: 1.75rem;
  line-height: 1.1;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.visibility-panel {
  border-color: rgba(0, 181, 191, 0.28);
}

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

.switch-card {
  min-height: 72px;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
  color: var(--ink);
  padding: 0.75rem;
}

.switch-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-card span {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5d9;
  transition: background 180ms ease;
}

.switch-card span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 8px rgba(17, 20, 24, 0.2);
  transition: transform 180ms ease;
}

.switch-card input:checked + span {
  background: var(--green);
}

.switch-card input:checked + span::after {
  transform: translateX(20px);
}

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

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
  color: var(--ink);
  padding: 0.72rem 0.8rem;
  font: inherit;
}

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

.span-2 {
  grid-column: span 2;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--green);
  color: #062f33;
  padding: 0 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: var(--gold);
  color: #1b1204;
}

.button.ghost {
  background: transparent;
  color: var(--green-dark);
  border-color: var(--line);
}

.row-list {
  display: grid;
  gap: 0.75rem;
}

.row-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.8rem;
}

.row-card .sort {
  grid-row: span 2;
}

.delete-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  border: 1px solid rgba(185, 80, 61, 0.28);
  border-radius: var(--radius);
  background: rgba(185, 80, 61, 0.08);
  color: var(--danger);
  font-weight: 700;
}

.delete-row input {
  width: auto;
  accent-color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1rem;
}

.notice {
  border-left: 4px solid var(--gold);
  background: #fff8e8;
  padding: 0.8rem;
  border-radius: var(--radius);
  color: #563a08;
}

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

@media (max-width: 760px) {
  .admin-top-inner,
  .form-grid,
  .row-card,
  .visibility-grid {
    grid-template-columns: 1fr;
  }

  .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-top-inner {
    display: grid;
    padding: 0.9rem 0;
  }

  .span-2 {
    grid-column: auto;
  }
}
