:root {
  --bg: #030711;
  --ink: #f2f6ff;
  --muted: #9aa8bf;
  --card: #0f1b33;
  --card-soft: #16243f;
  --line: #233553;
  --line-soft: #1a2b48;
  --accent: #2a64f6;
  --accent-hover: #3a74ff;
  --accent-soft: #1e3157;
  --success: #0ce28f;
  --danger: #ff667f;
  --warn: #ffcb66;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-card: 0 14px 36px rgba(3, 10, 24, 0.34);
  --shadow-soft: 0 0 0 1px rgba(102, 132, 180, 0.2);
}

* { box-sizing: border-box; }
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: radial-gradient(circle at 68% -15%, rgba(48, 90, 200, 0.16) 0%, transparent 40%), linear-gradient(180deg, #02050d 0%, #030711 100%);
}

.hero {
  display: none;
}
.hero h1 {
  margin: 0;
  letter-spacing: 0.01em;
  font-size: clamp(1.9rem, 2.9vw, 3rem);
  font-weight: 800;
}
.hero p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 760px;
}

.app-layout {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
}
.sidebar-shell {
  background: linear-gradient(180deg, #0e1a31 0%, #101e37 100%);
  padding: 1.3rem 0.95rem 1rem;
  box-shadow: inset -1px 0 0 rgba(151, 173, 209, 0.16);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.content-area {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  display: grid;
  align-content: start;
  gap: 1.15rem;
  padding: 0.65rem 1.4rem 1.7rem;
}
.content-header {
  position: relative;
  z-index: 5;
  padding: 0.65rem 0 0.7rem;
  background: transparent;
  backdrop-filter: none;
}
.content-header h1 {
  margin: 0 0 0;
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.01em;
}
.content-header p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.topbar {
  position: absolute;
  top: 16px;
  right: 0;
  min-height: 0;
  padding: 0;
  border-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  z-index: 2;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #101a2f;
  border: 1px solid #243754;
  color: #aab7cd;
  padding: 0;
}
.icon-btn:hover {
  background: #182742;
  color: #d5def0;
}
.topbar-user {
  height: 36px;
  border-radius: 10px;
  background: #0b1430;
  border: 1px solid #223655;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.55rem 0 0.35rem;
}
.topbar-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #4f8dff 0%, #8a3cff 100%);
  font-size: 0.78rem;
  font-weight: 700;
}
.danger-outline {
  border-color: rgba(248, 113, 113, 0.38);
  color: #fda4af;
}
.danger-outline:hover {
  border-color: rgba(248, 113, 113, 0.58);
  background: rgba(127, 29, 29, 0.2);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  margin-bottom: 1rem;
  padding: 0.1rem 0.25rem 0.8rem;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: var(--accent);
}
.brand-mark .brand-star {
  fill: #ffffff;
}
.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.tabs {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.tab-group {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.tab-group-label {
  padding: 0 0.72rem 0.22rem;
  color: #7e90ae;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tab-btn {
  border: 0;
  background: transparent;
  color: #c0ccdf;
  border-radius: 12px;
  font-weight: 600;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.56rem;
  justify-content: flex-start;
  padding: 0.68rem 0.72rem;
  font-size: 1.03rem;
}
.tab-btn.active {
  background: #2a64f6;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(42, 100, 246, 0.32);
}
.tab-ico {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b5c0d6;
}
.tab-btn.active .tab-ico {
  color: #ffffff;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(136, 165, 210, 0.14);
  padding: 0.85rem 0.35rem 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.62rem;
}
.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(150deg, #4f8dff 0%, #8a3cff 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
}
.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sidebar-user-meta strong {
  font-size: 1.08rem;
}
.sidebar-user-meta span {
  color: #94a2bc;
  font-size: 0.88rem;
}
.tab-panel { display: none; }
.tab-panel.active {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 1rem;
}
.settings-subtabs {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  background: #152540;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.25rem;
  width: fit-content;
}
.subtab-btn {
  border: 0;
  background: transparent;
  color: #aebad1;
  border-radius: 10px;
  font-weight: 600;
  padding: 0.48rem 0.7rem;
}
.subtab-btn.active {
  background: #253b5d;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(130, 162, 210, 0.24);
}
.settings-subpanel { display: none; }
.settings-subpanel.active { display: grid; gap: 1rem; }
.profit-subtabs {
  margin-bottom: 0.85rem;
  align-items: center;
}
.uploads-subtabs {
  margin-bottom: 0.85rem;
  justify-self: start;
  align-self: start;
  align-items: center;
  display: inline-flex !important;
  flex-wrap: nowrap;
  padding: 0.22rem;
  gap: 0.22rem;
  min-height: 0;
  height: auto;
  max-height: 42px;
  overflow: hidden;
  width: max-content;
}
.uploads-subtabs .subtab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.44rem 0.9rem;
  white-space: nowrap;
}
.uploads-panels {
  display: block;
}
.uploads-panel {
  display: none !important;
  margin-top: 0;
  align-self: stretch;
}
.uploads-panel.active {
  display: grid !important;
  gap: 1rem;
}
.ebay-policy-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(17, 30, 53, 0.55);
  min-width: 0;
}
.ebay-policy-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.ebay-policy-card-header h3 {
  margin: 0;
  font-size: 1rem;
}
.uploads-panel .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: #203353;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}
.ebay-policy-table-wrap {
  max-height: 260px;
}
.muted-cell {
  color: var(--muted);
}
.fba-kpi-grid strong,
.fba-summary-grid strong {
  font-size: 1.9rem;
}
.fba-kpi-grid,
.fba-summary-grid {
  gap: 0.8rem;
}
.fba-kpi-grid .metric-card,
.fba-summary-grid .metric-card {
  min-height: 104px;
  justify-content: center;
}
.fba-send-now-cell {
  font-weight: 800;
  color: #f8fafc;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.56rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.status-pill.ok {
  background: rgba(13, 148, 89, 0.16);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.32);
}
.status-pill.warn {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}
.status-pill.danger {
  background: rgba(220, 38, 38, 0.14);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.32);
}
.status-pill.muted {
  background: rgba(100, 116, 139, 0.12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.26);
}
.profit-subtabs .subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
}
.profit-subtab-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d7e4ff;
  flex: 0 0 18px;
  line-height: 0;
}
.profit-subtab-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.profit-subpanel {
  display: none;
  gap: 1rem;
}
.profit-subpanel.active {
  display: grid;
}
.profit-overview-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.profit-period-filter {
  display: flex;
  align-items: end;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.profit-period-filter label {
  min-width: 180px;
}
.profit-period-filter label.hidden {
  display: none;
}
.profit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.profit-kpi-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.4rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(28, 43, 70, 0.96);
  min-width: 0;
}
.profit-kpi-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 2rem;
  line-height: 1;
}
.profit-kpi-icon {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 74px;
}
.profit-kpi-icon svg {
  width: 34px;
  height: 34px;
  display: block;
}
.profit-kpi-icon-revenue {
  background: rgba(53, 101, 191, 0.42);
  color: #5da2ff;
}
.profit-kpi-icon-profit {
  background: rgba(39, 112, 82, 0.42);
  color: #1ef09a;
}
.profit-kpi-icon-margin {
  background: rgba(106, 70, 163, 0.42);
  color: #c17cff;
}
.profit-kpi-icon-orders {
  background: rgba(110, 68, 40, 0.42);
  color: #ff9829;
}
.profit-overview-table-card {
  padding: 0;
  overflow: hidden;
}
.profit-overview-table-card h3 {
  padding: 1.55rem 1.9rem;
  margin: 0;
}
.profit-overview-table-card .table-wrap {
  border-top: 1px solid var(--line);
}
.profit-overview-table-card table th,
.profit-overview-table-card table td {
  padding-left: 1.9rem;
  padding-right: 1.9rem;
}
.profit-overview-table-card table th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  color: #a8b6d1;
}
.profit-overview-table-card table td {
  font-size: 1rem;
}
.profit-overview-table-card table td:nth-child(1) {
  color: #58a1ff;
  font-weight: 700;
}
.profit-overview-table-card table td:nth-child(4) {
  color: #16ea8b;
  font-weight: 700;
}
.amazon-marketplace-breakdown {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(19, 33, 58, 0.86);
  overflow: hidden;
}
.amazon-marketplace-summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(140px, 0.4fr));
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
}
.amazon-marketplace-summary::-webkit-details-marker {
  display: none;
}
.amazon-marketplace-summary-title {
  font-weight: 800;
  font-size: 1.05rem;
}
.amazon-marketplace-summary-metric {
  display: grid;
  gap: 0.2rem;
}
.amazon-marketplace-summary-label {
  color: #94a2bc;
  font-size: 0.82rem;
}
.amazon-marketplace-summary strong {
  font-size: 1.2rem;
}
.amazon-marketplace-breakdown .table-wrap {
  border-top: 1px solid var(--line);
}
.amazon-marketplace-breakdown table td:first-child {
  color: #58a1ff;
  font-weight: 700;
}
.profit-calc-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 1rem;
  align-items: start;
}
.profit-calc-left,
.profit-calc-right {
  display: grid;
  gap: 1rem;
}
.profit-calc-card {
  min-width: 0;
}
.profit-mode-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.profit-mode-card {
  border: 1px solid rgba(108, 135, 186, 0.26);
  background: rgba(18, 32, 58, 0.68);
  color: #dfe9ff;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font-weight: 700;
  display: grid;
  gap: 0.18rem;
  align-content: center;
  min-height: 74px;
}
.profit-mode-card.is-active {
  background: rgba(34, 63, 118, 0.92);
  border-color: #5d8dff;
  box-shadow: inset 0 0 0 1px rgba(114, 156, 255, 0.25);
}
.profit-mode-card-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.profit-mode-card-subtitle {
  font-size: 0.72rem;
  color: #9fb0ce;
  font-weight: 500;
}
.profit-mode-icon {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  line-height: 0;
}
.profit-mode-icon svg,
.profit-section-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.profit-mode-icon-fba {
  color: #74a7ff;
}
.profit-mode-icon-merchant {
  color: #ffae53;
}
.profit-section-icon {
  margin-right: 0.35rem;
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  vertical-align: -0.08em;
}
.profit-section-icon-doc {
  color: #7db7ff;
}
.profit-section-icon-shipping {
  color: #ffb45a;
}
.profit-section-icon-costs {
  color: #b98cff;
}
.profit-dimension-grid.grid.four {
  margin-top: 0.2rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}
