:root {
  color: #142033;
  background: #eef3f8;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100%; background: #eef3f8; }
button, input, textarea, select { font: inherit; }
button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #1f5eff 0%, #1743c5 100%);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 11px 16px;
  box-shadow: 0 10px 22px rgba(31, 94, 255, 0.22);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(31, 94, 255, 0.26); }
button.secondary { background: #eef4ff; color: #1f4fbd; box-shadow: none; }
button.danger { background: #fff1f1; color: #c02626; box-shadow: none; }
code { background: #edf1ff; border-radius: 6px; padding: 2px 6px; }

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 560px) minmax(360px, 1fr);
  gap: 28px;
  padding: 48px;
  background:
    radial-gradient(circle at 15% 10%, rgba(31, 94, 255, .18), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(14, 165, 233, .18), transparent 28%),
    linear-gradient(135deg, #edf4ff 0%, #f8fbff 46%, #eef3f8 100%);
}
.login-panel, .login-aside, .panel, .card {
  border: 1px solid rgba(213, 222, 238, .85);
  border-radius: 28px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 70px rgba(20, 32, 64, 0.11);
}
.login-panel {
  padding: 44px;
  align-self: center;
  backdrop-filter: blur(16px);
}
.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #10213f;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .08em;
  margin-bottom: 24px;
}
.login-panel h1 { margin: 10px 0 14px; font-size: clamp(34px, 4.5vw, 54px); line-height: 1.08; letter-spacing: -0.04em; }
.login-subtitle, .login-aside p, .panel p, .card p { color: #667085; line-height: 1.7; }
.login-aside {
  padding: 46px;
  align-self: center;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, #10213f 0%, #183b73 55%, #1f5eff 100%);
  color: #fff;
  overflow: hidden;
  position: relative;
}
.login-aside::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  right: -80px;
  bottom: -90px;
  background: rgba(255,255,255,.12);
}
.login-aside h2 { max-width: 560px; margin: 18px 0 12px; font-size: clamp(30px, 4vw, 48px); line-height: 1.12; letter-spacing: -0.03em; }
.login-aside p { color: rgba(255,255,255,.76); max-width: 620px; }
.status-pill {
  align-self: flex-start;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 8px 13px;
  color: #eaf2ff;
  font-weight: 700;
  font-size: 13px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
  position: relative;
  z-index: 1;
}
.feature-grid div {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: rgba(255,255,255,.10);
  padding: 18px;
}
.feature-grid strong { display: block; font-size: 18px; margin-bottom: 6px; }
.feature-grid span { color: rgba(255,255,255,.72); font-size: 14px; }
.eyebrow { color: #1f5eff; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.login-form, .form-grid { display: grid; gap: 16px; margin: 26px 0 0; }
.login-form label, .form-grid label { display: grid; gap: 8px; color: #344054; font-weight: 700; }
.login-form input, .form-grid input, .form-grid textarea, .form-grid select, .filter-bar input, .filter-bar select {
  border: 1px solid #d5deee;
  border-radius: 14px;
  background: #fff;
  color: #142033;
  padding: 12px 14px;
  width: 100%;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.login-form input:focus, .form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus, .filter-bar input:focus, .filter-bar select:focus {
  border-color: #1f5eff;
  box-shadow: 0 0 0 4px rgba(31, 94, 255, .10);
}
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(140px, auto)); gap: 10px; margin: 16px 0 22px; }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid textarea { min-height: 120px; resize: vertical; }
.alert { display: grid; gap: 8px; border-radius: 14px; padding: 14px; }
.alert.error { background: #fff0f0; color: #b42318; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 270px 1fr; }
.sidebar {
  background: linear-gradient(180deg, #0e1a31 0%, #132a4e 100%);
  color: #fff;
  padding: 30px 18px;
  box-shadow: 16px 0 44px rgba(20, 32, 64, .14);
}
.brand { font-size: 30px; font-weight: 950; letter-spacing: .08em; }
.sidebar p { color: #9fb0d1; margin: 8px 0 0; }
.sidebar nav { display: grid; gap: 8px; margin-top: 30px; }
.nav-item {
  width: 100%;
  background: transparent;
  color: #d9e2ff;
  text-align: left;
  border-radius: 14px;
  box-shadow: none;
  padding: 12px 14px;
}
.nav-item:hover { background: rgba(255,255,255,.08); transform: none; box-shadow: none; }
.nav-item.active { background: #fff; color: #15356e; box-shadow: 0 12px 26px rgba(0,0,0,.16); }
.main-panel { padding: 30px; overflow: auto; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}
.topbar h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -0.03em; }
.topbar p { margin: 0; color: #667085; }
.hero-card {
  border-radius: 28px;
  background: linear-gradient(135deg, #10213f 0%, #1f5eff 100%);
  color: #fff;
  padding: 34px;
  box-shadow: 0 24px 58px rgba(20, 32, 64, 0.18);
}
.hero-card p { color: #e4e9ff; max-width: 760px; }
.hero-card h2 { margin: 8px 0 12px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -0.03em; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.card, .panel { padding: 24px; margin-bottom: 20px; }
.card h3, .panel h2 { margin: 0 0 10px; }
.card strong { display: block; color: #1f5eff; font-size: 34px; letter-spacing: -0.03em; }
.section-head, .quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quick-actions { justify-content: flex-start; margin: 16px 0; }
.table-list { display: grid; gap: 12px; }
.record-row {
  border: 1px solid #e5eaf5;
  border-radius: 18px;
  background: #fbfcff;
  padding: 16px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.record-row:hover { border-color: #c9d7f3; box-shadow: 0 12px 26px rgba(20, 32, 64, .07); transform: translateY(-1px); }
.record-row strong { display: block; margin-bottom: 7px; }
.record-row span { color: #667085; font-size: 13px; }
.record-row p { margin-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
pre {
  overflow: auto;
  max-height: 380px;
  border-radius: 14px;
  background: #0e1a31;
  color: #d6e4ff;
  padding: 16px;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .login-layout { grid-template-columns: 1fr; padding: 24px; }
  .login-aside { min-height: auto; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { border-radius: 0 0 24px 24px; }
}
@media (max-width: 640px) {
  .main-panel { padding: 18px; }
  .topbar { flex-direction: column; }
  .filter-bar, .feature-grid { grid-template-columns: 1fr; }
  .login-panel, .login-aside { padding: 28px; }
}

.nav-group { display: grid; gap: 7px; margin: 18px 0; }
.nav-group > span { color: #7f94bd; font-size: 12px; font-weight: 900; letter-spacing: .08em; padding: 0 12px; }
.table-head { margin-bottom: 16px; }
.table-wrap { overflow-x: auto; border: 1px solid #e5eaf5; border-radius: 18px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid #edf1f7; text-align: left; vertical-align: middle; }
.data-table th { background: #f7f9fd; color: #475467; font-size: 13px; font-weight: 900; }
.data-table td { color: #27364f; font-size: 14px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:last-child { white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.empty-cell, .empty-hint { color: #667085; text-align: center; padding: 28px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 800; }
.badge.ok { background: #e9f8ef; color: #067647; }
.badge.muted { background: #f2f4f7; color: #667085; }
.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.step-card { border: 1px solid #e5eaf5; border-radius: 18px; padding: 18px; background: #fbfcff; display: flex; align-items: flex-start; gap: 12px; }
.step-card b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #1f5eff; color: #fff; flex: 0 0 auto; }
.step-card span { color: #344054; line-height: 1.6; }
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .48); display: grid; place-items: center; padding: 24px; z-index: 20; }
.modal-card { width: min(960px, 96vw); max-height: 90vh; overflow: auto; border-radius: 24px; background: #fff; box-shadow: 0 24px 80px rgba(15, 23, 42, .28); padding: 24px; }
.filter-bar.single { grid-template-columns: minmax(220px, 1fr) auto; }

/* Production console density polish */
.modal-card { width: min(820px, 94vw); padding: 22px; }
.modal-card .section-head { border-bottom: 1px solid #edf1f7; padding-bottom: 14px; margin-bottom: 18px; }
.icon-button { width: 34px; height: 34px; padding: 0; border-radius: 10px; background: #f2f4f7; color: #344054; box-shadow: none; font-size: 22px; line-height: 1; }
.icon-button:hover { transform: none; box-shadow: none; background: #e8edf5; }
.modal-form { margin: 0; gap: 14px 16px; }
.modal-form label { font-size: 13px; }
.modal-form input, .modal-form textarea, .modal-form select { padding: 10px 12px; border-radius: 10px; }
.modal-form textarea { min-height: 92px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; border-top: 1px solid #edf1f7; }
.form-actions button { min-width: 84px; padding: 9px 16px; box-shadow: none; }
.toast { position: fixed; right: 28px; top: 24px; z-index: 40; border-radius: 12px; background: #101828; color: #fff; padding: 12px 16px; box-shadow: 0 14px 40px rgba(16,24,40,.22); font-weight: 700; }
.toast.error { background: #b42318; }
.panel > .form-grid:not(.modal-form) button[type="submit"] { justify-self: start; min-width: 120px; }
