:root {
  --ink: #17202a;
  --muted: #6c7684;
  --line: rgba(255, 255, 255, .55);
  --glass: rgba(255, 255, 255, .68);
  --accent: #0a84ff;
  --green: #34c759;
  --danger: #ff3b30;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 214, 102, .45), transparent 28%),
    radial-gradient(circle at 82% 10%, rgba(10, 132, 255, .25), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #edf3f8 48%, #f7f4ee 100%);
}

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

.glass {
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.45);
  box-shadow: 0 24px 70px rgba(31, 45, 61, .14);
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-shell {
  width: min(440px, 100%);
  padding: 28px;
  border-radius: 26px;
}

.brand-row { display: flex; gap: 8px; margin-bottom: 26px; }
.traffic { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
.red { background: #ff5f57; }
.yellow { background: #ffbd2e; }
.green { background: #28c840; }

h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.02; }
h2 { font-size: 22px; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-weight: 700; }

.stack { display: grid; gap: 15px; margin-top: 24px; }
label { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(23, 32, 42, .12);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  background: rgba(255,255,255,.78);
  outline: none;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(10,132,255,.12); }

button, .actions a, .primary, .small-link {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  text-align: center;
}
.primary, button.primary { background: var(--accent); color: #fff; }
.danger { background: var(--danger); color: #fff; }

.switch { text-align: center; color: var(--muted); }
.switch a { color: var(--accent); font-weight: 800; }
.alert { margin: 18px 0 0; padding: 12px 14px; border-radius: 14px; font-weight: 700; }
.bad { background: rgba(255,59,48,.12); color: #a51f18; }
.ok { background: rgba(52,199,89,.12); color: #176b2c; }

.topbar {
  position: sticky;
  top: 16px;
  z-index: 10;
  width: min(1120px, calc(100% - 32px));
  margin: 16px auto 0;
  border-radius: 22px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar div { display: flex; gap: 12px; align-items: baseline; }
.topbar nav { display: flex; gap: 12px; font-weight: 800; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 34px auto 70px;
}

.hero-panel {
  min-height: 230px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 34px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.55)),
    linear-gradient(45deg, rgba(10,132,255,.16), rgba(255,204,0,.16));
  border: 1px solid var(--line);
}
.status-pill {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(52,199,89,.14);
  color: #13722d;
  font-weight: 900;
  white-space: nowrap;
}

.sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.sub-card { border-radius: 24px; padding: 20px; transition: transform .18s ease, box-shadow .18s ease; }
.sub-card:hover { transform: translateY(-3px); box-shadow: 0 28px 80px rgba(31, 45, 61, .18); }
.sub-head { display: flex; justify-content: space-between; gap: 14px; }
.sub-head p { margin: 8px 0 0; color: var(--muted); }
.status-dot { width: 12px; height: 12px; background: var(--green); border-radius: 50%; margin-top: 8px; }
.form-row { margin-top: 18px; }
.compact-form { margin-top: 8px; }
.copy-input {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255,255,255,.58);
}
.action-panel {
  margin-top: 14px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.58);
}
.action-label {
  margin: 4px 2px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.actions { display: grid; gap: 8px; margin-bottom: 12px; }
.actions:last-child { margin-bottom: 0; }
.actions-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.actions-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.actions button, .actions a {
  min-height: 42px;
  border: 1px solid rgba(10,132,255,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.62));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 22px rgba(31,45,61,.08);
}
.actions button:hover, .actions a:hover {
  color: #fff;
  background: linear-gradient(180deg, #2d95ff, #0a84ff);
}
.empty { margin-top: 20px; border-radius: 22px; padding: 26px; color: var(--muted); }

.notice-card {
  min-height: 270px;
}
.notice-content {
  position: relative;
  color: var(--ink);
  line-height: 1.75;
}
.card-content {
  margin-top: 18px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.58);
}
.notice-content :first-child { margin-top: 0; }
.notice-content :last-child { margin-bottom: 0; }
.notice-content a { color: var(--accent); font-weight: 800; }
.code-area {
  min-height: 240px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.55;
}

.download-card {
  display: grid;
  gap: 16px;
}
.download-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  background: linear-gradient(180deg, #58adff, #0a84ff);
  box-shadow: 0 12px 26px rgba(10,132,255,.26);
}
.download-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.download-card h2 {
  margin: 0;
}
.download-desc {
  color: var(--muted);
  line-height: 1.7;
}
.download-button, .download-empty {
  display: block;
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  padding: 12px 15px;
  text-align: center;
  font-weight: 900;
}
.download-button {
  color: #fff;
  background: linear-gradient(180deg, #2d95ff, #0a84ff);
  box-shadow: 0 14px 32px rgba(10,132,255,.26);
}
.download-empty {
  color: var(--muted);
  background: rgba(255,255,255,.58);
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.72);
}
.toggle-row input {
  width: 46px;
  height: 28px;
  min-width: 46px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #c9d1dc;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  transition: background .18s ease;
}
.toggle-row input::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  margin: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.toggle-row input:checked { background: var(--green); }
.toggle-row input:checked::after { transform: translateX(18px); }

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  padding: 24px;
  background: rgba(255,255,255,.54);
  border-right: 1px solid rgba(255,255,255,.7);
}
.sidebar nav { display: grid; gap: 10px; margin-top: 28px; }
.sidebar a { padding: 12px 14px; border-radius: 14px; font-weight: 800; }
.sidebar a.active, .sidebar a:hover { background: rgba(10,132,255,.12); color: var(--accent); }
.admin-main { padding: 28px; }
.panel { border-radius: 24px; padding: 22px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px; border-bottom: 1px solid rgba(23,32,42,.08); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 160px; }
.badge { display: inline-block; padding: 6px 9px; border-radius: 999px; background: rgba(10,132,255,.12); color: var(--accent); font-weight: 900; font-size: 12px; }
.form-row-grid, .preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.preview-panel {
  margin-top: 18px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(23,32,42,.08);
  background: rgba(255,255,255,.44);
}
.notice-panel.preview-panel {
  min-height: 270px;
}
.notice-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 760px) {
  .topbar, .hero-panel { align-items: flex-start; flex-direction: column; }
  .form-row-grid, .preview-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.7); }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .admin-main { padding: 16px; }
}