.profit-dimension-grid.grid.four label {
  min-width: 0;
}
.profit-dimension-grid.grid.four input {
  min-width: 0;
}
.profit-min-price-card {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(39, 93, 255, 0.98), rgba(74, 116, 255, 0.86));
  color: #fff;
  border: 1px solid rgba(116, 154, 255, 0.35);
}
.profit-min-price-card strong {
  font-size: 2rem;
  line-height: 1.05;
}
.profit-breakdown-card,
.profit-margin-card,
.profit-summary-card {
  min-width: 0;
}
.profit-breakdown-list {
  display: grid;
  gap: 0.45rem;
}
.profit-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 108px);
  gap: 1rem;
  align-items: center;
  padding-bottom: 0.42rem;
  border-bottom: 1px solid rgba(108, 135, 186, 0.15);
}
.profit-breakdown-row.has-current {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 108px) minmax(92px, 108px);
}
.profit-breakdown-header {
  padding-bottom: 0.55rem;
}
.profit-breakdown-header span,
.profit-breakdown-header strong {
  color: #9fb0ce;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.profit-breakdown-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.profit-breakdown-row strong {
  color: #f6f9ff;
  text-align: right;
  justify-self: end;
  width: 100%;
  white-space: nowrap;
}
.profit-breakdown-row strong.negative {
  color: #ff7d82;
}
.profit-breakdown-row strong.positive {
  color: #3de48b;
}
.profit-breakdown-row > span:first-child {
  min-width: 0;
}
.profit-margin-card strong {
  font-size: 2rem;
  color: #3de48b;
}
.profit-margin-meta {
  display: grid;
  gap: 0.35rem;
  color: #c7d4ee;
}
.profit-summary-card .hint {
  margin: 0;
}
.profit-summary-card {
  background: rgba(18, 31, 56, 0.72);
}
.sales-data-filters {
  margin-bottom: 0.7rem;
  align-items: end;
}
.sales-preset-actions {
  margin-bottom: 0.7rem;
}
.sales-preset-actions .ghost.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 91, 255, 0.36);
}

