:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e8edf5;
  --line-soft: #f1f5f9;
  --text: #1e293b;
  --heading: #0f172a;
  --muted: #8a94a6;
  --muted-2: #a8b1c2;
  --blue: #2563eb;
  --blue-2: #1d4ed8;
  --blue-soft: #eef5ff;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --amber: #d97706;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 10px 30px rgba(15, 23, 42, 0.035);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.ico {
  flex: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.brand {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #0b1220;
  line-height: 1.05;
}

.brand-sub {
  font-size: 8.5px;
  letter-spacing: 2.2px;
  color: #94a3b8;
  margin-top: 3px;
  font-weight: 600;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 18px;
  scrollbar-width: thin;
}

.nav::-webkit-scrollbar {
  width: 5px;
}

.nav::-webkit-scrollbar-thumb {
  background: #dbe3ee;
  border-radius: 9px;
}

.nav-group {
  margin-bottom: 2px;
}

.nav-head {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 8px;
  color: #475569;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
}

.nav-head:hover {
  background: #f8fafc;
}

.nav-group.active > .nav-head {
  background: var(--blue-soft);
  color: var(--blue-2);
  font-weight: 600;
}

.nav-head .chev {
  margin-left: auto;
  color: #a4aec0;
  transition: transform 0.18s ease;
}

.nav-group.open > .nav-head .chev {
  transform: rotate(90deg);
}

.nav-sub {
  display: none;
  margin: 2px 0 5px 18px;
  padding-left: 13px;
  border-left: 1px solid #eef2f7;
}

.nav-group.open .nav-sub {
  display: block;
}

.nav-sub a {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  color: #64748b;
  font-size: 12.8px;
  margin: 1px 0;
}

.nav-sub a:hover {
  background: #f8fafc;
  color: #334155;
}

.nav-sub a.active {
  background: #f3f8ff;
  color: var(--blue-2);
  font-weight: 600;
}

.nav-sub a .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbd5e1;
  margin-right: 9px;
}

.nav-sub a.active .dot {
  background: var(--blue);
  box-shadow: 0 0 0 3px #dbeafe;
}

.sidebar-foot {
  flex: none;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94a3b8;
  font-size: 11px;
}

.local-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.local-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px #dcfce7;
}

.main {
  margin-left: 248px;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  z-index: 20;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9aa4b5;
  white-space: nowrap;
}

.breadcrumb b {
  color: #334155;
  font-weight: 600;
}

.breadcrumb .sep {
  color: #d1d9e6;
}

.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 5px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.env-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3b82f6;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.global-search {
  width: min(520px, 38vw);
  height: 38px;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: #94a3b8;
}

.global-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
  color: #334155;
}

.global-search input::placeholder {
  color: #a8b1c2;
}

.global-search kbd {
  font-family: inherit;
  font-size: 9.5px;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: #64748b;
}

.icon-btn:hover {
  background: #f1f5f9;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 4px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fca5a5, #f87171);
  color: #7f1d1d;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #fecaca;
}

.user-chip b {
  display: block;
  font-size: 12.5px;
  color: #1e293b;
  line-height: 1.2;
}

.user-chip span {
  display: block;
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 3px;
}

.content {
  padding: 24px 26px 48px;
  max-width: 1680px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--blue);
  margin-bottom: 7px;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -0.5px;
  color: var(--heading);
}

h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--heading);
}

.sub {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.updated {
  font-size: 11px;
  color: #9aa4b5;
  margin-right: 4px;
  white-space: nowrap;
}

.btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  color: #334155;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  background: var(--blue-2);
  border-color: var(--blue-2);
}

.btn.soft {
  background: var(--blue-soft);
  border-color: #dbeafe;
  color: var(--blue-2);
}

.btn.danger {
  color: var(--red);
  border-color: #fecaca;
  background: #fff;
}

.btn.danger:hover {
  background: var(--red-soft);
}

.btn.sm {
  height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 7px;
}

