/*
 * 劲猴跨境 ERP · Cosmic Glass theme
 * One visual language shared by the Flask business pages and the listing SPA.
 */
:root {
  --bg: #eaf5ff;
  --surface: rgba(255, 255, 255, .78);
  --surface-2: rgba(248, 252, 255, .72);
  --surface-soft: rgba(244, 250, 255, .74);
  --surface-hover: rgba(255, 255, 255, .9);
  --ink: #061a3a;
  --muted: #5b6f8d;
  --subtle: #7890ad;
  --line: rgba(117, 178, 232, .4);
  --line-soft: rgba(125, 181, 229, .24);
  --blue: #087cf2;
  --brand: #087cf2;
  --brand-strong: #0567dc;
  --brand-soft: rgba(214, 237, 255, .88);
  --cyan: #22d7ed;
  --green: #22c77a;
  --green-soft: rgba(220, 249, 234, .88);
  --red: #ff4d58;
  --red-soft: rgba(255, 231, 234, .9);
  --orange: #f59d21;
  --cosmic-glass: rgba(255, 255, 255, .68);
  --cosmic-glass-strong: rgba(255, 255, 255, .82);
  --cosmic-border: rgba(255, 255, 255, .86);
  --cosmic-border-blue: rgba(100, 181, 244, .32);
  --cosmic-shadow: 0 18px 50px rgba(34, 91, 151, .12), 0 2px 10px rgba(34, 91, 151, .055);
  --cosmic-shadow-soft: 0 9px 28px rgba(34, 91, 151, .09), 0 1px 4px rgba(34, 91, 151, .045);
  --cosmic-glow: 0 10px 28px rgba(8, 124, 242, .24), 0 0 24px rgba(34, 215, 237, .18);
  --shadow-sm: var(--cosmic-shadow-soft);
  --shadow: var(--cosmic-shadow);
  --shadow-lg: 0 28px 80px rgba(34, 91, 151, .18);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --focus: 0 0 0 1px #fff, 0 0 0 4px rgba(8, 124, 242, .22), 0 0 20px rgba(34, 215, 237, .12);
}

html {
  min-height: 100%;
  background: #eaf5ff;
}

body {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 20%, rgba(72, 154, 255, .28) 0 2.2%, transparent 8%),
    radial-gradient(circle at 92% 17%, rgba(81, 204, 255, .22), transparent 20%),
    radial-gradient(circle at 12% 96%, rgba(62, 139, 255, .26), transparent 22%),
    radial-gradient(circle at 78% 92%, rgba(88, 226, 241, .18), transparent 26%),
    linear-gradient(142deg, #d7ecff 0%, #eef8ff 39%, #dceeff 72%, #f4fbff 100%) fixed !important;
}

body::before,
body::after {
  position: fixed;
  pointer-events: none;
  content: "";
}

body::before {
  z-index: -2;
  inset: 0;
  background:
    radial-gradient(circle at 4% 57%, rgba(255, 255, 255, .95) 0 3px, rgba(89, 211, 255, .36) 4px, transparent 12px),
    radial-gradient(circle at 91% 32%, rgba(255, 255, 255, .98) 0 2px, rgba(67, 207, 247, .35) 3px, transparent 11px),
    radial-gradient(circle at 70% 10%, rgba(255, 255, 255, .85) 0 2px, transparent 8px),
    radial-gradient(circle at 19% 26%, rgba(40, 130, 244, .25) 0 15px, rgba(255, 255, 255, .22) 16px, transparent 34px);
  opacity: .9;
}

body::after {
  z-index: -1;
  top: 13vh;
  left: -12vw;
  width: 124vw;
  height: 62vw;
  max-height: 78vh;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(122, 205, 255, .12),
    0 0 48px rgba(255, 255, 255, .42),
    inset 0 0 32px rgba(255, 255, 255, .22);
  transform: rotate(-10deg);
}

