:root {
  color-scheme: light;
  --bg: #eef3fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #e6ebf3;
  --brand: #3157ff;
  --brand-2: #7c3aed;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar: #0f172a;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 25% 10%, rgba(49, 87, 255, .18), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(124, 58, 237, .14), transparent 28%),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 3vw, 42px); }

.app-shell { display: grid; grid-template-columns: 292px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px;
  color: white;
  background: linear-gradient(180deg, #111c35, var(--sidebar));
  border-right: 1px solid rgba(255,255,255,.08);
}
.brand-block { display: flex; gap: 14px; align-items: center; margin-bottom: 34px; color: white; }
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 18px 40px rgba(49, 87, 255, .32);
}
.brand-block small, .sidebar-card small { display: block; color: #9ca3af; font-size: 12px; margin-top: 4px; }
.side-nav { display: grid; gap: 8px; }
.nav-item {
  width: 100%;
  display: block;
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  color: #cbd5e1;
  background: transparent;
}
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.1); }
.nav-item.ghost { margin-top: 18px; border: 1px solid rgba(255,255,255,.14); }
.sidebar-card {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 26px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}
.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(16,185,129,.14);
}

.workspace { padding: 28px; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 6px; color: var(--brand); letter-spacing: .12em; font-size: 12px; font-weight: 800; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #111827;
}

.primary-button, .soft-button, .mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 800;
}
.primary-button { color: white; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 12px 26px rgba(49, 87, 255, .22); }
.soft-button { color: var(--ink); background: rgba(255,255,255,.72); border: 1px solid var(--line); }
.mini-button { padding: 7px 10px; margin: 2px 4px 2px 0; color: var(--brand); background: #eef2ff; }
.mini-button.muted { color: #475569; background: #f1f5f9; }
.mini-button.danger { color: var(--danger); background: #fef2f2; }

.hero-card, .panel, .stat-card, .login-panel {
  border: 1px solid rgba(255,255,255,.76);
  background: rgba(255,255,255,.82);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .08);
  backdrop-filter: blur(18px);
}
.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 26px;
  border-radius: 28px;
  margin-bottom: 22px;
}
.hero-card p { max-width: 780px; color: var(--muted); line-height: 1.8; }
.hero-metrics { display: grid; gap: 12px; min-width: 180px; }
.hero-metrics span { padding: 13px 15px; border-radius: 16px; background: #f8fafc; color: var(--muted); }
.hero-metrics b { display: block; color: var(--ink); font-size: 22px; margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { padding: 22px; border-radius: 24px; }
.stat-card span, .stat-card small { color: var(--muted); }
.stat-card strong { display: block; font-size: 36px; margin: 10px 0 4px; }
.stat-card .up { color: var(--success); }
.stat-card.danger strong { color: var(--danger); }
.content-grid { display: grid; grid-template-columns: 1.5fr .9fr; gap: 18px; }
.panel { padding: 24px; border-radius: 24px; margin-bottom: 20px; }
.panel.wide { min-height: 260px; }
.panel.narrow { max-width: 560px; margin: 0 auto 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  color: #475569;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 900;
}
.badge.success { color: #047857; background: #d1fae5; }
.badge.warning { color: #92400e; background: #fef3c7; }
.badge.muted { color: #475569; background: #e2e8f0; }
.badge.danger { color: var(--danger); background: #fee2e2; }

.flash { padding: 14px 16px; margin-bottom: 18px; border-radius: 16px; color: #1d4ed8; background: #dbeafe; border: 1px solid #bfdbfe; }
.hint { color: var(--muted); line-height: 1.7; }
.status-list { display: grid; gap: 14px; margin: 0; }
.status-list div { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.status-list dt { font-weight: 900; }
.status-list dd { margin: 4px 0 0; color: var(--muted); }
.setup-steps { display: grid; gap: 12px; }
.setup-steps div { display: flex; gap: 14px; align-items: center; padding: 15px; border-radius: 16px; background: #f8fafc; }
.setup-steps b { color: var(--brand); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 15px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.url-cell { max-width: 280px; word-break: break-all; color: #475569; }
.select-col { width: 42px; min-width: 42px; text-align: center; }
.actions-cell { min-width: 230px; }
.inline { display: inline; }

.bulk-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
}
.bulk-bar span { margin-left: 10px; color: var(--muted); font-size: 13px; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; justify-content: flex-end; }
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  color: var(--muted);
}
.page-controls { display: flex; align-items: center; gap: 10px; }
.page-controls strong { color: var(--ink); }

.auth-panel { max-width: 980px; margin: 0 auto; }
.login-panel { display: grid; grid-template-columns: 1fr 380px; gap: 28px; border-radius: 30px; padding: 30px; }
.login-copy { padding: 26px; border-radius: 24px; color: white; background: linear-gradient(135deg, #111827, #273b71); }
.login-copy p { color: #cbd5e1; line-height: 1.8; }
.login-form, .form-grid { display: grid; gap: 14px; }
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); }
.auth-links a { color: var(--brand); font-weight: 900; }
.auth-note { display: grid; gap: 10px; margin-top: 18px; }
.auth-note span { padding: 11px 12px; border-radius: 14px; color: #dbeafe; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); }

label { display: grid; gap: 8px; color: #475569; font-weight: 800; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 14px;
  color: var(--ink);
  background: white;
}
input[readonly] { color: #475569; background: #f8fafc; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.frequency-control { display: grid; grid-template-columns: 1fr 130px; gap: 10px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; margin-bottom: 18px; }
.form-grid.single { grid-template-columns: 1fr; }
.token-box { padding: 16px; border-radius: 16px; background: #0f172a; color: #e0e7ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar-card { position: static; margin-top: 24px; }
  .stat-grid, .content-grid, .login-panel { grid-template-columns: 1fr; }
  .topbar, .hero-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .workspace, .sidebar { padding: 18px; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
}
