/* ============================================================
   HIRSCHMAN Project Management System — Enhanced Stylesheet
   ============================================================ */

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.04); opacity: .85; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* --- Staggered children animation --- */
.stagger-children > *:nth-child(1)  { animation: fadeInUp .4s ease both .05s; }
.stagger-children > *:nth-child(2)  { animation: fadeInUp .4s ease both .10s; }
.stagger-children > *:nth-child(3)  { animation: fadeInUp .4s ease both .15s; }
.stagger-children > *:nth-child(4)  { animation: fadeInUp .4s ease both .20s; }
.stagger-children > *:nth-child(5)  { animation: fadeInUp .4s ease both .25s; }
.stagger-children > *:nth-child(6)  { animation: fadeInUp .4s ease both .30s; }
.stagger-children > *:nth-child(7)  { animation: fadeInUp .4s ease both .35s; }
.stagger-children > *:nth-child(8)  { animation: fadeInUp .4s ease both .40s; }
.stagger-children > *:nth-child(9)  { animation: fadeInUp .4s ease both .45s; }
.stagger-children > *:nth-child(10) { animation: fadeInUp .4s ease both .50s; }

/* --- CSS Custom Properties --- */
:root {
  --primary:        #5C7A7B;
  --primary-dark:   #4A6364;
  --primary-light:  #F0F5F5;
  --primary-soft:   #E4ECEC;
  --sidebar:        #FFFFFF;
  --sidebar-hover:  #F5F3F0;
  --sidebar-active: #5C7A7B;
  --bg:             #FAFAF8;
  --card:           #fff;
  --text:           #2C2C2C;
  --text-secondary: #7A7A78;
  --text-light:     #A0A09E;
  --border:         #E8E4DF;
  --border-light:   #F0EDE9;
  --success:        #6B9E7B;
  --warning:        #C4956A;
  --danger:         #B87070;
  --amber:          #C4956A;
  --sage:           #8FA3A0;
  --radius:         10px;
  --radius-sm:      6px;
  --radius-lg:      14px;
  --shadow:         0 1px 3px rgba(44,44,44,.04), 0 1px 2px rgba(44,44,44,.06);
  --shadow-md:      0 4px 12px rgba(44,44,44,.06), 0 1px 3px rgba(44,44,44,.04);
  --shadow-lg:      0 10px 30px rgba(44,44,44,.08), 0 2px 8px rgba(44,44,44,.04);
  --transition:     .2s ease;
}

/* --- Reset & Base --- */
*{ margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Selection --- */
::selection {
  background: rgba(92, 122, 123, .15);
  color: var(--text);
}

/* --- Focus Visible --- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Buttons (base) --- */
button {
  cursor: pointer;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background .2s;
  pointer-events: none;
}
button:hover::after {
  background: rgba(255,255,255,.1);
}
button:active {
  transform: scale(.97);
}

/* --- Form Inputs --- */
input, select, textarea {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  outline: none;
  transition: border .2s, box-shadow .2s;
  width: 100%;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92,122,123,.1);
}

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--border-light); }
th { background: #F0F5F5; font-weight: 500; color: var(--text-secondary); font-size: 13px; text-transform: uppercase; letter-spacing: .8px; }
tr:hover td { background: #F0F5F5; }

/* --- Project List Table: flexible columns, long names auto-wrap --- */
.proj-table { table-layout: auto; }
.proj-table th,
.proj-table td { white-space: normal; word-wrap: break-word; overflow-wrap: break-word; }
.proj-table td:first-child { min-width: 160px; font-weight: 500; }
.proj-table td:nth-child(3),
.proj-table td:nth-child(6) { white-space: nowrap; min-width: 80px; }
.proj-table td:nth-child(7),
.proj-table td:nth-child(8) { white-space: nowrap; }

/* ============================================================
   LOGIN PAGE - Split Screen
   ============================================================ */
.login-page {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* === Left Panel === */
.login-left {
  flex: 0 0 55%;
  position: relative;
  background: url("img_hero_slide_2_login.png") center/cover no-repeat, #182430;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 60px;
}
.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.3) 0%, rgba(15,23,42,0.7) 60%, rgba(15,23,42,0.9) 100%);
}
.login-left-content {
  position: relative;
  z-index: 1;
  color: #fff;
}
.login-left-content .brand-name {
  font-size: 36px;
  font-weight: 200;
  color: #fff;
  letter-spacing: 12px;
  margin-bottom: 12px;
}
.login-logo {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}
.login-logo svg {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}
.login-left-content .brand-cn {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 6px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 32px;
}
.login-left-content .tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  line-height: 1.8;
  letter-spacing: 1px;
  max-width: 380px;
}
.login-left-content .tagline span {
  display: block;
  width: 40px;
  height: 2px;
  background: rgba(24,36,48,0.6);
  margin-bottom: 16px;
}
.partner-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 14px;
  padding: 6px 20px;
  background: linear-gradient(135deg, rgba(212,175,55,0.15) 0%, rgba(212,175,55,0.05) 100%);
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 4px;
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(212,175,55,0.9);
  font-weight: 400;
  backdrop-filter: blur(4px);
}
.partner-badge-icon {
  font-size: 8px;
  opacity: 0.7;
}

.login-left .deco-dots {
  position: absolute;
  top: 40px;
  right: 40px;
  display: flex;
  gap: 8px;
  z-index: 1;
}
.login-left .deco-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}
.login-left .deco-dots span:first-child {
  background: rgba(24,36,48,0.8);
}

/* === Right Panel === */
.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F0F5F5;
  padding: 40px;
}
.login-form-wrap {
  width: 100%;
  max-width: 380px;
  animation: fadeSlideIn 0.6s ease both;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-form-wrap .welcome { margin-bottom: 40px; }
.login-form-wrap .welcome h2 {
  font-size: 28px;
  font-weight: 600;
  color: #2C2C2C;
  margin-bottom: 8px;
}
.login-form-wrap .welcome p {
  font-size: 16px;
  color: #8892a4;
  font-weight: 400;
}
.login-form-wrap .form-group { margin-bottom: 22px; }
.login-form-wrap .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}
.login-form-wrap .form-group input {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #2C2C2C;
  outline: none;
  transition: all 0.2s;
}
.login-form-wrap .form-group input::placeholder { color: #b0b8c8; }
.login-form-wrap .form-group input:focus {
  border-color: #5C7A7B;
  box-shadow: 0 0 0 3px rgba(92,122,123,0.12);
}

.login-form-wrap .btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #4A6364, #5C7A7B);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 2px;
  margin-top: 8px;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(92,122,123,0.3);
}
.login-form-wrap .btn-login:hover {
  box-shadow: 0 8px 28px rgba(92,122,123,0.45);
  transform: translateY(-1px);
}

.login-error {
  color: #e74c3c;
  font-size: 14px;
  text-align: center;
  margin-top: 16px;
  min-height: 20px;
}
.login-back-arrow {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 10;
  color: rgba(255,255,255,0.6);
  font-size: 28px;
  text-decoration: none;
  transition: all 0.2s;
  line-height: 1;
}
.login-back-arrow:hover { color: #fff; transform: translateX(-3px); }

.login-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
  color: #b0b8c8;
}