/* Floating global shell */
.topbar,
.erp-global-bar {
  top: 12px;
  z-index: 900;
  margin: 12px clamp(12px, 1.5vw, 28px) 0;
  border: 1px solid rgba(255, 255, 255, .86) !important;
  border-radius: 22px;
  background: rgba(241, 249, 255, .66) !important;
  box-shadow: 0 14px 38px rgba(28, 88, 155, .13), inset 0 1px 0 rgba(255, 255, 255, .82) !important;
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.topbar { position: sticky; }
.erp-global-bar { position: sticky; }

.erp-page-header.ai-tool-topbar {
  align-items: center;
  margin-bottom: 22px;
}

.erp-page-header.ai-tool-topbar .erp-page-header__actions {
  align-self: center;
}

.topbar-inner,
.erp-global-inner {
  width: 100%;
  max-width: 1660px;
  min-height: 68px;
  margin: 0 auto;
  padding: 9px 18px;
  gap: clamp(12px, 2vw, 30px);
}

.brand,
.erp-global-brand {
  gap: 12px;
  color: var(--ink);
  font-weight: 750;
  white-space: nowrap;
}

.erp-brand-mark {
  display: inline-grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 22px rgba(0, 112, 229, .22), 0 0 18px rgba(49, 220, 241, .15);
}

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

.brand-name,
.erp-global-brand strong {
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -.025em;
}

.nav-links,
.erp-global-links {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 17px;
  background: rgba(207, 231, 252, .34);
}

.nav-link,
.erp-global-links > a,
.erp-global-trigger {
  min-height: 40px;
  padding: 8px 11px;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #263d5e;
  font-size: 14px;
  font-weight: 550;
  line-height: 1;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.nav-link:hover,
.erp-global-links > a:hover,
.erp-global-trigger:hover {
  color: #075fbf;
  border-color: rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .62);
}

.nav-link.active,
.erp-global-links a.active {
  color: #087af1;
  border-color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .76) !important;
  box-shadow: 0 7px 18px rgba(25, 118, 221, .14), 0 0 18px rgba(38, 222, 237, .16), inset 0 1px 0 #fff !important;
  font-weight: 700;
}

.erp-nav-icon {
  display: inline-grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  color: currentColor;
}

.erp-nav-icon svg { display: block; width: 100%; height: 100%; }

.nav-submenu,
.nav-finance-dropdown,
.erp-global-submenu,
.erp-session-dropdown {
  border: 1px solid var(--cosmic-border) !important;
  border-radius: 18px !important;
  background: rgba(246, 251, 255, .88) !important;
  box-shadow: 0 22px 60px rgba(21, 73, 132, .18), inset 0 1px 0 #fff !important;
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.nav-option:hover,
.nav-option.active,
.erp-global-option:hover,
.erp-global-option.active,
.erp-session-dropdown-item:hover,
.erp-session-dropdown-item:focus-visible {
  background: linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(221, 241, 255, .76)) !important;
}

.erp-session-account {
  min-height: 46px;
  padding: 5px 13px 5px 6px;
  border: 1px solid rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .6);
  box-shadow: 0 7px 20px rgba(31, 91, 151, .12), inset 0 1px 0 #fff;
  color: var(--ink);
}

.erp-session-account:hover {
  border-color: rgba(103, 188, 247, .48);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 26px rgba(31, 91, 151, .17), 0 0 18px rgba(39, 210, 239, .1);
}

.erp-session-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(145deg, #25c7ff, #087cf2 58%, #0758ce);
  box-shadow: 0 5px 15px rgba(0, 111, 226, .24);
}

/* Page canvas and headings */
.main,
.app-shell {
  position: relative;
  z-index: 1;
}

body:not(.erp-login) > .main,
.app-shell > .main {
  padding-top: 54px;
}

