:root {
  --ink: #101828;
  --muted: #667085;
  --line: #e5e9f0;
  --paper: #f4f6f9;
  --white: #fff;
  --nav: #0b1220;
  --nav2: #121d31;
  --blue: #2767e8;
  --blue2: #1e55c5;
  --green: #12a06a;
  --amber: #e99a18;
  --red: #df4a4a;
  --shadow: 0 12px 36px rgba(16, 24, 40, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
.hidden {
  display: none !important;
}
.eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.2em;
  font-weight: 800;
  color: #7ca5ff;
}
.eyebrow.dark {
  color: var(--blue);
}
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 46%) 1fr;
}
.login-brand {
  padding: clamp(42px, 8vw, 110px);
  background:
    radial-gradient(circle at 20% 10%, #20365f 0, transparent 35%),
    linear-gradient(145deg, #0d1728, #080d17 72%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-brand:after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  right: -180px;
  bottom: -160px;
  box-shadow:
    0 0 0 80px rgba(255, 255, 255, 0.02),
    0 0 0 160px rgba(255, 255, 255, 0.015);
}
.brand-mark {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
  border-radius: 16px;
  margin-bottom: 44px;
  font: 800 25px Georgia;
  background: rgba(255, 255, 255, 0.06);
}
.brand-mark.small {
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 12px;
  font-size: 20px;
}
.login-brand h1 {
  font-size: clamp(42px, 5vw, 70px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0 0 26px;
}
.brand-copy {
  color: #aebbd0;
  line-height: 1.8;
  max-width: 430px;
}
.status-pill {
  margin-top: 52px;
  width: max-content;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  color: #b9c4d6;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.04);
}
.status-pill span,
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #36d391;
  margin-right: 7px;
  box-shadow: 0 0 0 4px rgba(54, 211, 145, 0.13);
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 32px;
  background: #f7f8fb;
}
.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 23px;
}
.login-card h2 {
  font-size: 32px;
  margin: 0 0 7px;
}
.muted,
.login-note {
  color: var(--muted);
  margin: 0;
}
.login-note {
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
.login-card label,
.dialog-fields label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.login-card input,
.dialog-fields input,
.dialog-fields select,
.dialog-fields textarea,
.filter-bar input {
  height: 48px;
  border: 1px solid #d9dee8;
  border-radius: 10px;
  padding: 0 14px;
  background: #fff;
  outline: none;
  transition: 0.2s;
}
.dialog-fields textarea {
  height: 100px;
  padding-top: 12px;
  resize: vertical;
}
.login-card input:focus,
.dialog-fields input:focus,
.dialog-fields select:focus,
.dialog-fields textarea:focus,
.filter-bar input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(39, 103, 232, 0.1);
}
.btn {
  border: 0;
  border-radius: 9px;
  height: 42px;
  padding: 0 17px;
  font-weight: 750;
  font-size: 13px;
  cursor: pointer;
  transition: 0.18s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 14px rgba(39, 103, 232, 0.22);
}
.btn.primary:hover {
  background: var(--blue2);
}
.btn.secondary {
  background: #fff;
  color: #344054;
  border: 1px solid #d6dce6;
}
.btn.full {
  width: 100%;
  height: 50px;
}
.form-error {
  min-height: 18px;
  color: var(--red);
  font-size: 13px;
  margin: -8px 0;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px 1fr;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  background: var(--nav);
  color: #fff;
  padding: 25px 18px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 32px;
}
.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}
.sidebar-brand strong {
  font-size: 19px;
}
.sidebar-brand span {
  font-size: 11px;
  color: #8fa0b9;
  margin-top: 2px;
}
.sidebar nav {
  display: grid;
  gap: 7px;
}
.sidebar nav button {
  display: flex;
  gap: 13px;
  align-items: center;
  border: 0;
  background: transparent;
  color: #91a1b9;
  padding: 12px 14px;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
  font-weight: 650;
}
.sidebar nav button span {
  font-size: 17px;
  width: 20px;
}
.sidebar nav button:hover,
.sidebar nav button.active {
  background: var(--nav2);
  color: #fff;
}
.sidebar nav button.active {
  box-shadow: inset 3px 0 var(--blue);
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid #1e2a3d;
  padding: 20px 4px 0;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
}
.sidebar-foot strong,
.sidebar-foot span {
  display: block;
}
.sidebar-foot strong {
  font-size: 13px;
}
.sidebar-foot span {
  font-size: 11px;
  color: #8292a9;
  margin-top: 3px;
}
.sidebar-foot button {
  border: 0;
  background: none;
  color: #8ea0b8;
  font-size: 20px;
  cursor: pointer;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #253b62;
  color: #9fc0ff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 88px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 clamp(22px, 4vw, 54px);
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar p {
  font-size: 11px;
  color: #98a2b3;
  margin: 0 0 4px;
}
.topbar h2 {
  font-size: 20px;
  margin: 0;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.icon-button {
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 21px;
  cursor: pointer;
  padding: 6px;
}
.topbar #menu-toggle {
  display: none;
}
.page {
  display: none;
  padding: 36px clamp(22px, 4vw, 54px) 60px;
  animation: fade 0.22s ease;
}
.page.active {
  display: block;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.hero-card {
  min-height: 190px;
  border-radius: 17px;
  padding: 35px 38px;
  color: #fff;
  background: linear-gradient(125deg, #12233d, #1c3153 70%, #244873);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-card:after {
  content: "";
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  right: -35px;
  top: -95px;
  border: 35px solid rgba(255, 255, 255, 0.04);
}
.hero-card h3 {
  font-size: 29px;
  margin: 0 0 10px;
}
.hero-card p:not(.eyebrow) {
  margin: 0;
  color: #afbdd0;
}
.hero-time {
  z-index: 1;
  text-align: right;
}
.hero-time span {
  display: block;
  color: #9eb0c9;
  font-size: 12px;
}
.hero-time strong {
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
  margin: 20px 0;
}
.metric-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.035);
}
.metric-grid p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}
.metric-grid strong {
  font-size: 27px;
}
.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.metric-icon.blue {
  background: #edf3ff;
  color: var(--blue);
}
.metric-icon.green {
  background: #e9f8f2;
  color: var(--green);
}
.metric-icon.amber {
  background: #fff5df;
  color: var(--amber);
}
.metric-icon.red {
  background: #fff0f0;
  color: var(--red);
}
.info-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 25px;
}
.panel h3 {
  margin: 0;
}
.panel-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.rule-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.rule-list li {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid #f0f2f5;
  font-size: 13px;
}
.rule-list li:last-child {
  border: 0;
}
.rule-list span {
  font-size: 10px;
  color: var(--blue);
  font-weight: 800;
}
.accent-panel {
  background: #eef3fb;
  border-color: #dbe5f3;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.accent-panel p:not(.eyebrow) {
  color: #53657f;
  line-height: 1.8;
}
.text-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--blue);
  text-align: left;
  font-weight: 750;
  cursor: pointer;
}
.section-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-tools h3 {
  font-size: 23px;
  margin: 0 0 5px;
}
.section-tools p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.button-row {
  display: flex;
  gap: 9px;
}
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 13px;
}
.filter-bar input {
  width: min(430px, 70%);
  height: 42px;
}
.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: auto;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.03);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}
th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f5;
  text-align: left;
  font-size: 12px;
  vertical-align: middle;
}
th {
  background: #fafbfc;
  color: #667085;
  font-size: 11px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
tbody tr:hover {
  background: #fafcff;
}
.mono {
  font:
    12px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
}
.badge.green {
  color: #08784d;
  background: #e8f8f1;
}
.badge.amber {
  color: #9a6400;
  background: #fff4dc;
}
.badge.red {
  color: #b42f2f;
  background: #ffeded;
}
.badge.gray {
  color: #596579;
  background: #edf0f4;
}
.badge.blue {
  color: #245dc3;
  background: #eaf1ff;
}
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.row-actions button {
  border: 1px solid #dce1e9;
  background: #fff;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 10px;
  cursor: pointer;
}
.row-actions button.danger {
  color: var(--red);
}
.toast {
  position: fixed;
  right: 26px;
  top: 105px;
  background: #12213a;
  color: #fff;
  padding: 13px 18px;
  border-radius: 9px;
  z-index: 40;
  box-shadow: var(--shadow);
  font-size: 13px;
}
dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(500px, calc(100% - 28px));
  box-shadow: 0 30px 90px rgba(8, 15, 28, 0.25);
}
dialog::backdrop {
  background: rgba(8, 15, 28, 0.52);
  backdrop-filter: blur(2px);
}
dialog form {
  padding: 25px;
}
dialog header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
dialog h3 {
  font-size: 22px;
  margin: 0;
}
.dialog-fields {
  display: grid;
  gap: 17px;
  padding: 22px 0;
}
.dialog-fields small {
  color: var(--muted);
  font-weight: 400;
}
dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
@media (max-width: 980px) {
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-brand {
    display: none;
  }
}
@media (max-width: 760px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: 0.22s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    grid-column: auto;
  }
  .topbar #menu-toggle {
    display: block;
  }
  .topbar {
    height: 74px;
    padding: 0 16px;
  }
  .page {
    padding: 22px 14px 45px;
  }
  .hero-card {
    padding: 28px 23px;
    min-height: 170px;
  }
  .hero-time {
    display: none;
  }
  .metric-grid {
    gap: 10px;
  }
  .metric-grid article {
    padding: 16px;
    gap: 11px;
  }
  .metric-grid strong {
    font-size: 22px;
  }
  .metric-icon {
    width: 35px;
    height: 35px;
  }
  .section-tools {
    align-items: flex-start;
    gap: 15px;
  }
  .button-row {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .top-actions span:not(.live-dot) {
    display: none;
  }
}
@media (max-width: 430px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric-grid article {
    display: block;
  }
  .metric-icon {
    margin-bottom: 10px;
  }
  .hero-card h3 {
    font-size: 25px;
  }
  .section-tools {
    display: grid;
  }
  .button-row {
    justify-content: flex-start;
  }
}
.generated-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.generated-card-toolbar > div {
  display: flex;
  gap: 8px;
}
.generated-card-toolbar .check-label {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}
.generated-card-toolbar input,
.generated-card-list input {
  width: 16px;
  height: 16px;
}
.generated-card-list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.generated-card-list label {
  display: grid;
  grid-template-columns: 18px 34px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f5;
  cursor: pointer;
}
.generated-card-list label:last-child {
  border-bottom: 0;
}
.generated-card-list label:hover {
  background: #f7f9fc;
}
.generated-card-list span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}
.generated-card-list code {
  font:
    12px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  user-select: all;
}
.card-filter-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 13px;
}
.card-filter-panel .filter-bar {
  margin: 0;
  flex-wrap: wrap;
}
.card-filter-panel .filter-bar input {
  flex: 1 1 280px;
}
.card-filter-panel select {
  height: 42px;
  border: 1px solid #d9dee8;
  border-radius: 9px;
  background: #fff;
  padding: 0 11px;
  color: #344054;
}
.card-batch-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-batch-tools label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.card-batch-tools label input {
  width: 72px;
  height: 38px;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  padding: 0 9px;
}
.card-batch-tools small {
  margin-left: auto;
  color: var(--muted);
}
.batch-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
  margin: 0 3px;
}
.btn.danger {
  background: #fff;
  color: var(--red);
  border: 1px solid #efb9b9;
}
.btn.danger:hover {
  background: #fff3f3;
}
.select-column {
  width: 42px;
  text-align: center;
}
.select-column input {
  width: 16px;
  height: 16px;
}
.danger-note {
  margin: 0;
  padding: 12px;
  border-radius: 9px;
  color: #a62f2f;
  background: #fff0f0;
  font-size: 12px;
  line-height: 1.65;
}