@media (max-width: 900px) {
  .login-left { display: none !important; }
  .login-right { flex: 1 !important; background: #F0F5F5; }
  .login-back-arrow { color: rgba(92,122,123,0.5) !important; }
  .login-back-arrow:hover { color: #5C7A7B; }
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: 220px;
  background: var(--sidebar);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  border-right: 1px solid var(--border);
}
.sidebar-brand { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.sidebar-logo { margin-bottom: 6px; }
.sidebar-brand-cn { font-size: 10px; color: var(--text-light); display: block; letter-spacing: 2px; font-weight: 300; }

.sidebar-nav { flex: 1; padding: 16px 0; }

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
  gap: 10px;
  position: relative;
}
.nav-item::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 0;
  background: var(--sidebar-active);
  border-radius: 0 2px 2px 0;
  transition: height .2s ease, top .2s ease;
}
.nav-item:hover::before {
  height: 60%;
  top: 20%;
}

.nav-item-text { display: flex; flex-direction: column; line-height: 1.3; }
.nav-item-text .zh { font-size: 14px; font-weight: 400; letter-spacing: .5px; }
.nav-item-text .en { font-size: 9px; color: var(--text-light); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 1px; font-weight: 400; }

.nav-item:hover { background: var(--sidebar-hover); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); border-right: 3px solid var(--sidebar-active); }
.nav-item.active::before { display: none; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.sidebar-user { font-size: 14px; color: var(--text-secondary); font-weight: 400; }
.sidebar-user strong { color: var(--text); display: block; font-size: 16px; font-weight: 400; letter-spacing: .5px; }
.btn-logout { margin-top: 10px; background: transparent; border: 1px solid var(--border); color: var(--text-light); padding: 7px 12px; font-size: 13px; width: 100%; border-radius: 8px; letter-spacing: 1px; }
.btn-logout:hover { background: var(--sidebar-hover); color: var(--primary); border-color: var(--primary); }

/* --- Main Content --- */
.main { margin-left: 220px; flex: 1; min-height: 100vh; }
.header { background: var(--card); border-bottom: 1px solid var(--border-light); padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; }
.header h1 { font-size: 20px; font-weight: 500; letter-spacing: 1px; color: var(--text); }
.content { padding: clamp(16px, 2vw, 36px) clamp(20px, 2.5vw, 40px); }

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.stat-card:hover::after {
  transform: scaleX(1);
}
.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.stat-card .label { font-size: 13px; color: var(--text-light); margin-bottom: 8px; letter-spacing: .5px; font-weight: 400; }
.stat-card .value { font-size: 28px; font-weight: 600; color: var(--text); letter-spacing: -.5px; }
.stat-card .sub   { font-size: 13px; color: var(--text-light); margin-top: 6px; font-weight: 400; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-header { padding: 16px 22px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 16px; font-weight: 500; letter-spacing: .3px; color: var(--text); }
.card-body { padding: 22px 24px; }
.card-body:has(> table) { padding: 0; overflow-x: auto; }
.card-body > table { min-width: 100%; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  letter-spacing: .2px;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}
.btn:active {
  transform: scale(.97);
}

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 2px 8px rgba(92,122,123,.2); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #247A50; border-color: #247A50; }
.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover  { background: #A93226; border-color: #A93226; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #A87030; border-color: #A87030; }
.btn-ghost   { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-soft); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 5px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; letter-spacing: .2px; }
.badge-blue   { background: #E8F0F6; color: #3A6B8C; }
.badge-green  { background: #E6F4EE; color: #2D7A52; }
.badge-yellow { background: #FDF6EC; color: #A07030; }
.badge-red    { background: #FDECEB; color: #B03025; }
.badge-gray   { background: #F0F2F4; color: #6B7785; }
.badge-purple { background: #E4ECEC; color: #5C7A7B; }
.badge-orange { background: #FDF0E6; color: #C47A2A; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,35,51,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
  animation: fadeIn .2s ease both;
}
.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: min(90vw, 800px);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn .25s ease both;
}
.modal-lg { width: min(92vw, 1100px); }
.modal-full { width: min(98vw, 1600px); max-height: 92vh; border-radius: 12px; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { font-size: 17px; font-weight: 500; letter-spacing: .5px; color: var(--text); }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-light); cursor: pointer; padding: 0; line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }

/* --- Form Groups --- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 400; margin-bottom: 6px; color: var(--text-light); letter-spacing: .5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ============================================================
   UPLOAD / FILE ITEMS
   ============================================================ */
.upload-zone { border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 44px; text-align: center; cursor: pointer; transition: all .2s; background: #FAFBFC; }
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone p { font-size: 16px; color: var(--text-light); margin-top: 10px; }

.file-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-light); gap: 14px; }
.file-item:last-child { border-bottom: none; }
.file-icon { width: 38px; height: 38px; background: var(--primary-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.file-info { flex: 1; }
.file-info .name { font-weight: 400; font-size: 14px; letter-spacing: .2px; color: var(--text); }
.file-info .meta { font-size: 13px; color: var(--text-light); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-light); }
.empty-state p { font-size: 16px; margin-bottom: 16px; font-weight: 400; }

/* ============================================================
   TOAST
   ============================================================ */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 22px; border-radius: var(--radius-sm); color: #fff; font-size: 14px; font-weight: 500; z-index: 2000; animation: slideIn .3s ease; letter-spacing: .2px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 22px; gap: 0; }
.tab {
  padding: 11px 22px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .2s;
  letter-spacing: .3px;
  position: relative;
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--primary); font-weight: 500; border-bottom-color: var(--primary); }

/* ============================================================
   FINANCE SUMMARY
   ============================================================ */
.finance-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.finance-box { background: #FAFBFC; border-radius: var(--radius); padding: 18px; text-align: center; border: 1px solid var(--border-light); }
.finance-box .label { font-size: 13px; color: var(--text-light); margin-bottom: 6px; letter-spacing: .3px; }
.finance-box .val { font-size: 24px; font-weight: 600; letter-spacing: -.3px; }
.finance-box .val.income  { color: var(--success); }
.finance-box .val.expense { color: var(--danger); }
.finance-box .val.profit  { color: var(--primary); }

/* ============================================================
   STEP FILES
   ============================================================ */
.step-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.step-file-tag { background: var(--primary-light); padding: 3px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: background .15s; color: var(--text-secondary); }
.step-file-tag:hover { background: var(--primary-soft); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D0CCC6; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #B8B2AA; }

/* ============================================================
   IMAGE GROUP / PREVIEW
   ============================================================ */
.img-group-title::before { content: ""; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }
.img-preview-close:hover { background: rgba(255,255,255,.2); }

/* ============================================================
   NEW COMPONENTS
   ============================================================ */

/* --- Search Bar --- */
.search-bar {
  position: relative;
  max-width: 420px;
  margin-bottom: 20px;
}
.search-bar input {
  padding-left: 40px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
  font-size: 14px;
}
.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92,122,123,.1);
}
.search-bar svg,
.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-light);
  pointer-events: none;
}

/* --- Filter Chips --- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.filter-chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .3px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-light);
  cursor: pointer;
  transition: all .2s;
}
.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  position: relative;
  transition: width .6s ease;
}

/* --- Chart Container --- */
.chart-container {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 20px 16px 16px 8px;
  height: 220px;
}
.chart-container .chart-title {
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: .5px;
}

/* --- Y Axis --- */
.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 8px;
  min-width: 36px;
  height: 100%;
}
.chart-y-label {
  font-size: 10px;
  color: var(--text-light);
  line-height: 1;
}

/* --- Plot Area --- */
.chart-plot-area {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chart-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-light);
  pointer-events: none;
}

/* --- Bar Chart --- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 1;
  padding: 0 8px;
  position: relative;
  z-index: 1;
}
.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
  justify-content: flex-end;
  gap: 4px;
  height: 140px;
}
.bar-value {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 2px;
  white-space: nowrap;
  color: var(--text-secondary);
}
.bar {
  width: 100%;
  max-width: 48px;
  border-radius: 4px 4px 0 0;
  transition: height .5s ease, opacity .3s;
  position: relative;
  min-height: 4px;
}
.bar:hover {
  opacity: .85;
  filter: brightness(1.1);
}
.bar-group .bar-label {
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: .3px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
  padding-top: 4px;
}

/* --- Kanban --- */
.kanban-column {
  background: #E4ECEC;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  padding: 16px;
  min-width: 260px;
  flex: 1;
}
.kanban-column .kanban-column-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-card {
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: grab;
  transition: box-shadow .2s, transform .2s;
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kanban-card:active {
  cursor: grabbing;
  transform: scale(.98);
}
.kanban-card .kanban-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.kanban-card .kanban-card-meta {
  font-size: 12px;
  color: var(--text-light);
}

/* --- Message Panel --- */
.msg-panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 480px;
  overflow: hidden;
}
.msg-panel .msg-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .3px;
}
.msg-panel .msg-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg-panel .msg-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 8px;
}
.msg-panel .msg-footer input {
  flex: 1;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
}

