:root {
  --bg: #f7f9fc;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-2: #fbfcfe;
  --line: rgba(63, 90, 120, 0.09);
  --ink: #243140;
  --muted: #758295;
  --accent: #2f65ad;
  --accent-2: #4aa1da;
  --warning: #9a6a2a;
  --danger: #a05a52;
  --shadow: 0 20px 44px rgba(86, 110, 138, 0.07);
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  background-image: radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 34%),
    radial-gradient(circle at top right, rgba(232, 241, 250, 0.7), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, #f7f9fc 100%);
}

.login-screen,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.88), transparent 26%),
    radial-gradient(circle at left top, rgba(220, 233, 245, 0.78), transparent 30%),
    radial-gradient(circle at right bottom, rgba(232, 239, 247, 0.76), transparent 32%),
    linear-gradient(180deg, #eef4fa 0%, #dfe8f2 100%);
}

.login-card,
.modal-card {
  width: min(436px, 100%);
  padding: 32px 30px 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 28px 60px rgba(88, 113, 141, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

.login-brand {
  gap: 14px;
  margin-bottom: 26px;
  padding: 0;
  color: var(--ink);
}

.login-brand .brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(47, 101, 173, 0.12);
}

.login-brand strong {
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

.login-brand span {
  color: var(--muted);
}

.login-card label,
.modal-card label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-field span {
  font-size: 12px;
  font-weight: 700;
  color: #7b8897;
}

.login-card input:not([type="checkbox"]),
.modal-card input:not([type="checkbox"]) {
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(131, 150, 171, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.login-card input:not([type="checkbox"]):focus,
.modal-card input:not([type="checkbox"]):focus {
  outline: none;
  border-color: rgba(47, 101, 173, 0.36);
  box-shadow: 0 0 0 4px rgba(74, 161, 218, 0.14);
}

.login-card button,
.modal-card button {
  width: 100%;
}

.login-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  margin: 10px 0 18px;
}

.login-check {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(47, 101, 173, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  color: #5d7086;
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.login-check:has(input:checked) {
  border-color: rgba(47, 101, 173, 0.28);
  background: linear-gradient(135deg, rgba(47, 101, 173, 0.08) 0%, rgba(74, 161, 218, 0.12) 100%);
  color: #2f65ad;
}

.login-check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
  accent-color: #2f65ad;
  box-shadow: none;
  vertical-align: middle;
}

.login-check span {
  line-height: 1;
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.login-help {
  margin-top: 0;
  color: #2f65ad;
  font-size: 13px;
}

.login-card .primary-button {
  min-height: 52px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 16px 28px rgba(47, 101, 173, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.login-help-note {
  color: #98a6b5;
  font-size: 12px;
  font-weight: 700;
}

.form-message {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

.form-message.info {
  color: #6b7d92;
}

.inline-form-message {
  flex: 1 0 100%;
  min-height: 0;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(160, 90, 82, 0.14);
  border-radius: 10px;
  background: rgba(160, 90, 82, 0.06);
}

.inline-form-message.success {
  color: #2f6b57;
  border-color: rgba(47, 107, 87, 0.14);
  background: rgba(47, 107, 87, 0.08);
}

.modal-backdrop {
  z-index: 30;
  background: rgba(35, 33, 29, 0.66);
}

.modal-card h2 {
  margin-bottom: 8px;
}

.ad-copy-modal-card {
  width: min(520px, 100%);
}

.ad-copy-modal-text {
  min-height: 72px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
}

.ad-copy-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.ad-copy-modal-actions button {
  width: auto;
}

.announcement-modal-card {
  width: min(520px, 100%);
  padding-top: 26px;
}

.announcement-modal-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 101, 173, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.announcement-modal-date {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.announcement-modal-text {
  min-height: 120px;
  max-height: min(42vh, 320px);
  overflow: auto;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.82);
  color: var(--ink);
  line-height: 1.75;
  white-space: pre-wrap;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.watermark-layer {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  background-repeat: repeat;
  opacity: 0.35;
}

.sidebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 14px 14px 0;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(246, 250, 255, 0.86) 100%);
  color: var(--ink);
  position: sticky;
  top: 12px;
  z-index: 16;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 28px;
  box-shadow: 0 22px 44px rgba(88, 113, 141, 0.12);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  border-bottom: 0;
  flex: 0 0 auto;
}

.brand strong {
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(47, 101, 173, 0.12) 0%, rgba(74, 161, 218, 0.18) 100%);
  color: #2f65ad;
  font-weight: 800;
}

.logo-mark {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(47, 101, 173, 0.12);
}

.sidebar .logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-footer span {
  color: var(--muted);
  font-size: 12px;
}

.nav-shell {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid rgba(74, 161, 218, 0.1);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 250, 255, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 40px;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6e7f92;
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.nav-item span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  color: #a7b8ca;
  font-size: 15px;
}

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(135deg, rgba(47, 101, 173, 0.1) 0%, rgba(74, 161, 218, 0.14) 100%);
  color: #204b82;
  box-shadow: 0 10px 24px rgba(74, 161, 218, 0.14);
  transform: translateY(-1px);
}

.nav-item.active span,
.nav-item:hover span {
  color: #3c88c4;
}

.nav-item.nav-hidden {
  display: none;
}

.nav-overflow {
  position: relative;
  flex: 0 0 auto;
}

.nav-overflow-toggle {
  min-width: 84px;
  justify-content: center;
  background: rgba(247, 250, 255, 0.92);
  border: 1px solid rgba(74, 161, 218, 0.1);
  color: #5b6f86;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.nav-overflow-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 6px;
  min-width: 208px;
  padding: 10px;
  border: 1px solid rgba(233, 239, 246, 0.96);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.985) 0%, rgba(248, 251, 255, 0.97) 100%);
  box-shadow: 0 24px 46px rgba(101, 128, 160, 0.17);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-overflow-menu .nav-item {
  width: 100%;
  justify-content: flex-start;
  min-height: 38px;
  padding-inline: 12px;
  border-radius: 14px;
}

.nav-overflow-menu::before {
  content: "扩展导航";
  display: block;
  padding: 2px 8px 6px;
  color: #93a5b7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-overflow-menu .nav-item.active {
  box-shadow: 0 12px 24px rgba(117, 144, 174, 0.1);
}

.nav-overflow-menu .nav-item:not(.active):hover {
  background: rgba(247, 250, 254, 0.95);
  box-shadow: none;
}

.sidebar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 4px;
  border: 1px solid rgba(74, 161, 218, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
}

.main {
  min-width: 0;
  padding: 26px 24px 28px;
}

@media (max-width: 1100px) {
  .sidebar {
    align-items: stretch;
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .nav-shell {
    order: 3;
    width: 100%;
  }

  .nav {
    width: 100%;
  }

  .sidebar-tools {
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  .sidebar {
    gap: 12px;
  }

  .brand {
    width: 100%;
  }

  .sidebar-tools {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .nav-shell {
    padding: 6px;
  }

  .nav-item {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .main {
    padding: 16px;
  }
}

.topbar,
.section-toolbar,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

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

.entry-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.pagination-summary {
  color: var(--muted);
  font-size: 13px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-actions button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.pagination-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.pagination-input {
  width: 72px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}

.file-button input {
  display: none;
}

.user-badge {
  display: flex;
  min-height: 48px;
  min-width: 198px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 8px;
  border: 1px solid rgba(74, 161, 218, 0.1);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 250, 255, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.user-badge-copy,
.user-badge small,
.user-badge strong {
  display: block;
}

.user-badge small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.user-badge strong {
  font-size: 14px;
  line-height: 1.35;
}

.user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 101, 173, 0.14) 0%, rgba(74, 161, 218, 0.22) 100%);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.search-box,
.select-box,
.date-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-box {
  min-width: 260px;
}

.select-box,
.date-box {
  min-width: 170px;
}

.date-box {
  min-width: 208px;
  border-color: transparent;
  background: var(--surface);
}

.select-box span,
.date-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.search-box input,
.select-box select,
.date-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
}

.slim-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.text-button {
  display: block;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.primary-button {
  padding: 0 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.secondary-button {
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--line);
  color: var(--ink);
}

.topbar-button {
  min-height: 40px;
  padding: 0 14px;
  white-space: nowrap;
  border-radius: 14px;
}

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

.danger-button {
  padding: 0 14px;
  border-color: #e3c1bc;
  background: #fcf6f4;
  color: var(--danger);
}

.product-form-actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  width: 36px;
  background: var(--surface-2);
  color: var(--danger);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

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

.metric {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.layout-grid,
.report-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}

.report-entry-form {
  display: grid;
  gap: 14px;
  align-items: stretch;
}

.report-rows {
  display: grid;
  gap: 10px;
}

.report-entry-row {
  display: grid;
  grid-template-columns: 150px 1.2fr 1fr 0.9fr 1fr 0.9fr 0.9fr 0.9fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.report-entry-row input {
  width: 100%;
}

.report-entry-row .icon-button {
  width: 38px;
  min-width: 38px;
}

.report-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

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

.report-summary-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.92) 100%);
  content-visibility: auto;
  contain: layout paint style;
}

.report-summary-card small,
.report-summary-card strong,
.report-summary-card span {
  display: block;
}

.report-summary-card small {
  color: var(--muted);
  font-size: 12px;
}

.report-summary-card strong {
  margin-top: 8px;
  font-size: 20px;
}

.report-summary-card span {
  margin-top: 6px;
  color: #607285;
  font-size: 13px;
  line-height: 1.45;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.report-grid > .panel {
  content-visibility: auto;
  contain: layout paint style;
}

.panel.wide {
  grid-column: span 1;
}

.report-summary-panel,
.report-grid .panel.wide {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.team-filter-row {
  grid-template-columns: minmax(0, 420px);
}

.table-wrap.flat {
  border: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.scrape-row-newest {
  background: rgba(99, 131, 160, 0.08);
}

.scrape-row-newest td {
  background: transparent;
}

.wide-table {
  min-width: 1180px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f6f9fc;
  color: #718197;
  font-size: 12px;
  font-weight: 700;
}

td {
  font-size: 14px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.badge,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.status.warn {
  background: #f7ecde;
  color: var(--warning);
}

.status.danger {
  background: #f8e9e6;
  color: var(--danger);
}

.section-toolbar {
  width: 100%;
  max-width: 100%;
  margin: 0 0 12px;
  justify-content: flex-end;
}

.section-toolbar > div:first-child {
  display: none;
}

.section-toolbar:has(> button, > .toolbar-actions) {
  width: fit-content;
  margin: -54px 0 12px auto;
}

.entry-form,
.filter-row,
.settings-form {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.entry-form input,
.entry-form select,
.filter-row input,
.filter-row select,
.settings-form input,
.settings-form select,
.settings-form textarea {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
}

.settings-form textarea {
  min-height: 140px;
  padding: 12px 10px;
  resize: vertical;
}

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

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 900px;
}

.settings-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field-hint {
  color: #8a98aa;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.field-hint-row {
  grid-column: 2 / -1;
  margin-top: -8px;
  color: #8a98aa;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.settings-form button {
  align-self: end;
}

.settings-note {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--muted);
  font-size: 12px;
}

.settings-note strong {
  color: var(--ink);
  font-size: 13px;
}

.settings-note.compact {
  min-height: 0;
}

.settings-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.announcement-form {
  max-width: 920px;
}

.announcement-note {
  min-height: auto;
}

.announcement-form-message {
  grid-column: 1 / -1;
  margin-top: -4px;
  text-align: left;
}

#scrapeForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  max-width: none;
}

#scrapeForm input[name="productUrl"] {
  width: 100%;
  min-width: 0;
}

.settings-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 2px;
}

.settings-checkbox input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
}

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

#logisticsForm button {
  align-self: end;
}

.product-create-form {
  max-width: 920px;
}

.full-row {
  grid-column: 1 / -1;
}

.image-preview-wrap {
  display: grid;
  grid-template-columns: 88px minmax(0, 180px);
  grid-template-rows: auto 1fr;
  gap: 4px 8px;
  align-items: start;
  width: fit-content;
  min-height: 88px;
  max-height: 88px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf8f4;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.product-preview {
  grid-row: 1 / 3;
  display: block;
  width: 76px;
  height: 76px;
  min-width: 76px;
  min-height: 76px;
  max-width: 76px;
  max-height: 76px;
  border-radius: 10px;
  object-fit: cover;
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
}

.image-preview-wrap small {
  max-width: 180px;
  line-height: 1.35;
}

.product-thumb,
.product-detail img {
  cursor: zoom-in;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 42px;
  background: rgba(0, 0, 0, 0.78);
}

.image-modal img {
  display: block;
  max-width: min(94vw, 1400px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.image-modal-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.34);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.hidden {
  display: none;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.empty-card {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #faf8f4;
}

.product-thumb {
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
}

#productTable td:last-child {
  white-space: nowrap;
}

#productTable td:last-child .secondary-button {
  min-height: 32px;
  padding: 0 10px;
}

.purchase-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}

.muted-text {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.tracking-value {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.tracking-link {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border-radius: 7px;
  background: #e9eef2;
  font-size: 12px;
}

.detail-panel {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.order-detail-layout {
  display: grid;
  gap: 14px;
}

.product-detail {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf8f4;
}

.product-detail img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.product-detail span,
.product-detail strong {
  display: block;
}

.product-detail span {
  color: var(--muted);
  font-size: 12px;
}

.product-detail strong {
  margin: 4px 0 6px;
}

.product-detail p {
  margin-bottom: 4px;
}

.detail-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.detail-grid span,
.detail-grid strong {
  display: block;
}

.detail-grid span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  white-space: normal;
  word-break: break-word;
}

a {
  color: var(--accent-2);
  font-weight: 700;
  text-decoration: none;
}

.todo-list,
.stack-list,
.cost-grid,
.permission-grid {
  display: grid;
  gap: 10px;
}

.inline-modules {
  margin-top: 0;
}

.cost-calc-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: start;
  gap: 14px 16px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.cost-calc-form label,
.cost-calc-form .cost-country-field {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cost-sku-field {
  grid-column: 1;
  grid-row: 1;
}

.cost-type-field {
  grid-column: 2;
  grid-row: 1;
}

.cost-quantity-field {
  grid-column: 3;
  grid-row: 1;
}

.cost-country-field {
  grid-column: 4;
  grid-row: 1 / span 3;
}

.cost-purchase-field {
  grid-column: 1;
  grid-row: 2;
}

.cost-weight-field {
  grid-column: 2;
  grid-row: 2;
}

.cost-calc-form input,
.cost-calc-form select {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.cost-calc-form input:focus,
.cost-calc-form select:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.cost-calc-form .primary-button {
  grid-column: 3;
  grid-row: 3;
  width: 100%;
  height: 42px;
  align-self: end;
}

.cost-country-picker {
  display: grid;
  gap: 8px;
  min-height: 148px;
  max-height: 190px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}

.cost-country-quick-list,
.cost-country-tags,
.cost-country-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cost-country-quick-list {
  width: 100%;
  gap: 8px;
}

.cost-country-quick {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #e1e8ef;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cost-country-quick.active {
  border-color: rgba(47, 101, 173, 0.28);
  background: #eaf4fb;
  color: var(--accent);
}

.cost-country-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e5f3ed;
  color: #275b49;
  font-size: 12px;
  font-weight: 800;
}

.cost-country-tag strong,
.cost-country-tag small {
  display: block;
}

.cost-country-tag strong {
  font-size: 12px;
}

.cost-country-tag small {
  font-size: 10px;
  font-weight: 700;
  color: #55756a;
}

.cost-rate-cell {
  color: #60728a;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.cost-country-tag button {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #55756a;
  line-height: 1;
}

.product-create-form textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  resize: vertical;
  background: #fbfcfb;
  color: var(--ink);
}

.cost-product-preview {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  height: 42px;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfb;
  overflow: hidden;
}

.cost-product-preview img {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
}

.cost-product-preview span,
.cost-product-preview strong {
  display: block;
}

.cost-product-preview span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.cost-product-preview strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cost-grid,
.permission-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#costGrid {
  display: block;
  width: 100%;
}

#costGrid .empty-card,
.cost-result-table-wrap {
  width: 100%;
}

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

.cost-result-table,
.cost-price-table {
  min-width: 760px;
}

.cost-country-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8faf8;
}

.cost-country-head span {
  color: var(--muted);
  font-size: 12px;
}

.cost-channel-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.cost-channel-group {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.cost-channel-group span {
  flex: 0 0 auto;
  min-width: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.cost-channel-group em {
  font-style: normal;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4f1;
  color: #355449;
  font-size: 11px;
  line-height: 1.4;
}

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

.cost-result-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.cost-result-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8faf8;
}

.cost-result-head span,
.cost-result-head small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.cost-result-head strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.cost-result-table,
.cost-price-table {
  width: 100%;
  border-collapse: collapse;
}

.cost-result-table th,
.cost-result-table td,
.cost-price-table th,
.cost-price-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.cost-result-table th,
.cost-price-table th {
  color: var(--muted);
  font-size: 12px;
}

.cost-price-table tbody tr:last-child td,
.cost-result-table tbody tr:last-child td,
.cost-result-table tbody tr:last-child th {
  border-bottom: 0;
}

.cost-price-table thead {
  background: #fbfcfb;
}

.cost-price-table tbody tr:nth-child(2) {
  background: #f1faf6;
}

.cost-formula {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.todo-item,
.stack-item,
.cost-card,
.permission-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.todo-item strong,
.stack-item strong {
  display: block;
  margin-bottom: 4px;
}

.cost-card strong,
.permission-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.permission-modules {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.permission-modules span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef3ef;
  color: #415348;
  font-size: 12px;
}

.permission-editor {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.permission-editor label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.store-scope {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.staff-modal-card {
  width: min(760px, 100%);
}

.staff-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.staff-form-grid label {
  display: grid;
  gap: 7px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions .primary-button,
.modal-actions .secondary-button {
  width: auto;
  min-width: 120px;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 82px 1fr 86px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-track {
  overflow: hidden;
  height: 12px;
  border-radius: 99px;
  background: #e7ece8;
}

.bar-fill {
  height: 100%;
  background: var(--accent-2);
}

.combo-chart {
  position: relative;
  min-height: 390px;
  padding: 12px 12px 48px;
  contain: layout paint style;
}

.chart-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.chart-summary article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.chart-summary span,
.chart-summary strong {
  display: block;
}

.chart-summary span {
  color: var(--muted);
  font-size: 12px;
}

.chart-summary strong {
  margin-top: 6px;
  font-size: 18px;
}

.combo-chart svg {
  position: absolute;
  inset: 112px 12px 96px;
  width: calc(100% - 24px);
  height: calc(100% - 208px);
  overflow: visible;
  pointer-events: none;
}

.combo-chart polyline {
  fill: none;
  stroke: #b42318;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.combo-bars {
  position: relative;
  z-index: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(82px, 1fr);
  align-items: end;
  gap: 10px;
  min-height: 230px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar,
.panel,
.metric {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.panel,
.metric,
.report-summary-card {
  box-shadow: 0 10px 22px rgba(86, 110, 138, 0.05);
}

.scraper-helper {
  margin-bottom: 14px;
}

.scraper-helper p {
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: #eef3ef;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
}

.combo-day {
  display: grid;
  gap: 5px;
  min-width: 82px;
  color: var(--muted);
  font-size: 11px;
}

.combo-day strong {
  color: var(--ink);
  font-size: 12px;
}

.combo-columns {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 170px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
}

.combo-columns span {
  display: block;
  flex: 1;
  min-height: 4px;
  border-radius: 5px 5px 0 0;
}

.bar-sales {
  background: var(--accent-2);
}

.bar-ad {
  background: #f2c14e;
}

.bar-profit-marker {
  opacity: 0.1;
  background: #b42318;
}

.chart-legend {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 99px;
}

.legend-sales {
  background: var(--accent-2);
}

.legend-ad {
  background: #f2c14e;
}

.legend-profit {
  background: #b42318;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: block;
    padding: 12px;
  }

  .brand {
    margin-bottom: 10px;
  }

  .nav {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar,
  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .section-toolbar {
    width: 100%;
    margin: 0 0 12px;
  }

  .search-box {
    min-width: 100%;
  }

  .metrics-grid,
  .chart-summary,
  .layout-grid,
  .report-grid,
  .report-summary-grid,
  .cost-grid,
  .cost-calc-form,
  #scrapeForm,
  #logisticsForm,
  .permission-grid,
  .detail-grid,
  .product-detail,
  .filter-row,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .field-hint-row {
    grid-column: 1 / -1;
    margin-top: -4px;
  }

  .cost-sku-field,
  .cost-type-field,
  .cost-quantity-field,
  .cost-country-field,
  .cost-purchase-field,
  .cost-weight-field,
  .cost-product-preview,
  .cost-calc-form .primary-button {
    grid-column: auto;
    grid-row: auto;
  }

  .staff-form-grid,
  .team-filter-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 16px;
  }

  h1 {
    font-size: 24px;
  }

  .topbar-actions,
  .entry-form {
    align-items: stretch;
    flex-direction: column;
  }

  .report-entry-row {
    grid-template-columns: 1fr;
  }

  .report-form-actions {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .entry-form input,
  .filter-row input,
  .filter-row select,
  .select-box,
  .date-box,
  .entry-form select {
    width: 100%;
  }
}
