﻿/* =========================================================================
   wize-redesign.css
   WIZE — weighing screen redesign. ONE new stylesheet, loaded AFTER all
   existing stylesheets (bootstrap, jquery-ui, shkila, site*.css, figma*.css).
   All rules are scoped under body.wz so the old look can be restored by
   removing the "wz" class from <body>.
   Light theme = default. Dark theme = html.wz-dark (set by wize-redesign.js
   from the existing Theme cookie / #f_newtheme switch).
   ========================================================================= */

body.wz {
  /* palette */
  --wz-primary: #1849A0;
  --wz-primary-dark: #0F3373;
  --wz-interactive: #4F86FF;
  --wz-ink: #324168;
  --wz-ink-strong: #1B2540;
  --wz-ink-soft: #5A6A92;
  --wz-bg: #F2F6FE;
  --wz-surface: #FFFFFF;
  --wz-surface-2: #F7F9FE;
  --wz-border: #DDDFE1;
  --wz-border-strong: #C3CBDA;
  --wz-stable: #1F7A4D;
  --wz-stable-bg: #EAF7F0;
  --wz-unstable: #8A5A00;
  --wz-unstable-bg: #FDF4E3;
  --wz-danger: #A32218;
  --wz-danger-bg: #FBECEA;
  --wz-shadow: 0 1px 2px rgba(24, 73, 160, .05), 0 8px 24px rgba(24, 73, 160, .07);
  /* metrics */
  --wz-s1: 4px; --wz-s2: 8px; --wz-s3: 12px; --wz-s4: 16px; --wz-s5: 24px;
  --wz-r1: 6px; --wz-r2: 10px; --wz-r3: 16px; --wz-rp: 999px;
  --wz-topbar-h: 60px;
  --wz-font: "Assistant", "Segoe UI", Helvetica, Arial, sans-serif;
  --wz-mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  background: var(--wz-bg);
  color: var(--wz-ink);
  font-family: var(--wz-font);
  font-size: 16px;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

html.wz-dark body.wz {
  --wz-ink: #D7DEEE;
  --wz-ink-strong: #FFFFFF;
  --wz-ink-soft: #97A3BE;
  --wz-bg: #0E1730;
  --wz-surface: #16213E;
  --wz-surface-2: #1B2748;
  --wz-border: #2A3760;
  --wz-border-strong: #3A4A78;
  --wz-primary: #3C74E0;
  --wz-primary-dark: #2A57AE;
  --wz-stable: #6BE3A5;
  --wz-stable-bg: rgba(107, 227, 165, .12);
  --wz-unstable: #F5C265;
  --wz-unstable-bg: rgba(245, 194, 101, .13);
  --wz-danger: #FF8E82;
  --wz-danger-bg: rgba(255, 142, 130, .13);
  --wz-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px rgba(0, 0, 0, .35);
}

body.wz .text-white { color: var(--wz-ink) !important; }
body.wz a { color: var(--wz-primary); }
body.wz a:hover { color: var(--wz-primary-dark); }

/* ===================== 1. TOP BAR (was the 250px side panel) ============ */

body.wz .main_panel {
  position: sticky;
  top: 0;
  left: auto;
  width: 100%;
  height: var(--wz-topbar-h);
  display: flex;
  align-items: stretch;
  gap: var(--wz-s4);
  padding: 0 var(--wz-s4);
  background: var(--wz-surface);
  border-bottom: 1px solid var(--wz-border);
  box-shadow: none;
  z-index: 1030;
}

body.wz .main_panel_title {
  position: relative;
  width: auto;
  margin: 0;
  display: flex;
  align-items: center;
  font-size: 1rem;
  white-space: nowrap;
}
body.wz .main_panel_title a { display: flex; align-items: center; }
body.wz .main_panel_title a div { display: flex; align-items: center; gap: var(--wz-s2); }
body.wz .main_panel_title a div img,
body.wz .main_panel_title a div span { margin: 0; }
body.wz .main_panel_title span {
  font-family: var(--wz-mono);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: .14em;
  color: var(--wz-primary-dark);
}
html.wz-dark body.wz .main_panel_title span { color: #FFFFFF; }
body.wz .system_logo { height: 26px; width: auto; }

body.wz .main_panel_list {
  position: static;
  display: flex !important;
  align-items: stretch;
  gap: var(--wz-s1);
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  max-width: none;
}

body.wz .dropdown_wrapper { position: relative; display: flex; }

body.wz .main_panel_item {
  display: flex;
  align-items: center;
  gap: var(--wz-s2);
  padding: 0 var(--wz-s3);
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--wz-ink);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  box-shadow: inset 0 -2px 0 transparent;
}
body.wz .main_panel_item:hover {
  background: var(--wz-surface-2);
  color: var(--wz-primary-dark);
  text-decoration: none;
}
html.wz-dark body.wz .main_panel_item:hover { color: #FFFFFF; }
body.wz .main_panel_item.open,
body.wz .main_panel_item.wz-current {
  color: var(--wz-primary-dark);
  box-shadow: inset 0 -2px 0 var(--wz-primary);
  background: var(--wz-surface-2);
}
html.wz-dark body.wz .main_panel_item.open,
html.wz-dark body.wz .main_panel_item.wz-current { color: #FFFFFF; }

body.wz .main_panel_item span {
  position: static;
  margin: 0;
  width: auto;
  transition: none;
}
/* the 30px panel icons were drawn for the dark side panel and read as noise
   in a 60px bar — the labels carry the meaning */
body.wz .main_panel_item img { display: none; }

/* caret: replace the giant » with a small chevron, only on real dropdowns */
body.wz .dropdown_toggle::after,
body.wz .open::after {
  content: "";
  position: static;
  float: none;
  right: auto;
  margin: 0 0 2px 0;
  transform: none;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: .65;
  font-size: 0;
  transition: transform .15s ease;
}
body.wz .dropdown_toggle.open::after { transform: rotate(-135deg); }
body.wz .main_panel_item:not(.dropdown_toggle)::after { content: none; }

/* dropdown list stays the immediate next sibling (figma.js requirement) */
body.wz .dropdown_list {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  min-width: 210px;
  padding: var(--wz-s1) 0;
  background: var(--wz-surface);
  border: 1px solid var(--wz-border);
  border-radius: var(--wz-r2);
  box-shadow: var(--wz-shadow);
  overflow: hidden;
  max-height: 0;
  padding: 0;
  border-width: 0;
  z-index: 1040;
}
/* figma.js writes an inline display:block on the list, so the closed state has
   to collapse padding and border too — otherwise a 10px sliver stays visible */
body.wz .open + .dropdown_list {
  overflow: visible;
  max-height: none;
  padding: var(--wz-s1) 0;
  border-width: 1px;
}
body.wz .dropdown_list .dropdown_item {
  padding: 9px var(--wz-s4);
  font-weight: 500;
  font-size: 14px;
  box-shadow: none;
}
body.wz .dropdown_list .dropdown_item:hover { box-shadow: none; }

body.wz .main_panel .form-group {
  display: flex;
  align-items: center;
  gap: var(--wz-s2);
  margin: 0;
  padding-right: var(--wz-s3);
  border-right: 1px solid var(--wz-border);
}
body.wz .main_panel .form-group label { margin: 0; font-size: 13px; color: var(--wz-ink-soft); cursor: pointer; white-space: nowrap; }
body.wz .main_panel .form-group input { width: auto; display: inline-block; }

body.wz .main_panel_footer {
  position: static;
  right: auto;
  display: flex;
  align-items: center;
  gap: var(--wz-s2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
body.wz .main_panel_footer img { height: 18px; width: 18px; }

body.wz #greeting { font-size: 14px; color: var(--wz-ink-soft); white-space: nowrap; }
body.wz .wz-topbar-right { display: flex; align-items: center; gap: var(--wz-s4); margin-right: auto; }
body.wz .wz-clock {
  font-family: var(--wz-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  color: var(--wz-ink-strong);
}

body.wz .navbar-toggler { display: none; }

/* ===================== 2. PAGE SHELL =================================== */

body.wz .form_wrapper,
body.wz .container,
body.wz .container-fluid { padding-top: 0; margin: 0; }

body.wz .form_wrapper {
  display: block;
  margin: 0 auto;
  padding: var(--wz-s3) var(--wz-s4) var(--wz-s4);
  max-width: 1720px;
  width: 100%;
}
body.wz .form_wrapper > .row { margin-left: -6px; margin-right: -6px; }
body.wz .form_wrapper > .row > [class*="col"] { padding-left: 6px; padding-right: 6px; }
body.wz .wz-row-top { margin-bottom: 12px; }

body.wz .wz-card {
  position: relative;
  width: auto;
  height: 100%;
  margin: 0;
  padding: var(--wz-s4);
  background: var(--wz-surface);
  border: 1px solid var(--wz-border);
  border-radius: var(--wz-r3);
  box-shadow: var(--wz-shadow);
  text-align: right;
}

/* ===================== 3. WEIGHT CARD ================================== */

body.wz .weight-mode-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--wz-s3);
  border-radius: var(--wz-r3);
}
body.wz .main-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--wz-s5);
  flex-wrap: wrap;
  width: 100%;
  padding: 0;
  background: none;
  border-radius: 0;
  text-align: right;
}

/* mode selector: segmented control */
body.wz .mode-wrapper {
  display: inline-flex;
  gap: var(--wz-s1);
  width: auto;
  padding: 4px;
  background: var(--wz-surface-2);
  border: 1px solid var(--wz-border);
  border-radius: var(--wz-rp);
}
body.wz .mode_item {
  display: block;
  width: auto;
  padding: 0;
}
body.wz .mode_item:after { content: none; display: none; }
body.wz .mode_item label {
  margin: 0 !important;
  padding: 7px 18px;
  border-radius: var(--wz-rp);
  font-size: 15px;
  font-weight: 600;
  color: var(--wz-ink-soft);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
body.wz .mode_item label:hover { color: var(--wz-primary-dark); }
body.wz .mode_item input[type="radio"]:checked + label {
  background: var(--wz-primary);
  color: #FFFFFF;
}
body.wz .mode_item input[type="radio"] + label::before { content: none; display: none; }

/* readout */
body.wz .wz-readout { display: flex; align-items: center; gap: var(--wz-s4); flex: 1 1 auto; min-width: 0; }
body.wz .weight-wrapper { position: relative; display: flex; align-items: baseline; gap: var(--wz-s2); }
body.wz .track { display: none !important; }
body.wz #weight {
  position: relative;
  top: 0;
  left: 0;
  width: auto;
  border: 0;
  font-family: var(--wz-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: clamp(64px, 9vw, 150px);
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--wz-primary-dark);
}
html.wz-dark body.wz #weight { color: #FFFFFF; }
body.wz .wz-unit { font-size: 26px; font-weight: 600; color: var(--wz-ink); }

body.wz .wz-status { display: flex; flex-direction: column; gap: var(--wz-s1); align-items: flex-start; }
body.wz .wz-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--wz-rp);
  border: 1.5px solid var(--wz-stable);
  background: var(--wz-stable-bg);
  color: var(--wz-stable);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
body.wz .wz-pill .wz-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
body.wz .wz-pill.is-unstable {
  border-color: var(--wz-unstable);
  background: var(--wz-unstable-bg);
  color: var(--wz-unstable);
}
body.wz .wz-pill.is-unstable .wz-dot { animation: wzPulse 1s ease-in-out infinite; }
body.wz .wz-pill.is-offline {
  border-color: var(--wz-danger);
  background: var(--wz-danger-bg);
  color: var(--wz-danger);
}
body.wz .wz-status-note { font-size: 14px; color: var(--wz-ink-soft); }
@keyframes wzPulse { 0%, 100% { opacity: 1 } 50% { opacity: .2 } }

/* scale picker (Bootstrap carousel structure kept as-is) */
body.wz .scales_wrapper { width: 260px; flex: 0 0 auto; }
body.wz .carousel {
  position: relative;
  border: 1px solid var(--wz-border);
  border-radius: var(--wz-r2);
  padding: 0 34px;
  background: var(--wz-surface-2);
}
body.wz .carousel-item div {
  padding: 10px 4px;
  font-size: 17px;
  font-weight: 600;
  color: var(--wz-ink-strong);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.wz .carousel-control-prev,
body.wz .carousel-control-next {
  width: 30px;
  background: transparent;
  opacity: 1;
  color: var(--wz-ink-soft);
}
body.wz .carousel-control-prev { left: 0; right: auto; }
body.wz .carousel-control-next { right: 0; left: auto; }
body.wz .carousel-control-prev-icon,
body.wz .carousel-control-next-icon {
  width: 14px;
  height: 14px;
  background: none;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
body.wz .carousel-control-prev-icon { transform: rotate(135deg); }
body.wz .carousel-control-next-icon { transform: rotate(-45deg); }
body.wz .wz-field-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--wz-ink-soft);
}

/* ===================== 4. BUTTONS ====================================== */

body.wz .btn_modern,
body.wz .btn.btn_modern {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 46px;
  margin: 0;
  padding: 10px 20px;
  background: var(--wz-surface);
  border: 1px solid var(--wz-border-strong);
  border-radius: var(--wz-r2);
  color: var(--wz-ink);
  font-family: var(--wz-font);
  font-size: 16px;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
body.wz .btn_modern:hover {
  width: 100%;
  background: var(--wz-surface-2);
  border-color: var(--wz-primary);
  color: var(--wz-primary-dark);
}
html.wz-dark body.wz .btn_modern:hover { color: #FFFFFF; }
body.wz .sh_btn { margin: 0; }
body.wz #btnWeigh {
  min-height: 58px;
  background: var(--wz-primary);
  border-color: var(--wz-primary-dark);
  color: #FFFFFF;
  font-size: 20px;
}
body.wz #btnWeigh:hover { background: var(--wz-primary-dark); color: #FFFFFF; }
body.wz .wz-weigh-col { flex: 0 0 auto; width: 220px; }
body.wz .wz-btn-hint { margin-top: 6px; font-size: 13px; color: var(--wz-ink-soft); text-align: center; }
body.wz #btnYard { width: auto; min-width: 84px; height: auto; }

/* ===================== 5. RESULTS ASIDE ================================ */

body.wz .weight_result_wrapper { margin: 0; display: flex; flex-direction: column; gap: var(--wz-s3); height: 100%; }
body.wz .wz-results { display: flex; flex-direction: column; gap: var(--wz-s2); }
body.wz .wz-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wz-s3);
  padding: 8px var(--wz-s3);
  background: var(--wz-surface-2);
  border: 1px solid var(--wz-border);
  border-radius: var(--wz-r2);
}
body.wz .wz-result-row label { margin: 0; font-size: 15px; font-weight: 600; color: var(--wz-ink-soft); }
body.wz .wz-result-row input {
  width: 128px;
  padding: 4px 8px;
  background: transparent;
  border: 0;
  font-family: var(--wz-mono);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  color: var(--wz-ink-strong);
}
body.wz .wz-result-row.is-net { background: var(--wz-primary); border-color: var(--wz-primary-dark); }
body.wz .wz-result-row.is-net label { color: rgba(255, 255, 255, .85); }
body.wz .wz-result-row.is-net input { color: #FFFFFF; font-size: 28px; }
body.wz #out_weight:disabled,
body.wz #in_weight:disabled,
body.wz #netto:disabled { background-color: transparent; opacity: 1; }
body.wz .obligo { margin: 0; }
body.wz .wz-actions { display: flex; flex-direction: column; gap: var(--wz-s2); margin-top: auto; }
body.wz .wz-actions .form-group { margin: 0; }

/* ===================== 6. DATA ENTRY =================================== */

body.wz .data-wrapper {
  width: auto;
  margin: 0;
  text-align: right;
}
body.wz .wz-data-head {
  display: flex;
  align-items: center;
  gap: var(--wz-s3);
  margin-bottom: var(--wz-s3);
}
body.wz .wz-data-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--wz-ink-strong);
}
body.wz .wz-data-head span { font-size: 14px; color: var(--wz-ink-soft); }

