:root {
  --bg: #f4f7fb;
  --sidebar: #fbfcfe;
  --card: #ffffff;
  --text: #1c2434;
  --muted: #8b95a7;
  --line: #e8edf4;
  --navy: #1c2434;
  --blue: #7db7ff;
  --orange: #f3b56b;
  --green: #22c55e;
  --pink: #ff5b7a;
  --shadow: 0 12px 30px rgba(28, 36, 52, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 70% -10%, #eef4ff 0%, transparent 55%),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
}
a { color: var(--navy); text-decoration: none; }
.app { display: block; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  background: linear-gradient(180deg, #fcfdff 0%, #f7f9fc 100%);
  border-right: 1px solid #eef2f7;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand b { font-size: 20px; letter-spacing: -0.03em; }
.logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #4b7cf3;
  background: #eef3ff;
  border: 1.5px solid #c9d8ff;
  font-weight: 800;
}
.nav-label {
  margin: 18px 8px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b7385;
  padding: 11px 12px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
}
.sidebar nav a svg { width: 18px; height: 18px; flex: none; }
.sidebar nav a.active {
  background: #eef1f6;
  color: var(--navy);
}
.sidebar nav a:hover { background: #f3f5f9; color: var(--navy); }
.badge {
  margin-left: auto;
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.side-foot { margin-top: auto; padding: 8px; }
.bot-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #d0d5dd; }
.bot-status.on { color: #16a34a; }
.bot-status.on .dot { background: #22c55e; }
.bot-status.off { color: var(--pink); }
.bot-status.off .dot { background: var(--pink); }
.logout { color: var(--muted); font-weight: 600; font-size: 13px; }
.content { margin-left: 236px; padding: 28px 36px 48px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}
.topbar h1 { margin: 0; font-size: 32px; letter-spacing: -0.04em; }
.sub { margin: 6px 0 0; color: var(--muted); }
.date-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.date-chip svg { width: 18px; height: 18px; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi {
  background: #fff;
  border-radius: 22px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}
.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #f4f6fa;
  color: #6b7385;
  display: grid;
  place-items: center;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi span { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi strong { display: block; font-size: 28px; letter-spacing: -0.04em; margin-top: 2px; }
.report {
  margin: 4px 0 28px;
}
.report-chart svg { width: 100%; height: 180px; display: block; }
.chart-plot { position: relative; }
.chart-values { position: absolute; inset: 0; pointer-events: none; }
.chart-point {
  position: absolute;
  transform: translate(-50%, calc(-100% + 5px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.chart-point b {
  font-size: 13px;
  font-weight: 800;
  color: #3d7dff;
  line-height: 1;
}
.chart-point i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #7db7ff;
}
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; }
.card {
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.table-card { padding: 18px 8px 8px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 16px 12px;
}
.card-head h2 { margin: 0; font-size: 18px; }
.head-tools { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f8fb;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
}
.search svg { width: 16px; height: 16px; }
.search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 140px;
  padding: 0;
}
.ghost {
  background: #f6f8fb;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid #f1f4f8; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.mono { color: var(--muted); font-weight: 600; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; }
.person small { color: var(--muted); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #eef3ff;
  color: #4b7cf3;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}
.empty { color: var(--muted); padding: 24px; }
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 12px;
  color: #5b6577;
  font-weight: 600;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.chip span {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef1f6;
  color: #5b6577;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.chip.new, .chip.pink { color: #be123c; }
.chip.seen, .chip.blue { color: #3b6de0; }
.chip.done, .chip.green { color: #15803d; }
.chip.cancelled, .chip.gray { color: #6b7385; }
.chip.orange { color: #c2410c; }
.chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.chip.active span {
  background: rgba(255,255,255,.16);
  color: #fff;
}
.form { padding: 22px; }
.form label { display: block; margin: 0 0 8px; font-weight: 700; }
.form label small { display: block; font-weight: 500; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span2 { grid-column: 1 / -1; }
input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbfcfe;
}
textarea { min-height: 88px; resize: vertical; }
button[type="submit"]:not(.link) {
  font: inherit;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  margin-top: 16px;
  cursor: pointer;
  font-weight: 700;
}
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; }
.check input { width: auto; }
.actions { display: flex; gap: 12px; align-items: center; }
.actions form { margin: 0; }
.link, .danger {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: auto;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.danger { color: var(--pink); }
.dim { opacity: .45; }
.status-form { margin: 0; }
.status {
  width: auto;
  min-width: 128px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
}
.status.new, .status.pink { background: #fff1f3; color: var(--pink); border-color: transparent; }
.status.seen, .status.blue { background: #eef3ff; color: #4b7cf3; border-color: transparent; }
.status.done, .status.green { background: #ecfdf3; color: #16a34a; border-color: transparent; }
.status.cancelled, .status.gray { background: #f4f6fa; color: #6b7385; border-color: transparent; }
.status.orange { background: #fff7ed; color: #c2410c; border-color: transparent; }
.muted-inline { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; font-weight: 500; }
.flash { padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; font-weight: 600; }
.flash.ok { background: #ecfdf3; color: #166534; }
.flash.error { background: #fff1f3; color: #be123c; }
.auth .content { margin: 0; padding: 0; }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.login-brand { margin-bottom: 18px; }
.login-card h1 { margin: 0; font-size: 28px; }
.login-card p, .login-card small { color: var(--muted); }
.login-card button { width: 100%; }
.add-btn {
  font: inherit;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
body.modal-open { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  background: rgba(28, 36, 52, 0.38);
  padding: 24px;
}
.modal.open { display: grid; }
.modal-card {
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(28, 36, 52, 0.18);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-title { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.modal-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: #f4f6fa;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #6b7385;
}
.modal .form { padding: 0; box-shadow: none; margin: 0; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.modal-actions .ghost {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.modal-actions [type="submit"] { margin-top: 0; }
@media (max-width: 720px) {
  .sidebar { position: relative; width: auto; }
  .content { margin-left: 0; padding: 18px; }
  .kpi-row, .grid2 { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 26px; }
}