.msg-item {
  display: flex;
  gap: 10px;
  animation: fadeInUp .3s ease both;
}
.msg-item .msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--primary-dark);
  font-weight: 500;
  flex-shrink: 0;
}
.msg-item .msg-bubble {
  background: #F8F6F4;
  border-radius: 12px;
  padding: 10px 14px;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.5;
}
.msg-item .msg-bubble .msg-sender {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}
.msg-item .msg-bubble .msg-text {
  color: var(--text);
}
.msg-item .msg-bubble .msg-time {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 4px;
}
.msg-item.own {
  flex-direction: row-reverse;
}
.msg-item.own .msg-bubble {
  background: var(--primary-light);
}

/* --- Todo Banner --- */
.todo-banner {
  background: linear-gradient(135deg, var(--primary-light), #fff);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeInUp .4s ease both;
}
.todo-banner .todo-banner-text {
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
}
.todo-banner .todo-banner-text strong {
  font-weight: 600;
  color: var(--primary-dark);
}
.todo-banner .todo-banner-count {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
  margin-left: 16px;
  white-space: nowrap;
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
  background: #E8ECF0;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.5) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 100%;
}
.skeleton-text:last-child {
  width: 60%;
}
.skeleton-heading {
  height: 22px;
  width: 40%;
  margin-bottom: 12px;
}
.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.skeleton-card {
  height: 120px;
  border-radius: var(--radius);
}

/* ============================================================
   DATA-TOOLTIP
   ============================================================ */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--sidebar);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .3px;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 999;
}
[data-tooltip]::after {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--sidebar);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  z-index: 999;
}
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
[data-tooltip]:hover::after {
  opacity: 1;
}

/* ============================================================
   RESPONSIVE — Tablet (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar {
    width: 64px;
    overflow: hidden;
  }
  .sidebar-logo,
  .sidebar-brand-cn,
  .nav-item-text,
  .sidebar-user,
  .sidebar-footer {
    display: none;
  }
  .sidebar-brand {
    padding: 16px 0;
    text-align: center;
  }
  .nav-item {
    justify-content: center;
    padding: 14px 0;
  }
  .nav-item svg {
    width: 20px;
    height: 20px;
  }
  .main {
    margin-left: 64px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .finance-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal {
    width: 90%;
    max-width: 800px;
  }
  .modal-lg {
    width: 92%;
    max-width: 1100px;
  }
  .modal-full {
    width: 96%;
    max-width: 1300px;
  }
  .chart-container {
    height: 180px;
  }
}

/* ============================================================
   MOBILE MENU BUTTON (hidden on desktop)
   ============================================================ */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
  color: var(--text);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
  opacity: 0;
  transition: opacity .3s;
}

