/* ============================================================
   植德商标报价系统 — CSS 自定义属性
   variables.css — 所有 CSS 模块引用的变量定义
   ============================================================ */

:root {
  /* 主色系 */
  --color-primary: #A21F2D;
  --color-primary-dark: #8a1a26;
  --color-primary-gradient: linear-gradient(135deg, #A21F2D 0%, #8a1a26 100%);

  /* 辅色 */
  --color-secondary: #C49958;

  /* 背景 */
  --color-bg: #f0f2f5;
  --color-card: #fff;
  --color-hover: #fafbfc;

  /* 文字 */
  --color-text: #222;
  --color-text-secondary: #666;
  --color-text-muted: #999;

  /* 边框 */
  --color-border: #e4e6eb;
  --color-border-light: #f0f0f0;

  /* 状态色 */
  --color-error: #c62828;
  --color-success: #2e7d32;

  /* 标签 */
  --color-tag-bg: #fef5f5;

  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;

  /* 圆角 */
  --radius-card: 10px;
  --radius-button: 8px;
  --radius-input: 6px;
  --radius-tag: 12px;
  --radius-modal: 12px;

  /* 阴影 */
  --shadow-card: 0 2px 8px rgba(0,0,0,.06);
  --shadow-modal: 0 20px 60px rgba(0,0,0,.3);
  --shadow-dropdown: 0 4px 12px rgba(0,0,0,.12);

  /* 间距 */
  --spacing-unit: 4px;
  --spacing-card: 20px;
  --spacing-card-mobile: 12px;

  /* 断点 */
  --breakpoint-mobile: 768px;
  --breakpoint-small: 600px;
}
/* ============================================================
   base.css — Reset & Base Typography
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--color-bg);
  color: #222;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: rgba(162, 31, 45, 0.15);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f0f0f0;
}
::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* Utility */
.empty {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 13px;
}

.emp {
  font-size: 12px;
  color: #bbb;
  padding: 4px 0;
}

.rt { text-align: right; }
.n { text-align: right; }
/* ============================================================
   layout.css — Header, Nav, Footer, Page Layout
   ============================================================ */

/* --- Calculator Header (index.css / madrid.css / single.css) --- */
.hd {
  background: linear-gradient(135deg, var(--color-primary), #7a1824);
  color: #fff;
  padding: 24px 16px 20px;
  text-align: center;
}

.hd h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.hd .sub {
  font-size: 12px;
  opacity: .55;
}

/* Flex-row header variant (quotes, suppliers, customers, admin) */
.hd-row {
  background: linear-gradient(135deg, var(--color-primary), #7a1824);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  text-align: left;
}
.hd-row h1 { font-size: 16px; font-weight: 700; flex-shrink: 0; }
.hd-row a { color: #fff; text-decoration: none; font-size: 12px; opacity: .7; transition: opacity .2s; }
.hd-row a:hover { opacity: 1; }
.hd-row .usr { font-size: 12px; opacity: .8; margin-left: auto; }

/* --- Admin-style Header (common.css) --- */
.hdr {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.hdr .logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hdr .nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hdr .nav a {
  color: #fff;
  font-size: 12px;
  opacity: 0.9;
}

.hdr .nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* --- Top Nav (Calculator pages) --- */
.topnav {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e4e6eb;
  flex-wrap: wrap;
}

.topnav a {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  color: #555;
  text-decoration: none;
  border: 1px solid #d0d5dd;
  transition: all 0.15s;
  font-weight: 500;
}

.topnav a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #fff5f5;
}

.topnav a.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* --- User Bar --- */
.usr {
  font-size: 12px;
  color: #666;
  padding: 6px 16px;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Body Container --- */
.bd {
  max-width: 980px;
  margin: -8px auto 0;
  padding: 0 12px;
}

/* --- Card --- */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px;
  margin-bottom: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.03);
}

.card h2 {
  font-size: 15px;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f2f5;
}

/* --- Footer --- */
.ft {
  text-align: center;
  padding: 20px 0 32px;
  font-size: 11px;
  color: #aaa;
}

.ft a {
  color: var(--color-primary);
  text-decoration: none;
}

/* --- Admin Tabs --- */
.admin-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.atab {
  padding: 6px 16px;
  background: #f5f5f5;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: #666;
  transition: all 0.15s;
}

.atab:hover {
  background: #ebebeb;
}

.atab.on {
  background: var(--color-primary);
  color: #fff;
}

/* --- PC Login Bar --- */
.pc-login-bar {
  text-align: center;
  padding: 6px 0 8px;
}

.pc-login-bar a {
  color: var(--color-primary);
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  opacity: .7;
  transition: opacity .15s;
}

.pc-login-bar a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* --- Login Page (100% match old project) --- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #A21F2D, #8a1a26);
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 36px 40px;
  width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}

.login-card h1 {
  font-size: 22px;
  color: #A21F2D;
  margin-bottom: 4px;
}

.login-card .sub {
  font-size: 12px;
  color: #999;
  margin-bottom: 24px;
}

.login-card input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
  background: #f8f9fb;
}

.login-card input:focus {
  border-color: #A21F2D;
  box-shadow: 0 0 0 2px rgba(162,31,45,.1);
  background: #fff;
}

.login-card button {
  width: 100%;
  padding: 12px;
  background: #A21F2D;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.login-card button:hover {
  background: #8a1a26;
}

.login-card .err {
  color: #c62828;
  font-size: 13px;
  margin-top: 8px;
  display: none;
}

/* --- Public Calc --- */
.public-calc {
  display: none;
  min-height: 100vh;
  background: var(--color-bg);
}

.main-app {
  display: none;
}

/* --- Loading & Error (shared) --- */
.ld {
  display: none;
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}

.err {
  display: none;
  background: #fff3f3;
  color: #c62828;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 13px;
  border: 1px solid #fdd;
}

/* ===== Supplier Edit Page ===== */
.supplier-edit-view {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px;
}
.edit-page-body {
  background: #fff;
  border-radius: 10px;
  padding: 24px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-top: 16px;
}
.supplier-edit-view .back-link {
  display: inline-block;
  margin-bottom: 10px;
  color: #A21F2D;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.supplier-edit-view .back-link:hover {
  text-decoration: underline;
}

/* ===== Rate Entry Section ===== */
#rateEntrySection {
  animation: fadeIn 0.2s ease;
}
#rateEntryForm {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
#rateGroupsPreview .rate-group {
  margin-bottom: 6px;
  padding: 6px 10px;
  background: #f0f2f5;
  border-radius: 4px;
  font-size: 12px;
}
#rateGroupsPreview .adm-btn {
  font-size: 11px;
  padding: 2px 8px;
}

/* ===== Slide Panel (侧边栏) ===== */
.slide-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.25);
  z-index: 900;
  display: none;
  animation: fadeIn 0.2s ease;
}
.slide-overlay.show { display: block; }

.slide-panel {
  position: fixed;
  top: 0; right: -620px;
  width: 580px;
  height: 100%;
  background: #fff;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  transition: right 0.28s cubic-bezier(0.4,0,0.2,1);
}
.slide-panel.open { right: 0; }

.slide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.slide-panel-header h3 {
  font-size: 16px;
  color: #A21F2D;
  margin: 0;
}
.slide-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  padding: 4px 8px;
  border-radius: 4px;
}
.slide-panel-close:hover { background: #f0f0f0; color: #333; }

.slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.slide-panel-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
  background: #fafafa;
}

/* 侧边栏内的表单样式 */
.sp-section {
  font-size: 12px;
  font-weight: 700;
  color: #A21F2D;
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}
.sp-section:first-child { margin-top: 0; }

.sp-fields label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
  margin-top: 10px;
}
.sp-fields label:first-child { margin-top: 0; }
.sp-fields input,
.sp-fields select,
.sp-fields textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
  background: #f8f9fb;
  transition: border-color 0.15s;
}
.sp-fields input:focus,
.sp-fields select:focus,
.sp-fields textarea:focus {
  border-color: #A21F2D;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(162,31,45,0.08);
}
.sp-fields textarea { min-height: 60px; resize: vertical; }

/* 侧边栏内的费率录入区 */
.sp-rate-entry {
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fb;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}
.sp-rate-entry .rate-add-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border: 1px dashed #d0d5dd;
  border-radius: 6px;
  margin-top: 8px;
}
.sp-rate-entry .rate-add-bar input,
.sp-rate-entry .rate-add-bar select {
  padding: 5px 6px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 12px;
}
.sp-rate-preview {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 8px;
}

/* ============================================================
   components.css — Buttons, Tables, Modals, Forms, Combo Box, Tags
   ============================================================ */