.btn.xs {
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 6px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.link {
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 12px;
  padding: 4px 4px;
}

.link:hover {
  color: var(--blue-2);
  text-decoration: underline;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toolbar-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.seg {
  display: inline-flex;
  background: #f8fafc;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: #64748b;
  font-size: 12px;
}

.seg-btn.active {
  background: #fff;
  color: #1e293b;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.09);
}

.date-range {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.date-range .arrow {
  color: #b6c0cf;
}

.select,
.input {
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 0 11px;
  font-size: 12.5px;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select:focus,
.input:focus,
textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px #eff6ff;
}

textarea {
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 12px;
  outline: 0;
  resize: vertical;
  color: #334155;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 11.5px;
}

.right {
  margin-left: auto;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 17px 18px 15px;
  min-height: 128px;
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: grid;
  place-items: center;
  flex: none;
}

.kpi-icon.green {
  background: #ecfdf5;
  color: #059669;
}

.kpi-icon.amber {
  background: #fffbeb;
  color: #d97706;
}

.kpi-value {
  margin: 12px 0 8px;
  font-size: 25px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -0.7px;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.kpi-value.neg {
  color: var(--red);
}

.kpi-delta {
  font-size: 10.5px;
  color: #94a3b8;
}

.kpi-delta.down {
  color: #ef4444;
}

.kpi-delta.warn {
  color: #f97316;
}

.kpi-delta.up {
  color: #16a34a;
}

.chart-panel {
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 0;
}

.panel-head p {
  margin: 5px 0 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
}

.panel-head .select {
  height: 34px;
  min-width: 128px;
}

.chart-wrap {
  padding: 6px 16px 12px;
}

.chart-legend {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 0 8px 2px;
  font-size: 10.5px;
  color: #64748b;
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}

.legend-dot.blue {
  background: #2563eb;
}

.legend-dot.gray {
  background: #cbd5e1;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mini-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-card .num {
  font-size: 20px;
  font-weight: 750;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.mini-card .label {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}

.tab {
  height: 36px;
  padding: 0 13px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab:hover {
  border-color: #bfdbfe;
  color: var(--blue-2);
}

.tab.active {
  background: var(--blue-soft);
  border-color: #bfdbfe;
  color: var(--blue-2);
  font-weight: 600;
}

.tab-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.tab.active .tab-count {
  background: #dbeafe;
  color: #1d4ed8;
}

.filter-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 230px;
}

.search-field .ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa4b5;
  pointer-events: none;
}

.search-field .input {
  width: 100%;
  padding-left: 34px;
}

.filter-card .select {
  min-width: 120px;
}

.filter-card .search-field {
  flex: 1.6;
}

.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-toolbar {
  min-height: 55px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.selected-info {
  font-size: 12px;
  color: #64748b;
}

.selected-info b {
  color: var(--blue-2);
}

.table-wrap {
  overflow-x: auto;
}

.table-products {
  table-layout: fixed;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 980px;
}

th {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  padding: 10px 11px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfdff;
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
  cursor: pointer;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  color: #64748b;
  letter-spacing: 0.1px;
}

.copy-mini {
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: #b0bac9;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  vertical-align: -5px;
  margin-left: 2px;
}

.copy-mini:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.thumb {
  width: 38px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid #eef2f7;
  display: block;
}

.name-cell {
  max-width: 300px;
}

.name-cell .zh {
  color: #1e293b;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-cell .en {
  margin-top: 3px;
  color: #a0aabb;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-link {
  color: #475569;
  font-size: 11px;
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-cell {
  max-width: 160px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  border: 1px solid;
  font-size: 10.5px;
  white-space: nowrap;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge.blue {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.badge.green {
  background: var(--green-soft);
  border-color: #bbf7d0;
  color: var(--green);
}

.badge.gray {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.badge.amber {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.price {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #334155;
  font-weight: 500;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.row-actions .btn.xs {
  border-color: #e2e8f0;
  padding: 0 6px;
}

.empty-row {
  padding: 54px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  font-size: 11.5px;
  color: #64748b;
  flex-wrap: wrap;
}

.pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pager button {
  min-width: 29px;
  height: 29px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 6px;
  color: #475569;
  font-size: 11px;
}

.pager button:hover {
  border-color: #bfdbfe;
  color: var(--blue-2);
}

.pager button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.form-head {
  align-items: center;
}

.form-head .back {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #475569;
  flex: none;
}

.form-head .title-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-panel {
  padding: 18px 20px 20px;
  margin-bottom: 14px;
}

.form-panel > h2,
.section-head h2 {
  font-size: 15px;
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-bottom: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.field label,
.label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.form-panel .input,
.form-panel .select {
  width: 100%;
}

.input.readonly {
  background: #f8fafc;
  color: #94a3b8;
}

.hint {
  margin-top: 7px;
  font-size: 10.5px;
  color: #a0aabb;
}

.lang-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.lang-tab {
  padding: 0 1px 10px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #64748b;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}

.lang-tab .filled {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
}

.spec-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 34px;
  gap: 10px;
  margin-bottom: 9px;
}

.spec-empty {
  border: 1px dashed #e2e8f0;
  background: #fbfdff;
  border-radius: 8px;
  padding: 30px 20px;
  text-align: center;
  color: #a0aabb;
  font-size: 11.5px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.upload-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.upload-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}

.upload-hint {
  min-height: 30px;
  margin: 4px 0 9px;
  color: #9aa4b5;
  font-size: 10px;
  line-height: 1.5;
}

.upload-drop {
  height: 158px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.upload-drop:hover {
  border-color: #93c5fd;
}

.upload-drop img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f8fafc;
}

.upload-drop .empty {
  text-align: center;
  color: #a8b1c2;
  font-size: 10.5px;
  line-height: 1.8;
}

.upload-drop .empty .ico {
  margin-bottom: 4px;
}

.upload-actions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 0 0;
}

.ai-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px 26px;
  border-radius: 15px;
  background:
    radial-gradient(circle at 82% 18%, rgba(147, 197, 253, 0.38), transparent 34%),
    linear-gradient(120deg, #0b1f52, #1d4ed8 55%, #3b82f6);
  color: #fff;
  box-shadow: 0 16px 40px rgba(29, 78, 216, 0.18);
  margin-bottom: 16px;
}

.ai-hero::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.ai-hero h1 {
  color: #fff;
  font-size: 24px;
}

.ai-hero p {
  max-width: 720px;
  margin: 8px 0 0;
  color: #c7dbff;
  font-size: 12px;
  line-height: 1.75;
}

.ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 9px;
  border: 1px solid rgba(191, 219, 254, 0.38);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  color: #dbeafe;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  margin-bottom: 11px;
}

.ai-hero-side {
  display: flex;
  gap: 10px;
  flex: none;
  position: relative;
  z-index: 1;
}

.ai-stat {
  min-width: 86px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(7px);
}

.ai-stat b {
  display: block;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.4px;
}

.ai-stat span {
  display: block;
  margin-top: 3px;
  color: #bfdbfe;
  font-size: 10px;
}

.ai-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  margin-bottom: 16px;
}

.ai-panel {
  padding: 18px 20px;
}

.ai-panel .panel-head {
  padding: 0;
  margin-bottom: 12px;
}

.ai-panel textarea {
  width: 100%;
  min-height: 104px;
  font-size: 13px;
  line-height: 1.65;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 14px;
}

.chip {
  border: 1px solid #dbeafe;
  background: #f6faff;
  color: #1d4ed8;
  border-radius: 99px;
  padding: 6px 10px;
  font-size: 10.5px;
}

.chip:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.plan-card {
  padding: 18px 20px;
  margin-bottom: 16px;
  scroll-margin-top: 84px;
}

.plan-banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 9px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #075985;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.plan-banner.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.plan-banner.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.plan-meta {
  display: flex;
  gap: 22px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.plan-meta div span {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.plan-meta div b {
  display: block;
  font-size: 13px;
  color: #1e293b;
  font-weight: 650;
}

.pre {
  background: #0f172a;
  color: #dbeafe;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.65;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-list {
  display: flex;
  flex-direction: column;
}

.log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.log-item:last-child {
  border-bottom: 0;
}

.log-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  margin-top: 7px;
  flex: none;
  box-shadow: 0 0 0 3px #dcfce7;
}

.log-item b {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.log-item p {
  margin: 3px 0 0;
  font-size: 10.5px;
  color: #94a3b8;
}

.api-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 20px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
}

.api-method.post {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.api-method.patch {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.api-path {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: #334155;
  word-break: break-all;
}

.placeholder-card {
  padding: 60px 26px;
  text-align: center;
}

.placeholder-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  display: inline-grid;
  place-items: center;
  margin-bottom: 15px;
}

.placeholder-card h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.placeholder-card p {
  margin: 0 auto 18px;
  max-width: 480px;
  color: #8a94a6;
  font-size: 12.5px;
  line-height: 1.7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.28);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 16px;
}

.modal-body {
  padding: 20px;
}

.modal-body .field {
  margin-bottom: 16px;
}

.modal-body .input,
.modal-body .select {
  width: 100%;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 11px 15px;
  border-radius: 9px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
  animation: toast-in 0.18s ease-out;
}

.toast.error {
  background: #b91c1c;
}

.toast.success {
  background: #15803d;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1350px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .sidebar {
    width: 216px;
  }

  .main {
    margin-left: 216px;
  }

  .global-search {
    width: 300px;
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 0 14px;
  }

  .global-search {
    display: none;
  }

  .content {
    padding: 18px 14px 38px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid-2,
  .upload-grid,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}