/* ============================================================
   RESPONSIVE — Mobile (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* --- Mobile menu button visible --- */
  .mobile-menu-btn {
    display: flex;
  }

  /* --- Sidebar as drawer overlay --- */
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    transition: transform .3s ease;
    z-index: 200;
  }
  .sidebar-logo,
  .sidebar-brand-cn,
  .nav-item-text,
  .sidebar-user {
    display: unset;
  }
  .sidebar-footer {
    display: block;
  }
  .sidebar-brand {
    padding: 24px 20px;
    text-align: left;
  }
  .nav-item {
    justify-content: flex-start;
    padding: 12px 20px;
  }
  .nav-item svg {
    width: 18px;
    height: 18px;
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
  }

  /* --- Main content full width --- */
  .main {
    margin-left: 0;
  }

  /* --- Header with space for hamburger --- */
  .header {
    padding: 14px 16px;
    padding-left: 58px;
  }
  .header h1 {
    font-size: 18px;
  }

  /* --- Content padding --- */
  .content {
    padding: 12px;
  }

  /* --- Stats grid single column --- */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 14px 16px;
  }
  .stat-card .value {
    font-size: 24px;
  }
  .stat-card .label {
    font-size: 12px;
  }

  /* --- Cards --- */
  .card-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .card-body {
    padding: 14px;
  }

  /* --- TABLE → Card view on mobile --- */
  .card-body table,
  .card-body thead,
  .card-body tbody,
  .card-body th,
  .card-body td,
  .card-body tr {
    display: block;
  }
  .card-body thead {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  .card-body tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 10px 14px;
    background: var(--card);
    box-shadow: var(--shadow);
  }
  .card-body td {
    border-bottom: none;
    padding: 3px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .card-body td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-light);
    font-size: 12px;
    min-width: 60px;
    flex-shrink: 0;
  }
  .card-body td:first-child {
    font-size: 16px;
    margin-bottom: 4px;
  }
  .card-body td:first-child::before {
    display: none;
  }
  .card-body td:last-child {
    margin-top: 6px;
    justify-content: flex-end;
  }
  .card-body td:last-child::before {
    display: none;
  }

  /* --- Form rows stack --- */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* --- Finance summary --- */
  .finance-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .finance-box .val {
    font-size: 20px;
  }

  /* --- Tabs scrollable --- */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tab {
    padding: 10px 14px;
    white-space: nowrap;
    font-size: 14px;
  }

  /* --- Modal full-screen on mobile --- */
  .modal,
  .modal-lg,
  .modal-full {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  .modal-header {
    padding: 14px 16px;
    padding-left: 52px;
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 10;
  }
  .modal-header h2 {
    font-size: 16px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-footer {
    padding: 12px 16px;
    position: sticky;
    bottom: 0;
    background: var(--card);
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-footer .btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  /* --- Project detail overview grid → single column --- */
  .modal-body > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* --- Workflow progress bar responsive --- */
  .modal-body div[style*="width:200px"] {
    width: 100px !important;
    flex-shrink: 1;
  }

  /* --- Workflow step cards --- */
  .wf-phase-container > div[style*="padding:12px"] {
    padding: 10px !important;
    margin-bottom: 5px !important;
  }

  /* --- Workflow step header: allow wrapping --- */
  .wf-phase-container > div[style*="padding:12px"] > div[style*="display:flex"][style*="gap:12px"] {
    flex-wrap: wrap;
  }

  /* --- Workflow buttons wrap --- */
  .wf-phase-container > div[style*="padding:12px"] > div > div[style*="display:flex"][style*="gap:8px"] {
    flex-wrap: wrap;
    gap: 4px !important;
  }

  /* --- Workflow step form inputs full width --- */
  .modal-body textarea[id="step-note-input"] {
    width: 100%;
  }

  /* --- Phase header buttons wrap --- */
  div[style*="wf-phase-header"] {
    flex-wrap: wrap;
  }

  /* --- Kanban / Phases page: narrower columns (handled by .ph-column class) --- */

  /* --- Message panel --- */
  .msg-panel {
    height: 400px;
  }
  .msg-item .msg-bubble {
    max-width: 85%;
  }

  /* --- Todo banner --- */
  .todo-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }
  .todo-banner .todo-banner-count {
    margin-left: 0;
  }

  /* --- Toast positioning --- */
  .toast {
    left: 16px;
    right: 16px;
    text-align: center;
  }

  /* --- Upload zone --- */
  .upload-zone {
    padding: 24px;
  }

  /* --- Chart --- */
  .chart-container {
    height: 150px;
  }
  .bar-group .bar-label {
    font-size: 9px;
    max-width: 50px;
  }

  /* --- Filter chips wrap --- */
  .filter-chips {
    gap: 6px;
  }
  .filter-chip {
    padding: 5px 12px;
    font-size: 12px;
  }

  /* --- Search bar --- */
  .search-bar {
    max-width: 100%;
  }

  /* --- Customer database mobile --- */
  div[style*="min-width:200px"] {
    min-width: auto !important;
  }

  /* --- Buttons touch-friendly sizing --- */
  .btn {
    min-height: 36px;
  }
  .btn-sm {
    min-height: 32px;
    padding: 6px 12px;
  }

  /* --- Sidebar footer buttons on mobile --- */
  .sidebar-footer .btn-logout {
    padding: 10px 12px;
    font-size: 14px;
    min-height: 40px;
  }

  /* --- Login page mobile --- */
  .login-right {
    padding: 24px;
  }
  .login-form-wrap .welcome h2 {
    font-size: 24px;
  }

  /* --- Pagination wrap --- */
  div[style*="justify-content:center"][style*="gap:6px"] {
    flex-wrap: wrap;
  }

  /* --- File item mobile --- */
  .file-item {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* --- Step file tags --- */
  .step-file-tag {
    font-size: 13px;
    padding: 4px 10px;
  }

  /* --- Image preview mobile --- */
  .img-preview-close {
    width: 36px;
    height: 36px;
  }
}

/* ============================================================
   RESPONSIVE — Small mobile (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {
  /* Stats grid: 1 column on very small screens */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Header tighter */
  .header {
    padding: 12px;
    padding-left: 54px;
  }
  .header h1 {
    font-size: 17px;
  }

  /* Content tighter padding */
  .content {
    padding: 10px;
  }

  /* Kanban columns handled by .ph-column class */

  /* Modal body tighter */
  .modal-body {
    padding: 12px;
  }

  /* Workflow progress bar even smaller */
  .modal-body div[style*="width:200px"],
  .modal-body div[style*="width:100px"] {
    width: 70px !important;
  }
}

/* Required field styles */
.form-group label .req {
  color: var(--danger, #ef4444);
  margin-left: 2px;
  font-weight: 600;
}
.form-group input.field-required,
.form-group select.field-required,
.form-group textarea.field-required {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
  animation: fieldShake 0.3s ease;
}
@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Folder tree action buttons show on hover */
.folder-tree-item:hover .folder-tree-actions { display: flex !important; }

/* Percent slider thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 2px solid #5C7A7B;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 2px solid #5C7A7B;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* --- File Manager: Thumbnail Grid View --- */
.file-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
}

.file-thumb-card {
  width: 170px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: all 0.15s ease;
  position: relative;
}

.file-thumb-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.12);
}

