/* ============================================================
   Sinovo Technologies 直销网站 — 主样式表 V2.0
   设计系统: 深蓝 #1a2a6c / 橙色 #f97316 / 电商卡片风格
   ============================================================ */

:root {
  --primary: #1a2a6c;
  --primary-light: #2b4fbf;
  --accent: #f97316;
  --accent-light: #fb923c;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1a202c;
  --text-muted: #5a6a7e;
  --border: #dde3ed;
  --success: #38a169;
  --danger: #e53e3e;
  --warning: #d69e2e;
  --info: #3182ce;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.15s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* ===== Top Bar (极简) ===== */
.top-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 48px;
}
.top-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px; color: var(--primary); text-decoration: none;
}
.top-logo span {
  background: var(--primary); color: #fff;
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
}
.top-actions {
  display: flex; align-items: center; gap: 14px;
}
.lang-switch {
  display: flex;
  gap: 2px;
  font-size: 13px;
  font-weight: 500;
}
.lang-switch a {
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}
.lang-switch a.active {
  background: var(--primary);
  color: #fff;
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.user-menu .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 14px;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  width: 100%;
}

/* ===== Hero Banner ===== */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 48px 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.hero-banner::after {
  content: '';
  position: absolute;
  right: -60px; bottom: -60px;
  width: 260px; height: 260px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.hero-banner h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; position: relative; z-index: 1; }
.hero-banner p { opacity: 0.85; font-size: 16px; position: relative; z-index: 1; }
.product-list-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.product-banner-copy { position: relative; z-index: 2; }
.product-banner-actions { display: flex; align-items: center; gap: 10px; position: relative; z-index: 2; }
.banner-icon-link {
  position: relative;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 10px;
  backdrop-filter: blur(4px);
}
.banner-icon-link:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.banner-icon-link svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.banner-cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--primary-light);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.page-cart-link {
  position: relative;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--primary);
  border-radius: 10px;
  box-shadow: 0 5px 16px rgba(26,42,108,.18);
}
.page-cart-link:hover { color: #fff; background: var(--accent); transform: translateY(-1px); }
.page-cart-link svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.page-cart-link span { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--accent); border: 2px solid var(--bg); border-radius: 10px; font-size: 10px; font-weight: 800; }

/* ===== Config & Quote Workspace ===== */
.quote-workspace {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: -12px 0 28px;
  box-shadow: var(--shadow);
}
.quote-workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.quote-workspace-heading h2 { color: var(--primary); font-size: 20px; line-height: 1.2; }
.quote-workspace-heading p { color: var(--text-muted); font-size: 13px; }
.workspace-eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.workspace-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 12px; }
.workspace-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 14px 16px;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.workspace-action:hover { color: var(--text); border-color: var(--accent); background: #fffaf5; box-shadow: var(--shadow); }
.workspace-action-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(26,42,108,.08); font-size: 20px; flex: 0 0 auto; }
.workspace-action span:nth-child(2) { min-width: 0; flex: 1; }
.workspace-action strong, .workspace-action small { display: block; }
.workspace-action strong { color: var(--primary); font-size: 14px; margin-bottom: 2px; }
.workspace-action small { color: var(--text-muted); font-size: 11.5px; line-height: 1.4; }
.workspace-action b { color: var(--accent); font-size: 22px; }