.card {
  min-width: 0;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem;
  backdrop-filter: blur(2px);
  box-shadow: var(--shadow-card);
}

h2 {
  margin: 0 0 0.8rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
h3 { margin: 0.3rem 0 0.6rem; font-size: 1.15rem; }

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 0.8rem;
}
.grid.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 0.8rem;
}
.grid.four {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0.8rem;
}

.kpi {
  background: #142440;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.78rem 0.86rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.kpi-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.kpi strong {
  font-size: 1.55rem;
  font-weight: 800;
}

.filters {
  display: grid;
  grid-template-columns: 240px 170px 150px 180px 180px 1fr;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.orders-filters {
  display: grid;
  grid-template-columns: 260px 220px 1fr;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.orders-filters > .actions.inline {
  grid-column: 1 / -1;
  margin-top: 0.35rem;
}
.actions.inline { margin-top: 1.5rem; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-size: 0.9rem;
  color: #d2dbee;
  font-weight: 600;
}

input[type="file"], textarea {
  border: 1px solid #314667;
  border-radius: var(--radius-sm);
  padding: 0.62rem 0.72rem;
  background: #1e2b43;
  color: var(--ink);
}
input[type="text"], input[type="number"], input[type="date"], select {
  border: 1px solid #314667;
  border-radius: var(--radius-sm);
  padding: 0.62rem 0.72rem;
  background: #1e2b43;
  color: var(--ink);
}
input[type="text"]::placeholder, input[type="number"]::placeholder, input[type="date"]::placeholder, textarea::placeholder {
  color: #7f8da8;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="date"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #4775c4;
  box-shadow: 0 0 0 2px rgba(71, 117, 196, 0.2);
}

textarea {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.actions {
  display: flex;
  gap: 0.58rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}
.filter-actions {
  margin-top: 0;
  align-self: end;
}
.overview-actions {
  margin-top: 0.9rem;
  margin-bottom: 0.95rem;
}
.dashboard-actions {
  margin-bottom: 1rem;
}
.actions + .table-wrap {
  margin-top: 1rem;
}

button {
  border: 1px solid transparent;
  background: var(--accent);
  color: #f4f8ff;
  border-radius: 11px;
  padding: 0.56rem 0.86rem;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
button:hover {
  background: var(--accent-hover);
}
button.ghost {
  background: #243753;
  color: #d4def0;
  border-color: #314b70;
}
button.danger {
  background: rgba(255, 102, 127, 0.08);
  color: #ff8ea0;
  border: 1px solid rgba(255, 123, 153, 0.45);
  padding: 0.35rem 0.58rem;
  border-radius: 9px;
}

.status { color: var(--muted); min-height: 1.2rem; margin: 0.7rem 0 0; }
.hint { color: var(--muted); margin: 0 0 0.5rem; font-size: 0.9rem; }
.hidden { display: none; }
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 26%),
    linear-gradient(180deg, #09101f 0%, #0b1327 100%);
  display: grid;
  place-items: center;
  padding: 2rem;
}
.auth-shell {
  width: min(520px, 100%);
}
.auth-card {
  display: grid;
  gap: 1.2rem;
  padding: 1.6rem;
  border-radius: 26px;
  border: 1px solid rgba(73, 96, 140, 0.42);
  background: rgba(17, 28, 51, 0.96);
  box-shadow: 0 24px 64px rgba(4, 9, 22, 0.42);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.auth-brand h1 {
  margin: 0 0 0.3rem;
}
.auth-brand p {
  margin: 0;
  color: var(--muted);
}
.auth-form {
  display: grid;
  gap: 0.95rem;
}
.auth-form button {
  width: 100%;
}
.auth-hint {
  margin: 0;
}
.auth-users-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.auth-users-card-head p {
  margin: 0.35rem 0 0;
}
.auth-tab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 32, 60, 0.72);
}
.auth-active-toggle {
  margin-top: 1.55rem;
}
#authUsersTable td:nth-child(6) {
  max-width: 280px;
}
.plain-list {
  margin: 0.45rem 0 0;
  padding-left: 1.05rem;
  color: var(--muted);
}
.shipping-toolbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
.shipping-toolbar .actions.inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
}
.shipping-toolbar .actions.inline button {
  white-space: nowrap;
  width: auto;
  flex: 1 1 0;
  min-width: 0;
  padding: 0.62rem 0.78rem;
  font-size: 0.82rem;
  line-height: 1.15;
}