.file-thumb-card.selected {
  border-color: var(--primary);
  background: #f0f5ff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.file-thumb-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}

.file-thumb-card:hover .file-thumb-check,
.file-thumb-card.selected .file-thumb-check {
  opacity: 1;
}

.file-thumb-img-wrap {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

.file-thumb-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-thumb-info {
  padding: 10px 12px 8px;
}

.file-thumb-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.file-thumb-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.file-thumb-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 0 12px 10px;
  opacity: 0;
  transition: opacity 0.15s;
}

.file-thumb-card:hover .file-thumb-actions {
  opacity: 1;
}

@media (max-width: 768px) {
  .file-grid {
    gap: 10px;
    padding: 10px;
  }
  .file-thumb-card {
    width: calc(50% - 5px);
  }
  .file-thumb-img-wrap {
    height: 110px;
  }
  .file-thumb-actions {
    opacity: 1;
  }
}

/* ============================================================
   SUPPLY MODULE (长期供货)
   ============================================================ */
.supply-customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.supply-cust-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.supply-cust-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(92,122,123,0.1);
}
.scc-name {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.scc-meta {
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}
.scc-stats {
  display: flex;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.scc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.scc-stat strong {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.scc-stat span {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Breadcrumb */
.supply-breadcrumb {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
}
.supply-breadcrumb a {
  color: var(--primary);
  cursor: pointer;
}
.supply-breadcrumb a:hover {
  text-decoration: underline;
}

/* Customer banner */
.supply-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: 12px;
  padding: 24px 28px;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.sb-name {
  font-size: 24px;
  font-weight: 700;
}
.sb-meta {
  font-size: 14px;
  opacity: 0.85;
  margin-top: 6px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.sb-stats {
  display: flex;
  gap: 32px;
}
.sb-stat {
  text-align: center;
}
.sb-stat-val {
  font-size: 24px;
  font-weight: 700;
}
.sb-stat-label {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 2px;
}

/* Page header */
.supply-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.supply-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.supply-page-sub {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Tags */
.supply-type-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: #F0F5F5;
  color: #5C7A7B;
}
.supply-status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.ss-pending { background: #fef3c7; color: #92400e; }
.ss-producing { background: #dbeafe; color: #1e40af; }
.ss-shipped { background: #e0e7ff; color: #3730a3; }
.ss-done { background: #d1fae5; color: #065f46; }

.supply-invoice-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.si-no { background: #fee2e2; color: #991b1b; }
.si-partial { background: #fef3c7; color: #92400e; }
.si-yes { background: #d1fae5; color: #065f46; }

/* Workflow steps */
.supply-wf-steps {
  display: flex;
  align-items: center;
  padding: 10px 0;
}
.supply-wf-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.supply-wf-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid var(--border);
  color: var(--text-light);
  background: var(--card);
}
.supply-wf-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
}
.supply-wf-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 -10px;
  margin-bottom: 24px;
}

/* Project cards */
.supply-project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.supply-proj-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.15s;
}
.supply-proj-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(92,122,123,0.1);
}
.spc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.spc-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.spc-meta {
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.spc-stats {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.spc-stat {
  font-size: 12px;
  color: var(--text-light);
}
.spc-stat strong {
  color: var(--text);
  font-size: 16px;
}

/* Expand link */
.supply-expand-link {
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
}
.supply-expand-link:hover {
  text-decoration: underline;
}

/* Summary bar */
.supply-summary-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 22px;
  background: #f8f9fa;
  border-top: 1px solid var(--border-light);
  font-size: 14px;
  flex-wrap: wrap;
}
.supply-summary-bar .label {
  color: var(--text-light);
}
.supply-summary-bar .value {
  font-weight: 600;
  margin-right: 8px;
}

/* Form styles */
.supply-form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.supply-form-section-title:first-child {
  margin-top: 0;
}
.supply-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.supply-form-row.triple {
  grid-template-columns: 1fr 1fr 1fr;
}
.supply-form-row.full {
  grid-template-columns: 1fr;
}
.supply-fg {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.supply-fg label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.supply-fg .req {
  color: #dc2626;
}
.supply-fg input,
.supply-fg select,
.supply-fg textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.supply-fg input:focus,
.supply-fg select:focus,
.supply-fg textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(92,122,123,0.1);
}
.supply-fg textarea {
  resize: vertical;
  min-height: 60px;
}

/* Product table */
.supply-product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 8px;
}
.supply-product-table th {
  text-align: left;
  padding: 8px 10px;
  background: #f8f9fa;
  border: 1px solid var(--border);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 13px;
}
.supply-product-table td {
  padding: 6px 8px;
  border: 1px solid var(--border);
}
.supply-product-table input,
.supply-product-table select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.supply-product-table input:focus,
.supply-product-table select:focus {
  border-color: var(--primary);
}
.supply-product-table .row-num {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  width: 36px;
}
.supply-product-table .col-amount {
  font-weight: 600;
  text-align: right;
  padding-right: 12px;
  white-space: nowrap;
}
.supply-product-table .col-action {
  width: 40px;
  text-align: center;
}
.supply-total-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  font-size: 14px;
}
.supply-total-bar .total-label {
  color: var(--text-secondary);
}
.supply-total-bar .total-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.supply-btn-add-row {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px dashed var(--primary-soft);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.supply-btn-add-row:hover {
  background: var(--primary-soft);
}

/* Info grid */
.supply-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.supply-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.supply-info-label {
  font-size: 13px;
  color: var(--text-light);
}
.supply-info-value {
  font-size: 16px;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .supply-customer-grid {
    grid-template-columns: 1fr;
  }
  .supply-project-cards {
    grid-template-columns: 1fr;
  }
  .supply-form-row.triple {
    grid-template-columns: 1fr;
  }
  .supply-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .sb-stats {
    gap: 20px;
  }
  .supply-info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   FULL-PAGE PROJECT DETAIL VIEW
   ============================================================ */

/* Top bar */
.pd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  margin: -24px -24px 24px -24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.pd-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.pd-back-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
}
.pd-back-btn:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text-light);
}
.pd-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}
.pd-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pd-topbar-actions {
  display: flex;
  gap: 8px;
}

/* Tabs */
.pd-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin: 0 -24px 24px -24px;
  padding: 0 24px;
  background: #fff;
}
.pd-tab {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  user-select: none;
}
.pd-tab:hover {
  color: var(--text);
  background: var(--bg);
}
.pd-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.pd-tab-count {
  font-size: 12px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Content area */
.pd-content {
  padding: 0;
}

/* Hero progress banner */
.pd-hero {
  position: relative;
  background: linear-gradient(135deg, #4A6364, #5C7A7B, #8FA3A0);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 24px;
  overflow: hidden;
  color: #fff;
}
.pd-hero-deco1 {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.pd-hero-deco2 {
  position: absolute;
  bottom: -40px;
  right: 80px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.pd-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.pd-hero-left {
  flex: 1;
}
.pd-hero-label {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 4px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.pd-hero-pct {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}
.pd-hero-sub {
  font-size: 16px;
  opacity: 0.75;
}
.pd-hero-right {
  width: 240px;
  flex-shrink: 0;
  margin-left: 32px;
}
.pd-hero-bar {
  height: 10px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}
.pd-hero-bar-fill {
  height: 100%;
  background: #fff;
  border-radius: 10px;
  transition: width 0.5s ease;
}
.pd-hero-meta {
  font-size: 14px;
  opacity: 0.85;
}

/* Metric cards */
.pd-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.pd-metric {
  padding: 20px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.pd-metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin-bottom: 12px;
  color: #fff;
}
.pd-metric-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
  font-weight: 500;
}
.pd-metric-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-all;
}

.pd-metric-client {
  background: linear-gradient(135deg, #F0F5F5, #E4ECEC);
  border: 1px solid #D0CBC5;
}
.pd-metric-client .pd-metric-icon {
  background: linear-gradient(135deg, #5C7A7B, #8FA3A0);
}

.pd-metric-amount {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
}
.pd-metric-amount .pd-metric-icon {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.pd-metric-pm {
  background: linear-gradient(135deg, #F0F5F5, #E8E4DF);
  border: 1px solid #D5D0CA;
}
.pd-metric-pm .pd-metric-icon {
  background: linear-gradient(135deg, #5C7A7B, #8FA3A0);
}

.pd-metric-contact {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa;
}
.pd-metric-contact .pd-metric-icon {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

/* Supply project overview banner */
.pd-supply-banner {
  background: linear-gradient(135deg, #F0F5F5, #E4ECEC);
  border: 1px solid #D0CBC5;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 20px;
}
.pd-supply-banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.pd-supply-banner-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pd-supply-banner-title {
  font-size: 13px;
  font-weight: 600;
  color: #5C7A7B;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pd-supply-banner-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.pd-supply-banner-right {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.pd-supply-banner-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pd-supply-banner-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}
.pd-supply-banner-value {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

/* Detail panel */
.pd-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.pd-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.pd-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.pd-field {
  padding: 8px 0;
}
.pd-field-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
  font-weight: 500;
}
.pd-field-value {
  font-size: 16px;
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
}

/* ============================================================
   Phases Page (Kanban)
   ============================================================ */
.ph-kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-bottom: 20px;
}
.ph-column {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ph-column-bar {
  height: 3px;
  flex-shrink: 0;
}
.ph-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
}
.ph-column-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ph-column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ph-column-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .2px;
}
.ph-column-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}
.ph-column-body {
  padding: 0 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}
.ph-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--text-light);
  font-size: 14px;
}
.ph-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .15s ease, border-color .2s ease;
  box-shadow: var(--shadow);
}
.ph-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border);
}
.ph-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
}
.ph-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ph-card-client {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ph-card-amt {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.ph-card-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .3px;
}
.ph-badge-bidding {
  background: #F3EEF7;
  color: #7B2D8B;
}
.ph-badge-procurement {
  background: #E4ECEC;
  color: #5C7A7B;
}
.ph-badge-supply {
  background: #FFF7ED;
  color: #EA580C;
}
.ph-card-progress-track {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}
.ph-card-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
}
.ph-card-progress-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  text-align: right;
}

/* Responsive */
@media (max-width: 1024px) {
  .pd-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .pd-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pd-hero-right {
    width: 180px;
  }
  .pd-supply-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .ph-kanban {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .pd-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin: -16px -16px 16px -16px;
  }
  .pd-topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .pd-tabs {
    margin: 0 -16px 16px -16px;
    padding: 0 16px;
    overflow-x: auto;
  }
  .pd-tab {
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
  }
  .pd-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .pd-detail-grid {
    grid-template-columns: 1fr;
  }
  .pd-hero {
    padding: 20px;
  }
  .pd-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .pd-hero-right {
    width: 100%;
    margin-left: 0;
  }
  .pd-hero-pct {
    font-size: 32px;
  }
  .ph-kanban {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== Finance & Reconciliation Cards ========== */
.fin-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.fin-card-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.fin-card {
  padding: 18px 20px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}
.fin-card-deco1 {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  right: -10px;
  top: -10px;
  opacity: 0.12;
}
.fin-card-deco2 {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  right: 20px;
  bottom: -8px;
  opacity: 0.08;
}
.fin-card-label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  opacity: 0.85;
}
.fin-card-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-all;
}
.fin-card-sub {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.65;
  font-weight: 500;
}

/* Card color variants */
.fin-card-blue {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #bfdbfe;
  color: #1e40af;
}
.fin-card-blue .fin-card-deco1,
.fin-card-blue .fin-card-deco2 { background: #5C7A7B; }

.fin-card-green {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #bbf7d0;
  color: #166534;
}
.fin-card-green .fin-card-deco1,
.fin-card-green .fin-card-deco2 { background: #22c55e; }

.fin-card-red {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-color: #fecaca;
  color: #991b1b;
}
.fin-card-red .fin-card-deco1,
.fin-card-red .fin-card-deco2 { background: #ef4444; }

.fin-card-purple {
  background: linear-gradient(135deg, #F0F5F5, #E8E4DF);
  border-color: #D5D0CA;
  color: #4A6364;
}
.fin-card-purple .fin-card-deco1,
.fin-card-purple .fin-card-deco2 { background: #5C7A7B; }

.fin-card-amber {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #fde68a;
  color: #92400e;
}
.fin-card-amber .fin-card-deco1,
.fin-card-amber .fin-card-deco2 { background: #f59e0b; }

.fin-card-teal {
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border-color: #99f6e4;
  color: #115e59;
}
.fin-card-teal .fin-card-deco1,
.fin-card-teal .fin-card-deco2 { background: #14b8a6; }

.fin-card-indigo {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border-color: #c7d2fe;
  color: #3730a3;
}
.fin-card-indigo .fin-card-deco1,
.fin-card-indigo .fin-card-deco2 { background: #8FA3A0; }

.fin-card-rose {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border-color: #fecdd3;
  color: #9f1239;
}
.fin-card-rose .fin-card-deco1,
.fin-card-rose .fin-card-deco2 { background: #f43f5e; }

/* Finance panels */
.fin-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.fin-chart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.fin-chart-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.fin-charts-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.fin-charts-row > .fin-panel {
  flex: 1;
  margin-bottom: 0;
}

/* Record sections */
.fin-record-section {
  margin-top: 16px;
}
.fin-record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.fin-record-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Empty states */
.fin-empty {
  text-align: center;
  padding: 24px;
}
.fin-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.4;
}
.fin-empty-text {
  font-size: 14px;
  color: var(--text-light);
}

/* Finance responsive */
@media (max-width: 1024px) {
  .fin-card-grid,
  .fin-card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .fin-charts-row {
    flex-direction: column;
  }
}
@media (max-width: 768px) {
  .fin-card-grid,
  .fin-card-grid-4 {
    grid-template-columns: 1fr;
  }
  .fin-card-value {
    font-size: 20px;
  }
}

/* ============================================================
   PROJECT FORM REDESIGN
   ============================================================ */

/* Wider modal for project form */
.pf-modal {
  max-width: 680px;
  width: 95vw;
}

/* Sections */
.pf-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.pf-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.pf-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
  line-height: 1;
}

/* Required asterisk */
.pf-req {
  color: #ef4444;
  font-size: 13px;
}

/* Type selection cards */
.pf-type-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.pf-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
  text-align: center;
}
.pf-type-card:hover {
  border-color: var(--primary);
  background: rgba(59,130,246,0.03);
}
.pf-type-card.active {
  border-color: var(--primary);
  background: rgba(59,130,246,0.06);
  box-shadow: 0 0 0 1px var(--primary);
}
.pftc-icon {
  font-size: 24px;
  margin-bottom: 6px;
  color: var(--primary);
  line-height: 1;
}
.pftc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.pftc-desc {
  font-size: 12px;
  color: var(--text-light);
}

/* Workflow preview */
.pf-wf-preview {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.pfp-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
  font-weight: 500;
}
.pfp-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.pfp-flow::-webkit-scrollbar {
  height: 4px;
}
.pfp-flow::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.pfp-phase-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}
.pfp-phase-bar {
  height: 6px;
  border-radius: 3px;
  min-width: 36px;
  transition: all .2s;
}
.pfp-phase-bar-single {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  min-width: 6px;
}
.pfp-phase-connector {
  width: 16px;
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
  align-self: center;
  margin-bottom: 20px;
}
.pfp-phase-name {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 6px;
  white-space: nowrap;
  font-weight: 500;
}
.pfp-phase-count {
  font-size: 9px;
  color: var(--text-light);
  opacity: .7;
  margin-top: 1px;
}

/* Supply section */
.pf-supply-section {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}
.pf-supply-section .pf-section-title {
  border-left-color: #d97706;
  color: #92400e;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .pf-type-cards {
    grid-template-columns: 1fr;
  }
  .pf-modal {
    max-width: 100%;
    width: 100%;
  }
}

/* ============================================================
   SUPPLY ORDER STYLES (协议供货订单)
   ============================================================ */

/* Agreement bar */
.so-agreement-bar {
  display: flex;
  gap: 24px;
  padding: 12px 16px;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.so-agreement-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.so-agreement-label {
  color: #92400e;
  font-weight: 500;
}
.so-agreement-value {
  color: var(--text);
  font-weight: 600;
}

/* Summary stats row */
.so-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.so-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.so-stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.so-stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}
.so-stat-progress .so-stat-num { color: #5C7A7B; }
.so-stat-done .so-stat-num { color: #16a34a; }
.so-stat-amount .so-stat-num { color: #d97706; font-size: 20px; }

/* Toolbar */
.so-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

/* Order table */
.so-order-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--card-bg);
}
.so-order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.so-order-table thead {
  background: #f8fafc;
}
.so-order-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.so-order-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.so-order-table tbody tr:last-child td {
  border-bottom: none;
}
.so-order-table tbody tr:hover {
  background: #f8fafc;
}
.so-product-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 200px;
  font-size: 13px;
  color: var(--text-light);
}

/* Progress cell in table */
.so-progress-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.so-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.so-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5C7A7B, #8FA3A0);
  border-radius: 3px;
  transition: width .3s ease;
}
.so-progress-text {
  font-size: 12px;
  color: var(--text-light);
}

/* Status badges */
.so-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}
.so-status-done {
  background: #dcfce7;
  color: #166534;
}

/* Action buttons in table */
.so-actions-cell {
  white-space: nowrap;
}
.so-act-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background .15s;
}
.so-act-view { color: #5C7A7B; }
.so-act-view:hover { background: #F0F5F5; }
.so-act-edit { color: #d97706; }
.so-act-edit:hover { background: #fef3c7; }
.so-act-del { color: #dc2626; }
.so-act-del:hover { background: #fef2f2; }

/* ============================================================
   SUPPLY ORDER DETAIL MODAL
   ============================================================ */

/* Order info bar */
.sod-info-bar {
  display: flex;
  gap: 20px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sod-info-item {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sod-info-label {
  color: var(--text-light);
  font-size: 13px;
}

/* Progress section */
.sod-progress-wrap {
  margin-bottom: 20px;
}
.sod-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-light);
}
.sod-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}
.sod-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5C7A7B, #8FA3A0);
  border-radius: 4px;
  transition: width .4s ease;
}

/* Step dots */
.sod-step-dots {
  display: flex;
  justify-content: space-between;
  position: relative;
}
.sod-step-dots::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}
.sod-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 1;
  flex: 1;
}
.sod-dot-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
  border: 2px solid #d1d5db;
  color: #9ca3af;
  transition: all .2s;
}
.sod-dot-done .sod-dot-circle {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.sod-dot-current .sod-dot-circle {
  border-color: #5C7A7B;
  color: #5C7A7B;
  box-shadow: 0 0 0 3px rgba(92, 122, 123, .15);
}
.sod-dot-label {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  white-space: nowrap;
}
.sod-dot-done .sod-dot-label { color: #16a34a; font-weight: 500; }
.sod-dot-current .sod-dot-label { color: #5C7A7B; font-weight: 600; }

/* Step cards */
.sod-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sod-step-card {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s;
}
.sod-step-card:hover {
  border-color: #cbd5e1;
}
.sod-step-done {
  border-color: #bbf7d0;
  background: #fafff9;
}
.sod-step-expanded {
  border-color: #93c5fd;
}
.sod-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .15s;
}
.sod-step-header:hover {
  background: #f8fafc;
}
.sod-step-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sod-step-idx {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--text-light);
}
.sod-step-done .sod-step-idx {
  background: #dcfce7;
  color: #16a34a;
}
.sod-step-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.sod-step-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.sod-badge-done {
  background: #dcfce7;
  color: #166534;
}
.sod-step-arrow {
  font-size: 12px;
  color: var(--text-light);
}

/* Step body (expanded) */
.sod-step-body {
  padding: 16px;
  border-top: 1px solid var(--border-light);
  background: #F0F5F5;
}
.sod-step-desc {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.5;
}
.sod-docs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sod-doc-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 13px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  border: 1px solid #fde68a;
}
.sod-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.sod-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sod-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
}
.sod-field input,
.sod-field textarea,
.sod-field select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
}
.sod-field input:focus,
.sod-field textarea:focus,
.sod-field select:focus {
  outline: none;
  border-color: #5C7A7B;
  box-shadow: 0 0 0 2px rgba(92, 122, 123, .1);
}
.sod-field-full {
  grid-column: 1 / -1;
}
.sod-field textarea {
  resize: vertical;
  min-height: 50px;
}
.sod-step-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* Responsive */
@media (max-width: 768px) {
  .so-summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .so-order-table th:nth-child(3),
  .so-order-table td:nth-child(3) {
    display: none;
  }
  .sod-fields {
    grid-template-columns: 1fr;
  }
  .sod-step-dots {
    overflow-x: auto;
  }
  .sod-dot-label {
    font-size: 10px;
  }
  .modal-full {
    width: 100%;
    max-height: 96vh;
  }
}
@media (max-width: 600px) {
  .so-summary-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .so-stat-card {
    padding: 10px 12px;
  }
  .so-stat-num {
    font-size: 20px;
  }
  .so-agreement-bar {
    flex-direction: column;
    gap: 8px;
  }
  .sod-info-bar {
    flex-direction: column;
    gap: 8px;
  }
}

/* ===== Reconciliation Timeline ===== */
.recon-tl-node {
  transition: transform 0.15s;
}
.recon-tl-node:hover {
  transform: translateY(-2px);
}
.recon-node-overdue .recon-dot {
  animation: reconPulse 2s infinite;
}
@keyframes reconPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(192,57,43,0); }
}

/* ===== Supply Order Product Table ===== */
.sof-form-grid { grid-template-columns: 1fr 1fr 1fr !important; margin-bottom: 20px; }
.sof-form-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sof-form-toolbar-btns { display: flex; gap: 8px; }
.sof-form-total { font-size: 16px; font-weight: 600; }
.sof-form-total span { color: var(--primary); }
.sof-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sof-empty { text-align: center; padding: 24px; color: var(--text-light); font-size: 14px; }
#sof-prod-table {
  border-collapse: collapse;
  table-layout: fixed;
  --sof-col-cb: 36px;
  --sof-col-seq: 44px;
  --sof-col-name: 200px;
  --sof-col-spec: 120px;
  --sof-col-unit: 60px;
  --sof-col-qty: 80px;
  --sof-col-price: 100px;
  --sof-col-amt: 110px;
  --sof-col-act: 40px;
  --sof-cell-px: 6px;
  --sof-cell-py: 6px;
}
#sof-prod-table thead tr {
  background: var(--primary-light);
  border-bottom: 1px solid var(--border);
}
#sof-prod-table th {
  padding: 8px var(--sof-cell-px);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sof-prod-table .sof-th-cb,
