
:root {
  --bg: #f5f8ff;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --panel2: #eef4ff;
  --border: #d8e5ff;
  --text: #10213f;
  --muted: #5f7297;
  --blue: #326dff;
  --blue-soft: #e8efff;
  --green: #0ea766;
  --red: #e55252;
  --yellow: #f2a93b;
  --purple: #8b5cf6;
  --shadow: 0 18px 48px rgba(42, 76, 160, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--blue); text-decoration: none; }
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 290px;
  padding: 24px 20px;
  background: rgba(255, 255, 255, .92);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  backdrop-filter: blur(8px);
}
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 34px; }
.logo, .auth-logo {
  width: 48px; height: 48px; border-radius: 16px;
  display: grid; place-items: center;
  font-weight: 900;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 12px 24px rgba(50, 109, 255, .22);
}
.brand h1 { margin: 0; font-size: 24px; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
nav { display: flex; flex-direction: column; gap: 10px; }
.nav-btn {
  width: 100%; text-align: left; padding: 14px 16px;
  border: 1px solid transparent; border-radius: 14px;
  background: transparent; color: var(--muted);
  font-weight: 700; cursor: pointer; font-size: 15px;
}
.nav-btn:hover, .nav-btn.active {
  color: var(--blue); background: var(--blue-soft);
  border-color: #cfe0ff;
}
.sidebar-note {
  margin-top: 32px; padding: 16px; border-radius: 16px;
  background: #eefbf5; border: 1px solid #cceedd;
  color: #116b46; display: flex; flex-direction: column; gap: 8px; font-size: 13px;
}
.sidebar-user {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  font-size: 13px;
}
.main { flex: 1; padding: 28px 34px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.topbar h2 { margin: 0; font-size: 30px; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.content { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card, .stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 14px; font-size: 18px; }
.card h4 { margin: 0 0 8px; }
.stat .num { font-size: 34px; font-weight: 900; color: var(--blue); }
.stat .label { color: var(--muted); font-weight: 700; margin-top: 4px; }
label { display: block; font-weight: 800; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
input, textarea, select {
  width: 100%; background: #fff; color: var(--text);
  border: 1px solid #d5e1fb; border-radius: 13px;
  padding: 13px 14px; outline: none; font-size: 15px;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(50, 109, 255, .12); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  border: 0; border-radius: 13px; padding: 12px 16px;
  font-weight: 900; cursor: pointer; color: white; background: var(--blue);
  box-shadow: 0 10px 22px rgba(50, 109, 255, .18);
}
.btn:hover { filter: brightness(1.03); }
.btn.ghost { background: white; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.red { background: var(--red); }
.btn.green { background: var(--green); }
.btn.yellow { background: var(--yellow); color: #111827; }
.btn.small { padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.badge {
  display: inline-flex; align-items: center; padding: 6px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 900;
  background: #eef4ff; color: var(--muted); border: 1px solid #d7e4ff;
}
.badge.pending_approval { background: #fff5e7; color: #9a6300; border-color: #ffe0a8; }
.badge.waiting_button, .badge.not_following { background: #f4ecff; color: #7144cb; border-color: #ddccff; }
.badge.delivered { background: #eafaf1; color: #16784f; border-color: #c7f0d7; }
.badge.rejected, .badge.failed { background: #fff0f0; color: #b03e3e; border-color: #ffcaca; }
.badge.filtered { background: #f2f6fb; color: #5f7297; border-color: #dde6f3; }
.list { display: flex; flex-direction: column; gap: 14px; }
.item {
  padding: 18px; border-radius: 18px;
  background: var(--panel-soft); border: 1px solid #e2ebfc;
}
.item-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 10px; }
.muted { color: var(--muted); }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f4f7ff; border: 1px solid var(--border); padding: 2px 7px; border-radius: 7px; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 14px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 800; }
.toggle input { width: auto; }
.timeline { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.timeline-event { padding: 12px 14px; border-left: 3px solid var(--blue); background: #eef4ff; border-radius: 12px; }
.timeline-event.user { border-left-color: var(--green); background: #eafaf1; }
.timeline-event.system { border-left-color: var(--purple); background: #f4ecff; }
.toast {
  position: fixed; bottom: 24px; right: 24px; background: #fff; border: 1px solid var(--border);
  color: var(--text); padding: 14px 16px; border-radius: 14px; display: none; box-shadow: var(--shadow); z-index: 100;
}
.toast.show { display: block; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 20px; background: #fff; }
pre { white-space: pre-wrap; background: #f7f9fe; border: 1px solid var(--border); border-radius: 16px; padding: 16px; color: #24407d; }
.auth-screen, #authScreen {
  min-height: 100vh;
  display: block;
  padding: 28px;
  background: linear-gradient(180deg, #fbfdff 0%, #eef4ff 100%);
}
.landing-shell {
  display: grid;
  grid-template-columns: 1.35fr .9fr;
  gap: 24px;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
}
.landing-hero, .auth-panel {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.landing-hero { padding: 30px; }
.auth-panel-wrap { position: sticky; top: 28px; }
.auth-panel { padding: 26px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; background: #ebf2ff; color: var(--blue); font-weight: 800; font-size: 13px;
}
.landing-hero h1 {
  font-size: 42px; line-height: 1.12; margin: 18px 0 14px;
  max-width: 720px;
}
.landing-hero h1 span { color: var(--blue); }
.hero-text { color: var(--muted); font-size: 17px; line-height: 1.7; max-width: 760px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 22px; }
.feature-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 24px;
}
.feature-card {
  display: flex; gap: 14px; align-items: start; padding: 16px; border-radius: 18px;
  background: #f8fbff; border: 1px solid #dfeaff;
}
.feature-card b { display: block; margin-bottom: 6px; }
.feature-card p, .guide-item p { margin: 0; color: var(--muted); line-height: 1.55; }
.feature-icon {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #326dff, #8b5cf6); color: white; font-weight: 900; flex: 0 0 auto;
}
.guide-card { margin-top: 22px; padding: 20px; border-radius: 22px; background: #f9fbff; border: 1px solid #dfe9ff; }
.guide-card h3 { margin: 0 0 14px; }
.guide-list { display: grid; gap: 12px; }
.guide-item {
  display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: start;
  padding: 12px 0; border-bottom: 1px dashed #dbe6fb;
}
.guide-item:last-child { border-bottom: 0; }
.guide-item span {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: #edf3ff; color: var(--blue); font-weight: 900;
}
.auth-topline { color: var(--blue); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.auth-panel h2 { margin: 12px 0 8px; font-size: 32px; }
.auth-subtitle { margin: 0 0 18px; color: var(--muted); line-height: 1.6; }
.auth-tabs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  background: #f2f6ff; border: 1px solid #d9e5ff; border-radius: 16px; padding: 6px; margin-bottom: 18px;
}
.auth-tab {
  border: 0; background: transparent; border-radius: 12px; padding: 12px 14px; font-weight: 800; color: var(--muted); cursor: pointer;
}
.auth-tab.active { background: white; color: var(--blue); box-shadow: 0 6px 16px rgba(50,109,255,.08); }
.auth-submit { width: 100%; margin-top: 6px; }
.switch-note { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.link-btn {
  border: 0; background: transparent; color: var(--blue); font-weight: 800; cursor: pointer; padding: 0;
}
.help-box {
  margin-top: 18px; padding: 16px; border-radius: 18px; background: #f8fbff; border: 1px solid #dce8ff;
}
.help-box b { display: block; margin-bottom: 8px; }
.help-box ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
@media (max-width: 1180px) {
  .landing-shell { grid-template-columns: 1fr; }
  .auth-panel-wrap { position: static; }
}
@media (max-width: 1000px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  nav { flex-direction: row; overflow-x: auto; }
  .nav-btn { white-space: nowrap; }
  .grid-2, .grid-3, .grid-4, .form-row, .feature-grid { grid-template-columns: 1fr; }
  .main { padding: 20px; }
  .landing-hero h1 { font-size: 32px; }
  .auth-screen, #authScreen { padding: 16px; }
}