@media (max-width: 1180px) {
  .shipping-toolbar .actions.inline {
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .shipping-toolbar .actions.inline {
    display: grid;
    grid-template-columns: 1fr;
  }
}
.shipping-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.shipping-list-header h3 {
  margin: 0;
}
.segmented-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(11, 26, 56, 0.96);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem;
}
.segmented-toggle button {
  min-width: 86px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--muted);
}
.segmented-toggle button.is-active {
  background: linear-gradient(135deg, rgba(59, 107, 246, 0.95), rgba(85, 131, 255, 0.88));
  color: #f7faff;
  box-shadow: 0 10px 24px rgba(47, 95, 231, 0.24);
}
.shipping-layout {
  align-items: start;
}
.shipping-list-card,
.shipping-detail-card,
.shipping-dhl-card {
  background: rgba(18, 31, 56, 0.55);
}
.product-detail-shell {
  gap: 1rem;
}
.product-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.product-detail-panel {
  display: grid;
  gap: 1rem;
}
.product-detail-layout {
  align-items: start;
}
.product-detail-card {
  background: rgba(18, 31, 56, 0.55);
}
.product-images-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.product-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
}
.product-image-card {
  background: #12203c;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.65rem;
  display: grid;
  gap: 0.45rem;
}
.product-image-card.is-primary {
  box-shadow: inset 0 0 0 1px rgba(79, 141, 255, 0.38);
}
.product-image-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: #0b1a38;
  border: 1px solid var(--line-soft);
}
.product-image-meta {
  color: var(--muted);
  font-size: 0.75rem;
}
.product-image-card .actions {
  margin-top: 0;
}
.product-title-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}
.mini-inline-btn {
  white-space: nowrap;
  padding: 0.5rem 0.7rem;
}
.product-link-btn {
  border: 0;
  background: transparent;
  color: #f2f6ff;
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  border-radius: 0;
}
.product-link-btn:hover {
  background: transparent;
  color: #91b2ff;
}
.input-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.input-meta.is-over {
  color: var(--danger);
}
.shipping-detail-meta,
.shipping-address {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.shipping-address-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.shipping-address-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.shipping-address-actions select {
  min-width: 140px;
}
.shipping-error-box {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 107, 0.4);
  background: rgba(140, 24, 24, 0.22);
  color: #ffd7d7;
  font-size: 0.92rem;
  line-height: 1.45;
}
.shipping-merge-hint {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(93, 141, 255, 0.35);
  background: rgba(41, 76, 145, 0.22);
  color: #d8e6ff;
  font-size: 0.9rem;
  line-height: 1.4;
}
.shipping-merge-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.4rem;
  padding: 0.18rem 0.46rem;
  border-radius: 999px;
  background: rgba(59, 107, 246, 0.18);
  border: 1px solid rgba(93, 141, 255, 0.28);
  color: #cfe0ff;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}