#sof-prod-table .sof-td-cb { width: var(--sof-col-cb); text-align: center; }
#sof-prod-table .sof-th-seq,
#sof-prod-table .sof-row-seq { width: var(--sof-col-seq); text-align: center; }
#sof-prod-table .sof-th-name { width: var(--sof-col-name); text-align: left; }
#sof-prod-table .sof-th-spec { width: var(--sof-col-spec); text-align: left; }
#sof-prod-table .sof-th-unit,
#sof-prod-table .sof-p-unit { width: var(--sof-col-unit); text-align: center; }
#sof-prod-table .sof-th-qty,
#sof-prod-table .sof-p-qty { width: var(--sof-col-qty); text-align: center; }
#sof-prod-table .sof-th-price,
#sof-prod-table .sof-p-price { width: var(--sof-col-price); text-align: right; }
#sof-prod-table .sof-th-amt,
#sof-prod-table .sof-p-amt { width: var(--sof-col-amt); text-align: right; }
#sof-prod-table .sof-th-act,
#sof-prod-table .sof-td-act { width: var(--sof-col-act); text-align: center; }
#sof-prod-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
}
#sof-prod-table tbody tr:hover {
  background: var(--primary-light);
}
#sof-prod-table td {
  padding: var(--sof-cell-py) var(--sof-cell-px);
  vertical-align: middle;
}
#sof-prod-table .sof-td-cb { }
#sof-prod-table .sof-td-act { }
#sof-prod-table .sof-row-seq { color: var(--text-light); }
#sof-prod-table .sof-row-del { cursor: pointer; color: var(--danger); font-size: 17px; }
#sof-prod-table .sof-row-del:hover { color: var(--primary-dark); }
#sof-prod-table input[type="text"],
#sof-prod-table input[type="number"] {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
#sof-prod-table input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(92,122,123,0.1);
}
#sof-prod-table .sof-p-qty,
#sof-prod-table .sof-p-price {
}
#sof-prod-table .sof-p-price {
}
#sof-prod-table .sof-p-unit {
}
#sof-prod-table .sof-p-amt {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  min-width: 80px;
  padding: 6px 8px !important;
}
.sof-col-slider-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
}
.sof-col-slider-wrap label {
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-secondary);
}
.sof-col-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.sof-col-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s;
}
.sof-col-slider::-webkit-slider-thumb:hover {
  background: var(--primary-dark);
}
.sof-col-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* ===== Unified Order Detail Modal - Sections ===== */
.sod-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}
.sod-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.sod-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sod-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}
.sod-info-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sod-info-row {
  display: flex;
  gap: 12px;
}
.sod-info-field {
  flex: 1;
  min-width: 0;
}
.sod-info-field label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
  font-weight: 500;
}
.sod-info-field input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 14px;
  box-sizing: border-box;
  background: #fff;
  transition: border-color .15s;
}
.sod-info-field input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(92,122,123,0.1);
}
.sod-info-field-full {
  flex: 1 1 100%;
}
.sod-add-prod-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  background: rgba(92,122,123,0.06);
  border: 1px solid rgba(92,122,123,0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.sod-add-prod-btn:hover {
  background: rgba(92,122,123,0.12);
  border-color: var(--primary);
}
.sod-total-row {
  text-align: right;
  padding: 10px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.sod-total-row span {
  color: var(--primary);
  font-size: 17px;
}

/* ============================================================
   Product Edit Modal — Redesigned
   ============================================================ */

/* input focus */
.modal-full input:focus,
.modal-full select:focus,
.modal-full textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(92,122,123,.1);
}

/* section cards */
.modal-full .pe-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
  transition: box-shadow .2s;
}
.modal-full .pe-section:hover {
  box-shadow: var(--shadow-md);
}