/* --- Buttons --- */
.btn {
  background: linear-gradient(135deg, #A21F2D, #8a1a26);
  color: #fff;
  border: none;
  padding: 11px 36px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .5px;
  box-shadow: 0 2px 8px rgba(162,31,45,.25);
  transition: all .2s;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(162,31,45,.3); }
.btn:active { transform: translateY(0); }
.btn:disabled { background: #bbb; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.sec { background: #f5f5f5; color: #666; }

.pbtn {
  background: #fff;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.pbtn:hover { background: var(--color-primary); color: #fff; }

.fbtn {
  padding: 7px 14px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}

.fbtn.sec { background: #f0f0f0; color: #666; }
.fbtn:hover { background: var(--color-primary-dark); }

.cancel {
  padding: 8px 20px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
}

.save {
  padding: 8px 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.del, .del-btn {
  background: none;
  border: none;
  color: #c62828;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
}

.del:hover, .del-btn:hover {
  opacity: .7;
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #f8f8f8;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  border-bottom: 1.5px solid #e8eaed;
  white-space: nowrap;
}

th.active { background: #f0f0f0; color: var(--color-primary); }
th:hover { background: #f0f0f0; cursor: pointer; }

td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}
.adm-btn { padding: 3px 8px; border: 1px solid #d0d5dd; border-radius: 4px; font-size: 11px; cursor: pointer; background: #fff; }
.adm-btn:hover { background: #f4f5f8; }

/* Mode tags (quotes page) */
.mode-tag { font-size: 10px; padding: 2px 6px; border-radius: 3px; white-space: nowrap; background: #e8e8e8; }
.mode-new, .mode-namechange { background: #e3f2fd; color: #1565c0; }
.mode-renew { background: #e8f5e9; color: #2e7d32; }
.mode-assign { background: #fff3e0; color: #e65100; }
.mode-single, .mode-direct { background: #f3e5f5; color: #7b1fa2; }
.mode-domestic { background: #fce4ec; color: #c62828; }
.mode-foreign { background: #e8eaf6; color: #283593; }

/* Quote cards (customers page) */
.qcards { display: flex; flex-direction: column; gap: 6px; }
.qcard { background: #f8f9fb; border-radius: 6px; padding: 10px 12px; cursor: pointer; border: 1px solid #eef0f3; transition: all .15s; }
.qcard:hover { border-color: var(--color-primary); background: #fff; }
.qcard .qc-row { display: flex; align-items: center; gap: 10px; }
.qcard .qc-name { font-weight: 600; color: #222; flex: 1; }
.qcard .qc-date { font-size: 11px; color: #999; }
.qcard .qc-mode { font-size: 11px; background: #eee; padding: 2px 6px; border-radius: 3px; }
.qcard .qc-amt { font-weight: 600; color: var(--color-primary); }
tr.z { background: #fafbfc; }

.sort-arrow { font-size: 9px; margin-left: 3px; color: #bbb; }

/* --- Modal --- */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.show { display: flex; }

.mc {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.mo {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,.45);
  z-index: 5000;
  justify-content: center;
  align-items: center;
}

.mo.show { display: flex; }

.mo-in {
  background: #fff;
  border-radius: 10px;
  width: 92%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 28px;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
}

.mo-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.mo-x:hover { background: #eee; color: var(--color-primary); }

/* --- Forms --- */
.fld {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fld label {
  font-size: 12px;
  color: #777;
  font-weight: 600;
}

.fld input, .fld select {
  padding: 9px 12px;
  border: 1.5px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fafbfc;
  width: 100px;
  text-align: center;
  font-weight: 600;
  transition: border .2s, box-shadow .2s, background .2s;
}

.fld input:focus, .fld select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(162,31,45,.08);
  background: #fff;
}

.row {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.fbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 0;
}

.fbar input, .fbar select {
  padding: 7px 10px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}

.fbar input:focus, .fbar select:focus {
  border-color: var(--color-primary);
}

/* --- Combo Box --- */
.combo-wrap { position: relative; }

.combo-drop {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.combo-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

.combo-item:hover { background: #fff0f0; }
.combo-item.sel { background: #fff0f0; font-weight: 600; color: var(--color-primary); }

.ci-zh { font-size: 13px; }
.ci-en { font-size: 10px; color: #999; }

/* --- Tags --- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  min-height: 26px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef5f5;
  color: var(--color-primary);
  padding: 3px 8px 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid #fcd5d5;
}

.tag .x {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: .4;
}

.tag .x:hover { opacity: 1; }

/* --- Role & Mode Badges --- */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.role-admin { background: #ffebee; color: #c62828; }
.role-subadmin { background: #fff3e0; color: #e65100; }
.role-editor { background: #e8f5e9; color: #2e7d32; }
.role-viewer { background: #e3f2fd; color: #1565c0; }

.mode-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: #f0e0e0;
  color: var(--color-primary);
}

/* --- Search Bar --- */
.search-bar {
  padding: 8px 16px;
  border-bottom: 1px solid #e4e6eb;
  position: relative;
  background: #fff;
}

.search-bar input {
  width: 100%;
  padding: 9px 10px 9px 34px;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  font-size: 15px;
  outline: none;
  background: #f8f9fb;
  transition: all .2s;
  color: #222;
}

.search-bar input:focus {
  background: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(162,31,45,.08);
}

.search-bar .icon {
  position: absolute;
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 14px;
  pointer-events: none;
}

/* --- Quick Bar --- */
.quick-bar {
  padding: 5px 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid #e4e6eb;
  background: #fafbfc;
}

.quick-label {
  font-size: 14px;
  color: #888;
  margin-right: 2px;
  white-space: nowrap;
}

.quick-btn {
  padding: 5px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
  color: #444;
  white-space: nowrap;
  font-weight: 500;
}

.quick-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #fff5f5;
}

/* --- Region Tabs --- */
.region-tabs {
  display: flex;
  border-bottom: 1px solid #e4e6eb;
  background: #fafbfc;
  overflow-x: auto;
  padding: 0 4px;
}

.region-tab {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  color: #777;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  margin: 0 1px;
  font-weight: 500;
}

.region-tab:hover {
  color: var(--color-primary);
  background: #fff5f5;
}

.region-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 700;
}

/* --- Toast --- */
.toast {
  position: fixed;
  top: 12px;
  right: 12px;
  padding: 8px 16px;
  background: #333;
  color: #fff;
  border-radius: 5px;
  font-size: 12px;
  z-index: 9999;
  opacity: 1;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* --- Misc --- */
.count { font-size: 11px; color: #999; }
.meta { font-size: 11px; color: #999; }

/* Modal form column layout */
.mc .f { display: flex; flex-direction: column; gap: 10px; }
.mc .f label { font-size: 12px; color: #666; font-weight: 500; }
.mc .f input, .mc .f select, .mc .f textarea { padding: 8px 10px; border: 1px solid #d0d5dd; border-radius: 4px; font-size: 13px; outline: none; width: 100%; box-sizing: border-box; }
.mc .f input:focus, .mc .f select:focus, .mc .f textarea:focus { border-color: var(--color-primary); }
.ba { display: flex; justify-content: flex-end; gap: 8px; }
.ba .save { background: var(--color-primary); color: #fff; border: none; padding: 8px 24px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.ba .cancel { background: #fff; color: #666; border: 1px solid #ddd; padding: 8px 24px; border-radius: 6px; font-size: 14px; cursor: pointer; }

/* Combo box */
.ccb-wrap { position: relative; }
.ccb-drop { position: absolute; top: 100%; left: 0; right: 0; max-height: 200px; overflow-y: auto; border: 1px solid #d0d5dd; border-radius: 4px; background: #fff; z-index: 999; box-shadow: 0 4px 12px rgba(0,0,0,.12); font-size: 12px; }
.ccb-drop .ccb-item { padding: 5px 8px; cursor: pointer; }
.ccb-drop .ccb-item:hover { background: #fef5f5; color: #A21F2D; }
.ccb-drop .ccb-item.sel { background: #fef5f5; color: #A21F2D; font-weight: 600; }
.fbar-ccb { display: inline-block; vertical-align: middle; }

/* Expandable rate rows */
.rate-expand-row { display: none; }
.rate-expand-row.open { display: table-row; }
.rate-expand-row td { background: #fafbfc; padding: 0; }
.rate-expand-inner { padding: 8px 14px; }
.re-empty { text-align: center; padding: 8px; color: #aaa; font-size: 11px; }
.name { font-weight: 600; cursor: pointer; }
.name:hover { color: #A21F2D; }
.name .ex-ar { font-size: 10px; margin-right: 4px; display: inline-block; transition: transform .2s; }
tr.expanded .name .ex-ar { transform: rotate(90deg); }
.ex-ar-sm { font-size: 9px; margin-left: 2px; transition: transform .2s; display: inline-block; }
tr.expanded .ex-ar-sm { transform: rotate(90deg); }

/* ===== 供应商费用历史 Modal ===== */
.rh-overlay { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.45); z-index:2000; align-items:center; justify-content:center; }
.rh-overlay.show { display:block; }
.rh-box { background:#fff; width:100vw; height:100vh; overflow:hidden; display:flex; flex-direction:column; }
.rh-head { display:flex; justify-content:space-between; align-items:center; padding:14px 20px; border-bottom:1px solid #e4e6eb; }
.rh-head h2 { font-size:17px; color:#A21F2D; }
.rh-close { border:none; background:none; color:#999; font-size:20px; cursor:pointer; padding:4px 8px; border-radius:4px; }
.rh-close:hover { background:#f0f0f0; color:#A21F2D; }
.rh-tabs { display:flex; border-bottom:1px solid #ddd; background:#f5f5f5; padding:0 14px; gap:0; }
.rh-tab { padding:10px 18px; font-size:13px; cursor:pointer; border:none; background:none; color:#777; border-bottom:2px solid transparent; transition:all .12s; }
.rh-tab:hover { color:#A21F2D; background:#fff0f0; }
.rh-tab.active { color:#A21F2D; border-bottom-color:#A21F2D; font-weight:600; background:#fff; }
.rh-panel { flex:1; overflow-y:auto; padding:16px 20px; }
.rh-panel-hd, .rh-global-ctrl, .rh-comp-ctrl { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:14px; align-items:flex-end; }
.rh-sel-row { display:flex; align-items:center; gap:6px; }
.rh-sel-row label { font-size:12px; color:#555; white-space:nowrap; }
.rh-sel-row select, .rh-sel-row input[type=text] { padding:6px 10px; border:1px solid #d0d5dd; border-radius:4px; font-size:13px; outline:none; min-width:130px; }
.rh-sel-row select:focus, .rh-sel-row input:focus { border-color:#A21F2D; }
.rh-sel-stretch { flex:1; }
.rh-sel-stretch input { width:100%; min-width:auto; }
.rh-chart-wrap { background:#fafbfc; border-radius:6px; border:1px solid #e4e6eb; padding:12px; margin-bottom:10px; }
.rh-chart-empty { text-align:center; padding:40px 20px; color:#bbb; font-size:13px; }
.rh-timeline-wrap { margin-top:8px; }
.rh-tl-item { display:flex; align-items:flex-start; gap:10px; padding:8px 10px; border-radius:4px; margin-bottom:3px; font-size:12px; }
.rh-tl-item:hover { background:#f8f9fb; }
.rh-tl-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; margin-top:5px; }
.rh-tl-dot.create { background:#2EBB59; }
.rh-tl-dot.update { background:#FA8C16; }
.rh-tl-dot.delete { background:#E8522D; }
.rh-tl-body { flex:1; min-width:0; }
.rh-tl-body .tl-main { display:flex; justify-content:space-between; gap:6px; }
.rh-tl-body .tl-action { font-weight:600; }
.rh-tl-body .tl-action.create { color:#2EBB59; }
.rh-tl-body .tl-action.update { color:#FA8C16; }
.rh-tl-body .tl-action.delete { color:#E8522D; }
.rh-tl-body .tl-detail { color:#555; }
.rh-tl-body .tl-detail .old { color:#999; text-decoration:line-through; margin-right:4px; }
.rh-tl-body .tl-detail .new { color:#A21F2D; font-weight:600; }
.rh-tl-body .tl-who { color:#aaa; font-size:11px; margin-top:1px; }
.rh-global-list { }
.rh-global-item { padding:8px 12px; border:1px solid #eee; border-radius:5px; margin-bottom:5px; font-size:12px; display:flex; justify-content:space-between; align-items:center; }
.rh-global-item:hover { border-color:#ddd; }
.rh-global-item .gi-left { flex:1; min-width:0; }
.rh-global-item .gi-left .gi-sup { font-weight:600; }
.rh-global-item .gi-left .gi-det { color:#666; margin:2px 0; }
.rh-global-item .gi-left .gi-who { color:#aaa; font-size:11px; }
.rh-global-item .gi-right { text-align:right; flex-shrink:0; margin-left:10px; }
.rh-hint { text-align:center; padding:30px; color:#bbb; font-size:13px; }
.rh-comp-sup-list { display:flex; flex-wrap:wrap; gap:6px; }
.rh-comp-sup-item { padding:5px 12px; border:1px solid #d0d5dd; border-radius:14px; font-size:12px; cursor:pointer; transition:all .12s; user-select:none; }
.rh-comp-sup-item:hover { border-color:#A21F2D; background:#fef5f5; }
.rh-comp-sup-item.selected { background:#A21F2D; color:#fff; border-color:#A21F2D; }
.rh-comp-table { width:100%; border-collapse:collapse; font-size:12px; }
.rh-comp-table th, .rh-comp-table td { padding:8px 12px; border:1px solid #e4e6eb; text-align:center; }
.rh-comp-table th { background:#f8f8f8; font-weight:600; }
.rh-comp-table .fee-type { text-align:left; font-weight:500; }
.rh-comp-table .no-data { color:#ccc; }
.hm-btn { padding:6px 12px; border-radius:4px; font-size:12px; cursor:pointer; border:none; }
.c-en { color:#888; font-size:10px; margin-left:4px; }
.combo-item { padding:6px 10px; font-size:12px; cursor:pointer; }
.combo-item:hover { background:#fef5f5; color:#A21F2D; }
.combo-item.sel { background:#fef5f5; color:#A21F2D; font-weight:600; }
/* ============================================================
   calculator.css — Calculator Pages (Madrid, Single, Domestic, Foreign)
   ============================================================ */

/* --- Country Selector --- */
.cwrap { position: relative; }

.cinput {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fafbfc;
  transition: border .2s;
}

.cinput:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(162,31,45,.08);
  background: #fff;
}

.cdd {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  border: 1.5px solid #e0e4ea;
  border-radius: 8px;
  background: #fff;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.cdd .it {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f8f8fa;
}

.cdd .it:last-child { border-bottom: none; }
.cdd .it:hover { background: #f5f5ff; }

.cdd .it .ck {
  width: 16px;
  height: 16px;
  border: 2px solid #d0d5dd;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cdd .it.sel .ck {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.cdd .it.sel .ck::after {
  content: '\2713';
  color: #fff;
  font-size: 11px;
  font-weight: bold;
}

.cdd .it .cn { color: #222; }
.cdd .it .fe { font-size: 11px; color: #aaa; margin-left: auto; }

/* --- PC Country Grid --- */
.pc-country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px;
  max-height: 500px;
  overflow-y: auto;
  padding: 2px;
}

.pc-ci {
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  transition: all .12s;
  border: 1px solid transparent;
}

.pc-ci:hover {
  border-color: #e0e4ea;
  background: #f9fafc;
}

.pc-ci.selected {
  background: #fef5f5;
  border-color: #fcd5d5;
}

.pc-ci .pc-ck {
  width: 16px;
  height: 16px;
  border: 2px solid #d0d5dd;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pc-ci.selected .pc-ck {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.pc-ci.selected .pc-ck::after {
  content: '\2713';
  color: #fff;
  font-size: 11px;
  font-weight: bold;
}

.pc-ci .pc-nm { color: #222; font-weight: 500; }
.pc-ci .pc-en { font-size: 10px; color: #bbb; margin-left: 2px; }
.pc-ci .pc-of { font-size: 10px; padding: 1px 5px; border-radius: 3px; white-space: nowrap; margin-left: auto; }
.pc-ci .pc-fee { font-size: 10px; color: #999; margin-left: 4px; font-family: SF Mono, Consolas, monospace; }

@media (max-width: 600px) {
  .pc-country-grid { grid-template-columns: 1fr; }
}

/* --- Single Country Grid --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  padding: 2px 0;
}

.gitem {
  padding: 8px 12px;
  border: 1px solid #e8ecf0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .15s;
  user-select: none;
}

.gitem:hover { background: #f8f9ff; border-color: var(--color-primary); }
.gitem.sel { background: #fef5f5; border-color: var(--color-primary); }

.gitem .ck {
  width: 16px;
  height: 16px;
  border: 2px solid #d0d5dd;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gitem.sel .ck {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.gitem.sel .ck::after {
  content: '\2713';
  color: #fff;
  font-size: 10px;
  font-weight: bold;
}

.gitem .cn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gitem .fr { font-size: 10px; color: #999; flex-shrink: 0; }
.gitem.sel .fr { color: var(--color-primary); }

/* --- Search Wrap (Single) --- */
.srch-wrap {
  position: relative;
  margin-bottom: 12px;
}

.srch-wrap input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fafbfc;
  transition: border .2s;
}

.srch-wrap input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(162,31,45,.08);
  background: #fff;
}

/* --- Tabs (Single) --- */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tab {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid #e0e4ea;
  background: #fff;
  color: #666;
  transition: all .15s;
  white-space: nowrap;
}

.tab:hover { border-color: var(--color-primary); color: var(--color-primary); }
.tab.on { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* --- Result --- */
.res {
  display: none;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.rbody {
  border: 1px solid #e8ecf0;
  border-radius: 8px;
  overflow: hidden;
}

/* --- Summary --- */
.sum {
  display: flex;
  gap: 40px;
  align-items: center;
  padding: 16px 24px 14px;
  font-size: 11px;
  color: #999;
  border-bottom: 1px solid #f0f2f5;
}

.sum .kv {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sum .kv .v { font-size: 14px; font-weight: 700; color: #444; }
.sum .kv .k { font-size: 10px; color: #bbb; }
.sum .sep { width: 1px; height: 14px; background: #e0e4ea; flex-shrink: 0; }

/* --- Table --- */
.tbl {
  width: 100%;
  border-collapse: collapse;
}

.tbl th {
  background: #f9fafb;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  padding: 9px 14px;
  text-align: left;
  border-bottom: 2px solid #e8ecf0;
}

.tbl th:first-child { padding-left: 24px; }
.tbl th:last-child { padding-right: 24px; }
.tbl th.rt { text-align: right; }

.tbl td {
  padding: 10px 14px;
  font-size: 13px;
  color: #444;
  border-bottom: 1px solid #f4f5f8;
}

.tbl td:first-child { padding-left: 24px; }
.tbl td:last-child { padding-right: 24px; }
.tbl td.rt { text-align: right; font-family: SF Mono, Consolas, monospace; font-size: 12px; }
.tbl td.cn { font-weight: 600; color: #333; }
.tbl tr.z td { background: #fafbfc; }

/* --- Grand Total --- */
.gt {
  margin: 10px 0 0;
  padding: 16px 24px;
  background: linear-gradient(135deg, #fef9ed, #fef7e4);
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 12px;
  border-top: 2px solid #f5d9a0;
}

.gt .gl { font-size: 10px; color: #999; font-weight: 600; }
.gt .gv { font-size: 22px; font-weight: 800; color: var(--color-primary); }

/* --- Notes --- */
.nt {
  padding: 20px 24px;
  font-size: 10px;
  color: #aaa;
  line-height: 2.2;
}

.nt .ni { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 4px; }
.nt .ico { flex-shrink: 0; width: 18px; text-align: center; font-size: 11px; }
.nt em { font-style: normal; color: #ccc; }

/* --- Domestic & Foreign Builder --- */
.builder {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
  border: 1px solid rgba(0,0,0,.04);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.builder h2 {
  font-size: 16px;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.builder-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 11px;
  color: #999;
  font-weight: 600;
}

.field input, .field select {
  -webkit-appearance: none;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  outline: none;
  text-align: left;
}

.field input:focus, .field select:focus {
  border-color: var(--color-primary);
}

.qty-inp { width: 80px; }
.goods-inp { width: 90px; }

.fee-preview, .fee-display {
  font-size: 14px;
  color: #999;
  padding: 10px 0;
  white-space: nowrap;
  min-width: 200px;
}

.fee-preview b, .fee-display b { color: #222; }
.fee-preview .extra, .fee-display .extra { color: #e67e22; font-size: 12px; }

.add-btn {
  padding: 10px 28px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.add-btn:hover { background: #8a1a26; }

.goods-info {
  font-size: 12px;
  color: #e67e22;
  margin-top: 6px;
  padding: 6px 12px;
  background: #fff8f0;
  border-radius: 6px;
  display: none;
}

/* --- Quote Wrap --- */
.quote-wrap {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.04);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.qt-empty {
  padding: 40px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

.qt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.qt-table th {
  background: #f9fafb;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid #e8ecf0;
}

.qt-table th.rt { text-align: right; }

.qt-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f4f5f8;
  vertical-align: middle;
}

.qt-table td.rt { text-align: right; font-family: SF Mono, Consolas, monospace; }
.qt-table .extra-row td { font-size: 12px; color: #e67e22; background: #fffdf8; }

.del-btn {
  background: none;
  border: none;
  color: #c62828;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  line-height: 1;
}

.del-btn:hover { opacity: .7; }

/* --- Other Costs --- */
.other-costs {
  margin-top: 8px;
  padding: 12px 20px;
  background: #fafbfc;
  border-top: 1px dashed #e0e4ea;
}

.other-costs h3 {
  font-size: 12px;
  color: #777;
  font-weight: 600;
  margin-bottom: 8px;
}

.other-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.other-row input {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 13px;
  outline: none;
}

.other-row input:focus { border-color: var(--color-primary); }

.other-row .oc-name { flex: 1; }
.other-row .oc-amt { width: 120px; text-align: right; }

.other-row .oc-del {
  background: none;
  border: none;
  color: #c62828;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
}

.other-total {
  text-align: right;
  font-size: 12px;
  color: #666;
  padding: 4px 0;
  font-weight: 600;
}

.other-add {
  padding: 5px 14px;
  background: none;
  border: 1px dashed var(--color-primary);
  color: var(--color-primary);
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

.other-add:hover { background: #fef5f5; }

/* --- Quote Summary --- */
.qt-summary {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 20px;
  border-top: 2px solid var(--color-primary);
  gap: 20px;
}

.qt-summary .info { font-size: 12px; color: #999; }
.qt-summary .total { font-size: 28px; font-weight: 700; color: var(--color-primary); }

/* --- Currency Bar --- */
.cur-bar {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 14px 12px 12px;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 10;
}

.cur-btn {
  padding: 8px 24px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  color: #666;
}

.cur-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.cur-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* --- Print --- */
@media print {
  body { background: #fff; }
  .hd, .header, .pc-login-bar, .ft, .card:not(.res), .nav, .login, #loginPage,
  .pbtn, .pc-ip, .pc-drop, .btn, .rh-overlay, .mh, .mnav, #pcCountryInput,
  #pcCountryDropdown, #pcErr, .ld { display: none !important; }
  .card.res { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; margin: 0; }
  .card.res h2 { display: none !important; }
  .print-hdr { display: block !important; text-align: center; padding: 24px 0 16px; border-bottom: 2px solid var(--color-primary); margin-bottom: 16px; }
  .print-hdr-company { font-size: 20px; font-weight: 700; color: var(--color-primary); letter-spacing: 1px; }
  .print-hdr-title { font-size: 14px; color: #555; margin-top: 6px; }
  .print-hdr-date { font-size: 11px; color: #999; margin-top: 4px; }
  .tbl { font-size: 12px; }
  .tbl th { background: var(--color-primary) !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .gt { font-size: 16px; }
  .sum { font-size: 12px; }
  #pcResultNote { font-size: 11px; }
}

/* Print header — hidden on screen, shown when printing */
.print-hdr { display: none; }
.print-hdr-company { font-size: 20px; font-weight: 700; color: var(--color-primary); letter-spacing: 1px; }
.print-hdr-title { font-size: 14px; color: #555; margin-top: 6px; }
.print-hdr-date { font-size: 11px; color: #999; margin-top: 4px; }

/* --- Responsive (calculator-specific) --- */
@media (max-width: 600px) {
  .card { padding: 16px; }
  .sum { flex-wrap: wrap; gap: 12px; }
  .tbl th, .tbl td { padding: 8px 10px; font-size: 11px; }
  .tbl td.rt { font-size: 10px; }
}
/* ============================================================
   madrid.css — Madrid Calculator Page-Specific Styles
   ============================================================ */

/* ===== Madrid Header ===== */
.header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  box-shadow: 0 2px 8px rgba(162, 31, 45, 0.3);
  position: relative;
  z-index: 10;
}
.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: rgba(196, 153, 88, .35);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.header-sub {
  font-size: 12px;
  opacity: .55;
  margin-top: 2px;
}
.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.header-btn {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
  white-space: nowrap;
}
.header-btn:hover {
  background: rgba(255, 255, 255, .22);
}
.header-user {
  font-size: 13px;
  opacity: .75;
  margin-right: 8px;
  white-space: nowrap;
}
.header-role {
  font-size: 11px;
  background: rgba(255, 255, 255, .12);
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: 4px;
}

/* ===== Mode Bar ===== */
.mode-bar {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 40px;
  position: relative;
  z-index: 9;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.mode-bar .header-mode {
  display: flex;
  gap: 2px;
  align-items: center;
}
.hm-label {
  font-size: 13px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  margin-right: 6px;
  padding: 3px 10px;
  background: #C49958;
  border-radius: 4px;
  white-space: nowrap;
}
.hm-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, .15);
  margin: 0 6px;
  flex-shrink: 0;
}
.hm-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .65);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: color .15s;
  white-space: nowrap;
  font-weight: 500;
}
.hm-btn:hover {
  color: #fff;
}
.hm-btn.active {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== Main App ===== */
.main-app { display: none; }

/* ===== App Layout ===== */
.app-layout {
  display: flex;
  height: calc(100vh - 92px);
  overflow: hidden;
}
.left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e4e6eb;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}
.right-panel {
  width: 360px;
  display: flex;
  flex-direction: column;
  background: #fff;
  flex-shrink: 0;
  overflow: hidden;
  align-self: stretch;
  min-height: 0;
}
.right-panel #normal-panel,
.right-panel #direct-quote,
.right-panel #assign-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.right-panel .sel-list,
.right-panel .direct-rates {
  min-height: 0;          /* 修复 flex 子元素无法收缩的问题 */
}

/* ===== Config Bar ===== */
.config-bar {
  padding: 8px 16px;
  background: #f8f9fb;
  border-bottom: 1px solid #e4e6eb;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.config-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.config-label {
  font-size: 14px;
  color: #555;
  white-space: nowrap;
  font-weight: 500;
}
.config-input {
  padding: 5px 7px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  outline: none;
  width: 54px;
  text-align: center;
  color: #222;
  font-weight: 600;
}
.config-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(162, 31, 45, .12);
}
.config-input.wide {
  width: 72px;
}
.config-btn {
  padding: 5px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
  background: #fff;
  color: #444;
  line-height: 1.5;
  font-weight: 500;
}
.config-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.config-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-weight: 600;
}
.config-divider {
  width: 1px;
  height: 22px;
  background: #d0d5dd;
}

/* ===== Customer Selector ===== */
.cu-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  background: #fafbfc;
  border-bottom: 1px solid #e4e6eb;
  font-size: 12px;
}
.cu-bar .cu-lbl {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
}
.cu-wrap {
  position: relative;
  flex: 1;
}
.cu-wrap input {
  width: 100%;
  padding: 3px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  background: #fff;
}
.cu-wrap input:focus {
  border-color: var(--color-primary);
}
.cu-dd {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

/* ===== Search Bar (Madrid-specific) ===== */
.madrid-view .search-bar {
  padding: 8px 16px;
  border-bottom: 1px solid #e4e6eb;
  position: relative;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.madrid-view .search-bar input {
  flex: 1;
  padding: 9px 10px 9px 34px;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  font-size: 15px;
  outline: none;
  background: #f8f9fb;
  transition: all .2s;
  color: #222;
}
.madrid-view .search-bar input:focus {
  background: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(162, 31, 45, .08);
}
.madrid-view .search-bar .icon {
  position: absolute;
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 14px;
  pointer-events: none;
}

/* ===== Quick Bar (Madrid-specific) ===== */
.madrid-view .quick-bar {
  padding: 5px 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid #e4e6eb;
  background: #fafbfc;
}
.madrid-view .quick-label {
  font-size: 14px;
  color: #888;
  margin-right: 2px;
  white-space: nowrap;
}
.madrid-view .quick-btn {
  padding: 5px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
  color: #444;
  white-space: nowrap;
  font-weight: 500;
}
.madrid-view .quick-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #fff5f5;
}

/* ===== Region Tabs (Madrid-specific) ===== */
.madrid-view .region-tabs {
  display: flex;
  border-bottom: 1px solid #e4e6eb;
  background: #fafbfc;
  overflow-x: auto;
  padding: 0 4px;
}
.madrid-view .region-tab {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  color: #777;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  margin: 0 1px;
  font-weight: 500;
}
.madrid-view .region-tab:hover {
  color: var(--color-primary);
  background: #fff5f5;
}
.madrid-view .region-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 700;
}

/* ===== Country List ===== */
.country-list {
  flex: 1;
  overflow-y: auto;
}
.country-list::-webkit-scrollbar {
  width: 4px;
}
.country-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.country-group-title {
  padding: 4px 16px;
  font-size: 13px;
  color: #999;
  background: #f5f6f8;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
  letter-spacing: 0.5px;
}
.country-item {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  cursor: pointer;
  transition: all .1s;
}
.country-item:hover {
  background: #f5f5ff;
}
.country-item.selected {
  background: #fff0f0;
}
.country-item .cb {
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
  margin-right: 6px;
}
.country-item.selected .cb {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.country-item.selected .cb::after {
  content: '\2713';
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}
.country-item .nm {
  font-size: 16px;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 0 40%;
}
.country-item .fh {
  font-size: 15px;
  color: #555;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  margin-left: 6px;
}
.country-item .badge {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 10px;
  background: #eee;
  color: #666;
  white-space: nowrap;
  font-weight: 500;
  flex-shrink: 0;
  margin-left: 3px;
}
.of-bdg {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
  line-height: 1.4;
}
.cn-alias {
  color: #555;
  font-size: 13px;
  font-weight: 500;
  margin-left: 2px;
}

/* ===== WIPO Badges ===== */
.country-item .wipobadge,
.sel-item .wipobadge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 8px;
  white-space: nowrap;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
}
.country-item .wipobadge.y,
.sel-item .wipobadge.y {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}
.country-item .wipobadge.n,
.sel-item .wipobadge.n {
  background: #fce4ec;
  color: #c62828;
  border: 1px solid #f8bbd0;
  letter-spacing: 0.3px;
}
.country-item .wipobadge.t,
.sel-item .wipobadge.t {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
  font-weight: 700;
}
.country-item .wipobadge.r,
.sel-item .wipobadge.r {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
  font-weight: 600;
}

/* ===== Direct Group Selectors ===== */
.d-group-sel {
  padding: 2px 6px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 11px;
  color: var(--color-primary);
  background: #fff;
  cursor: pointer;
  outline: none;
  margin: 0 6px;
}
.d-group-tag {
  font-size: 11px;
  color: var(--color-primary);
  background: #fff5f5;
  border: 1px solid #f8d0d0;
  border-radius: 4px;
  padding: 2px 8px;
  margin: 0 6px;
}

/* ===== Right Panel — Selected List ===== */
.sel-hdr {
  padding: 10px 16px;
  border-bottom: 1px solid #e4e6eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sel-hdr .t {
  font-size: 16px;
  font-weight: 600;
  color: #222;
}
.sel-hdr .c {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 19px;
}
.sel-hdr .clr {
  padding: 4px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #888;
  background: #fff;
}
.sel-hdr .clr:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.sel-src {
  padding: 5px 16px;
  border-bottom: 1px solid #e4e6eb;
}
.sel-src input {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  background: #fafbfc;
  color: #222;
}
.sel-src input:focus {
  border-color: var(--color-primary);
}
.sel-list {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 3px 16px;
  min-height: 0;
}
.sel-empty {
  text-align: center;
  padding: 30px;
  color: #ccc;
  font-size: 13px;
}
.sel-item {
  display: flex;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #eee;
  gap: 5px;
}
.sel-item .nm {
  flex: 1;
  font-size: 16px;
  color: #111;
}
.sel-item .fe {
  font-size: 15px;
  color: var(--color-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sel-item .sfee {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 700;
  margin-left: 3px;
  white-space: nowrap;
}
.sel-item .rm {
  width: 18px;
  height: 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sel-item .rm:hover {
  color: var(--color-primary);
}

/* ===== Increment Control ===== */
.inc-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin: 0 3px;
}
.inc-ctrl button {
  width: 18px;
  height: 20px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
}
.inc-ctrl button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.inc-inp {
  width: 28px;
  height: 20px;
  border: 1px solid #ccc;
  border-radius: 3px;
  text-align: center;
  font-size: 12px;
  outline: none;
  color: #222;
  font-weight: 600;
}
.inc-inp:focus {
  border-color: var(--color-primary);
}

/* ===== Quote Bar ===== */
.quote-bar {
  padding: 10px 16px;
  border-top: 1px solid #e4e6eb;
  background: #fafbfc;
  flex-shrink: 0;
}
.quote-summary {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.qi {
  text-align: center;
}
.qi .l {
  font-size: 12px;
  color: #888;
  margin-bottom: 1px;
}
.qi .v {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}
.qi .sv {
  font-size: 13px;
  color: #555;
}
.qi-btn {
  padding: 8px 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
  white-space: nowrap;
  align-self: flex-end;
}
.qi-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(162, 31, 45, .3);
}

/* ===== Assign Panel ===== */
.an-el {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.an-body {
  flex: 1;
  padding: 16px 16px;
  overflow-y: auto;
}
.an-card {
  background: #f8f9fb;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.an-card .big {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
}
.an-card .sm {
  font-size: 12px;
  color: #aaa;
}
.an-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}
.an-row .l {
  color: #666;
}
.an-row .v {
  font-weight: 600;
}
.an-total {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 4px;
  border-top: 2px solid var(--color-primary);
  margin-top: 4px;
}
.an-total .l {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
}
.an-total .v {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ===== Direct Mode ===== */
.direct-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.direct-left {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid #e4e6eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.direct-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Supplier Search (Direct Mode) ===== */
.supplier-search {
  padding: 5px 10px;
  border-bottom: 1px solid #e4e6eb;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.supplier-search input {
  width: 100%;
  padding: 4px 7px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 11px;
  outline: none;
  background: #f8f9fb;
}
.supplier-search input:focus {
  border-color: var(--color-primary);
}
.supplier-search .srow {
  display: flex;
  gap: 3px;
}
.supplier-search .srow input {
  flex: 1;
}

/* ===== Supplier List (Direct Mode) ===== */
.supplier-list {
  flex: 1;
  overflow-y: auto;
}
.supplier-item {
  padding: 7px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: all .1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.supplier-item:hover {
  background: #f5f5ff;
}
.supplier-item.active {
  background: #fff0f0;
  border-left: 3px solid var(--color-primary);
}
.supplier-item .sn {
  font-size: 14px;
  font-weight: 600;
  color: #222;
}
.supplier-item .sn .rtg {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  margin-left: 3px;
  vertical-align: middle;
}
.rtg-A { background: #e8f5e9; color: #2e7d32; }
.rtg-B { background: #fff8e1; color: #f57f17; }
.rtg-C { background: #ffebee; color: #c62828; }
.supplier-item .sc {
  font-size: 12px;
  color: #888;
  margin-top: 1px;
}
.supplier-acts {
  padding: 6px 12px;
  border-top: 1px solid #e4e6eb;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.supplier-acts button {
  padding: 5px 11px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  background: #fff;
  color: #444;
}
.supplier-acts button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ===== Direct Rate Table ===== */
.direct-tbar {
  padding: 6px 12px;
  border-bottom: 1px solid #e4e6eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}
.direct-tbar .tt {
  font-size: 14px;
  font-weight: 600;
}
.direct-tbar .st {
  font-size: 11px;
  color: #888;
}
.direct-rates {
  flex: 1;
  overflow-y: auto;
  padding: 3px 12px;
  position: relative;
}
.rate-group-title {
  padding: 5px 0 2px;
  font-size: 12px;
  color: #999;
  font-weight: 700;
  border-bottom: 1px solid #f0f0f0;
  margin-top: 4px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

/* ===== Direct Rate Cards ===== */
.dcard {
  border: 1px solid #e4e6eb;
  border-radius: 6px;
  margin: 5px 0;
  overflow: hidden;
  background: #fff;
}
.dcard-hdr {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  cursor: pointer;
  gap: 5px;
  background: #fafbfc;
  border-bottom: 1px solid #e4e6eb;
  user-select: none;
}
.dcard-hdr:hover {
  background: #f0f1f3;
}
.dcard-flag {
  font-size: 14px;
}
.dcard-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #222;
}
.dcard-total {
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 600;
}
.dcard-badge {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #eee;
  color: #888;
}
.dcard-badge2 {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #e8f5e9;
  color: #2e7d32;
}
.dcard-badge3 {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #e3f2fd;
  color: #1565c0;
}
.darrow {
  font-size: 10px;
  color: #999;
  width: 14px;
  text-align: center;
}
.dcard-body { }
.dcard-body.dcoll { display: none; }

/* ===== Direct Rate Groups ===== */
.dgroup {
  border: 1px solid #eef0f2;
  border-radius: 4px;
  margin: 4px 8px;
  overflow: hidden;
}
.dgroup-hdr {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  cursor: pointer;
  gap: 8px;
  background: #f8f9fa;
  border-bottom: 1px solid #eef0f2;
  user-select: none;
  font-size: 14px;
}
.dgroup-hdr:hover {
  background: #f0f1f3;
}
.dgroup-icon {
  font-size: 14px;
}
.dgroup-name {
  flex: 1;
  font-weight: 600;
  color: #333;
}
.dgroup-total {
  font-size: 15px;
  color: var(--color-primary);
  font-weight: 700;
}
.dgroup-body { }
.dgroup-body.dcoll { display: none; }
.dgroup-body .drate-row:last-child { border-bottom: none; }
.dgroup-add {
  text-align: center;
  padding: 4px;
  margin: 2px 8px;
  cursor: pointer;
  border: 1px dashed #ccc;
  border-radius: 4px;
  color: #888;
  font-size: 11px;
}
.dgroup-add:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #fff5f5;
}
.dgroup-add-item {
  text-align: center;
  padding: 3px;
  cursor: pointer;
  color: #888;
  font-size: 11px;
  border-top: 1px dashed #eee;
}
.dgroup-add-item:hover {
  color: var(--color-primary);
  background: #fff5f5;
}

/* ===== Mode Badges ===== */
.mode-badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
  margin: 0 1px;
  white-space: nowrap;
}
.mode-flat { background: #e8f5e9; color: #2e7d32; }
.mode-perClass { background: #e3f2fd; color: #1565c0; }
.mode-tiered { background: #fff3e0; color: #e65100; }
.mode-tieredN { background: #f3e5f5; color: #6a1b9a; }

/* ===== Icon Buttons ===== */
.btn-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1;
}
.btn-icon-sm:hover { background: #e0e0e0; }
.btn-icon-sm.del:hover { background: #ffebee; color: #c62828; }

/* ===== Direct Rate Rows ===== */
.drate-row {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  gap: 8px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 15px;
}
.drate-row:last-child { border-bottom: none; }
.drate-type { flex: 1; color: #444; }
.drate-amt {
  white-space: nowrap;
  color: var(--color-primary);
  font-weight: 600;
  margin-right: 5px;
}
.drate-model {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}
.drate-del {
  cursor: pointer;
  color: #ccc;
  font-size: 14px;
  padding: 0 3px;
}
.drate-del:hover { color: var(--color-primary); }
.drate-edit {
  cursor: pointer;
  color: #ccc;
  font-size: 14px;
  padding: 0 3px;
}
.drate-edit:hover { color: var(--color-primary); }
.drate-save {
  cursor: pointer;
  color: var(--color-primary);
  font-size: 14px;
  padding: 0 3px;
}
.drate-save:hover { color: #C49958; }
.drate-row.dr-editing {
  background: #fff8e1;
  gap: 3px;
  flex-wrap: wrap;
  padding: 5px 8px;
}
.drate-row.dr-editing .de-sel {
  padding: 2px 3px;
  border: 1px solid var(--color-primary);
  border-radius: 3px;
  font-size: 10px;
  outline: none;
  background: #fff;
}
.drate-row.dr-editing .de-num {
  padding: 2px 4px;
  border: 1px solid var(--color-primary);
  border-radius: 3px;
  font-size: 10px;
  width: 55px;
  text-align: right;
  outline: none;
}

/* ===== Direct Section Divider ===== */
.dsect { margin: 0; }
.dsect-hdr {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  background: #fafbfc;
  border-bottom: 1px solid #f0f0f0;
  color: #555;
}

/* ===== Rate Items ===== */
.rate-item {
  display: flex;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f5f5f5;
  gap: 5px;
}
.rate-item .rn { flex: 1; font-size: 13px; }
.rate-item .rf {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 600;
  white-space: nowrap;
}
.rate-item .rt { font-size: 11px; color: #888; }
.rate-item .rd {
  cursor: pointer;
  color: #ccc;
  font-size: 13px;
  padding: 0 3px;
}
.rate-item .rd:hover { color: var(--color-primary); }

.direct-empty {
  text-align: center;
  padding: 40px 20px;
  color: #bbb;
  font-size: 14px;
}

/* ===== Direct Toolbar Button ===== */
.tb-btn {
  cursor: pointer;
  font-size: 12px;
  color: #C49958;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}
.tb-btn:hover { background: rgba(196, 153, 88, .1); }

/* ===== Direct Rate History ===== */
.dhist {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 5;
  overflow-y: auto;
  padding: 10px 14px;
}
.dhist-hdr {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dhist-back {
  cursor: pointer;
  font-size: 12px;
  color: #888;
}
.dhist-back:hover { color: var(--color-primary); }
.dhist-item {
  padding: 6px 8px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 11px;
  line-height: 1.5;
}
.dhist-item:last-child { border-bottom: none; }
.dhist-action {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  font-weight: 600;
}
.dhist-create { background: #e8f5e9; color: #2e7d32; }
.dhist-update { background: #fff3e0; color: #e65100; }
.dhist-delete { background: #ffebee; color: #c62828; }
.dhist-empty {
  text-align: center;
  padding: 40px;
  color: #bbb;
  font-size: 13px;
}

/* ===== QE Bar (Quick Edit) ===== */
.qe-bar {
  padding: 6px 12px;
  border-bottom: 1px solid #e4e6eb;
  background: #f8f9fb;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.qe-bar select,
.qe-bar input {
  padding: 4px 7px;
  border: 1px solid #d0d5dd;
  border-radius: 3px;
  font-size: 12px;
  outline: none;
  background: #fff;
}
.qe-bar select:focus,
.qe-bar input:focus {
  border-color: var(--color-primary);
}
.qe-bar .qe-btn {
  padding: 4px 13px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.qe-bar .qe-btn:hover { background: var(--color-primary-dark); }
.qe-bar .qe-label {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}
.qe-bar input[type=number] { width: 52px; }

/* ===== Direct Hint ===== */
.dhint {
  padding: 6px 12px;
  background: #fff9e6;
  border-bottom: 1px solid #ffeeba;
  font-size: 12px;
  color: #856404;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== Currency Tag ===== */
.ccy-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  background: #eef;
  color: #55a;
}

/* ===== Supplier Modal ===== */
.sm-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.sm-hdr h2 {
  font-size: 17px;
  color: var(--color-primary);
}
.sm-body {
  display: flex;
  gap: 16px;
  min-height: 360px;
}
.sm-side {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid #eee;
  padding-right: 12px;
}
.sm-side .sml { list-style: none; }
.sm-side .sml li {
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
}
.sm-side .sml li:hover { background: #f5f5ff; }
.sm-side .sml li.active {
  background: #fff0f0;
  color: var(--color-primary);
  font-weight: 600;
}
.sm-main {
  flex: 1;
  overflow-y: auto;
}
.sm-field { margin-bottom: 8px; }
.sm-field label {
  font-size: 11px;
  color: #888;
  display: block;
  margin-bottom: 2px;
}
.sm-field input,
.sm-field select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
}
.sm-field input:focus,
.sm-field select:focus {
  border-color: var(--color-primary);
}
.sm-acts {
  margin-top: 12px;
  display: flex;
  gap: 6px;
}
.sm-acts button {
  padding: 5px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.sm-acts .ps {
  background: var(--color-primary);
  color: #fff;
  border: none;
}
.sm-acts .ps:hover { background: var(--color-primary-dark); }
.sm-acts .ps2 {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.sm-acts .ps2:hover { background: #fff5f5; }
.sm-acts .pd {
  background: #fff;
  color: #999;
  border: 1px solid #ddd;
}
.sm-acts .pd:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* ===== Combo Items ===== */
.combo-item {
  padding: 5px 8px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 1px solid #f0f0f0;
  transition: background .1s;
}
.combo-item:hover { background: #fff0f0; }
.combo-item.sel {
  background: #fff0f0;
  font-weight: 600;
  color: var(--color-primary);
}
.combo-item .c-en {
  font-size: 10px;
  color: #999;
  margin-left: 3px;
}

/* ===== Quote Modal ===== */
.qmodal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .45);
  z-index: 5000;
  justify-content: center;
  align-items: center;
}
.qmodal.show {
  display: flex;
}
.qmodal-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.qmodal-content {
  background: #fff;
  border-radius: 10px;
  width: 92%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 28px;
  position: relative;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .25);
  z-index: 1;
}
.qmodal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}
.qmodal-close:hover {
  background: #eee;
  color: var(--color-primary);
}

/* ===== Report (Madrid-specific overrides) ===== */
.madrid-view .rpt {
  font-size: 13px;
  line-height: 1.9;
}
.madrid-view .rpt-hdr {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--color-primary);
  margin-bottom: 18px;
}
.madrid-view .rpt-hdr h1 {
  font-size: 18px;
  color: var(--color-primary);
  margin-bottom: 6px;
}
.madrid-view .rpt-hdr .s {
  font-size: 10px;
  color: #999;
}
.madrid-view .rpt-customer {
  background: #fff5f5;
  border: 1px solid #ffd7d7;
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--color-primary);
  font-weight: 600;
}
.madrid-view .rpt-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 11px;
  color: #555;
}
.madrid-view .rpt-tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}
.madrid-view .rpt-tbl th {
  background: var(--color-primary);
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
}
.madrid-view .rpt-tbl td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
}
.madrid-view .rpt-tbl .n {
  text-align: right;
  font-family: Menlo, Consolas, monospace;
}
.madrid-view .rpt-sum {
  margin-top: 14px;
  padding: 16px 20px;
  background: #fff5f5;
  border-radius: 8px;
  border: 1px solid #ffd7d7;
}
.madrid-view .rpt-sum .r {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}
.madrid-view .rpt-sum .l {
  color: #555;
  font-size: 12px;
}
.madrid-view .rpt-sum .v {
  font-weight: 700;
  color: #222;
  font-size: 13px;
}
.madrid-view .rpt-sum .g {
  font-size: 18px;
  color: var(--color-primary);
  font-weight: 800;
}
.madrid-view .rpt-note {
  margin-top: 12px;
  padding: 10px 16px;
  background: #f9f9f9;
  border-radius: 5px;
  font-size: 11px;
  color: #555;
  line-height: 1.8;
}
.madrid-view .rpt-acts {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}
.madrid-view .rpt-acts button {
  padding: 5px 16px;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
.madrid-view .btp {
  background: var(--color-primary);
  color: #fff;
}
.madrid-view .btp:hover {
  background: var(--color-primary-dark);
}
.madrid-view .btc {
  background: #fff;
  color: var(--color-primary);
}
.madrid-view .btc:hover {
  background: #fff5f5;
}

/* ===== Madrid Responsive ===== */
/* (responsive overrides moved to bottom of file) */

/* ===== Modal Background (click-to-close overlay) ===== */
.mo-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 0;
}

/* ===== Quick Edit Button ===== */
.qe-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background .15s;
}

.qe-btn:hover {
  background: var(--color-primary-dark);
}

/* ===== History Panel (slide-in) ===== */
.history-panel {
  position: fixed;
  top: 50px;
  right: 0;
  width: 340px;
  height: calc(100vh - 50px);
  background: #fff;
  box-shadow: -3px 0 20px rgba(0,0,0,.1);
  z-index: 800;
  transform: translateX(100%);
  transition: transform .25s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.history-panel.open {
  transform: translateX(0);
}

.hist-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e4e6eb;
}

.hist-hdr .t {
  font-size: 14px;
  font-weight: 600;
}

.hist-hdr .cl {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 18px;
}

.hist-hdr .cl:hover {
  color: #A21F2D;
}

.hist-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 14px;
}

.hist-empty {
  text-align: center;
  padding: 30px;
  color: #bbb;
  font-size: 12px;
}

.hist-item {
  padding: 8px 12px;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all .12s;
}

.hist-item:hover {
  border-color: #A21F2D;
}

.hist-item .h1 {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.hist-item .h1 .n {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-item .h1 .d {
  font-size: 10px;
  color: #aaa;
  white-space: nowrap;
  margin-left: 8px;
}

.hist-item .h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #888;
}

.hist-item .h2 .amt {
  color: var(--color-primary);
  font-weight: 700;
  margin-right: 6px;
}

.hist-item .h2 .del {
  cursor: pointer;
  font-size: 13px;
  opacity: .5;
  transition: opacity .15s;
}

.hist-item .h2 .del:hover {
  opacity: 1;
}

/* ===== Supplier List in Modal ===== */
.sm-side .sml {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sm-side .sml li {
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
  transition: background .1s;
}

.sm-side .sml li:hover {
  background: #f5f5ff;
}

.sm-side .sml li.active {
  background: #fff0f0;
  color: var(--color-primary);
  font-weight: 600;
}

/* ===== Rate History Tabs ===== */
.rh-tab {
  transition: all .15s;
}

/* ===== Responsive: History Panel ===== */
@media (max-width: 768px) {
  .history-panel {
    width: 100%;
    right: -100%;
  }

  .history-panel.open {
    right: 0;
  }
}

/* ===== Madrid Responsive ===== */
@media (max-width: 1100px) {
  .config-bar {
    gap: 6px 10px;
  }
  .config-label {
    font-size: 12px;
  }
  .config-input {
    width: 36px;
  }
  .config-input.wide {
    width: 48px;
  }
  .config-btn {
    padding: 4px 10px;
    font-size: 12px;
  }
  .config-divider {
    height: 18px;
  }
  .hm-label {
    font-size: 11px;
    padding: 2px 6px;
  }
}

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 92px);
  }
  .left-panel {
    border-right: none;
    border-bottom: 1px solid #e4e6eb;
    max-height: none;
    overflow-y: visible;
    flex: 1;
  }
  .right-panel {
    width: 100%;
    max-height: none;
    flex: 0 0 auto;
  }
  .right-panel .quote-bar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .1);
  }
  .config-bar {
    padding: 6px 12px;
    gap: 6px 12px;
  }
  .config-input {
    width: 38px;
  }
  .config-input.wide {
    width: 50px;
  }
  .header-mode .hm-btn {
    font-size: 10px;
    padding: 2px 7px;
  }
  .hm-label {
    font-size: 11px;
    padding: 2px 6px;
  }
  .hm-divider {
    height: 14px;
  }
  .qi-btn {
    padding: 5px 14px;
    font-size: 12px;
  }
  .direct-left {
    width: 200px;
  }
  .history-panel {
    width: 100%;
  }
  .region-tab {
    padding: 8px 10px;
    font-size: 12px;
  }
  .quick-btn {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 40px;
  }
  .country-item {
    padding: 6px 16px;
    min-height: 40px;
  }
  .sel-item {
    padding: 8px 0;
    min-height: 40px;
  }
  .sel-item .nm {
    font-size: 13px;
  }
  .sel-item .fe {
    font-size: 12px;
  }
  .sel-item .sfee {
    font-size: 11px;
  }
  .inc-inp {
    width: 32px;
    font-size: 13px;
  }
  .inc-ctrl button {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .rpt-tbl th,
  .rpt-tbl td {
    font-size: 11px;
    padding: 4px 6px;
  }
  .rpt-sum {
    padding: 10px 14px;
  }
}

@media (max-width: 500px) {
  .left-panel,
  .right-panel {
    max-height: none;
  }
  .right-panel .quote-bar {
    position: static;
  }
  .header {
    padding: 0 6px;
    height: 42px;
  }
  .header-logo {
    font-size: 13px;
  }
  .header-sub {
    font-size: 11px;
  }
  .header-btn {
    padding: 5px 8px;
    font-size: 11px;
    min-height: 36px;
  }
  .config-bar {
    padding: 6px 8px;
    gap: 4px 6px;
  }
  .config-label {
    font-size: 11px;
  }
  .config-input {
    width: 36px;
    font-size: 13px;
    padding: 5px 3px;
  }
  .config-input.wide {
    width: 44px;
  }
  .config-btn {
    padding: 6px 10px;
    font-size: 11px;
    min-height: 36px;
  }
  .quick-btn {
    padding: 5px 10px;
    font-size: 11px;
    min-height: 36px;
  }
  .region-tab {
    padding: 7px 12px;
    font-size: 11px;
  }
  .country-item {
    padding: 8px 10px;
    min-height: 40px;
  }
  .country-item .nm {
    font-size: 13px;
  }
  .country-item .fh {
    font-size: 11px;
  }
  .country-group-title {
    padding: 4px 12px;
    font-size: 11px;
  }
  .sel-hdr {
    padding: 8px 10px;
  }
  .sel-hdr .t {
    font-size: 12px;
  }
  .sel-list {
    padding: 3px 10px;
  }
  .sel-item {
    padding: 7px 0;
    min-height: 40px;
  }
  .sel-item .nm {
    font-size: 12px;
  }
  .sel-item .fe {
    font-size: 12px;
  }
  .sel-item .sfee {
    font-size: 11px;
  }
  .sel-item .wipobadge {
    font-size: 11px;
    padding: 1px 5px;
  }
  .sel-src {
    padding: 3px 10px;
  }
  .sel-src input {
    font-size: 12px;
    padding: 5px 8px;
  }
  .inc-inp {
    width: 30px;
    font-size: 12px;
  }
  .inc-ctrl button {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .rpt-hdr h1 {
    font-size: 15px;
  }
  .rpt-meta {
    font-size: 11px;
    gap: 8px;
  }
  .rpt-tbl th,
  .rpt-tbl td {
    font-size: 11px;
    padding: 4px 6px;
  }
  .rpt-sum .g {
    font-size: 16px;
  }
  .rpt-acts button {
    padding: 5px 10px;
    font-size: 11px;
    min-height: 36px;
  }
  .login-card {
    padding: 20px 16px;
    width: 92%;
  }
  .login-card h1 {
    font-size: 17px;
  }
  .toast {
    font-size: 11px;
  }
  .qi-btn {
    padding: 9px 20px;
    font-size: 13px;
    min-height: 40px;
  }
  .qi .v {
    font-size: 14px;
  }
}

@media (max-width: 380px) {
  .header {
    padding: 0 4px;
    height: 40px;
  }
  .header-logo {
    font-size: 12px;
  }
  .header-btn {
    padding: 4px 6px;
    font-size: 11px;
    min-height: 32px;
  }
  .header-user {
    font-size: 11px;
  }
  .quick-btn {
    font-size: 11px;
    padding: 4px 8px;
    min-height: 32px;
  }
  .region-tab {
    font-size: 11px;
    padding: 6px 10px;
  }
  .hm-btn {
    font-size: 11px;
    padding: 3px 6px;
  }
  .hm-label {
    font-size: 11px;
    padding: 1px 4px;
  }
  .hm-divider {
    height: 12px;
    margin: 0 2px;
  }
  .config-input {
    width: 32px;
    font-size: 13px;
  }
  .config-input.wide {
    width: 40px;
  }
  .config-btn {
    font-size: 11px;
    padding: 5px 8px;
    min-height: 32px;
  }
  .mode-bar {
    height: 34px;
  }
}
/* ============================================================
   admin.css — Admin Panel, User Form, Rate History, Audit Log
   ============================================================ */

/* ===== User Form Modal ===== */
.uf-overlay { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.35); z-index:2000; align-items:center; justify-content:center; }
.uf-overlay.show { display:flex; }
.uf-box { background:var(--color-card); border-radius:8px; width:360px; max-width:92vw; box-shadow:0 8px 30px rgba(0,0,0,.15); padding:20px; }
.uf-box h3 { font-size:15px; color:var(--color-primary); margin:0 0 14px; }
.uf-field { margin-bottom:12px; }
.uf-field label { display:block; font-size:12px; color:var(--color-text-secondary); margin-bottom:3px; }
.uf-field input,.uf-field select { width:100%; padding:8px 11px; border:1px solid #d0d5dd; border-radius:4px; font-size:14px; outline:none; box-sizing:border-box; }
.uf-field input:focus,.uf-field select:focus { border-color:var(--color-primary); }
.uf-field .pw-wrap { position:relative; }
.uf-field .pw-wrap input { padding-right:40px; }
.uf-field .pw-wrap .pw-toggle { position:absolute; right:8px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; font-size:16px; padding:4px; line-height:1; color:var(--color-text-muted); }
.uf-field .pw-wrap .pw-toggle:hover { color:var(--color-primary); }
.uf-acts { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }
.uf-acts button { padding:7px 18px; border-radius:4px; font-size:12px; cursor:pointer; border:1px solid #d0d5dd; background:var(--color-card); }
.uf-acts .uf-save { background:var(--color-primary); color:#fff; border-color:var(--color-primary); }
.uf-acts .uf-save:hover { background:#8a1924; }

/* ===== Rate History Modal ===== */
.rh-overlay { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.45); z-index:2000; align-items:center; justify-content:center; }
.rh-overlay.show { display:flex; }
.rh-box { background:var(--color-card); border-radius:10px; width:820px; max-width:94vw; max-height:92vh; overflow:hidden; display:flex; flex-direction:column; box-shadow:0 12px 48px rgba(0,0,0,.2); }
.rh-head { display:flex; justify-content:space-between; align-items:center; padding:14px 20px; border-bottom:1px solid var(--color-border); }
.rh-head h2 { font-size:17px; color:var(--color-primary); }
.rh-close { border:none; background:none; color:var(--color-text-muted); font-size:20px; cursor:pointer; padding:4px 8px; border-radius:4px; }
.rh-close:hover { background:var(--color-border-light); color:var(--color-primary); }
.rh-tabs { display:flex; border-bottom:1px solid #ddd; background:#f5f5f5; padding:0 14px; gap:0; }
.rh-tab { padding:10px 18px; font-size:13px; cursor:pointer; border:none; background:none; color:#777; border-bottom:2px solid transparent; transition:all .12s; }
.rh-tab:hover { color:var(--color-primary); background:#fff0f0; }
.rh-tab.active { color:var(--color-primary); border-bottom-color:var(--color-primary); font-weight:600; background:var(--color-card); }
.rh-panel { flex:1; overflow-y:auto; padding:16px 20px; }
.rh-panel-hd, .rh-global-ctrl, .rh-comp-ctrl { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:14px; align-items:flex-end; }
.rh-sel-row { display:flex; align-items:center; gap:6px; }
.rh-sel-row label { font-size:12px; color:#555; white-space:nowrap; }
.rh-sel-row select, .rh-sel-row input[type=text] { padding:6px 10px; border:1px solid #d0d5dd; border-radius:4px; font-size:13px; outline:none; min-width:130px; }
.rh-sel-row select:focus, .rh-sel-row input:focus { border-color:var(--color-primary); }
.rh-sel-stretch { flex:1; }
.rh-sel-stretch input { width:100%; min-width:auto; }
.rh-chart-wrap { background:var(--color-hover); border-radius:6px; border:1px solid var(--color-border); padding:12px; margin-bottom:10px; }
.rh-chart-empty { text-align:center; padding:40px 20px; color:#bbb; font-size:13px; }
.rh-timeline-wrap { margin-top:8px; }
.rh-tl-item { display:flex; align-items:flex-start; gap:10px; padding:8px 10px; border-radius:4px; margin-bottom:3px; font-size:12px; }
.rh-tl-item:hover { background:#f8f9fb; }
.rh-tl-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; margin-top:5px; }
.rh-tl-dot.create { background:#2EBB59; }
.rh-tl-dot.update { background:#FA8C16; }
.rh-tl-dot.delete { background:#E8522D; }
.rh-tl-body { flex:1; min-width:0; }
.rh-tl-body .tl-main { display:flex; justify-content:space-between; gap:6px; }
.rh-tl-body .tl-action { font-weight:600; }
.rh-tl-body .tl-action.create { color:#2EBB59; }
.rh-tl-body .tl-action.update { color:#FA8C16; }
.rh-tl-body .tl-action.delete { color:#E8522D; }
.rh-tl-body .tl-detail { color:#555; }
.rh-tl-body .tl-detail .old { color:var(--color-text-muted); text-decoration:line-through; margin-right:4px; }
.rh-tl-body .tl-detail .new { color:var(--color-primary); font-weight:600; }
.rh-tl-body .tl-who { color:#aaa; font-size:11px; margin-top:1px; }
.rh-global-item { padding:8px 12px; border:1px solid #eee; border-radius:5px; margin-bottom:5px; font-size:12px; display:flex; justify-content:space-between; align-items:center; }
.rh-global-item:hover { border-color:#ddd; }
.rh-global-item .gi-left { flex:1; min-width:0; }
.rh-global-item .gi-left .gi-sup { font-weight:600; }
.rh-global-item .gi-left .gi-det { color:var(--color-text-secondary); margin:2px 0; }
.rh-global-item .gi-left .gi-who { color:#aaa; font-size:11px; }
.rh-global-item .gi-right { text-align:right; flex-shrink:0; margin-left:10px; }
.rh-hint { text-align:center; padding:30px; color:#bbb; font-size:13px; }
.rh-comp-sup-list { display:flex; flex-wrap:wrap; gap:6px; }
.rh-comp-sup-item { padding:5px 12px; border:1px solid #d0d5dd; border-radius:14px; font-size:12px; cursor:pointer; transition:all .12s; user-select:none; }
.rh-comp-sup-item:hover { border-color:var(--color-primary); }
.rh-comp-sup-item.selected { background:var(--color-primary); color:#fff; border-color:var(--color-primary); }
.rh-comp-table-wrap { overflow-x:auto; }
.rh-comp-table { width:100%; border-collapse:collapse; font-size:13px; }
.rh-comp-table th { background:#f5f5f5; padding:8px 12px; text-align:left; font-weight:600; color:#555; border:1px solid var(--color-border); white-space:nowrap; }
.rh-comp-table td { padding:7px 12px; border:1px solid var(--color-border); }
.rh-comp-table .sup-header { background:var(--color-primary); color:#fff; font-weight:600; text-align:center; }
.rh-comp-table .fee-type { font-weight:600; color:#555; white-space:nowrap; }
.rh-comp-table .no-data { color:#bbb; text-align:center; }

/* ===== History Panel ===== */
.history-panel { position:fixed; top:50px; right:0; width:340px; height:calc(100vh - 50px); background:var(--color-card); box-shadow:-3px 0 20px rgba(0,0,0,.1); z-index:800; transform:translateX(100%); transition:transform .25s; overflow:hidden; display:flex; flex-direction:column; }
.history-panel.open { transform:translateX(0); }
.hist-hdr { padding:12px 16px; border-bottom:1px solid var(--color-border); display:flex; justify-content:space-between; align-items:center; }
.hist-hdr .t { font-size:14px; font-weight:600; }
.hist-hdr .cl { border:none; background:none; color:var(--color-text-muted); cursor:pointer; font-size:18px; }
.hist-hdr .cl:hover { color:var(--color-primary); }
.hist-list { flex:1; overflow-y:auto; padding:6px 14px; }
.hist-item { padding:8px 12px; border:1px solid #eee; border-radius:6px; margin-bottom:6px; cursor:pointer; transition:all .12s; }
.hist-item:hover { border-color:var(--color-primary); }
.hist-item .h1 { display:flex; justify-content:space-between; font-size:13px; margin-bottom:2px; color:var(--color-text); }
.hist-item .h1 .n { font-weight:600; }
.hist-item .h1 .d { color:var(--color-text-muted); font-size:11px; }
.hist-item .h2 { font-size:12px; color:var(--color-text-secondary); display:flex; justify-content:space-between; }
.hist-item .h2 .amt { color:var(--color-primary); font-weight:700; }
.hist-item .del { color:#ccc; cursor:pointer; font-size:11px; margin-left:6px; }
.hist-item .del:hover { color:var(--color-primary); }
.hist-empty { text-align:center; padding:30px; color:#bbb; font-size:12px; }

/* ===== Admin Panel ===== */
.admin-panel { display:none; position:fixed; top:50px; left:0; width:100%; height:calc(100vh - 50px); background:var(--color-card); z-index:700; overflow:hidden; flex-direction:column; }
.admin-panel.open { display:flex; }
.admin-hdr { padding:12px 20px; border-bottom:1px solid var(--color-border); display:flex; justify-content:space-between; align-items:center; background:var(--color-hover); }
.admin-hdr .t { font-size:16px; font-weight:600; color:var(--color-primary); }
.admin-hdr .cl { border:none; background:none; color:var(--color-text-muted); cursor:pointer; font-size:18px; }
.admin-hdr .cl:hover { color:var(--color-primary); }
.admin-tabs { display:flex; border-bottom:1px solid #ddd; background:#f5f5f5; padding:0 10px; }
.admin-tab { padding:8px 16px; font-size:12px; cursor:pointer; border:none; background:none; color:var(--color-text-secondary); border-bottom:2px solid transparent; }
.admin-tab:hover { color:var(--color-primary); background:#fff0f0; }
.admin-tab.active { color:var(--color-primary); border-bottom-color:var(--color-primary); font-weight:600; background:var(--color-card); }
.admin-body { flex:1; overflow-y:auto; padding:16px 20px; }
.admin-table { width:100%; border-collapse:collapse; font-size:13px; }
.admin-table th { background:#f5f5f5; padding:8px 10px; text-align:left; font-weight:600; color:#555; border-bottom:1px solid #ddd; }
.admin-table td { padding:7px 10px; border-bottom:1px solid #eee; }
.admin-table .role-badge { display:inline-block; padding:2px 9px; border-radius:3px; font-size:11px; font-weight:600; }
.role-admin { background:#ffebee; color:#c62828; }
.role-editor { background:#e3f2fd; color:#1565c0; }
.role-viewer { background:#f3e5f5; color:#7b1fa2; }
.role-subadmin { background:#fff3e0; color:#e65100; }
.role-member { background:#e8f5e9; color:#2e7d32; }
.role-regional { background:#e3f2fd; color:#1565c0; }
.role-territory { background:#fce4ec; color:#c62828; }
.role-nonmember { background:#f5f5f5; color:var(--color-text-muted); }

/* ===== Audit Log ===== */
.audit-filter { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; align-items:center; }
.audit-filter select,.audit-filter input { padding:6px 9px; border:1px solid #d0d5dd; border-radius:4px; font-size:12px; outline:none; background:#f8f9fb; }
.audit-filter select:focus,.audit-filter input:focus { border-color:var(--color-primary); }
.audit-filter button { padding:6px 16px; border:1px solid var(--color-primary); border-radius:4px; font-size:12px; cursor:pointer; background:var(--color-primary); color:#fff; font-weight:600; }
.audit-filter button:hover { background:var(--color-primary-dark); }
.audit-badge { display:inline-block; padding:2px 7px; border-radius:3px; font-size:10px; font-weight:600; white-space:nowrap; }
.audit-badge.login { background:#e8f5e9; color:#2e7d32; }
.audit-badge.logout { background:#f3e5f5; color:#7b1fa2; }
.audit-badge.config_update { background:#e3f2fd; color:#1565c0; }
.audit-badge.supplier_create,.audit-badge.supplier_update { background:#e8f5e9; color:#2e7d32; }
.audit-badge.supplier_delete,.audit-badge.rate_delete,.audit-badge.quote_delete,.audit-badge.user_delete,.audit-badge.rate_history_delete { background:#ffebee; color:#c62828; }
.audit-badge.rate_create,.audit-badge.rate_update { background:#fff3e0; color:#e65100; }
.audit-badge.user_create,.audit-badge.user_update { background:#e3f2fd; color:#1565c0; }
.audit-badge.quote_save { background:#fce4ec; color:#880e4f; }
.audit-badge.country_update { background:#e0f7fa; color:#00695c; }
.audit-badge.rate_history_clear { background:#ffebee; color:#b71c1c; }
.audit-badge.system_init { background:#f5f5f5; color:#555; }
.audit-detail { max-width:400px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; font-size:12px; color:#555; }
.audit-detail:hover { color:var(--color-primary); }
.audit-detail.exp { white-space:normal; word-break:break-all; max-width:600px; background:var(--color-hover); padding:4px 8px; border-radius:3px; }
.audit-pager { display:flex; align-items:center; gap:8px; margin-top:10px; font-size:13px; }
.audit-pager button { padding:4px 12px; border:1px solid #d0d5dd; border-radius:4px; cursor:pointer; font-size:12px; background:var(--color-card); color:#444; }
.audit-pager button:hover { border-color:var(--color-primary); color:var(--color-primary); }
.audit-pager button:disabled { opacity:.4; cursor:default; }
.audit-pager .info { color:#888; }
.audit-count { font-size:13px; color:#888; margin-bottom:10px; }

/* ===== Admin Controls ===== */
.adm-btn { padding:4px 12px; border:1px solid #ddd; border-radius:3px; cursor:pointer; font-size:12px; background:var(--color-card); color:#444; }
.adm-btn:hover { border-color:var(--color-primary); color:var(--color-primary); }
.adm-input { padding:5px 9px; border:1px solid #d0d5dd; border-radius:4px; font-size:13px; outline:none; }
.adm-input:focus { border-color:var(--color-primary); }
.adm-pg { display:flex; align-items:center; gap:8px; margin-top:10px; font-size:12px; }

/* ===== Config Form ===== */
#configForm .fld { margin-bottom:12px; }
#configForm .fld input { max-width:300px; }

/* ===== Modal Titles ===== */
#userModalTitle, #custModalTitle, #supModalTitle { font-size:16px; color:var(--color-primary); }

/* ===== Password Hint ===== */
#uPassword::placeholder { color:#ccc; font-size:12px; }
/* ============================================================
   report.css — Report / Quote Modal Styles
   ============================================================ */

/* --- Report Container --- */
.rpt {
  font-size: 13px;
  line-height: 1.9;
}

.rpt-hdr {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--color-primary);
  margin-bottom: 18px;
}

.rpt-hdr h1 {
  font-size: 18px;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.rpt-hdr .s {
  font-size: 10px;
  color: #999;
}

/* --- Report Customer --- */
.rpt-customer {
  background: #fff5f5;
  border: 1px solid #ffd7d7;
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--color-primary);
  font-weight: 600;
}

.rpt-customer .l {
  font-weight: 400;
  font-size: 11px;
  color: #999;
}

/* --- Report Meta --- */
.rpt-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 11px;
  color: #555;
}

/* --- Report Table --- */
.rpt-tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.rpt-tbl th {
  background: var(--color-primary);
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
}

.rpt-tbl td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
}

.rpt-tbl .n {
  text-align: right;
  font-family: Menlo, Consolas, monospace;
}

/* --- Report Summary --- */
.rpt-sum {
  margin-top: 14px;
  padding: 16px 20px;
  background: #fff5f5;
  border-radius: 8px;
  border: 1px solid #ffd7d7;
}

.rpt-sum .r {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.rpt-sum .l {
  color: #555;
  font-size: 12px;
}

.rpt-sum .v {
  font-weight: 700;
  color: #222;
  font-size: 13px;
}

.rpt-sum .g {
  font-size: 18px;
  color: var(--color-primary);
  font-weight: 800;
}

/* --- Report Notes --- */
.rpt-note {
  margin-top: 12px;
  padding: 10px 16px;
  background: #f9f9f9;
  border-radius: 5px;
  font-size: 11px;
  color: #555;
  line-height: 1.8;
}

/* --- Report Footer --- */
.rpt-ft {
  font-size: 10px;
  color: #999;
  text-align: center;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

/* --- Report Actions --- */
.rpt-acts {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.rpt-acts button {
  padding: 5px 16px;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

/* --- Report Action Buttons --- */
.btp {
  background: var(--color-primary);
  color: #fff;
}

.btp:hover {
  background: var(--color-primary-dark);
}

.btc {
  background: #fff;
  color: var(--color-primary);
}

.btc:hover {
  background: #fff5f5;
}
/* ============================================================
   OA 综合首页样式
   oa-home.css — OA 办公门户首页专用样式
   依赖 variables.css 中定义的 CSS 自定义属性
   ============================================================ */

/* ===== 页面容器 ===== */
.oa-home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  font-family: var(--font-family);
  color: var(--color-text);
}

/* ===== 顶部 Header ===== */
.oa-header {
  background: var(--color-primary-gradient);
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.oa-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.oa-header-logo {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.oa-header-title {
  font-size: 14px;
  opacity: 0.9;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.oa-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.oa-header-user {
  font-size: 14px;
  font-weight: 500;
}

.oa-header-role {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-tag);
}

.oa-header-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 5px 14px;
  border-radius: var(--radius-button);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: var(--font-family);
}

.oa-header-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ===== 欢迎区域 ===== */
.oa-welcome {
  text-align: center;
  padding: 50px 20px 30px;
}

.oa-welcome-title {
  font-size: 28px;
  color: var(--color-text);
  margin: 0 0 8px;
  font-weight: 700;
}

.oa-welcome-subtitle {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ===== 系统卡片网格 ===== */
.oa-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 0 40px 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* ===== 卡片基础样式 ===== */
.oa-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
  border: 1px solid var(--color-border-light);
  text-decoration: none;
  color: inherit;
}

/* 可用卡片 — 可点击 + hover 上浮 */
.oa-card--active {
  cursor: pointer;
}

.oa-card--active:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 不可用卡片 — 半透明、灰色调、禁止点击 */
.oa-card--disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.oa-card--disabled:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

/* ===== 卡片图标 ===== */
.oa-card-icon {
  font-size: 36px;
  line-height: 1;
}

/* ===== 卡片主体 ===== */
.oa-card-body {
  flex: 1;
}

.oa-card-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 6px;
}

.oa-card-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ===== 状态标签 ===== */
.oa-card-status {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}

.oa-card-status--active {
  background: rgba(46, 125, 50, 0.1);
  color: var(--color-success);
}

.oa-card-status--coming {
  background: var(--color-border);
  color: var(--color-text-muted);
}

/* ===== 底部 Footer ===== */
.oa-footer {
  text-align: center;
  padding: 20px;
  margin-top: auto;
}

.oa-footer p {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0;
}

/* ===== 响应式 — 小屏单列 ===== */
@media (max-width: 768px) {
  .oa-cards {
    grid-template-columns: 1fr;
    padding: 0 16px 30px;
  }

  .oa-welcome {
    padding: 30px 16px 20px;
  }

  .oa-welcome-title {
    font-size: 22px;
  }

  .oa-header {
    padding: 8px 12px;
  }

  .oa-header-title {
    display: none;
  }
}
/* ============================================================
   responsive.css — Mobile Responsive Styles
   Consolidated from common.css, index.css, single.css,
   domestic.css, foreign-to-china.css
   ============================================================ */


/* ===== Mobile Country Search (hide grid, show search only) ===== */
@media (max-width: 600px) {
  .pc-grid-card,
  .pc-quick-card { display: none !important; }
  .pc-mobile-search { display: block !important; }
  .pc-grid-card.has-results { display: block !important; }
}
@media (min-width: 601px) {
  .pc-mobile-search { display: none !important; }
}


/* ===== @media (max-width: 640px) — Builder Row Responsive ===== */
@media (max-width: 640px) {
  .builder-row {
    flex-direction: column;
  }
  .builder-row .combo-wrap {
    width: 100% !important;
  }
  .builder-row .qty-inp,
  .builder-row .goods-inp {
    width: 100%;
  }
  .builder-row input,
  .builder-row select,
  .combo-wrap input {
    text-align: left !important;
  }
  .builder-row .field {
    width: 100% !important;
    min-width: 0 !important;
  }
  .builder-row .field input,
  .builder-row .field select,
  .builder-row .field .combo-wrap {
    width: 100% !important;
  }
}

/* ===== @media (max-width: 768px) — Comprehensive Mobile ===== */
@media (max-width: 768px) {
  /* --- Common Header --- */
  .hdr {
    padding: 8px 10px;
    flex-wrap: wrap;
  }
  .hdr .logo {
    font-size: 15px;
  }
  .hdr .nav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .header-mode {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 4px 8px;
  }
  .mode-bar {
    overflow-x: auto;
  }

  /* --- Public Calc Header --- */
  .hd h1 {
    font-size: 17px;
  }
  .hd .sub {
    font-size: 11px;
  }
  .bd {
    padding: 0 8px;
    margin-top: -4px;
  }

  /* --- Cards --- */
  .card {
    margin: 8px 10px;
    padding: 12px;
  }
  .card h2 {
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 6px;
  }

  /* --- Country Search Input --- */
  .cinput {
    padding: 12px 14px;
    font-size: 16px;
    min-height: 44px;
  }
  .cdd .it {
    padding: 10px 12px;
    font-size: 14px;
    min-height: 44px;
  }
  .cdd .it .ck {
    width: 18px;
    height: 18px;
  }

  /* --- Tags --- */
  .tags {
    gap: 4px;
    margin-top: 8px;
  }
  .tag {
    padding: 5px 8px 5px 10px;
    font-size: 12px;
    min-height: 36px;
  }
  .tag .x {
    font-size: 16px;
    padding: 2px;
  }

  /* --- Form Row → Column --- */
  .row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .fld input,
  .fld select {
    width: 100%;
    padding: 11px 12px;
    font-size: 16px;
    min-height: 44px;
  }
  .field {
    width: 100%;
  }
  .combo-wrap {
    width: 100% !important;
  }

  /* --- Buttons --- */
  .btn {
    width: 100%;
    padding: 13px 24px;
    font-size: 16px;
    min-height: 44px;
  }
  .pbtn {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
    padding: 11px 24px;
    font-size: 14px;
    min-height: 44px;
  }

  /* --- Result Summary --- */
  .sum {
    gap: 12px 20px;
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .sum .kv .v {
    font-size: 13px;
  }

  /* --- Filter Bar --- */
  .fbar {
    flex-direction: column;
  }
  .fbar input,
  .fbar select {
    width: 100% !important;
  }

  /* --- Tables --- */
  table {
    font-size: 11px;
  }
  th,
  td {
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
  }
  .rbody {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tbl {
    min-width: 420px;
  }
  .tbl th,
  .tbl td {
    padding: 8px 10px;
    font-size: 11px;
  }
  .tbl th:first-child,
  .tbl td:first-child {
    padding-left: 16px;
  }
  .tbl td.rt {
    font-size: 11px;
  }

  /* --- Grand Total --- */
  .gt {
    padding: 10px 16px;
  }
  .gt .gv {
    font-size: 18px;
  }

  /* --- Notes --- */
  .nt {
    padding: 10px 16px;
    font-size: 11px;
  }
  .nt .ni {
    line-height: 1.8;
  }

  /* --- Footer --- */
  .ft {
    padding: 16px 0 24px;
    font-size: 11px;
  }

  /* --- Country Grid --- */
  .pc-country-grid,
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    max-height: 280px;
  }

  /* --- Modal --- */
  .mo-in {
    width: 98%;
    max-height: 90vh;
  }
  .mc {
    width: 95%;
    max-height: 85vh;
  }

  /* --- Other Costs --- */
  .other-row {
    flex-direction: column;
  }
  .oc-name,
  .oc-amt {
    width: 100%;
  }

  /* --- Currency Bar --- */
  .cur-bar {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .cur-btn {
    flex-shrink: 0;
  }

  /* --- Quick Bar --- */
  .quick-bar {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .quick-btn {
    flex-shrink: 0;
  }

  /* --- Region Tabs --- */
  .region-tabs {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .reg-tab {
    flex-shrink: 0;
  }

  /* --- Report Meta --- */
  .rpt-meta {
    flex-direction: column;
    gap: 4px;
  }

  /* --- Admin Tabs --- */
  .admin-tabs {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .atab {
    flex-shrink: 0;
  }

  /* --- Login --- */
  .login-card {
    width: 90%;
    padding: 24px 20px;
  }
  .login-card h1 {
    font-size: 18px;
  }
  .login-card input {
    padding: 12px 14px;
    font-size: 16px;
  }
  .login-card button {
    padding: 13px;
    font-size: 16px;
  }

  /* --- Loading --- */
  .ld {
    padding: 24px;
    font-size: 13px;
  }

  /* --- Quote Summary --- */
  .qt-summary {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }
  .qt-summary .total {
    margin-left: 0;
    text-align: right;
    font-size: 22px;
  }
  .qt-summary .info {
    font-size: 11px;
  }

  /* --- Quote Wrap Table on Mobile --- */
  .quote-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .qt-table {
    min-width: 500px;
  }

  /* --- Result Meta --- */
  .res-meta {
    flex-direction: column;
    gap: 8px;
  }
}

/* ===== @media (max-width: 600px) — Simple Responsive ===== */
@media (max-width: 600px) {
  .card {
    padding: 16px;
  }
  .sum {
    flex-wrap: wrap;
    gap: 12px;
  }
  .tbl th,
  .tbl td {
    padding: 8px 10px;
    font-size: 11px;
  }
  .tbl td.rt {
    font-size: 10px;
  }
  .pc-country-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== @media (max-width: 500px) — Small Phones ===== */
@media (max-width: 500px) {
  .pc-country-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .hd h1,
  .hdr .logo {
    font-size: 14px;
  }

  .card h2,
  .builder h2 {
    font-size: 14px;
  }

  .btn {
    padding: 8px 20px;
    font-size: 13px;
  }
}

/* ===== @media (max-width: 480px) — Topnav ===== */
@media (max-width: 480px) {
  .topnav a {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* ===== @media (max-width: 400px) — Very Small Screens ===== */
@media (max-width: 400px) {
  .hd h1 {
    font-size: 15px;
  }
  .card {
    padding: 14px 10px;
  }
  .tbl {
    min-width: 350px;
  }
  .tbl th,
  .tbl td {
    padding: 6px 8px;
    font-size: 11px;
  }
  .gt .gv {
    font-size: 16px;
  }
  .btn {
    font-size: 14px;
    padding: 11px 18px;
  }
  .cinput {
    font-size: 14px;
    padding: 10px 12px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

/* 报价单弹窗切换标签（双轨制：标准/非标） */
.qmodal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: center;
}
.qt-tab {
  padding: 6px 18px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.qt-tab:hover { border-color: #a21f2d; color: #a21f2d; }
.qt-tab.active {
  background: #a21f2d;
  border-color: #a21f2d;
  color: #fff;
  font-weight: 600;
}