.shipping-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.55rem 0 1rem;
}
.shipping-item-chip {
  padding: 0.42rem 0.6rem;
  border-radius: 999px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  font-size: 0.86rem;
}
#shippingTable tbody tr.is-selected {
  background: rgba(42, 100, 246, 0.14);
}
#shippingTable th:first-child,
#shippingTable td:first-child {
  width: 92px;
  min-width: 92px;
}
.shipping-table-action-btn {
  white-space: nowrap;
}
.shipping-article-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#shippingDetailAddress {
  white-space: pre-line;
}
.shipping-address-modal-card {
  width: min(760px, 94vw);
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #d7e2fb;
  font-size: 0.92rem;
}
.checkbox-inline input {
  margin: 0;
}

.unknown-wrap {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  background: #12203c;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 24, 0.72);
}
.modal-card {
  position: relative;
  margin: 5vh auto 0;
  width: min(980px, 94vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #2a3e5f;
  border-radius: 16px;
  background: #0f1b33;
  padding: 1rem 1.05rem;
  box-shadow: 0 24px 64px rgba(1, 4, 12, 0.64);
}
.modal-table {
  margin-top: 0.8rem;
  max-height: 44vh;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.82rem;
  color: var(--warn);
}

.table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  max-height: 70vh;
  background: #0f1b33;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.tab-panel,
.settings-subpanel {
  min-width: 0;
  max-width: 100%;
}

th, td {
  border-bottom: 1px solid #243654;
  padding: 0.58rem 0.62rem;
  text-align: left;
  font-size: 0.84rem;
}

.select-all-inline {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.18rem;
  font-size: 0.72rem;
  white-space: nowrap;
  color: #d7e2fb;
  font-weight: 600;
}
.select-all-inline input {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid #d2dbef;
  border-radius: 3px;
  background: #ffffff;
  display: inline-block;
  position: relative;
  cursor: pointer;
}
.select-all-inline input:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: 2px solid #1d2a48;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}
.select-all-inline input:indeterminate::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 5px;
  height: 2px;
  background: #1d2a48;
}