/* image upload main area */
.pe-img-main:hover {
  border-color: var(--primary) !important;
  background: var(--primary-light);
}

/* image thumbnail hover */
.pe-img-thumb:hover {
  border-color: var(--primary) !important;
  background: var(--primary-light);
}

/* param row transition */
.pe-param-row {
  transition: opacity .2s, transform .2s;
}
.pe-param-row:hover {
  opacity: .9;
}

/* footer buttons */
.modal-full .modal-footer button {
  transition: all .15s ease;
}
.modal-full .modal-footer button:hover {
  transform: translateY(-1px);
}

/* scrollbar in modal body */
.modal-full .modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-full .modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.modal-full .modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.modal-full .modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ============================================================
   Product Edit Modal v3 — dm- classes
   ============================================================ */

/* Header */
.dm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dm-header h3 {
  font-size: 18px;
  font-weight: 600;
}
.dm-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s;
}
.dm-close:hover {
  background: var(--border-light);
}

/* Body */
.dm-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}
.dm-body::-webkit-scrollbar {
  width: 6px;
}
.dm-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Form layout */
.dm-form {
  max-width: 900px;
  margin: 0 auto;
}

/* Image upload section */
.dm-img-section {
  margin-bottom: 28px;
}
.dm-img-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dm-img-label::before {
  content: '';
  width: 3px;
  height: 15px;
  background: var(--primary);
  border-radius: 2px;
  display: inline-block;
}
.dm-img-upload-area {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.dm-img-slot {
  width: 120px;
  height: 120px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.dm-img-slot:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.dm-img-slot.has-image {
  border-style: solid;
  border-color: var(--border);
}
.dm-img-slot.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dm-img-slot .slot-icon {
  width: 32px;
  height: 32px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.dm-img-slot .slot-text {
  font-size: 12px;
  color: var(--text-light);
}
.dm-img-slot .slot-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  border: none;
  font-size: 13px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.dm-img-slot.has-image:hover .slot-remove {
  display: flex;
}
.dm-img-hint {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
}

/* Form row: label | input */
.dm-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.dm-row-label {
  width: 100px;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.dm-row-label .required {
  color: var(--danger);
  margin-right: 2px;
}
.dm-row-input {
  flex: 1;
}

/* Inputs */
.dm-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.dm-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92,122,123,.1);
}
.dm-input-lg {
  padding: 11px 14px;
  font-size: 16px;
  font-weight: 500;
}
select.dm-input {
  appearance: auto;
  cursor: pointer;
}
.dm-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card);
  color: var(--text);
  outline: none;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.dm-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92,122,123,.1);
}