body.wz .data-wrapper .form-group { margin-bottom: var(--wz-s3); text-align: right; }
body.wz .data-wrapper .form-group > .row { margin: 0; display: block; }
body.wz .data-wrapper label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--wz-ink-soft);
  text-align: right;
}
body.wz .data-wrapper input[type="text"],
body.wz .data-wrapper input:not([type]) {
  width: 100% !important;
  height: 42px;
  padding: 8px 12px;
  background: var(--wz-surface);
  border: 1px solid var(--wz-border-strong);
  border-radius: var(--wz-r1);
  color: var(--wz-ink-strong);
  font-size: 16px;
}
body.wz .data-wrapper input::placeholder { color: var(--wz-ink-soft); opacity: .8; }
body.wz .data-wrapper input:focus,
body.wz .wz-card input:focus {
  outline: 3px solid rgba(79, 134, 255, .35);
  outline-offset: 1px;
  border-color: var(--wz-interactive);
}
body.wz .LicenseNumber .row { display: flex !important; align-items: flex-end; gap: var(--wz-s2); }
body.wz .LicenseNumber .row > div { width: auto !important; flex: 1 1 auto; }
body.wz .LicenseNumber .form-group { margin: 0; }
body.wz .LicenseNumber input[type="text"] { width: 100% !important; }
body.wz .wz-required input { border-color: var(--wz-unstable); background: var(--wz-unstable-bg); }