.page-header::before,
.erp-page-header::before {
  width: 5px;
  background: linear-gradient(180deg, #38ddf1, #0c8df8 54%, #075bd7) !important;
  box-shadow: 0 5px 18px rgba(8, 124, 242, .3), 0 0 18px rgba(34, 215, 237, .2) !important;
}

.page-header .page-title,
.erp-page-header .page-title,
.erp-page-header h1,
.page-title {
  color: var(--ink) !important;
  font-weight: 760 !important;
  letter-spacing: -.045em !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}

.page-header .page-sub,
.erp-page-header .page-sub,
.erp-page-header .eyebrow,
.erp-page-header #erpPageEyebrow { color: var(--muted) !important; }

/* Shared glass surfaces across business modules. */
.card,
.card-hero,
.chart-card,
.table-wrap,
.panel,
.metric,
.kpi,
.store-card,
.store-binding-section,
.seller-sync-panel,
.promo-workspace,
.promo-toolbar,
.promo-card,
.warehouse-list-card,
.settings-card,
.provider-card,
.dc-sidebar,
.dc-filter-panel,
.dc-card,
.draft-section,
.ozon-category-recommendation-panel,
.ozon-selection-panel,
.image-studio-layout > *,
.image-studio-control-panel,
.image-studio-workspace-panel,
.image-edit-agent-shell,
.image-edit-agent-chat,
.image-edit-agent-workspace,
.image-edit-agent-history-panel,
.model-settings-card,
.model-provider-card,
.model-routing-card,
.user-management-card,
.account-panel,
.account-summary,
.auth-card {
  border: 1px solid var(--cosmic-border-blue) !important;
  background:
    radial-gradient(circle at 4% 0%, rgba(114, 218, 255, .11), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(244, 250, 255, .63)) !important;
  box-shadow: var(--cosmic-shadow-soft) !important;
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
}

.card:hover,
.chart-card:hover,
.panel:hover,
.provider-card:hover,
.dc-card:hover {
  border-color: rgba(88, 178, 245, .45) !important;
  box-shadow: var(--cosmic-shadow) !important;
}

/* Tables and dense data views stay readable while adopting the theme. */
.erp-data-view,
.erp-data-table-shell,
table.data,
.dc-table,
.warehouse-table,
.channel-table,
.promo-product-table {
  border-color: rgba(100, 163, 218, .24) !important;
  background: rgba(255, 255, 255, .58) !important;
}

table.data th,
.erp-data-table-shell th,
.dc-table th,
.warehouse-table th,
.channel-table th,
.promo-product-table th,
thead th {
  background: linear-gradient(180deg, rgba(235, 247, 255, .88), rgba(225, 241, 253, .7)) !important;
  color: #47617f !important;
}

table.data td,
.erp-data-table-shell td,
.dc-table td,
.warehouse-table td,
.channel-table td,
.promo-product-table td {
  border-color: rgba(111, 165, 213, .18) !important;
}

tbody tr { transition: background-color .16s ease; }
tbody tr:hover { background-color: rgba(232, 246, 255, .62) !important; }

/* Controls */
input,
textarea,
select,
.search,
.filter-input,
.form-control {
  border-color: rgba(104, 164, 216, .32) !important;
  background: rgba(255, 255, 255, .7) !important;
  color: var(--ink) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

input:focus,
textarea:focus,
select:focus,
.search:focus-within,
.filter-input:focus {
  border-color: rgba(8, 124, 242, .66) !important;
  outline: 0;
  box-shadow: var(--focus) !important;
}

.btn,
.button,
.primary-button,
.dc-query,
.guard-btn,
button {
  border-radius: 12px;
}

.btn:not(.btn-secondary):not(.btn-ghost):not(.btn-danger),
.button.primary,
button.primary,
.primary-button,
.dc-query,
.guard-btn:not(.secondary):not(.danger),
.home-welcome-action.primary {
  border-color: rgba(255, 255, 255, .28) !important;
  background: linear-gradient(135deg, #16baff 0%, #087cf2 55%, #0662d7 100%) !important;
  color: #fff !important;
  box-shadow: var(--cosmic-glow), inset 0 1px 0 rgba(255, 255, 255, .36) !important;
}

.btn:not(.btn-secondary):not(.btn-ghost):not(.btn-danger):hover,
.button.primary:hover,
button.primary:hover,
.primary-button:hover,
.dc-query:hover,
.guard-btn:not(.secondary):not(.danger):hover,
.home-welcome-action.primary:hover {
  background: linear-gradient(135deg, #2bcbff 0%, #0a85fa 52%, #075ad1 100%) !important;
  box-shadow: 0 13px 32px rgba(8, 124, 242, .3), 0 0 26px rgba(34, 215, 237, .22) !important;
  transform: translateY(-1px);
}

.btn-secondary,
.btn-ghost,
.button:not(.primary),
.icon-button,
.segment,
button.secondary,
.home-welcome-action:not(.primary) {
  border-color: rgba(103, 164, 218, .3) !important;
  background: rgba(255, 255, 255, .7) !important;
  color: var(--ink) !important;
  box-shadow: 0 5px 16px rgba(35, 87, 142, .075), inset 0 1px 0 #fff;
}

.tab.active,
.segment.active,
.dc-sidebar button.active,
.promo-mode-tabs button.active {
  color: #0878ed !important;
  border-color: rgba(255, 255, 255, .86) !important;
  background: rgba(255, 255, 255, .82) !important;
  box-shadow: 0 7px 18px rgba(34, 102, 170, .12), 0 0 16px rgba(46, 211, 239, .1) !important;
}

.badge,
.status-badge,
.tag,
.pill {
  border-color: rgba(99, 166, 221, .25) !important;
  background: rgba(235, 247, 255, .78) !important;
  backdrop-filter: blur(10px);
}

/* Dialogs, drawers and overlays */
.modal-backdrop,
.dialog-backdrop,
.drawer-backdrop,
.erp-modal-backdrop,
.account-plugin-modal-backdrop {
  background: rgba(40, 73, 115, .28) !important;
  backdrop-filter: blur(10px) saturate(110%);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
}

.modal,
.modal-content,
.dialog,
.drawer,
.erp-modal,
.account-plugin-modal,
.model-settings-dialog,
.image-studio-history-detail-dialog,
.image-studio-lightbox,
.user-account-dialog,
[role="dialog"] {
  border-color: var(--cosmic-border) !important;
  background:
    radial-gradient(circle at 0 0, rgba(97, 211, 255, .13), transparent 32%),
    rgba(249, 252, 255, .92) !important;
  box-shadow: 0 30px 90px rgba(20, 67, 123, .25), inset 0 1px 0 #fff !important;
  backdrop-filter: blur(28px) saturate(135%);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
}

.empty-state,
.promo-empty,
.product-empty,
.warehouse-empty,
.dc-empty {
  border-color: rgba(104, 175, 230, .22) !important;
  background:
    radial-gradient(circle at 50% 18%, rgba(65, 194, 255, .13), transparent 35%),
    rgba(248, 252, 255, .68) !important;
}

/* Homepage hero */
body.erp-home .main {
  max-width: none;
  padding: 52px clamp(22px, 5vw, 88px) 64px;
}

.home-welcome {
  min-height: calc(100vh - 178px);
  padding: 36px 0 56px;
}

.home-welcome-card {
  width: min(100%, 1060px);
  padding: 64px 72px 62px;
  overflow: visible;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 9%, rgba(74, 205, 255, .18), transparent 30%),
    radial-gradient(circle at 12% 100%, rgba(55, 145, 255, .11), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, .74), rgba(240, 249, 255, .54));
  box-shadow: 0 30px 80px rgba(30, 91, 157, .18), inset 0 1px 0 #fff;
  backdrop-filter: blur(26px) saturate(132%);
  -webkit-backdrop-filter: blur(26px) saturate(132%);
}

.home-welcome-card::before,
.home-welcome-card::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(73, 169, 241, .24);
  border-radius: 50%;
  content: "";
}

.home-welcome-card::before {
  top: 84px;
  left: 50%;
  width: 360px;
  height: 116px;
  transform: translateX(-50%) rotate(-7deg);
}

.home-welcome-card::after {
  top: 104px;
  left: 50%;
  width: 270px;
  height: 88px;
  border-color: rgba(32, 218, 237, .27);
  transform: translateX(-50%) rotate(12deg);
}

.home-welcome-mark {
  position: relative;
  z-index: 1;
  width: 150px;
  height: 150px;
  margin: -8px auto 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 38px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 18px 40px rgba(0, 112, 225, .2), 0 0 32px rgba(35, 219, 237, .16);
}

.home-welcome-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-welcome-eyebrow { color: #087cf2; }
.home-welcome-title {
  color: #061936;
  font-size: clamp(42px, 5vw, 66px);
  font-weight: 800;
  letter-spacing: -.055em;
}
.home-welcome-copy { color: #5b6d86; font-size: 18px; }
.home-welcome-action { min-height: 52px; padding: 0 28px; border-radius: 14px; font-weight: 700; }

/* Login page */
body.erp-login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 30px;
}

.erp-login .login-card {
  position: relative;
  width: min(100%, 460px);
  padding: 42px;
  border: 2px solid rgba(255, 255, 255, .86);
  border-radius: 30px;
  background:
    radial-gradient(circle at 0 0, rgba(83, 205, 255, .16), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .84), rgba(242, 250, 255, .66));
  box-shadow: 0 30px 80px rgba(26, 83, 146, .2), inset 0 1px 0 #fff;
  backdrop-filter: blur(26px) saturate(132%);
  -webkit-backdrop-filter: blur(26px) saturate(132%);
}

.login-logo-mark {
  width: 64px;
  height: 64px;
  overflow: hidden;
  flex: 0 0 64px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 10px 26px rgba(5, 108, 221, .2), 0 0 22px rgba(35, 217, 239, .13);
}

.login-logo-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.erp-login .login-title { color: var(--ink); font-weight: 780; }
.erp-login .login-form input { min-height: 50px; border-radius: 13px; }
.erp-login .login-form .btn { min-height: 50px; }

/* First-paint authentication guard uses the same brand instead of flashing a second UI. */
#erpAuthBootGuard {
  background:
    radial-gradient(circle at 50% 40%, rgba(37, 197, 255, .2), transparent 24%),
    linear-gradient(142deg, #d7ecff, #f2faff 48%, #dceeff) !important;
}

.erp-auth-boot-card {
  padding: 20px 24px;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 20px;
  background: rgba(255, 255, 255, .68);
  box-shadow: var(--cosmic-shadow);
  backdrop-filter: blur(22px);
}

.erp-auth-boot-card img { border-radius: 14px; }

.auth-overlay {
  background:
    radial-gradient(circle at 50% 34%, rgba(38, 199, 255, .18), transparent 28%),
    linear-gradient(142deg, #d7ecff, #f1f9ff 48%, #dceeff) !important;
}

.auth-card {
  border-radius: 28px !important;
  box-shadow: 0 30px 80px rgba(26, 83, 146, .2), inset 0 1px 0 #fff !important;
}

.footer {
  position: relative;
  z-index: 1;
  border-top-color: rgba(112, 169, 219, .18);
  color: #6b7e98;
}

@media (max-width: 1280px) {
  .nav-link,
  .erp-global-links > a,
  .erp-global-trigger { padding-inline: 8px; font-size: 13px; }
  .erp-nav-icon { width: 17px; height: 17px; flex-basis: 17px; }
  .brand-name,
  .erp-global-brand strong { font-size: 16px; }
  .erp-brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
}

@media (max-width: 1080px) {
  .erp-nav-icon { display: none; }
  .topbar-inner,
  .erp-global-inner { gap: 10px; padding-inline: 12px; }
}

@media (max-width: 860px) {
  .topbar,
  .erp-global-bar { top: 6px; margin: 6px 7px 0; border-radius: 17px; }
  .topbar-inner,
  .erp-global-inner { min-height: 58px; overflow-x: auto; }
  .erp-brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; }
  .brand-name,
  .erp-global-brand strong { display: none; }
  .nav-links,
  .erp-global-links { flex: 0 0 auto; }
  body:not(.erp-login) > .main,
  .app-shell > .main { padding-top: 36px; }
  .home-welcome-card { padding: 48px 26px; }
  .home-welcome-mark { width: 116px; height: 116px; border-radius: 30px; }
}

@media (max-width: 640px) {
  body::after { top: 22vh; left: -55vw; width: 210vw; height: 110vw; }
  .home-welcome { min-height: auto; padding: 20px 0 40px; }
  .home-welcome-title { font-size: 38px; }
  .home-welcome-copy { font-size: 15px; }
  .erp-login .login-card { padding: 32px 24px; border-radius: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