/* Collapsible section */
.dm-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 12px 0;
  background: none;
  border: none;
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.dm-collapse-header .arrow {
  width: 20px;
  height: 20px;
  color: var(--text-light);
  transition: transform .2s;
}
.dm-collapse-header.open .arrow {
  transform: rotate(180deg);
}
.dm-collapse-body {
  overflow: hidden;
  transition: max-height .3s ease;
}
.dm-collapse-body.collapsed {
  max-height: 0 !important;
}

/* Param row */
.dm-param-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.dm-param-row .dm-input {
  margin-bottom: 0;
}
.dm-param-del {
  width: 34px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  transition: all .15s;
}
.dm-param-del:hover {
  border-color: var(--danger);
  color: var(--danger);
}
.dm-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px;
  background: var(--primary-light);
  border: 1px dashed var(--primary);
  border-radius: 6px;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
  transition: all .15s;
}
.dm-add-btn:hover {
  background: var(--primary-soft);
}

/* Footer */
.dm-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
}
.dm-btn {
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: all .15s;
  border: none;
}
.dm-btn-cancel {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.dm-btn-cancel:hover {
  background: var(--border-light);
}
.dm-btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(92,122,123,.2);
}
.dm-btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(92,122,123,.3);
}
.dm-btn-danger {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  margin-right: auto;
}
.dm-btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

/* === Tag display (detail modal spec/material) === */
.dm-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

/* ============================================================
   PRODUCTS PAGE — Three-column layout
   ============================================================ */
.prod-cat-tree {
  width: 220px;
  min-width: 220px;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.prod-grid-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.prod-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.prod-grid-scroll {
  flex: 1;
  overflow-y: auto;
  padding-top: 12px;
}
.prod-detail-panel {
  width: 340px;
  min-width: 340px;
  border-left: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cat-tree-node:hover {
  background: var(--sidebar-hover);
}

/* Category add button in product edit form */
.cat-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-light);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.cat-add-btn:hover:not(:disabled) {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}
.cat-add-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.cat-clear-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-light);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.cat-clear-btn:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* ============================================================
   STEP FORM FIELDS (sf-*)
   ============================================================ */
.sf-container {
  margin-top: 12px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sf-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 14px;
  letter-spacing: .3px;
}
.sf-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.sf-field {
  display: flex;
  flex-direction: column;
}
.sf-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  letter-spacing: .3px;
  font-weight: 400;
}
.sf-input,
.sf-textarea,
.sf-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  background: #fff;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}
.sf-input:focus,
.sf-textarea:focus,
.sf-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92,122,123,.1);
}
.sf-textarea {
  resize: vertical;
  min-height: 68px;
  line-height: 1.5;
}
.sf-select {
  appearance: auto;
}
.sf-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sf-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  border: none;
  padding: 0;
}
.sf-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.sf-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.sf-slider-num {
  width: 56px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  background: #fff;
}
.sf-slider-num:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92,122,123,.1);
}
.sf-slider-pct {
  font-size: 14px;
  font-weight: 500;
  min-width: 36px;
}
.sf-slider-hint {
  font-size: 12px;
  margin-top: 4px;
}
.sf-note-wrap {
  margin-top: 12px;
}
.sf-note {
  font-size: 13px;
  min-height: 48px;
}
.sf-upload {
  margin-top: 10px;
}
.sf-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
@media (max-width: 700px) {
  .sf-row {
    grid-template-columns: 1fr;
  }
}

/* Doc slot (upload area in step form) */
.sf-doc-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  height: 100%;
  box-sizing: border-box;
}
/* Doc slot when used as compact field in 2-column row */
.sf-doc-field {
  display: flex;
  flex-direction: column;
}
.sf-doc-field .sf-doc-slot {
  flex: 1;
}
.sf-doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sf-doc-name {
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sf-doc-icon {
  font-size: 13px;
}
.sf-doc-status {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 4px;
}
.sf-doc-wait {
  color: var(--danger);
  background: rgba(184,112,112,.08);
}
.sf-doc-ok {
  color: var(--primary);
  background: var(--primary-light);
}
.sf-doc-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sf-doc-btn {
  padding: 6px 14px;
  font-size: 14px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.sf-doc-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.sf-doc-btn-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.sf-doc-btn-primary:hover {
  background: var(--primary);
  color: #fff;
}
.sf-doc-btn-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.sf-doc-btn-danger:hover {
  background: var(--danger);
  color: #fff;
}