body.wz .uploadFile #files {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
  background: var(--wz-surface-2);
  border: 1px dashed var(--wz-border-strong);
  border-radius: var(--wz-r1);
}
body.wz .uploadFile .dz-message {
  margin: 0;
  font-size: 15px !important;
  font-weight: 600;
  color: var(--wz-ink-soft);
}

/* ===================== 7. MODALS ======================================= */

body.wz .modal-bg {
  background: var(--wz-surface);
  border: 1px solid var(--wz-border);
  border-radius: var(--wz-r3);
  color: var(--wz-ink);
}
body.wz .modal-title { font-size: 20px; font-weight: 700; color: var(--wz-ink-strong); }
body.wz .modal-header, body.wz .modal-footer { border: 0; }
body.wz .modal-body.scroll-y { max-height: 60vh; overflow-y: auto; }
body.wz .list-group-item {
  background: var(--wz-surface-2);
  border: 1px solid var(--wz-border);
  border-radius: var(--wz-r2);
  margin-bottom: var(--wz-s2);
  color: var(--wz-ink);
}
body.wz .list-group-item:hover { border-color: var(--wz-primary); background: var(--wz-surface); cursor: pointer; }
body.wz .btn-accept, body.wz .btn-decline {
  min-width: 56px;
  border-radius: var(--wz-r2);
  font-size: 18px;
  font-weight: 700;
}
body.wz .btn-accept { background: var(--wz-primary); color: #FFFFFF; }
body.wz .btn-decline { background: var(--wz-surface-2); border: 1px solid var(--wz-border-strong); color: var(--wz-ink); }
body.wz #tare .form-control, body.wz #v_tare {
  height: 46px;
  background: var(--wz-surface);
  border: 1px solid var(--wz-border-strong);
  border-radius: var(--wz-r1);
  color: var(--wz-ink-strong);
  font-family: var(--wz-mono);
  font-size: 20px;
  text-align: center;
}

