html, body {
  margin: 0;
  height: 100%;
  background: #F5F7FA;
  color: #0A1628;
}

#gate.hidden,
#shell.hidden,
#panel-login.hidden,
#panel-invite.hidden,
#panel-bad.hidden {
  display: none !important;
}

html, body, .webix_view, .webix_el_button button, input, textarea, button {
  font-family: "Fira Sans", sans-serif;
}

.file-pick {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.side {
  display: flex;
  flex-direction: column;
  width: 240px;
  min-height: 0;
  flex: none;
  background: #ffffff;
  border-right: 1px solid #E6F0FF;
}

.menu-btn {
  height: 44px;
  padding: 0 12px;
  border: 1px solid #E6F0FF;
  border-radius: 8px;
  background: #ffffff;
  color: #0A1628;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.menu-btn:hover { background: #F5F7FA; }
.menu-btn:focus-visible,
.nav-btn:focus-visible,
.who-btn:focus-visible {
  outline: 2px solid #0066FF;
  outline-offset: 2px;
}

.nav-label {
  margin: 16px 20px 4px;
  color: #6B7280;
  font-size: 13px;
}

.nav-btn[hidden],
.nav-label[hidden] { display: none; }

.nav-btn {
  display: flex;
  align-items: center;
  text-decoration: none;
  width: calc(100% - 16px);
  min-height: 44px;
  margin: 2px 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0A1628;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.nav-btn:hover { background: #F5F7FA; }

.nav-btn.is-on,
.nav-btn.is-on:hover {
  background: #0066FF;
  color: #ffffff;
}

.who-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #0A1628;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.scrim { display: none; }

@media (max-width: 1023px) {
  .side {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }
  .side.is-open { transform: none; }
  .scrim {
    display: block;
    position: fixed;
    z-index: 30;
    inset: 0;
    background: rgba(10, 22, 40, 0.4);
  }
  .scrim.hidden { display: none; }
}

@media (min-width: 1024px) {
  .menu-btn { display: none; }
  .side { position: static; transform: none; }
  .scrim { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
}

#stage { position: relative; background: #F5F7FA; min-width: 0; }
#stage-mount { flex: 1; min-height: 0; min-width: 0; width: 100%; }

#stage .webix_layout_line,
#stage .webix_layout_clean,
#stage .webix_view.webix_layout_line {
  background: #F5F7FA;
}

.webix_view img {
  max-width: none;
}

.field-label {
  color: #0A1628;
  font-size: 13px;
  font-weight: 600;
}

.page-title,
.page-title .webix_template,
.section,
.section .webix_template,
.dlg-head,
.dlg-head .webix_template {
  background: transparent !important;
  border: none !important;
  color: #0A1628 !important;
  padding: 0;
}

.dlg-head .webix_el_label,
.dlg-head .webix_el_label .webix_el_box {
  background: transparent !important;
  border: none !important;
  color: #0A1628 !important;
  padding-left: 16px !important;
}

.dlg-head {
  background: #ffffff !important;
  border-bottom: 1px solid #E6F0FF !important;
}

.page-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
  flex: 1;
  padding: 16px;
  overflow: auto;
}

.page-stage .note { margin: 0; }
h2.section-text { margin: 0; }

.page-head label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6B7280;
  font-size: 13px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0;
  flex: 1;
  font-size: 20px;
  font-weight: 600;
}

.page-head input,
.page-head select,
.sheet input,
.sheet select {
  height: 40px;
  border: 1px solid #D9E2EC;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #0A1628;
}

.sheet {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.sheet label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #6B7280;
  font-size: 13px;
}

button.btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #E6F0FF;
  background: #fff;
  color: #0A1628;
  font-weight: 500;
  cursor: pointer;
}

button.btn-blue { background: #0066FF; border-color: #0066FF; color: #fff; }
button.btn-red { color: #EF4444; border-color: #FECACA; }

#grid, .grid { flex: 1; min-height: 240px; }

.dash-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 280px; }
.dash-split section { display: flex; flex-direction: column; min-height: 0; }
.dash-split h2 { margin: 0 0 8px; font-size: 16px; }

.page-title-text {
  font-size: 20px;
  font-weight: 600;
  color: #0A1628;
}

.section-text {
  font-size: 14px;
  font-weight: 600;
  color: #0A1628;
}

.webix_el_button button,
.webix_button {
  border: 1px solid #E6F0FF !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0A1628 !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

.webix_el_button button:hover,
.webix_button:hover {
  background: #F5F7FA !important;
}

.btn-main button,
.webix_el_button.btn-main button {
  background: #0066FF !important;
  border-color: #0066FF !important;
  color: #ffffff !important;
}

.btn-main button:hover,
.webix_el_button.btn-main button:hover {
  background: #4D94FF !important;
}

.webix_el_button.btn-soft button,
.webix_el_button.btn-soft.webix_focused button {
  background: #ffffff !important;
  border-color: #E6F0FF !important;
  box-shadow: none !important;
}

.btn-on button,
.webix_el_button.btn-on button,
.webix_el_button.btn-on.webix_focused button {
  background: #E6F0FF !important;
  border-color: #0066FF !important;
  color: #0A1628 !important;
  box-shadow: none !important;
}

.btn-danger button,
.webix_el_button.btn-danger button {
  background: #ffffff !important;
  border-color: #EF4444 !important;
  color: #EF4444 !important;
}

.btn-danger button:hover {
  background: #F5F7FA !important;
}

.webix_el_button button .webix_icon,
.webix_input_icon {
  color: inherit;
}

.webix_el_text input,
.webix_el_search input,
.webix_el_combo input,
.webix_el_datepicker input,
.webix_el_richselect .webix_inp_static,
.webix_el_textarea textarea {
  border: 1px solid #E6F0FF !important;
  background: #ffffff !important;
  border-radius: 8px !important;
  color: #0A1628 !important;
}

.webix_el_text input:focus,
.webix_el_search input:focus,
.webix_el_combo input:focus,
.webix_el_datepicker input:focus,
.webix_el_richselect .webix_inp_static:focus,
.webix_el_textarea textarea:focus {
  outline: 2px solid #0066FF;
  outline-offset: 1px;
}

.webix_inp_label {
  color: #0A1628;
  font-weight: 500;
}

.webix_dtable .webix_hcell,
.data .webix_hcell {
  background: #F5F7FA !important;
  color: #0A1628 !important;
  font-weight: 600;
  border-color: #E6F0FF !important;
}

.webix_dtable .webix_cell,
.data .webix_cell {
  color: #0A1628;
  border-color: #E6F0FF !important;
}

.pick .webix_cell { cursor: pointer; }

.webix_dtable .webix_column > .webix_cell.webix_row_select,
.webix_dtable .webix_row_select,
.webix_dtable .webix_select_mark {
  background: #E6F0FF !important;
  color: #0A1628 !important;
}

.webix_dtable .webix_column > .webix_cell.webix_row_hover {
  background: #F5F7FA !important;
}

.webix_window {
  border: 1px solid #E6F0FF !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(10, 22, 40, 0.16);
}

.webix_win_head,
.webix_win_body,
.webix_popup {
  border-color: #E6F0FF !important;
}

.webix_popup {
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.12);
}

.webix_modal_box {
  border: none !important;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(10, 22, 40, 0.16);
}

.note {
  background: #F5F7FA;
  border-radius: 8px;
  padding: 10px 12px;
  color: #0A1628;
  line-height: 1.5;
}

.kpi-wrap,
.kpi-wrap .webix_template {
  background: transparent !important;
  border: 0 !important;
  overflow: hidden !important;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.kpi {
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 8px 20px rgba(10, 22, 40, 0.06);
}

.kpi span {
  display: block;
  color: #6B7280;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.kpi b {
  display: block;
  margin-top: 8px;
  color: #0A1628;
  font-size: 26px;
  font-weight: 600;
}

.kpi-sku { background: #E6F0FF; }
.kpi-sku b { color: #0066FF; }
.kpi-value { background: rgba(77, 148, 255, 0.18); }
.kpi-warn { background: rgba(245, 158, 11, 0.18); }
.kpi-warn b { color: #F59E0B; }
.kpi-hot { background: rgba(239, 68, 68, 0.14); }
.kpi-hot b { color: #EF4444; }

.act {
  color: #0066FF;
  margin-right: 10px;
  cursor: pointer;
  background: none;
  border: none;
  font-weight: 600;
}

.act-del,
.act-no { color: #EF4444; }

.pic-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  vertical-align: middle;
}

.pic-col {
  text-align: center;
}

.pic-cell .thumb,
.pic-cell .letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: none;
}

.thumb,
.preview {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  background: #F5F7FA;
  display: block;
}

.preview {
  width: 72px;
  height: 72px;
}

.pager .webix_pager_item,
.pager .webix_pager_item_selected {
  color: #0A1628;
}

.pager .webix_pager_item_selected {
  background: #E6F0FF;
  border-color: #0066FF;
}

.avatar {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
  background: #F5F7FA;
}

.letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0066FF;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.invite-avatar {
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #0066FF;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 600;
}

.pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-name {
  color: #6B7280;
  font-size: 13px;
}

.st { font-weight: 600; }
.st-draft { color: #6B7280; }
.st-submitted { color: #F59E0B; }
.st-approved { color: #10B981; }
.st-rejected { color: #EF4444; }

.webix_message {
  border: none !important;
  border-radius: 8px;
  box-shadow: none !important;
  background: #0066FF;
  color: #ffffff;
}

.webix_message.webix_error { background: #EF4444; }

.app-bar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 12px;
  background: #FFFFFF;
  border-bottom: 1px solid #E6F0FF;
}

.who-wrap { position: relative; }

.who-menu {
  position: absolute;
  right: 0;
  top: 48px;
  z-index: 90;
  min-width: 180px;
  padding: 6px;
  background: #FFFFFF;
  border: 1px solid #E6F0FF;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.12);
}

.who-menu button,
.who-menu a {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0A1628;
  font: 500 15px "Fira Sans", sans-serif;
  text-align: left;
  text-decoration: none;
  line-height: 44px;
  cursor: pointer;
}

#go-logout { color: #EF4444; }

#go-logout:hover { background: rgba(239, 68, 68, 0.12); }

.who-menu button:hover,
.who-menu a:hover { background: #E6F0FF; }

.who-menu button:focus-visible,
.who-menu a:focus-visible {
  outline: 2px solid #0066FF;
  outline-offset: 2px;
}

.set-account div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #E6F0FF;
  color: #0A1628;
}

.set-account span { color: #6B7280; }

.html-pop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 22, 40, .35);
}

.html-pop[hidden] { display: none; }

.html-card {
  width: min(480px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(10, 22, 40, .18);
}

.html-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.html-card-head h2 { margin: 0; font-size: 20px; }

.html-card label {
  display: block;
  margin-top: 12px;
  color: #6B7280;
  font-size: 14px;
}

.html-card input,
.html-card select {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 4px;
  padding: 0 12px;
  border: 1px solid #D9E2EC;
  border-radius: 8px;
  color: #0A1628;
  background: #fff;
}

.html-card .check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0A1628;
}

.html-card .check input { width: 16px; height: 16px; margin: 0; }

.html-card .note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #F5F7FA;
  color: #0A1628;
  font-size: 14px;
}

.form-error { margin-top: 10px; color: #EF4444; font-size: 14px; }

.html-actions { display: flex; gap: 8px; margin-top: 16px; }

.html-actions button,
#user-close,
#user-resend {
  height: 40px;
  padding: 0 16px;
  border: 1px solid #E6F0FF;
  border-radius: 8px;
  background: #fff;
  color: #0A1628;
  cursor: pointer;
}

.html-actions button[type="submit"] {
  margin-left: auto;
  border-color: #0066FF;
  background: #0066FF;
  color: #fff;
}

#user-resend { width: 100%; margin-top: 12px; }

@media (max-width: 980px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .dash-split { grid-template-columns: 1fr; }
  .page-stage { overflow: auto; }
}

@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
}