@media (max-width: 960px) {
  .shipping-list-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.row-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.mini-btn {
  border: 0;
  background: #233754;
  color: #cad4ea;
  border-radius: 8px;
  padding: 0.15rem 0.35rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.mini-btn.ok {
  background: var(--accent);
  color: #ffffff;
}
.mini-btn.no {
  border: 1px solid #8d3e55;
  background: transparent;
  color: #ff9eb6;
}

th {
  position: sticky;
  top: 0;
  background: #152540;
  color: #d7e2fb;
  font-weight: 700;
}
th[data-sort-key] {
  cursor: pointer;
  user-select: none;
}
th.sorted-asc::after {
  content: " ▲";
  color: var(--accent);
  font-size: 0.72rem;
}
th.sorted-desc::after {
  content: " ▼";
  color: var(--accent);
  font-size: 0.72rem;
}

tr:nth-child(even) td { background: #12203a; }
.po-gap-row td {
  height: 10px;
  padding: 0;
  background: transparent !important;
  border: 0;
}
.po-group-row td {
  background: #152743 !important;
  border-top: 0;
  border-bottom: 0;
  font-weight: 700;
}
.po-group-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.po-group-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}
.po-item-row td:first-child {
  padding-left: 1rem;
}
.po-item-row td {
  background: #10203a;
  border-left: 0;
  border-right: 0;
}
.po-item-missing td {
  background: #2a1d28 !important;
}
.po-item-missing td:nth-child(4),
.po-item-missing td:nth-child(5),
.po-item-missing td:nth-child(6),
.po-item-missing td:nth-child(7) {
  box-shadow: inset 0 0 0 1px rgba(255, 116, 140, 0.28);
}
.po-item-first td {
  border-top: 0;
}
.po-item-last td {
  border-bottom: 1px solid #274062;
}
.po-invoice-input {
  min-width: 140px;
  width: 100%;
  max-width: 220px;
  padding: 0.35rem 0.45rem;
  border: 1px solid #335077;
  border-radius: 9px;
  background: #1d2d47;
  color: var(--ink);
}
.po-invoice-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.po-invoice-link {
  border: 0;
  background: transparent;
  color: #8eb5ff;
  text-decoration: underline;
  font-size: 0.76rem;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}
.po-invoice-link:hover {
  color: #c2d8ff;
}
.po-doc-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.po-match-input {
  width: 100%;
  min-width: 120px;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(255, 116, 140, 0.45);
  border-radius: 7px;
  background: #332534;
  color: #ffd8e0;
}
.po-match-input:focus {
  outline: none;
  border-color: #ff6a90;
  box-shadow: 0 0 0 2px rgba(255, 106, 144, 0.2);
}
.po-meta-input {
  width: 100%;
  min-width: 150px;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #162541;
  color: #eff4ff;
}
.po-meta-input:focus {
  outline: none;
  border-color: #5b8cff;
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.18);
}
.po-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 700;
}
.po-status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}
.po-status.red { color: #ffc3d0; }
.po-status.red::before { background: #d44b4b; }
.po-status.yellow { color: #ffe0a4; }
.po-status.yellow::before { background: #d3ad28; }
.po-status.green { color: #b7f1d8; }
.po-status.green::before { background: #2ca66f; }
.po-status.neutral { color: #d7e2fb; }
.po-status.neutral::before { background: #7f91b7; }
.po-status.green::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #79dcb5;
}
.po-tracking-status-wrap {
  display: grid;
  gap: 0.3rem;
  min-width: 170px;
}
.po-tracking-summary-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: #162541;
  color: #eff4ff;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  display: grid;
  gap: 0.3rem;
  text-align: left;
}
.po-tracking-summary-btn:hover {
  border-color: #5b8cff;
  background: #1a2c4d;
}
.mini-muted {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.mini-link {
  color: #9ec3ff;
  text-decoration: underline;
}
.mini-link:hover {
  color: #cfe0ff;
}
.tracking-detail-wrap {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.tracking-detail-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(18, 31, 56, 0.55);
  display: grid;
  gap: 0.35rem;
}
.tracking-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.po-total-row td {
  background: #2a3249 !important;
  font-weight: 700;
  border-top: 0;
  border-bottom: 0;
}
.po-total-row td:first-child {
  color: #d0dcf6;
}
.wr-gap-row td {
  height: 10px;
  padding: 0;
  background: transparent !important;
  border: 0;
}
.wr-group-row td {
  background: #152743 !important;
  border-top: 0;
  border-bottom: 0;
  font-weight: 800;
}
.wr-group-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.wr-group-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2f6ebc;
}
.wr-item-row td {
  background: #10203a;
  border-left: 0;
  border-right: 0;
}
.ean-cell-input {
  width: 140px;
  max-width: 100%;
  padding: 0.35rem 0.45rem;
  border: 1px solid #335077;
  border-radius: 9px;
  background: #1d2d47;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}
.sku-image {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #0b1a38;
}
.sku-image-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px dashed var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.7rem;
}

@media (max-width: 900px) {
  .product-detail-header {
    flex-direction: column;
  }
  .product-images-header {
    flex-direction: column;
  }
  .app-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-shell {
    position: static;
    min-height: auto;
    padding: 0.6rem;
  }
  .sidebar-footer {
    display: none;
  }
  .sidebar-brand {
    margin-bottom: 0.5rem;
  }
  .brand-text {
    font-size: 1.1rem;
  }
  .content-area {
    padding: 0.8rem;
  }
  .tabs {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .tab-group {
    display: contents;
  }
  .tab-group-label {
    width: 100%;
    padding: 0.2rem 0 0;
  }
  .tab-btn {
    width: auto;
    text-align: left;
    padding: 0.55rem 0.8rem;
  }
  .profit-calc-shell { grid-template-columns: 1fr; }
  .grid.two { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .orders-filters { grid-template-columns: 1fr; }
  .actions.inline { margin-top: 0; }
}


#resultTable th:first-child,
#resultTable td:first-child {
  min-width: 136px;
  width: 136px;
}

#resultTable {
  border-collapse: separate;
  border-spacing: 0;
}

#resultTable th:first-child {
  position: sticky;
  left: 0;
  z-index: 8;
  background: #152540;
  background-clip: padding-box;
  box-shadow: 1px 0 0 #243654, 6px 0 14px rgba(4, 10, 24, 0.18);
}

#resultTable td:first-child {
  position: sticky;
  left: 0;
  z-index: 7;
  background: #0f1b33;
  background-clip: padding-box;
  box-shadow: 1px 0 0 #243654, 6px 0 14px rgba(4, 10, 24, 0.18);
}

#resultTable tr:nth-child(even) td:first-child {
  background: #12203a;
}

.flatfile-shell {
  display: grid;
  gap: 1.25rem;
}

.flatfile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.flatfile-header h3 {
  margin: 0 0 0.35rem;
}

.flatfile-header .hint {
  margin: 0;
  max-width: 56rem;
}

.flatfile-grid {
  align-items: end;
}

.flatfile-grid input[readonly] {
  opacity: 0.88;
}

.flatfile-preview-wrap {
  max-height: 26rem;
}

#flatfilePreviewTable th:nth-child(1),
#flatfilePreviewTable td:nth-child(1) {
  min-width: 9rem;
}

#flatfilePreviewTable th:nth-child(2),
#flatfilePreviewTable td:nth-child(2) {
  min-width: 20rem;
}

#resultTable tr:nth-child(even) td:first-child {
  background: #12203a;
}