/* ===================== 8. RESPONSIVE =================================== */

@media (max-width: 1400px) {
  body.wz #greeting { display: none; }
}
@media (max-width: 1150px) {
  body.wz .main_panel .form-group { display: none; }
  body.wz .main_panel_item { padding: 0 10px; font-size: 14px; }
}
@media (max-width: 1199px) {
  body.wz .main-wrapper { gap: var(--wz-s3); }
  body.wz .scales_wrapper { width: 200px; }
  body.wz .wz-weigh-col { width: 180px; }
}
@media (max-width: 991px) {
  body.wz #weight { font-size: clamp(52px, 12vw, 96px); }
  body.wz .wz-readout { flex-wrap: wrap; }
}
@media (max-width: 767px) {
  body.wz .main_panel { height: auto; flex-wrap: wrap; padding: var(--wz-s2); position: static; }
  body.wz .navbar-toggler {
    display: block;
    order: 2;
    margin-right: auto;
    padding: 6px;
    width: auto;
    height: auto;
    background: none;
    border: 1px solid var(--wz-border);
    border-radius: var(--wz-r1);
  }
  body.wz .main_panel_list {
    display: none !important;
    order: 4;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    padding: var(--wz-s2) 0;
  }
  body.wz .main_panel_list.show { display: flex !important; }
  body.wz .main_panel_item { padding: 12px var(--wz-s3); }
  body.wz .dropdown_list { position: static; box-shadow: none; }
  body.wz .main_panel .form-group { border: 0; padding: var(--wz-s2) var(--wz-s3); }
  body.wz .main_panel_list_toggler:before { background: var(--wz-ink); box-shadow: 0 .25em 0 0 var(--wz-ink), 0 .5em 0 0 var(--wz-ink); }
  body.wz .mode-wrapper { flex-wrap: wrap; border-radius: var(--wz-r2); }
  body.wz .wz-weigh-col, body.wz .scales_wrapper { width: 100%; }
}