/* ===== Customer Preference Insights ===== */
.preference-stats .stat-card { padding: 18px 20px; }
.preference-top-value { font-size: 19px !important; line-height: 1.25 !important; }
.preference-filter-card { margin-bottom: 20px; }
.preference-filter-form { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(150px, 1fr)) auto auto; gap: 12px; align-items: end; }
.preference-filter-form .form-group { margin-bottom: 0; }
.preference-layout { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.insight-title { color: var(--primary); font-size: 16px; margin-bottom: 12px; }
.insight-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.insight-row:last-child { border-bottom: 0; }
.insight-row strong { color: var(--accent); }
.preference-table-wrap { border-radius: var(--radius-sm); }
.confirm-modal-content { width: min(460px, calc(100vw - 32px)); }
.confirm-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.overdue-followup-alert { position: fixed; right: 22px; bottom: 22px; z-index: 1400; width: min(390px, calc(100vw - 32px)); overflow: hidden; background: #fff; border: 1px solid #fdba74; border-radius: 12px; box-shadow: 0 16px 45px rgba(15,23,42,.22); }
.overdue-followup-alert-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; color: #7c2d12; background: #fff7ed; border-bottom: 1px solid #fed7aa; }
.overdue-followup-alert-head strong, .overdue-followup-alert-head span { display: block; }
.overdue-followup-alert-head strong { font-size: 15px; }
.overdue-followup-alert-head span { margin-top: 2px; font-size: 11.5px; color: #9a3412; }
.overdue-followup-alert-head button { border: 0; background: transparent; color: #9a3412; font-size: 24px; line-height: 1; cursor: pointer; }
.overdue-followup-alert-list { max-height: 300px; overflow-y: auto; }
.overdue-followup-alert-list > a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 16px; border-bottom: 1px solid #f1f5f9; }
.overdue-followup-alert-list > a:last-child { border-bottom: 0; }
.overdue-followup-alert-list > a:hover { background: #fffaf5; }
.overdue-followup-alert-list span, .overdue-followup-alert-list em { min-width: 0; }
.overdue-followup-alert-list strong, .overdue-followup-alert-list small { display: block; }
.overdue-followup-alert-list strong { overflow: hidden; color: var(--primary); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.overdue-followup-alert-list small { color: var(--text-muted); font-size: 10.5px; font-style: normal; }
.overdue-followup-alert-list em { flex: 0 0 auto; color: var(--danger); font-size: 11.5px; font-weight: 700; font-style: normal; text-align: right; }
.excel-import-guide { padding: 16px; margin-bottom: 18px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.excel-import-guide > strong { display: block; color: var(--primary); margin-bottom: 4px; }
.excel-import-guide p { font-size: 12px; margin-bottom: 10px; }
.excel-column-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.excel-column-list code { padding: 3px 7px; color: #334155; background: #fff; border: 1px solid var(--border); border-radius: 4px; font-size: 11px; }
.product-manage-actions .btn {
  height: 42px;
  min-height: 42px;
  padding: 0 22px;
  line-height: 1;
  white-space: nowrap;
}
.table-wrap-sticky.product-data-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}
.product-data-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -4px 0 24px;
  color: var(--text-muted);
  font-size: 13px;
}
.product-data-pagination-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.product-data-page-link {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.product-data-page-link:hover { color: #fff; background: var(--primary); border-color: var(--primary); }
.product-data-page-link.is-current { color: #fff; background: var(--primary); border-color: var(--primary); cursor: default; }
.product-data-page-link.is-disabled { color: #94a3b8; background: #f8fafc; cursor: not-allowed; }
.product-data-page-link.is-disabled:hover { color: #94a3b8; background: #f8fafc; border-color: var(--border); }
.product-data-page-ellipsis { min-width: 24px; text-align: center; }
.product-category-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 190px; padding: 12px; overflow-y: auto; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.product-category-option { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 7px 8px; color: #334155; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 12px; cursor: pointer; }
.product-category-option:hover { border-color: #94a3b8; }
.product-category-option input { flex: 0 0 auto; accent-color: var(--accent); }
.product-category-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-tier-prices,
.product-shipping-fields {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.product-tier-prices legend,
.product-shipping-fields legend { padding: 0 6px; color: var(--primary); font-weight: 700; }
.product-tier-prices > p,
.product-shipping-fields > p { margin: 0 0 12px; font-size: 12px; line-height: 1.6; }
.product-shipping-fields .form-group { margin-bottom: 12px; }
.product-shipping-fields .form-row:last-child .form-group { margin-bottom: 0; }
.product-tier-price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.product-tier-price-grid .form-group { margin: 0; }
.product-tier-price-input { position: relative; }
.product-tier-price-input > span { position: absolute; top: 50%; left: 12px; z-index: 1; color: var(--text-muted); transform: translateY(-50%); }
.product-tier-price-input .form-input { padding-left: 27px; }
.product-tier-warning { padding: 8px 10px; color: #9a5a00; background: #fff7e6; border: 1px solid #f5c978; border-radius: 6px; }
.product-surcharge-options {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.product-surcharge-options legend { padding: 0 6px; color: var(--primary); font-weight: 700; }
.product-surcharge-options > p { margin: 0 0 12px; font-size: 12px; line-height: 1.6; }
.product-surcharge-list { display: grid; gap: 10px; }
.product-surcharge-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 12px; }
.product-surcharge-check { margin: 0; }
.product-surcharge-input[hidden] { display: none; }
.product-option-select-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 720px) {
  .product-category-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-tier-price-grid, .product-surcharge-row, .product-option-select-grid { grid-template-columns: 1fr; }
}
.analytics-note { padding: 13px 16px; margin-bottom: 20px; color: #334155; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; font-size: 12.5px; }
.analytics-section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 28px 0 10px; }
.analytics-section-heading span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.analytics-section-heading h3 { color: var(--primary); font-size: 18px; }
.analytics-section-heading p { color: var(--text-muted); font-size: 12px; }
.analytics-card { overflow: hidden; }
.analytics-table-wrap { margin: 0; }
.analytics-table-wrap .data-table th, .analytics-table-wrap .data-table td { vertical-align: middle; }
.analytics-bar { width: 130px; height: 7px; display: inline-block; margin-right: 7px; overflow: hidden; vertical-align: middle; background: #e8edf5; border-radius: 5px; }
.analytics-bar i { display: block; height: 100%; min-width: 2px; background: linear-gradient(90deg, var(--primary-light), var(--accent)); border-radius: inherit; }
.analytics-empty { padding: 50px 24px; text-align: center; color: var(--text-muted); }
.analytics-empty > div { font-size: 40px; margin-bottom: 8px; }
.analytics-empty h3 { color: var(--primary); font-size: 17px; margin-bottom: 5px; }
.analytics-empty p { font-size: 12.5px; }
.analytics-empty.compact { padding: 28px 20px; }

/* ===== Stats ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.stat-card .stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-icon.blue { background: rgba(26,42,108,0.1); color: var(--primary); }
.stat-icon.orange { background: rgba(249,115,22,0.1); color: var(--accent); }
.stat-icon.green { background: rgba(56,161,105,0.1); color: var(--success); }
.stat-icon.purple { background: rgba(128,90,213,0.1); color: #805ad5; }

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f1f5f9;
}
.card-body { padding: 18px 20px; }
.card-title { font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.card-badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-hot  { background: #fed7d7; color: #c53030; }
.badge-new  { background: #bee3f8; color: #2a4365; }
.badge-best { background: #c6f6d5; color: #22543d; }

/* ===== Project Overview Dates ===== */
.project-date-summary {
  display: grid;
  align-items: center;
  column-gap: 20px;
  row-gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
}
.project-date-summary > span { white-space: nowrap; }
.project-date-summary-no-change {
  grid-template-columns: max-content max-content minmax(220px, 1fr);
  grid-template-areas: "start original note";
}
.project-date-summary-with-change {
  grid-template-columns: max-content max-content minmax(220px, 1fr);
  grid-template-areas:
    "start revised note"
    ". original note";
}
.project-date-start { grid-area: start; }
.project-date-original { grid-area: original; }
.project-original-target-edit,
.project-revised-target-edit {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.project-original-target-edit:hover,
.project-revised-target-edit:hover { color: var(--primary); }
.project-original-target-edit:focus-visible,
.project-revised-target-edit:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: 3px;
}
.project-date-edit-icon {
  margin-left: 4px;
  color: var(--primary-light);
  font-size: 12px;
}
.project-date-revised-group {
  grid-area: revised;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.project-date-revised { white-space: nowrap; }
.project-change-count {
  white-space: nowrap;
  padding: 2px 10px;
  border-radius: 10px;
  background: #d1fae5;
  color: #065f46;
  font-weight: 600;
  text-decoration: none;
}
.project-change-count:hover { color: #064e3b; background: #a7f3d0; }
.project-overview-note-area {
  grid-area: note;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.project-overview-note-display {
  display: flex;
  align-items: baseline;
  min-width: 0;
  flex: 1 1 auto;
}
.project-overview-note-display[hidden] { display: none; }
.project-overview-note-value {
  min-width: 0;
  color: #e65100;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
  white-space: normal;
}
.project-overview-note-edit {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}
.project-overview-edit-open { flex: 0 0 auto; white-space: nowrap; }
.project-delete-open { flex: 0 0 auto; white-space: nowrap; }
.project-delete-warning {
  margin-top: 12px;
  padding: 10px 12px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.55;
}
.project-overview-note-modal-content { width: min(560px, calc(100vw - 32px)); }
.project-overview-note-modal-content .form-textarea {
  width: 100%;
  min-height: 96px;
}
.project-overview-note-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.project-overview-edit-modal-content { width: min(520px, calc(100vw - 32px)); }
.project-overview-edit-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.project-original-target-modal-content { width: min(500px, calc(100vw - 32px)); }
.project-original-target-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ===== Product Grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}
.product-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.product-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
}
.product-card-body { padding: 16px 18px 20px; }
.product-card-model {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.product-card-name { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.product-card-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.product-card-tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.product-detail-image-wrap {
  width: 100%;
  height: 380px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.product-detail-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.product-detail-info-card .card-body { padding: 18px 20px; }
.product-detail-info-card h4 {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 15px;
}
.product-detail-info-card p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.price-estimate-card {
  margin: 16px 0;
  overflow: hidden;
  background: #f0f4ff;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
}
.price-estimate-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(26,42,108,0.1);
}
.price-estimate-row span { color: var(--text-muted); font-size: 13px; }
.price-estimate-row strong { color: var(--primary); text-align: right; }
.price-estimate-tier-label { display: block; margin-top: 2px; color: var(--primary-light); font-size: 11px; }
.price-estimate-options {
  padding: 3px 0 9px;
  color: var(--text-muted);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
.price-estimate-unit { border-top: 1px solid rgba(26,42,108,0.18); }
.price-estimate-unit strong { font-size: 17px; }
.price-estimate-total {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--primary);
  border-bottom: 0;
}
.price-estimate-total span, .price-estimate-total strong { font-size: 18px; font-weight: 700; }
.price-estimate-total strong { color: var(--accent); }
.price-estimate-note {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.55;
}

/* ===== Shopping Cart ===== */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.cart-section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.cart-section-title > div { display: flex; align-items: center; gap: 9px; }
.cart-section-title > div > span { min-width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--primary); border-radius: 14px; font-size: 12px; font-weight: 700; }
.cart-section-title h3 { color: var(--primary); font-size: 18px; }
.cart-section-title small { color: var(--text-muted); font-size: 11.5px; text-align: right; }
.cart-item-list { display: grid; gap: 14px; }
.cart-item-card { display: grid; grid-template-columns: 170px minmax(0, 1fr); overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color var(--transition), box-shadow var(--transition); }
.cart-item-card:hover { border-color: #bdc8da; box-shadow: var(--shadow-lg); }
.cart-item-image { min-height: 205px; padding: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg,#f8fafc,#edf2f8); border-right: 1px solid var(--border); }
.cart-item-image img { width: 100%; height: 100%; max-height: 180px; object-fit: contain; }
.cart-item-image > span { font-size: 46px; }
.cart-item-main { min-width: 0; padding: 18px 20px 16px; }
.cart-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cart-item-heading h3 { color: var(--primary); font-size: 16px; line-height: 1.35; }
.cart-model { display: block; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; margin-bottom: 3px; }
.cart-remove-btn { width: 30px; height: 30px; color: var(--text-muted); background: #f3f5f8; border: 0; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.cart-remove-btn:hover { color: #fff; background: var(--danger); }
.cart-config-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 16px; }
.cart-config-chips > span { padding: 6px 9px; color: #334155; background: #f7f9fc; border: 1px solid var(--border); border-radius: 6px; font-size: 11.5px; }
.cart-config-chips small { display: block; color: var(--text-muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cart-item-footer { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.cart-quantity small, .cart-line-total small { display: block; color: var(--text-muted); font-size: 10px; }
.cart-quantity strong { color: var(--primary); font-size: 18px; }
.cart-price-detail { display: flex; flex-wrap: wrap; gap: 5px 15px; color: var(--text-muted); font-size: 10.5px; }
.cart-price-detail strong { color: var(--text); }
.cart-line-total { text-align: right; }
.cart-line-total strong { display: block; color: var(--accent); font-size: 18px; white-space: nowrap; }
.cart-summary-card { position: sticky; top: 22px; padding: 24px; background: var(--card); border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.cart-summary-card h3 { color: var(--primary); font-size: 20px; margin: 3px 0 18px; }
.cart-summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; color: var(--text-muted); border-bottom: 1px solid var(--border); font-size: 12.5px; }
.cart-summary-row strong { color: var(--text); }
.cart-summary-total { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 18px 0 14px; }
.cart-summary-total span { color: var(--primary); font-weight: 700; }
.cart-summary-total strong { color: var(--accent); font-size: 22px; white-space: nowrap; }
.cart-summary-note { padding: 10px 12px; margin-bottom: 16px; color: var(--text-muted); background: #f8fafc; border-radius: 6px; font-size: 10.5px; line-height: 1.5; }
.cart-continue-link { display: block; margin-top: 14px; text-align: center; font-size: 12px; font-weight: 600; }
.cart-empty-state { padding: 70px 24px; text-align: center; background: var(--card); border: 1px dashed #c5cfdd; border-radius: var(--radius); }
.cart-empty-icon { width: 76px; height: 76px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; color: var(--primary); background: #eef3ff; border-radius: 50%; }
.cart-empty-icon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cart-empty-state h3 { color: var(--primary); font-size: 20px; }
.cart-empty-state p { color: var(--text-muted); font-size: 13px; margin-top: 5px; }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 24px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: #fff7ed;
}
.tab-btn.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(26,42,108,0.2);
}
.tab-btn.active::after { display: none; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Sub-tabs (smaller, inside tab panel) */
.sub-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.sub-tab-btn {
  padding: 7px 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sub-tab-btn:hover { color: var(--accent); border-color: var(--accent); }
.sub-tab-btn.active {
  color: var(--accent);
  background: #fff7ed;
  border-color: var(--accent);
}
.sub-tab-btn.active::after { display: none; }
.sub-tab-panel { display: none; }
.sub-tab-panel.active { display: block; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-light); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53030; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; margin: 0 0 20px; background: #fff; }
.table-wrap-sticky { overflow: auto; max-height: 65vh; margin: 0 0 20px; background: #fff; }
.project-task-table-wrap { max-height: 82vh; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: #fff;
}
.data-table thead th {
  background: var(--primary);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
.data-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.data-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tbody tr:hover { background: #f7fafc; }

.page-header.order-page-header {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.order-page-header h2 { margin: 0; }
.order-add-button { margin-left: auto; }
.order-back-link {
  color: var(--text-muted);
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
}
.order-back-link:hover { color: var(--accent); }
.order-status-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.order-status-tab {
  min-width: 116px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.order-status-tab span {
  min-width: 20px;
  padding: 1px 6px;
  color: inherit;
  background: rgba(100,116,139,.1);
  border-radius: 999px;
  font-size: 11px;
  text-align: center;
}
.order-status-tab:hover { color: var(--accent); border-color: var(--accent); background: #fff7ed; }
.order-status-tab.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.order-status-tab.active span { background: rgba(255,255,255,.18); }
.order-table-wrap { border-radius: var(--radius-sm); overflow: auto; max-height: 70vh; }
.order-table {
  min-width: 0;
  table-layout: fixed;
}
.order-table .order-col-customer { width: 8.5%; }
.order-table .order-col-number { width: 9.5%; }
.order-table .order-col-content { width: 7.5%; }
.order-table .order-col-date { width: 5.5%; }
.order-table .order-col-required { width: 8.5%; }
.order-table .order-col-progress { width: 5%; }
.order-table .order-col-stage { width: 9%; }
.order-table .order-col-stage-time { width: 6%; }
.order-table .order-col-remarks { width: 23.25%; }
.order-table .order-col-follow-up { width: 5.5%; }
.order-table .order-col-delivery { width: 5.5%; }
.order-table .order-col-tracking { width: 6.25%; }
.order-table th,
.order-table td {
  overflow-wrap: anywhere;
}
.order-table thead th {
  padding: 9px 8px;
  white-space: normal;
  line-height: 1.25;
}
.order-table tbody td { padding: 8px; }
.order-table tbody tr:nth-child(odd) { background: #fff; }
.order-table tbody tr:nth-child(even) { background: #f0f4f8; }
.order-table tbody tr:hover { background: #fff4e8; }
.order-customer-cell { font-weight: 600; color: var(--primary); }
.order-number-open,
.order-customer-open {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.order-number-open:hover,
.order-number-open:focus,
.order-customer-open:hover,
.order-customer-open:focus { color: var(--accent); text-decoration: underline; outline: none; }
.order-progress-heading,
.order-target-date-heading,
.order-progress-cell,
.order-stage-time-cell,
.order-date-cell { white-space: nowrap; }
.order-content-preview {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.order-content-preview:hover,
.order-content-preview:focus { color: var(--accent); text-decoration: underline; outline: none; }
.order-edit-display {
  display: inline;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.order-edit-display:hover,
.order-edit-display:focus {
  color: var(--accent);
  text-decoration: underline;
  outline: none;
}
.order-edit-display[hidden] { display: none; }
.order-date-control,
.order-stage-control,
.order-text-control,
.order-number-control {
  display: none;
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.order-text-control { resize: vertical; white-space: normal; }
.order-edit-control.is-editing { display: block; }
.order-date-control:focus,
.order-stage-control:focus,
.order-text-control:focus,
.order-number-control:focus {
  outline: 2px solid rgba(237, 137, 54, 0.25);
  border-color: var(--accent);
}
.order-date-control.save-success,
.order-stage-control.save-success,
.order-text-control.save-success,
.order-number-control.save-success { border-color: var(--success); }
.order-remarks-cell { vertical-align: top; white-space: normal; }
.order-remarks-display {
  display: block;
  width: 100%;
  margin: 0;
  line-height: 1.4;
  white-space: pre-wrap;
  vertical-align: top;
}
.order-progress-display { display: block; font-weight: 600; white-space: nowrap; }
.order-progress-value { font-size: 13px; font-weight: 600; white-space: nowrap; }
.order-stage-time-display,
.order-stage-time-value { font-weight: 600; white-space: nowrap; }
.delivery-photo-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
}
.delivery-photo-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f0f4f8;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition);
}
.delivery-attachment-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.delivery-photo-link:hover,
.delivery-photo-link:focus {
  background: #fff7ed;
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}
.delivery-photo-count {
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
}
.delivery-shipment-fields {
  display: grid;
  gap: 14px;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.delivery-shipment-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.delivery-shipment-field span { white-space: nowrap; }
.delivery-shipment-field .form-input {
  width: 100%;
  padding: 7px 10px;
}
.delivery-shipment-field .form-textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
}
.delivery-attachment-groups {
  display: grid;
  gap: 14px;
}
.delivery-attachment-group {
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.delivery-attachment-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.delivery-attachment-group h4 {
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}
.delivery-photos-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 8px 0 0;
}
.delivery-documents-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  overflow: visible;
  padding-bottom: 0;
}
.delivery-documents-gallery.is-empty::before,
.delivery-media-gallery.is-empty::before {
  content: "No files.";
  display: block;
  padding: 4px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}
.delivery-documents-gallery .delivery-photo-gallery-item {
  flex: 0 1 auto;
  width: auto;
  min-width: 96px;
  max-width: 190px;
  overflow: visible;
  background: #f8fafc;
}
.delivery-documents-gallery .delivery-photo-gallery-item:hover {
  transform: none;
}
.delivery-upload-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}
.delivery-photo-gallery-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.delivery-photo-gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}
.delivery-photo-gallery-item img,
.delivery-photo-gallery-item video {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.delivery-photo-gallery-item img {
  cursor: zoom-in;
}
.delivery-document-link {
  width: auto;
  min-width: 96px;
  max-width: 190px;
  min-height: 32px;
  padding: 4px 8px 4px 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--primary);
  background: linear-gradient(145deg, #f8fafc, #eef2ff);
  text-decoration: none;
}
.delivery-document-link:hover {
  color: var(--accent);
}
.delivery-document-link > span:last-child {
  display: block;
  min-width: 0;
  max-width: 125px;
}
.delivery-document-link strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delivery-document-link small {
  display: none;
}
.delivery-document-icon {
  width: 18px;
  height: 20px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--primary);
  font-size: 9px;
  font-weight: 800;
}
.delivery-photo-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: rgba(229, 62, 62, 0.9);
  color: #fff;
  font-size: 15px;
  line-height: 20px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 2;
}
.delivery-photo-gallery-item:hover .delivery-photo-delete-btn {
  opacity: 1;
}
.delivery-photo-gallery-item:focus-within .delivery-photo-delete-btn {
  opacity: 1;
}
.delivery-photo-delete-btn:hover {
  background: var(--danger);
}
.delivery-photo-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.delivery-photo-view {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.delivery-photo-view[hidden] { display: none; }
.delivery-photo-thumb {
  display: block;
  width: 50px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
}
.delivery-photo-add {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  background: #fff7ed;
  color: var(--accent);
  font-size: 24px;
  line-height: 30px;
  cursor: pointer;
}
.delivery-photo-add:hover,
.delivery-photo-add:focus { background: #ffedd5; outline: 2px solid rgba(237, 137, 54, 0.2); }
.delivery-photo-add:disabled { cursor: wait; opacity: 0.65; }
.order-detail-modal {
  width: min(980px, calc(100vw - 24px));
  max-height: 96vh;
  overflow-y: auto;
}
.order-content-table-wrap { overflow-x: visible; }
.order-content-table { width: 100%; border-collapse: collapse; }
.order-content-table th {
  padding: 10px 12px;
  background: var(--primary);
  color: #fff;
  text-align: left;
}
.order-content-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.order-content-table:not(.is-editable) th:last-child,
.order-content-table:not(.is-editable) td:last-child { width: 36%; }
.order-content-table.is-editable { min-width: 520px; }
.order-content-table.is-editable th:nth-child(2),
.order-content-table.is-editable td:nth-child(2) { width: 150px; }
.order-content-table.is-editable .order-content-action-heading,
.order-content-table.is-editable .order-content-action-cell { width: 82px; text-align: center; }
.order-content-product-input,
.order-content-quantity-input { width: 100%; min-width: 0; }
.order-content-delete {
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.order-content-delete:hover,
.order-content-delete:focus { text-decoration: underline; outline: none; }
.order-content-empty-row td { padding: 24px 12px; color: var(--text-muted); text-align: center; }
#order-content-error { margin-top: 14px; }
.order-content-editor-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
@media (max-width: 600px) {
  .order-detail-modal {
    width: calc(100vw - 16px);
    min-height: 0;
    max-height: 96vh;
  }
  .order-content-table-wrap { overflow-x: auto; }
}
.add-order-modal-content { width: 760px; }
.form-help { margin-top: 5px; color: var(--text-muted); font-size: 12px; }
.edit-order-photo-preview { margin-bottom: 10px; }
.edit-order-photo-preview[hidden] { display: none; }
.edit-order-photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.edit-order-photo-list img,
.edit-order-photo-list video {
  display: block;
  width: 96px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.edit-order-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.edit-order-actions-right { display: flex; gap: 10px; }
.delivery-photo-modal-content { width: min(860px, 92vw); }
#delivery-photo-modal .delivery-photo-modal-content { width: min(806px, 92vw); }
.delivery-photo-full { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; object-fit: contain; }
#delivery-photo-zoom-modal .delivery-photo-zoom-content {
  display: flex;
  flex-direction: column;
  width: min(1200px, 96vw);
  height: min(900px, 92vh);
  max-width: 96vw;
  max-height: 92vh;
  padding: 20px 24px 24px;
  overflow: hidden;
}
#delivery-photo-zoom-modal .modal-header {
  flex: 0 0 auto;
  margin-bottom: 12px;
}
.delivery-photo-zoom-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-bottom: 10px;
}
.delivery-photo-zoom-toolbar .btn {
  min-width: 36px;
  padding: 6px 10px;
}
.delivery-photo-zoom-toolbar span {
  min-width: 56px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.delivery-photo-zoom-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  background: #eef2f7;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}
#delivery-photo-zoom-modal .delivery-photo-full {
  max-width: 100%;
  max-height: calc(92vh - 150px);
  transform-origin: top center;
  transition: transform .16s ease;
  cursor: zoom-in;
  user-select: none;
}
#delivery-photo-zoom-modal .delivery-photo-full.is-zoomed {
  cursor: zoom-out;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
  background: var(--card);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.form-input:disabled,
.form-select:disabled {
  background: #edf2f7;
  color: #a0aec0;
  cursor: not-allowed;
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* ===== Alerts ===== */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error   { background: #fed7d7; color: #c53030; border: 1px solid #feb2b2; }
.alert-success { background: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.alert-warning { background: #fefcbf; color: #744210; border: 1px solid #faf089; }
.alert-info    { background: #bee3f8; color: #2a4365; border: 1px solid #90cdf4; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 400px;
}
.toast-success { background: #c6f6d5; color: #22543d; }
.toast-error   { background: #fed7d7; color: #c53030; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ===== Progress Bar ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #edf2f7;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.progress-fill.blue   { background: var(--primary); }
.progress-fill.orange { background: var(--accent); }
.progress-fill.green  { background: var(--success); }

/* ===== Stage Timeline ===== */
.stage-flow-wrap { margin: 20px 0; }
.stage-track {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 0 12px 0;
}
.stage-track::before {
  content: '';
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  height: 3px;
  background: #e2e8f0;
  border-radius: 2px;
  z-index: 0;
}
.stage-node {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; flex: 1; min-width: 0;
}
.stage-dot {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.stage-done .stage-dot {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(26,42,108,0.3);
}
.stage-done .stage-dot::after { content: '\2713'; }
.stage-active .stage-dot {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 0 6px rgba(249,115,22,0.18), 0 2px 8px rgba(249,115,22,0.35);
  animation: stagePulse 2s ease-in-out infinite;
}
@keyframes stagePulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(249,115,22,0.18), 0 2px 8px rgba(249,115,22,0.35); }
  50%     { box-shadow: 0 0 0 10px rgba(249,115,22,0.08), 0 2px 12px rgba(249,115,22,0.45); }
}
.stage-pending .stage-dot {
  background: #fff; color: #a0aec0;
  border: 2.5px dashed #cbd5e0;
}
.stage-label {
  font-size: 11px; font-weight: 600; text-align: center;
  line-height: 1.35; max-width: 90px; word-break: keep-all;
}
.stage-done .stage-label    { color: var(--primary); }
.stage-active .stage-label  { color: var(--accent); }
.stage-pending .stage-label { color: #a0aec0; }
.stage-legend {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 18px; font-size: 13px;
}
.legend-dot {
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.legend-done    { background: var(--primary); }
.legend-active  { background: var(--accent); }
.legend-pending { background: #fff; border: 2px dashed #cbd5e0; }

/* ===== Order Flow ===== */
.order-flow {
  display: flex; flex-direction: column;
  gap: 6px; margin: 16px 0;
}
.order-step {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--bg);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
.order-step .step-label { font-weight: 600; min-width: 100px; color: var(--primary); }
.order-step .step-note  { color: var(--text-muted); font-size: 13px; }
.order-step.active { background: #fff3e0; border-left-color: var(--accent); }
.order-step.done   { border-left-color: var(--success); }

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 22px;
  color: var(--primary);
}
.page-header .breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
}
.page-header .breadcrumb a { color: var(--text-muted); }
.page-header .breadcrumb a:hover { color: var(--accent); }

/* ===== Filters Sidebar ==== */
.filter-sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.filter-sidebar h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--border);
}
.filter-sidebar label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: color var(--transition);
}
.filter-sidebar label:hover { color: var(--accent); }
.filter-sidebar label input[type="checkbox"] {
  accent-color: var(--accent);
}
.filter-group-gap {
  height: 12px;
}

/* ===== Layout Helpers ===== */
.two-col {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .quote-workspace-heading { align-items: flex-start; flex-direction: column; }
  .preference-layout { grid-template-columns: 1fr; }
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-28 { margin-bottom: 28px; }
.mb-36 { margin-bottom: 36px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.fw-600 { font-weight: 600; }

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, #0d1b4a 60%, #1a2a6c 100%);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.03) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(30px, -20px); }
}
.login-card {
  background: var(--card);
  border-radius: 16px;
  padding: 44px 40px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}
.login-card .brand {
  text-align: center;
  margin-bottom: 32px;
}
.login-card .brand h1 {
  font-size: 24px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.login-card .brand p {
  font-size: 12px;
  color: var(--primary-light);
  margin-top: 4px;
  letter-spacing: -0.1px;
  white-space: nowrap;
}
.login-card .form-input {
  margin-bottom: 16px;
}
.password-wrap {
  position: relative;
  margin-bottom: 16px;
}
.password-wrap .form-input {
  margin-bottom: 0;
  padding-right: 40px;
}
.pwd-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  user-select: none;
}
.pwd-toggle:hover { color: var(--accent); }
.login-card .form-extra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 20px;
}
.login-footer-text {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 24px;
  line-height: 1.6;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 32px;
  width: 560px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; color: var(--primary); }
.modal-close {
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
}
.modal-close:hover { color: var(--danger); }

/* ===== Footer ===== */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.8);
  padding: 40px 0 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.footer-col h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
  font-weight: 600;
}
.footer-col p, .footer-col a {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  line-height: 2;
  display: block;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  margin-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 6px; }

/* ===== Tags ===== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.tag-accent  { background: #fff3e0; color: #e65100; }
.tag-success { background: #c6f6d5; color: #22543d; }
.tag-danger  { background: #fed7d7; color: #c53030; }
.tag-info    { background: #bee3f8; color: #2a4365; }
.tag-muted   { background: #edf2f7; color: #718096; }

/* ===== Responsive ==== */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .preference-filter-form { grid-template-columns: repeat(2, 1fr); }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary-card { position: static; }
}

/* ===== Module Cards (Dashboard) ===== */
.module-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.module-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
  text-decoration: none;
}
.module-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(249,115,22,0.12);
  transform: translateY(-2px);
}
.module-card .module-icon {
  font-size: 36px;
  width: 56px; height: 56px;
  border-radius: 12px;
  background: rgba(26,42,108,0.06);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.module-card .module-info { flex: 1; }
.module-card .module-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.module-card .module-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Mini Stats ===== */
.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  transition: all var(--transition);
}
.mini-stat:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.mini-stat .mini-num {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.mini-stat .mini-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.mini-stat.blue   .mini-num { color: var(--primary); }
.mini-stat.orange .mini-num { color: var(--accent); }
.mini-stat.green  .mini-num { color: var(--success); }
.mini-stat.purple .mini-num { color: #805ad5; }

/* ===== Clickable Stage Nodes ===== */
.stage-node.clickable { cursor: pointer; }
.stage-node.clickable:hover .stage-dot { transform: scale(1.15); }

/* ===== Editable Cells (project detail) ===== */
.editable {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background var(--transition);
  min-width: 40px;
  display: inline-block;
}
.editable:hover { background: #fff3e0; }
.project-task-table .project-task-stage {
  width: 84px;
  min-width: 84px;
  max-width: 84px;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  line-height: 1.35;
}
.project-task-table .project-task-name {
  width: 240px;
  max-width: 240px;
  white-space: nowrap;
}
.project-task-table .project-col-action {
  width: 92px;
  max-width: 92px;
}
.project-task-table .project-col-duration {
  width: 68px;
  max-width: 68px;
}
.project-task-table .project-col-date {
  width: 94px;
  max-width: 94px;
}
.project-task-table .project-col-status {
  width: 68px;
  max-width: 68px;
}
.project-task-table .project-col-overdue {
  width: 72px;
  max-width: 72px;
}
.project-task-table .project-col-note {
  width: 34%;
  min-width: 280px;
}
.project-task-table thead .project-col-action,
.project-task-table thead .project-col-duration,
.project-task-table thead .project-col-date,
.project-task-table thead .project-col-status,
.project-task-table thead .project-col-overdue {
  padding-right: 6px;
  padding-left: 6px;
  white-space: normal;
  line-height: 1.25;
}
.project-task-table tbody .project-col-action,
.project-task-table tbody .project-col-duration,
.project-task-table tbody .project-col-date,
.project-task-table tbody .project-col-status,
.project-task-table tbody .project-col-overdue {
  padding-right: 6px;
  padding-left: 6px;
}
.project-task-table tbody .project-col-date,
.project-task-table tbody .project-col-status,
.project-task-table tbody .project-col-overdue {
  white-space: nowrap;
}
.editable-cell {
  position: relative;
  cursor: pointer;
}
.editable-cell:hover { background: #fff3e0; }
.editable-cell .editable {
  min-width: 100%;
  min-height: 20px;
}
.editable-cell form { display: inline; }
.inline-input {
  padding: 4px 8px;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  font-size: 13px;
  width: 100%;
  max-width: 120px;
  font-family: inherit;
}
.project-task-table .project-col-note .inline-input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.project-task-table .project-col-note .editable {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.project-note-inline-input {
  min-height: calc(4.5em + 10px);
  line-height: 1.5;
  resize: vertical;
}
.inline-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(249,115,22,0.15); }
.inline-select {
  padding: 4px 6px;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  font-family: inherit;
}

/* Overdue coloring */
.overdue-red  { background: #fed7d7; color: #c53030; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.overdue-green { background: #c6f6d5; color: #22543d; font-weight: 600; padding: 2px 6px; border-radius: 4px; }

/* Draggable progress bar */
.progress-bar.draggable { cursor: grab; position: relative; height: 14px; }
.progress-bar.draggable:active { cursor: grabbing; }
.progress-bar.draggable:hover { opacity: 0.9; }

@media (max-width: 768px) {
  .preference-filter-form { grid-template-columns: 1fr; }
  .product-data-pagination { align-items: flex-start; flex-direction: column; }
  .product-data-pagination-links { justify-content: flex-start; }
  .analytics-section-heading { align-items: flex-start; flex-direction: column; }
  .cart-item-card { grid-template-columns: 120px minmax(0, 1fr); }
  .cart-item-image { min-height: 180px; }
  .cart-item-footer { grid-template-columns: auto 1fr; }
  .cart-line-total { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-end; text-align: left; }
  .order-table-wrap { overflow-x: auto; }
  .order-table { min-width: 1280px; }
  .module-cards { grid-template-columns: 1fr; }
  .mini-stats { justify-content: center; }
}
@media (max-width: 768px) {
  .header-nav { display: none; }
  .header-nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    box-shadow: var(--shadow);
  }
  .hamburger { display: flex; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stage-track {
    flex-direction: column; align-items: flex-start;
    gap: 0; padding-left: 28px;
  }
  .stage-track::before {
    top: 0; bottom: 0; left: 18px; right: auto;
    width: 4px; height: auto;
  }
  .stage-node { flex-direction: row; gap: 14px; padding: 6px 0; }
  .stage-label { text-align: left; max-width: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .main-content { padding: 16px 12px 40px; }
  .hero-banner { padding: 32px 20px; }
  .hero-banner h1 { font-size: 22px; }
  .product-list-banner { gap: 14px; }
  .banner-icon-link { width: 40px; height: 40px; }
  .banner-icon-link svg { width: 20px; height: 20px; }
  .stats-row { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product-detail-image-wrap { height: 280px; padding: 12px; }
  .cart-item-card { grid-template-columns: 1fr; }
  .cart-item-image { min-height: 155px; border-right: 0; border-bottom: 1px solid var(--border); }
  .cart-item-main { padding: 15px; }
  .cart-section-title { align-items: flex-start; flex-direction: column; }
  .cart-section-title small { text-align: left; }
  .cart-summary-card { padding: 20px; }
  .project-date-summary-no-change {
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
      "start original"
      "note note";
    column-gap: 12px;
  }
  .project-date-summary-with-change {
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
      "start revised"
      ". original"
      "note note";
    column-gap: 12px;
  }
  .freight-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 6px 0 0;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
  vertical-align: middle;
}
.freight-input {
  transition: border-color 0.25s ease;
}
.login-card { padding: 32px 24px; }
}
