/* Schindler Global Spare Parts Hub - light theme */
:root {
  --red: #E30613;
  --red-dark: #B90510;
  --red-soft: #FDECEE;
  --ink: #1B1F24;
  --ink-2: #3C4650;
  --muted: #6B7682;
  --line: #E3E7EC;
  --line-2: #EEF1F5;
  --bg: #F6F8FA;
  --card: #FFFFFF;
  --ok: #1F8A4C;
  --warn: #B8791B;
  --info: #1F5FA8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---------- top bar ---------- */
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1360px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 6px; background: var(--red);
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; letter-spacing: .5px;
}
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.logo-sub { font-size: 11px; color: var(--muted); font-weight: 400; }

.topnav { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.topnav a {
  padding: 7px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 500;
}
.topnav a:hover { background: var(--line-2); text-decoration: none; }
.topnav a.active { background: var(--red-soft); color: var(--red-dark); }

.top-utils { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.lang-switch a { padding: 5px 11px; color: var(--muted); font-size: 12px; }
.lang-switch a.active { background: var(--red); color: #fff; }
.lang-switch a:hover { text-decoration: none; }
.currency-chip {
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px;
  font-size: 12px; color: var(--ink-2); background: #fff;
}
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line); border-radius: 20px; background: #fff;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--red-soft);
  color: var(--red-dark); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-chip .who { font-size: 12px; color: var(--ink-2); }
.user-chip .role { font-size: 10px; color: var(--muted); display: block; }

/* ---------- search + brand bar ---------- */
.searchbar { background: #fff; border-bottom: 1px solid var(--line); }
.searchbar-inner { max-width: 1360px; margin: 0 auto; padding: 14px 20px; display: flex; gap: 14px; align-items: center; }
.searchbox { flex: 1; position: relative; }
.searchbox input {
  width: 100%; padding: 12px 130px 12px 42px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.searchbox input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(227, 6, 19, .1); }
.searchbox .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbox .btn-search {
  position: absolute; right: 5px; top: 5px; bottom: 5px; padding: 0 20px;
  background: var(--red); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600;
}
.searchbox .btn-search:hover { background: var(--red-dark); }

.brandbar { background: #fff; border-bottom: 1px solid var(--line); }
.brandbar-inner {
  max-width: 1360px; margin: 0 auto; padding: 0 20px; display: flex; gap: 4px; overflow-x: auto;
}
.brandbar a {
  padding: 11px 16px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.brandbar a:hover { color: var(--red); text-decoration: none; }
.brandbar a.active { color: var(--red-dark); border-bottom-color: var(--red); }

/* ---------- layout ---------- */
.wrap { max-width: 1360px; margin: 0 auto; padding: 18px 20px 60px; }
.sidebar { width: 236px; flex: 0 0 236px; }
.main { flex: 1; min-width: 0; }
.layout { display: flex; gap: 18px; align-items: flex-start; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-hd { padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.panel-bd { padding: 12px 16px; }

.navgroup { margin-bottom: 6px; }
.navgroup > .navgroup-title {
  padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--ink);
  text-transform: uppercase; letter-spacing: .5px; display: flex; justify-content: space-between; cursor: pointer;
}
.navgroup > .navgroup-title:hover { color: var(--red); }
.navgroup ul { list-style: none; margin: 0; padding: 0 0 4px 0; }
.navgroup li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px 7px 14px; color: var(--ink-2); font-size: 13px; border-radius: 6px;
}
.navgroup li a:hover { background: var(--line-2); color: var(--red); text-decoration: none; }
.navgroup li a.active { background: var(--red-soft); color: var(--red-dark); font-weight: 600; }
.navgroup li .chev { color: var(--muted); font-size: 11px; }
.navgroup li ul { padding-left: 12px; }
.navgroup li ul a { font-size: 12px; color: var(--muted); padding: 6px 10px; }
.navgroup li ul a.active { color: var(--red-dark); background: var(--red-soft); }

/* ---------- cards / grids ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 14px; }
.cat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: block; color: var(--ink); transition: .15s;
}
.cat-card:hover { border-color: var(--red); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.cat-card .cc-thumb {
  height: 92px; border-radius: 8px; background: linear-gradient(135deg, #F2F5F8, #E7ECF2);
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: #9AA6B2; margin-bottom: 10px;
}
.cat-card .cc-name { font-weight: 600; font-size: 13px; }
.cat-card .cc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.section-title { font-size: 15px; font-weight: 700; margin: 22px 0 10px; display: flex; justify-content: space-between; align-items: flex-end; }
.section-title .more { font-size: 12px; font-weight: 500; color: var(--red); }

/* ---------- product list ---------- */
.prod-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.prod {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: .15s;
}
.prod:hover { box-shadow: var(--shadow); border-color: #D7DDE4; }
.prod-img {
  height: 150px; background: linear-gradient(135deg, #F3F6F9, #E9EEF3);
  display: flex; align-items: center; justify-content: center; color: #A7B2BD; font-size: 13px; position: relative;
}
.prod-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-img .badge-oem {
  position: absolute; left: 8px; top: 8px; background: rgba(27, 31, 36, .82); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.prod-bd { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.prod-pn { font-family: "Consolas", "SFMono-Regular", monospace; font-size: 13px; font-weight: 700; color: var(--ink); }
.prod-desc { font-size: 12.5px; color: var(--ink-2); min-height: 34px; }
.prod-meta { font-size: 11.5px; color: var(--muted); }
.prod-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.price { font-size: 17px; font-weight: 700; color: var(--red); }
.price small { font-size: 11px; color: var(--muted); font-weight: 500; }
.lead { font-size: 11.5px; color: var(--muted); }

/* ---------- product detail ---------- */
.detail-grid { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.detail-img {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.detail-img .ph { height: 320px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #F3F6F9, #E9EEF3); color: #A7B2BD; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); font-size: 13px; text-align: left; vertical-align: top; }
.spec-table th { width: 190px; color: var(--muted); font-weight: 500; background: #FAFBFC; }
.spec-table td { color: var(--ink); }
.spec-table .mono { font-family: "Consolas", monospace; font-weight: 600; }

/* ---------- table ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.tbl th { background: #FAFBFC; color: var(--muted); font-weight: 600; font-size: 12px; }
.tbl tbody tr:hover { background: #FCFDFE; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: "Consolas", "SFMono-Regular", monospace; }

/* ---------- buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: inherit;
}
.btn:hover { border-color: #C9D2DA; text-decoration: none; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(227, 6, 19, .1); }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-inline .field { margin-bottom: 0; }

/* ---------- misc ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-PENDING { background: #FFF4E0; color: var(--warn); }
.badge-CONFIRMED { background: #E7F0FB; color: var(--info); }
.badge-SHIPPED { background: #E6F4EC; color: var(--ok); }
.badge-CLOSED { background: #EEF1F5; color: var(--muted); }
.badge-CANCELLED { background: #FDECEE; color: var(--red-dark); }
.badge-OPEN { background: #FFF4E0; color: var(--warn); }
.badge-CONVERTED { background: #E6F4EC; color: var(--ok); }
.badge-admin { background: var(--red-soft); color: var(--red-dark); }
.badge-muted { background: #EEF1F5; color: var(--muted); }

.alert { padding: 11px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-ok { background: #E6F4EC; color: #14663A; border: 1px solid #BFE3CE; }
.alert-err { background: var(--red-soft); color: var(--red-dark); border: 1px solid #F6CFD3; }
.alert-info { background: #E7F0FB; color: #17497F; border: 1px solid #C7DEF6; }
.alert-warn { background: #FFF6E6; color: #8A5A0B; border: 1px solid #F0DDB4; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .big { font-size: 34px; opacity: .35; margin-bottom: 8px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 4px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; font-size: 13px; color: var(--ink-2); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a.active { color: var(--red-dark); border-bottom-color: var(--red); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--red); }

.footer { border-top: 1px solid var(--line); background: #fff; margin-top: 40px; }
.footer-inner { max-width: 1360px; margin: 0 auto; padding: 18px 20px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.note { font-size: 12px; color: var(--muted); }
.hidden-row { display: none; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb12 { margin-bottom: 12px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- form / page furniture ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
             margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-size: 21px; font-weight: 700; margin: 0 0 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }
.form-grid .field { min-width: 0; }
.form-grid .grow2 { grid-column: span 2; }
@media (max-width: 720px) { .form-grid .grow2 { grid-column: span 1; } }

/* three-step guidance */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
          border-radius: 50%; background: var(--red); color: #fff; font-size: 12.5px; font-weight: 700; margin-bottom: 9px; }
.step h3 { font-size: 14px; margin: 0 0 5px; font-weight: 650; }
.step p { font-size: 12.5px; color: var(--muted); margin: 0 0 11px; line-height: 1.55; }

/* dropzone */
.dropzone { border: 2px dashed var(--line); border-radius: 10px; padding: 26px 18px; text-align: center;
            background: #FBFCFD; transition: border-color .15s, background .15s; }
.dropzone.dragover { border-color: var(--red); background: var(--red-soft); }
.dropzone .dz-icon { font-size: 30px; opacity: .35; }
.dropzone .dz-text { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.dropzone .dz-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dropzone input[type=file] { margin-top: 12px; }
.dz-name { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--red-dark); }

.mt4 { margin-top: 4px; }

/* image slots (product drawings) */
.img-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.img-slot { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #FBFCFD; }
.img-slot-hd { font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 9px; }
.img-preview { height: 170px; border: 1px dashed var(--line); border-radius: 6px; background: #fff;
               display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 10px; }
.img-preview img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.img-empty { text-align: center; color: #C3CBD4; }
.img-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.img-form input[type=file] { font-size: 12px; flex: 1; min-width: 150px; }

/* drawing thumbnails on the detail page */
.thumb-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.thumb { width: 76px; height: 62px; border: 1px solid var(--line); border-radius: 6px;
          background: #fff; cursor: pointer; object-fit: contain; padding: 3px; }
.thumb.on { border-color: var(--red); box-shadow: 0 0 0 2px rgba(227, 6, 19, .14); }

/* hover zoom layer */
.zoom-layer { position: fixed; z-index: 9000; display: none; width: 380px; height: 290px;
              background: #fff; border: 1px solid var(--line); border-radius: 10px;
              box-shadow: 0 18px 44px rgba(16, 24, 40, .22); padding: 6px; pointer-events: none; }
.zoom-layer.on { display: block; }
.zoom-layer img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 700px) { .zoom-layer { display: none !important; } }

/* login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #F6F8FA 0%, #EDF1F5 100%); }
.login-card { width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 19px; margin: 14px 0 4px; }
.login-card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 20px; }

@media (max-width: 980px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .topnav { display: none; }
}

/* ---- category breadcrumb + level chips (4-level taxonomy) ---- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--red); }
.crumbs a.on { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: #C3CAD3; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
        background: #fff; color: var(--ink-2); font-size: 12.5px; text-decoration: none; }
.chip:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

/* ---- auto translate helpers ---- */
.tr-btn { margin-left: 8px; font-size: 11.5px; padding: 2px 8px; vertical-align: middle; }
.tr-btn:disabled { opacity: .55; cursor: wait; }
.tr-ok { outline: 2px solid #9FC7EF; border-radius: 4px; transition: outline-color .4s; }

/* ---- custom file picker ---- */
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-wrap { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.file-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* RFQ new: E & E radio options */
.ee-cell .ee-opt { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #3C4650; white-space: nowrap; margin: 2px 0; }
.ee-cell .ee-opt input { margin: 0; }

/* material review states */
.badge-active { background: #E6F4EC; color: var(--ok); }
.badge-pending { background: #FFF4E0; color: var(--warn); }
.badge-rejected { background: #FDECEE; color: var(--red-dark); }
.badge-draft { background: #EEF1F5; color: var(--muted); }
.badge-obsolete { background: #EEF1F5; color: var(--muted); }
