/* ==========================================================================
   NexERP — site-wide theme
   Ported from base desing/*.html (dark navy #0c0e16 / gold #e8a838 accent,
   Space Grotesk + DM Sans). One stylesheet, used by every page.
   ========================================================================== */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
}
html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: "DM Sans", sans-serif;
  background: #0c0e16;
  color: #f0f0f5;
  overflow-x: hidden;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}
a {
  color: inherit;
  text-decoration: inherit;
}
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  color: inherit;
}
button,
select {
  text-transform: none;
  cursor: pointer;
}
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
table {
  border-collapse: collapse;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #0c0e16;
  --bg-input: #1a1e2e;
  --surface: #131620;
  --card: #1a1e2e;
  --bg-card: #1a1e2e;
  --searchCard: #1a1e2e;
  --border: #2a2f42;
  --accent: #e8a838;
  --accent-hover: #f0b84e;
  --txt: #f0f0f5;
  --txt-sec: #8b8fa3;
  --txt-muted: #5c6078;
  --teal: #1a9e80;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --info: #60a5fa;
  --purple: #a78bfa;
  --rose: #fb7185;
  --bg-header-1: #1a1f2e;
  --bg-header-2: #141821;
  --txt-table: #b8bac8;
  --txt-dim: #3d4156;
  --border-light: rgba(42, 47, 66, 0.3);
  --pd-gold: #f59e0b;
  --pd-gold-light: #fbbf24;
  --pd-gold-dim: rgba(245, 158, 11, 0.08);
  --pd-ocean: #38bdf8;
  --pd-ocean-light: #7dd3fc;
  --pd-ocean-dim: rgba(56, 189, 248, 0.08);
  --inputform-bg: #222324;
  --warning: #fbbf24;
  --error: #dc4545;
  --error-bg: rgba(236, 174, 174, 0.199);
  --error-bg2: rgba(248, 113, 113, 0.15);
  --info-border: rgba(96, 165, 250, 0.18);
  --scrollbar-track: #0c0e16;
  --scrollbar-thumb: #2a2f42;
}
/* :root {
  --bg-body: #0c0e16;
  --bg-surface: #131620;
  --bg-surface2: #0f1219;
  --bg-card: #1a1e2e;
  --bg-input: #1a1e2e;
  --bg-thead: #111420;
  --bg-section: #151921;
  --bg-hover-row: #1f2438;
  --bg-elevated: #161a26;
  --border: #2a2f42;
  --border-hover: #3a3f52;
  --border-light: rgba(42, 47, 66, 0.3);
  --border-lighter: rgba(42, 47, 66, 0.4);
  --txt: #f0f0f5;
  --txt-bright: #e2e8f0;
  --txt-sec: #8b8fa3;
  --txt-muted: #5c6078;
  --txt-dim: #3d4156;
  --txt-table: #b8bac8;
  --accent: #e8a838;
  --accent-hover: #f0b84e;
  --accent-bg: rgba(232, 168, 56, 0.04);
  --accent-bg2: rgba(232, 168, 56, 0.07);
  --accent-bdr: rgba(232, 168, 56, 0.2);
  --accent-bdr2: rgba(232, 168, 56, 0.12);
  --shadow: rgba(0, 0, 0, 0.6);
  --shadow-heavy: rgba(0, 0, 0, 0.7);
  --sb-track: #0c0e16;
  --sb-thumb: #2a2f42;
  --topbar-bg: rgba(12, 14, 22, 0.95);
  --filter-bg: rgba(19, 22, 32, 0.98);
  --overlay: rgba(0, 0, 0, 0.65);
  --overlay2: rgba(0, 0, 0, 0.7);
  --success: #34d399;
  --error: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;
  --teal: #2dd4bf;
  --success-bg: rgba(52, 211, 153, 0.1);
  --warning-bg: rgba(251, 191, 36, 0.1);
  --error-bg: rgba(248, 113, 113, 0.1);
  --error-bg2: rgba(248, 113, 113, 0.15);
  --purple-bg: rgba(192, 132, 252, 0.08);
  --purple: #c084fc;
} */
.light-mode {
  --bg: #f8f9fa;
  --bg-input: #f5f6fa;
  --surface: #ffffff;
  --card: #ffffff;
  --bg-card: #ffffff;
  --searchCard: #f8f9fa;
  --border: #dee2e6;
  --accent: #e8a838;
  --accent-hover: #e7a430;
  --txt: #212529;
  --txt-sec: #495057;
  --txt-muted: #6c757d;
  --teal: #0d9488;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --info: #2563eb;
  --purple: #7c3aed;
  --rose: #e11d48;
  --pd-gold: #d97706;
  --pd-gold-light: #f59e0b;
  --pd-gold-dim: rgba(217, 119, 6, 0.1);
  --pd-ocean: #0284c7;
  --pd-ocean-light: #0ea5e9;
  --pd-ocean-dim: rgba(2, 132, 199, 0.1);
  --bg-header-1: #f8fafc;
  --bg-header-2: #f1f5f9;
  --txt-table: #4a5068;
  --txt-dim: #9ca3af;
  --border-light: rgba(229, 231, 235, 0.8);
  --inputform-bg: #e7e9eb;
  --warning: #d97706;
  --error: #dc4545;
  --error-bg: rgba(236, 174, 174, 0.199);
  --error-bg2: rgba(248, 113, 113, 0.15);
  --accent-bdr: rgba(217, 119, 6, 0.3);
  --info-border: rgba(37, 99, 235, 0.18);
  --scrollbar-track: #f3f4f6;
  --scrollbar-thumb: #d1d5db;
}
.light-mode .ovt-sg-lbl {
  color: #b45309 !important;
}
.light-mode .nav-i.active {
  color: #d49a30 !important;
  /* background: rgba(245, 244, 243, 0.1) !important; */
  border-left-color: #d49a30 !important;
}
.nav-i.active {
  color: #e8a838;
  /* background: rgba(232, 168, 56, 0.08); */
  border-left-color: #e8a838;
}
/* body.light-mode {
  --bg-body: #f0f2f7;
  --bg-surface: #ffffff;
  --bg-surface2: #fafbfd;
  --bg-card: #ffffff;
  --bg-input: #f5f6fa;
  --bg-thead: #f0f2f7;
  --bg-section: #f8f9fc;
  --bg-hover-row: #eef0f6;
  --bg-elevated: #ffffff;
  --border: #dde1ec;
  --border-hover: #c8cdd8;
  --border-light: rgba(180, 185, 200, 0.3);
  --border-lighter: rgba(180, 185, 200, 0.4);
  --txt: #1a1d2e;
  --txt-bright: #2d3148;
  --txt-sec: #6b7088;
  --txt-muted: #8b90a8;
  --txt-dim: #b0b5c5;
  --txt-table: #4a5068;
  --accent: #d97706;
  --accent-hover: #b45c05;
  --accent-bg: rgba(217, 119, 6, 0.06);
  --accent-bg2: rgba(217, 119, 6, 0.1);
  --accent-bdr: rgba(217, 119, 6, 0.3);
  --accent-bdr2: rgba(217, 119, 6, 0.18);
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-heavy: rgba(0, 0, 0, 0.12);
  --sb-track: #f0f2f7;
  --sb-thumb: #c8cdd8;
  --topbar-bg: rgba(240, 242, 247, 0.92);
  --filter-bg: rgba(255, 255, 255, 0.98);
  --overlay: rgba(0, 0, 0, 0.35);
  --overlay2: rgba(0, 0, 0, 0.4);
  --success: #22a87a;
  --error: #dc4545;
  --warning: #d97706;
  --info: #4a8fe7;
  --teal: #1a9e80;
  --success-bg: rgba(34, 168, 122, 0.1);
  --warning-bg: rgba(217, 119, 6, 0.12);
  --error-bg: rgba(220, 69, 69, 0.1);
  --error-bg2: rgba(220, 69, 69, 0.12);
  --purple-bg: rgba(156, 92, 220, 0.1);
  --purple: #9c5cdc;
}
body.light-mode .btn-a,
body.light-mode .btn-approve {
  background: #d97706 !important;
  color: #ffffff !important;
}
body.light-mode .btn-a:hover,
body.light-mode .btn-approve:hover {
  background: #b45c05 !important;
  color: #ffffff !important;
}
body.light-mode .pg-b.active {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
}
body.light-mode .ft .cnt {
  background: #d97706;
  color: #ffffff;
} */

body.light-mode,
.light-mode body {
  background-color: var(--bg) !important;
  color: var(--txt) !important;
}
body.light-mode .ef-sel {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%236b7088'/%3E%3C/svg%3E");
}
/* ---------- Layout shell ---------- */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 220px;
  background: linear-gradient(180deg, #131620, #0f1219);
  border-right: 1px solid var(--border);
  z-index: 50;
  transition:
    transform 0.3s ease,
    background 0.3s ease,
    border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}
.light-mode #sidebar {
  background: #ffffff;
}
#sidebar.collapsed {
  transform: translateX(-220px);
}
.sb-logo {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-logo .ico {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #e8a838, #c78d2c);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #0c0e16;
}
.sb-logo .brand-text {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--txt);
}
.sb-logo .brand-sub {
  font-size: 9px;
  color: var(--txt-muted);
  letter-spacing: 0.5px;
}
.sb-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
}
.nav-i {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  color: var(--txt-sec);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  border-left: 3px solid transparent;
  margin: 1px 0;
}
.nav-i:hover {
  color: var(--txt);
  background: rgba(232, 168, 56, 0.04);
}
.nav-i.active {
  color: var(--accent);
  background: rgba(232, 168, 56, 0.08);
  border-left-color: var(--accent);
}
.nav-i i {
  width: 17px;
  text-align: center;
  font-size: 12px;
}
.nav-i .cnt {
  margin-left: auto;
  background: #f87171;
  color: #fff;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 700;
}
.nav-i.has-sub {
  /* justify-content: space-between; */
}
.nav-arrow {
  font-size: 9px;
  color: var(--txt-muted);
  transition: transform 0.2s;
  margin-left: auto;
}
.nav-i.has-sub.open .nav-arrow {
  transform: rotate(180deg);
  color: var(--accent);
}
.nav-sub {
  /* padding-left: 14px; */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.nav-sub.open {
  max-height: 3000px;
}
.nav-sub .nav-i {
  font-size: 12px;
  padding: 9px 18px;
}
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}

#main {
  margin-left: 220px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  position: relative;
}
#main.expanded {
  margin-left: 0;
}

#topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  background: rgba(12, 14, 22, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.light-mode #topbar {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.tb-tog,
.tb-btn {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--txt-sec);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  flex-shrink: 0;
  position: relative;
}
.tb-tog:hover,
.tb-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.n-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 13px;
  height: 13px;
  background: #f87171;
  border-radius: 50%;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}
.tb-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tb-4search-grid {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 750px;
  margin: 0 12px;
}
.ovt-sg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--searchCard);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  flex: 1;
  min-width: 0;
}
.ovt-sg-item:focus-within {
  border-color: var(--accent);
}
.ovt-sg-lbl {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.ovt-sg-inp {
  background: transparent;
  border: none;
  color: var(--txt);
  font-size: 11px;
  outline: none;
  width: 100%;
  min-width: 40px;
}
.tb-acts {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  flex-shrink: 0;
}
.pf-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
}
.pf-btn:hover {
  border-color: var(--accent);
}
.pf-btn .avatar {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--accent);
  color: #0c0e16;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  overflow: hidden;
}
.pf-btn .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pf-btn span {
  font-size: 11.5px;
  color: var(--txt);
  white-space: nowrap;
}

.dd-p {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  min-width: 260px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 65;
  overflow: hidden;
}
.dd-p.show {
  display: block;
}
.dd-h {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dd-i {
  padding: 9px 14px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid rgba(42, 47, 66, 0.4);
}
.dd-i:hover {
  background: rgba(232, 168, 56, 0.06);
}
.dd-i:last-child {
  border-bottom: none;
}
.nd {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.nt {
  font-size: 11px;
  color: var(--txt);
  line-height: 1.4;
}
.ntm {
  font-size: 9.5px;
  color: var(--txt-muted);
  margin-top: 1px;
}
.pm-i {
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--txt-sec);
  cursor: pointer;
}
.pm-i:hover {
  color: var(--txt);
  background: rgba(232, 168, 56, 0.06);
}
.pm-i.dng {
  color: #f87171;
}
.pm-d {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.page-wrap {
  padding: 24px 32px;
}

/* ---------- Filter bar ---------- */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.fr {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  position: relative;
}
.fl {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--txt-muted);
  font-weight: 600;
}
.ft,
.fdt {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 10px;
  color: var(--txt);
  font-size: 11.5px;
  cursor: pointer;
  width: 100%;
}
.ft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  user-select: none;
}
.ft:hover,
.fdt:focus {
  border-color: var(--accent);
}
.ft .cnt {
  background: var(--accent);
  color: #0c0e16;
  font-size: 9px;
  padding: 0 5px;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.5;
}
.fab {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 5px solid var(--border);
}
.fab .btn {
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 6px;
}
.light-mode .fab .btn-a {
  color: #050505;
}
.actions-row {
  flex: 0 0 100%; /* Move to next line */
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #070707; /* optional */
}

/* Multi-select checkbox dropdown panel (.ft toggle -> .fp panel, see assets/js/multiselect.js) */
.fp {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 100;
  overflow: hidden;
}
.fp.show {
  display: block;
  animation: fd 0.12s ease;
}
@keyframes fd {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fps2 {
  width: 100%;
  padding: 6px 8px;
  background: var(--surface);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--txt);
  font-size: 11px;
  outline: none;
}
.fp-list {
  max-height: 180px;
  overflow-y: auto;
}
.fpo {
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--txt-sec);
  cursor: pointer;
  transition: background 0.1s;
}
.fpo:hover {
  background: rgba(232, 168, 56, 0.06);
}
.fpo input[type="checkbox"] {
  accent-color: var(--accent);
  width: 12px;
  height: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.fpa {
  display: flex;
  justify-content: space-between;
  padding: 5px 8px;
  border-top: 1px solid var(--border);
}
.fpa button {
  font-size: 9.5px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

/* Plain text/select filter inputs — ported from base desing/*.html's .fi/.fsl (report-page
   filter-bar text search boxes and Yes/No "Attached" dropdowns). */
.fi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 10px;
  color: var(--txt);
  font-size: 11.5px;
  outline: none;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.2s;
}
.fi:focus {
  border-color: var(--accent);
}
.fi::placeholder {
  color: var(--txt-dim, var(--txt-muted));
  font-size: 10px;
}
.fsl {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 10px;
  color: var(--txt);
  font-size: 11.5px;
  outline: none;
  font-family: inherit;
  width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235c6078'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
  transition: border-color 0.2s;
}
.fsl:focus {
  border-color: var(--accent);
}
.fsl option {
  background: var(--card);
  color: var(--txt);
}

.btn {
  padding: 7px 14px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
}
.btn-a {
  background: var(--accent);
  color: #0c0e16;
}
.btn-a:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-g {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--txt-sec);
}
.btn-g:hover {
  border-color: var(--txt-muted);
  color: var(--txt);
}
.btn-d {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
}
.btn-d:hover {
  background: rgba(248, 113, 113, 0.18);
}
.btn-ocean {
  background: var(--pd-ocean);
  color: #0c0e16;
}
.btn-ocean:hover {
  background: var(--pd-ocean-light);
  transform: translateY(-1px);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 10.5px;
}

/* ---------- KPI cards ---------- */
.kpi-g {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-c {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}
.kpi-c:hover {
  border-color: #3a3f52;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}
.ki {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 10px;
}
.kl {
  font-size: 11px;
  color: var(--txt-sec);
  margin-bottom: 4px;
  font-weight: 500;
}
.kv {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
  color: var(--txt);
}
.kpi-sub {
  font-size: 12px;
  color: var(--txt-sec);
  font-weight: 500;
  margin-bottom: 6px;
}
.kcmp {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
}
.kcmp.up {
  color: #34d399;
}
.kcmp.dn {
  color: #f87171;
}
.kcmp.nt {
  color: var(--txt-muted);
}
.cmp-t {
  display: flex;
  gap: 3px;
  background: var(--surface);
  border-radius: 4px;
  padding: 2px;
  border: 1px solid var(--border);
}
.cmp-b {
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--txt-muted);
  font-weight: 500;
}
.cmp-b.active {
  background: var(--accent);
  color: #0c0e16;
}

/* ---------- Charts ---------- */
.ch-g {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.ch-c {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 16px;
  overflow: hidden;
}
.ch-c h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ch-c h3 i {
  color: var(--accent);
  font-size: 11px;
}
.ch-w {
  position: relative;
  height: 230px;
}

/* ---------- Overview / data tables ---------- */
.ovt-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
.ovt-hdr {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
/* .ovt-hdr-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
} */
.ovt-hdr-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  /* border-bottom: 1px solid var(--border); */
  border-radius: 9px 9px 0 0;
  background: var(--bg-card);
  transition:
    background 0.35s,
    border-color 0.35s;
}
.ovt-hdr h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ovt-hdr h3 .rc {
  font-size: 10.5px;
  color: var(--txt-muted);
  font-weight: 400;
  font-family: "DM Sans";
}
.ovt-sc {
  overflow-x: auto;
  max-height: 560px;
  overflow-y: auto;
}
.ovt {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.ovt thead {
  position: sticky;
  top: 0;
  z-index: 5;
}
.ovt th {
  background: #111420;
  padding: 10px 12px;
  text-align: left;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--txt-muted);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.light-mode .ovt th {
  background: #f8f9fa;
}
.ovt th:hover {
  color: var(--accent);
}
.ovt th .si {
  margin-left: 2px;
  font-size: 7px;
  opacity: 0.4;
}
.ovt th.sd .si {
  opacity: 1;
  color: var(--accent);
}
.ovt td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(42, 47, 66, 0.35);
  white-space: nowrap;
  color: var(--txt-table);
  vertical-align: top;
}
.ovt tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}
.ovt-static tbody tr {
  cursor: default;
}
.ovt tbody tr:hover {
  background: rgba(232, 168, 56, 0.04);
}
.ovt tbody tr.sel {
  background: var(--accent-bg2, rgba(232, 168, 56, 0.07));
}
.ovt tfoot td {
  background: #111420;
  padding: 8px 12px;
  font-weight: 700;
  color: var(--accent);
  border-top: 2px solid var(--accent);
  font-size: 11px;
}
.light-mode .ovt tfoot td {
  background: #f8f9fa;
}
.ovt-ft {
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
}
.ovt-ft .info {
  font-size: 11px;
  color: var(--txt-muted);
}
.pg {
  display: flex;
  gap: 3px;
}
.pg-b {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--txt-sec);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-b:hover {
  border-color: var(--txt-muted);
  color: var(--txt);
}
.pg-b.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0c0e16;
  font-weight: 700;
}
.pg-b:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Grouped table headers + column-finder (Production Tracking) */
.ovt thead tr.prod-th-group th {
  background: #161a28 !important;
  font-size: 8.8px !important;
  letter-spacing: 1px;
  color: var(--teal) !important;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border) !important;
  text-align: center;
  cursor: default;
}
.light-mode .ovt thead tr.prod-th-group th {
  background: #f0f1f5 !important;
  color: #0d9488 !important;
  border-bottom-color: #e2e5ef !important;
}
.cf-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  transition: border-color 0.2s;
  min-width: 220px;
}
.cf-wrap:focus-within {
  border-color: var(--teal);
}
.cf-wrap .cf-inp {
  background: transparent;
  border: none;
  color: var(--txt);
  font-size: 11.3px;
  outline: none;
  width: 160px;
  font-family: inherit;
}
.cf-wrap .cf-inp::placeholder {
  color: var(--txt-muted);
  font-size: 10.3px;
}
.light-mode .cf-wrap {
  background: #f0f1f5;
  border-color: #e2e5ef;
}
.light-mode .cf-wrap:focus-within {
  border-color: #0d9488;
}
.cf-dd {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 300px;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 110;
  max-height: 360px;
  overflow-y: auto;
}
.cf-dd.show {
  display: block;
}
.light-mode .cf-dd {
  background: #ffffff;
  border-color: #e2e5ef;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.cf-dd-h {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 9.3px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--txt-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cf-dd-h i {
  color: var(--teal);
  font-size: 10.3px;
}
.light-mode .cf-dd-h {
  border-bottom-color: #e2e5ef;
  color: #6b7084;
}
.cf-item {
  padding: 7px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(42, 47, 66, 0.3);
}
.cf-item:hover,
.cf-item.cf-hl {
  background: rgba(45, 212, 191, 0.06);
}
.cf-item-lbl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: var(--txt);
  font-weight: 600;
}
.cf-item-lbl i:first-child {
  color: var(--teal);
  margin-right: 6px;
}
.cf-item-lbl .cf-arrow {
  color: var(--txt-muted);
  font-size: 9px;
}
.cf-item-cols {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cf-item-cols span {
  font-size: 9.5px;
  color: var(--txt-sec);
  background: rgba(139, 143, 163, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
}
.cf-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 11px;
  color: var(--txt-muted);
}
.ovt thead th.cf-hl {
  background: rgba(45, 212, 191, 0.18) !important;
  transition: background 0.3s;
}

.st-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  display: inline-block;
  letter-spacing: 0.2px;
}
.st-send {
  background: rgba(45, 212, 191, 0.1);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.2);
}
.st-approved {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.st-pending {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.st-rejected {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.st-na {
  background: rgba(139, 143, 163, 0.08);
  color: var(--txt-muted);
  border: 1px solid rgba(139, 143, 163, 0.15);
}
.stg {
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 700;
  display: inline-block;
  letter-spacing: 0.2px;
}
.stg-fw {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
}
.stg-ss {
  background: rgba(96, 165, 250, 0.08);
  color: var(--info);
  border: 1px solid var(--info-border);
}

/* ---------- Drawer / modal ---------- */
#dOv {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}
#dOv.show {
  display: block;
  opacity: 1;
}
#dPn {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  width: 960px;
  max-width: 95vw;
  max-height: 90vh;
  background: #0d0f17;
  border: 1px solid var(--border);
  border-radius: 16px;
  z-index: 101;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.8);
}
.light-mode #dPn {
  background: #f8f9fa;
}
#dPn.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.dh {
  padding: 0;
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 10;
  flex-shrink: 0;
}
.dh-inner {
  padding: 20px 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.dh-title-block h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dh-subtitle {
  font-size: 11px;
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.dh-subtitle .sep {
  color: var(--border);
}
.dh-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.dc {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--txt-sec);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.dc:hover {
  border-color: #f87171;
  color: #f87171;
}
.dept-tabs {
  display: flex;
  gap: 2px;
  background: #0a0c14;
  padding: 16px 28px 0;
  overflow-x: auto;
}
.light-mode .dept-tabs {
  background: #e9ecef;
}
.dept-tab {
  padding: 10px 20px;
  border-radius: 10px 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--txt-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-bottom: none;
}
.dept-tab.active {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border);
}
.dh-stripe {
  height: 3px;
  margin-top: 16px;
  background: linear-gradient(90deg, var(--accent), #c78d2c);
}
.db {
  padding: 28px 40px;
  flex: 1;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.d-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.d-metric {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.d-metric .dm-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--txt-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.d-metric .dm-val {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--txt);
}
.d-metric .dm-sub {
  font-size: 10px;
  color: var(--txt-muted);
  margin-top: 4px;
}

.pdf-section {
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}
.ps-header {
  padding: 12px 0 8px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ps-header .ps-step {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: "Space Grotesk", sans-serif;
}
.ps-header h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  text-transform: uppercase;
}
.ps-body {
  padding: 16px 0 24px;
}
.pdf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 32px;
}
.pdf-grid.thirds {
  grid-template-columns: repeat(3, 1fr);
}
.field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.f-lbl {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--txt-muted);
  font-weight: 600;
}
.dinp,
.dsel,
.dtxta {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 1px dotted var(--border);
  border-radius: 0;
  padding: 4px 2px;
  color: var(--txt);
  font-size: 12px;
  outline: none;
  width: 100%;
}
.dinp {
  /* background: var(--inputform-bg); */
  border-radius: 5px;
}
.dsel {
  background: var(--card);
}
.dinp:focus,
.dsel:focus,
.dtxta:focus {
  border-bottom-color: var(--accent);
}
.dinp:disabled,
.dsel:disabled,
.dtxta:disabled,
.field-locked .dinp,
.field-locked .dsel,
.field-locked .dtxta {
  opacity: 0.55;
  cursor: not-allowed;
  border-bottom-style: solid;
}
.dtxta {
  resize: vertical;
  min-height: 32px;
}
.dinp-ro {
  border-bottom: none;
  cursor: default;
  color: var(--txt);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.dinp-ro:hover {
  border-bottom: none;
}

/* Sample-approval rows (Production drawer) */
.appr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.appr-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.appr-content {
  flex: 1;
  min-width: 100%;
}
.appr-title {
  margin-bottom: 6px;
  font-size: 10px;
  color: var(--txt-sec);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Create-PO sticky header + attached table section */
.fc-sticky {
  position: sticky;
  z-index: 35;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  padding: 12px 16px;
}
.tbl-sec {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0 0 9px 9px;
  border-top: none;
  margin-top: -1px;
  overflow: hidden;
}

/* "View Only" pill badge (read-only drawers) */
.vo-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.2);
  color: #2dd4bf;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: "Space Grotesk", sans-serif;
}
.vo-badge i {
  font-size: 8px;
}

.ovt th.ns {
  cursor: default;
}
.ovt th.ns:hover {
  color: var(--txt-muted);
}
.ovt tfoot .tl {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  letter-spacing: 0.4px;
}
.ovt-sg-ico {
  color: var(--txt-muted);
  font-size: 9px;
  pointer-events: none;
  flex-shrink: 0;
}
.step-po {
  background: rgba(232, 168, 56, 0.12);
  color: #e8a838;
}
.step-prod {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}
.step-ship {
  background: rgba(45, 212, 191, 0.12);
  color: #2dd4bf;
}
.crit-alert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #f87171;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-left: 6px;
}
.auto-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.18);
  color: #2dd4bf;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-left: 4px;
}

/* ==========================================================================
   PO Department detail drawer — ported verbatim from
   base desing/PO Department.html (dsplit/dleft/dright split-panel pattern).
   Uses its own #poDrawerOv/#poDrawerPn ids so it can't collide with the
   generic #dOv/#dPn drawer used by Dashboard/Production.
   ========================================================================== */
#poDrawerOv {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}
#poDrawerOv.show {
  display: block;
  opacity: 1;
}
#poDrawerPn {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 1440px;
  max-width: 97vw;
  height: 90vh;
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  z-index: 101;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
#poDrawerPn.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
#poDrawerPn .dh {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  gap: 12px;
  border-radius: 14px 14px 0 0;
  flex-shrink: 0;
  position: static;
}
#poDrawerPn .dh h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--txt);
}
#poDrawerPn .db {
  flex: 1;
  display: flex;
  overflow: hidden;
  padding: 0;
  background: transparent;
  border-top: none;
}
.dsplit {
  display: flex;
  width: 100%;
  height: 100%;
}
.dleft {
  width: 70%;
  height: 100%;
  overflow-y: auto;
  padding: 14px 16px;
  border-right: 1px solid var(--border);
}
.dright {
  width: 30%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.dright-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--card);
  align-items: center;
}
.dright-tab {
  flex: 1;
  padding: 10px 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--txt-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.dright-tab:hover {
  color: var(--txt);
}
.dright-tab.active[data-tab="prod"] {
  color: var(--teal);
}
.dright-tab.active[data-tab="ship"] {
  color: #60a5fa;
}
.dright-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.dright-panel {
  display: none;
}
.dright-panel.active {
  display: block;
}
.dept-hdr {
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
  font-family: "Space Grotesk", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dept-hdr.pr-hdr {
  color: var(--teal);
}
.dept-hdr.sh-hdr {
  color: #60a5fa;
}

.ps {
  background: rgba(232, 168, 56, 0.06);
  border: 1px solid rgba(232, 168, 56, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.ps i {
  font-size: 20.5px;
  color: var(--accent);
}
.ps div h4 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13.5px;
  color: var(--warning);
}
.ps div p {
  font-size: 11px;
  color: var(--txt-sec);
}
.ed-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 7px 10px;
  background: rgba(232, 168, 56, 0.06);
  border: 1px solid rgba(232, 168, 56, 0.18);
  border-radius: 6px;
}
.ed-toolbar .ed-hint {
  margin-right: auto;
  font-size: 10px;
  color: var(--txt-sec);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ed-toolbar .ed-hint i {
  color: var(--accent);
  font-size: 9.5px;
}
.ed-toolbar .ed-hint.editing-hint {
  color: var(--warning);
}
.ed-toolbar .ed-hint.editing-hint i {
  color: var(--warning);
}
.ds {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.ds:hover {
  border-color: #3a3f52;
}
.ds h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 10.5px;
  color: var(--txt-sec);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.ds h3 i {
  font-size: 9.5px;
}
.ds.edited {
  border-color: rgba(232, 168, 56, 0.3);
  /* background: rgba(232, 168, 56, 0.02); */
}
.ds.edited h3 {
  color: var(--warning);
}
.dsl {
  margin-bottom: 0;
}
.mn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: rgba(232, 168, 56, 0.12);
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 700;
  flex-shrink: 0;
}
.dg {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
}
.dg3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 14px;
}
.dg4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 14px;
}

/* Milestone cards — Production Department drawer (base desing/Production
   Department.html renderLP()): a grid of small cards for sample-approval /
   date / range / qty milestones, distinct from the .dg label-value grids. */
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}
.milestone-grid.grid4 {
  grid-template-columns: repeat(3, 1fr);
}
.milestone-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.2s;
}
.milestone-card:hover {
  border-color: var(--border-hover);
}
.mc-title {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--txt-muted);
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.mc-status {
  margin-bottom: 4px;
}
.mc-date {
  font-size: 9.5px;
  color: var(--txt-sec);
  font-family: "Space Grotesk", monospace;
  line-height: 1.4;
}
.mc-comment {
  font-size: 9px;
  color: var(--txt-muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-pair {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 4px;
}
.mc-pair-arrow {
  color: var(--txt-muted);
  font-size: 9px;
  flex-shrink: 0;
}
.mc-lbl {
  font-size: 8px;
  color: var(--txt-muted);
  font-weight: 700;
  min-width: 10px;
  flex-shrink: 0;
}
/* Right-panel reference cards — Production Department drawer (base desing/
   Production Department.html renderRP()): info-card/info-row/section-label,
   distinct from the .dm/.f2/.l2/.v2 pattern PO's own drawer reuses. */
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}
.info-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}
.info-card .card-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 4px 0;
  font-size: 10px;
  gap: 8px;
}
.info-row:not(:last-child) {
  border-bottom: 1px solid var(--border-light);
}
.info-row .label {
  color: var(--txt-muted);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 55%;
}
.info-row .value {
  color: var(--txt-bright);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}
.info-row .value.positive {
  color: var(--green);
}
.info-row .value.negative {
  color: var(--red);
}
.info-row .value.warning {
  color: var(--amber);
}
.info-row .value.highlight {
  color: var(--teal);
}
.section-label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--teal);
  font-weight: 700;
  padding: 6px 0 3px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(45, 212, 191, 0.15);
}
.f2 {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.l2 {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--txt-muted);
  font-weight: 600;
}
.v2 {
  font-size: 11.5px;
  color: var(--txt);
  font-weight: 500;
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  word-break: break-word;
}
.v2.hl {
  color: var(--accent);
}
.v2.dt {
  font-family: "Space Grotesk", monospace;
  color: var(--txt-sec);
  font-size: 11px;
}
.v2.lc {
  color: var(--teal);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
}
.spills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 1px;
}
.spl {
  background: rgba(232, 168, 56, 0.08);
  border: 1px solid rgba(232, 168, 56, 0.2);
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: "Space Grotesk", sans-serif;
}
.dm {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 6px;
}
.dm-h {
  padding: 7px 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--border);
}
.dm-h.pr {
  color: var(--teal);
  background: rgba(45, 212, 191, 0.03);
}
.dm-h.sh {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.03);
}
.dm-b {
  padding: 6px 8px;
}
.vr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}
.vr3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px 8px;
}
.appr-item {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.appr-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.wip-row {
  padding: 3px 0;
  border-bottom: 1px dashed var(--border);
}
.wip-row:last-child {
  border-bottom: none;
}
.wip-lbl {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--txt-muted);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.wip-lbl i {
  font-size: 7.5px;
  color: var(--teal);
}
.cp-auto {
  font-size: 7.5px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(232, 168, 56, 0.08);
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 4px;
}
.cp-req {
  color: #f87171;
  font-size: 7.5px;
  margin-left: 2px;
}
.ship-sub-hdr {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--txt-muted);
  margin: 5px 0 3px;
  padding-top: 3px;
  border-top: 1px dashed var(--border);
}
.ship-remarks {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 10.5px;
  color: var(--txt-sec);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 40px;
}
#poDrawerPn .appr-title {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--teal);
}
.dright .dm-b {
  padding: 5px 6px;
}
.dright .vr,
.dright .vr3 {
  gap: 3px 6px;
}
.dright .f2 {
  gap: 1px;
}
.dright .l2 {
  font-size: 7.5px;
}
.dright .v2 {
  font-size: 10px;
  min-height: 14px;
}
.dright .appr-title {
  font-size: 8px;
  margin-bottom: 2px;
}
.dright .appr-item {
  padding: 3px 0;
}
.dright .wip-lbl {
  font-size: 7.5px;
  margin-bottom: 1px;
}
.dright .wip-row {
  padding: 2px 0;
}
.dright .ship-sub-hdr {
  font-size: 7.5px;
  margin: 3px 0 2px;
  padding-top: 2px;
}
.dright .sbb {
  font-size: 8.5px;
  padding: 1px 5px;
}
.dright .dept-hdr {
  font-size: 9.5px;
  margin-bottom: 5px;
  padding-bottom: 4px;
}
.dright .dm-h {
  padding: 5px 6px;
  font-size: 8px;
}
.dright .dm {
  margin-bottom: 4px;
}
.dright .ship-remarks {
  font-size: 9.5px;
  padding: 6px 8px;
}

/* Inline edit-mode fields (Edit PO) */
.ef-g {
  margin-bottom: 3px;
}
.ef-lbl {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--txt-muted);
  font-weight: 600;
  margin-bottom: 1px;
  display: block;
}
.ef-inp,
.ef-date,
.ef-sel,
.ef-ta {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--txt);
  font-size: 11px;
  padding: 4px 6px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.ef-sel {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%235c6078'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  padding-right: 18px;
  cursor: pointer;
}
.ef-inp:focus,
.ef-date:focus,
.ef-sel:focus,
.ef-ta:focus {
  border-color: var(--accent);
}
.ef-sel {
  appearance: none;
  cursor: pointer;
}
.ef-ta {
  resize: vertical;
  min-height: 26px;
  font-size: 10.5px;
}
.ef-ro {
  background: rgba(232, 168, 56, 0.06) !important;
  border: 1px dashed var(--border) !important;
  color: var(--accent) !important;
  font-weight: 600;
  cursor: default;
}
.ef-locked {
  opacity: 0.55;
}
.ef-locked .l2 {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Status badges used inside the drawer (Approved/Pending/Rejected/…) */
.sbb {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sb-ap {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.sb-pn {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.sb-rj {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.sb-cr {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
  animation: cpulse 2s ease infinite;
}
@keyframes cpulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Style/colorway image preview inside Identity & Product Info */
.id-mod-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.id-mod-fields {
  flex: 1;
  min-width: 0;
}
.id-mod-img {
  width: 120px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.id-mod-img img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.id-mod-img .no-img {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt-muted);
  background: var(--surface);
  font-size: 28.5px;
}
.id-mod-img .img-lbl {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--txt-muted);
  font-weight: 600;
  text-align: center;
}

/* ---------- Style Sheet preview panel ---------- */

.style-layout {
  display: flex;
  gap: 18px;
  height: calc(100vh - 110px);
}
.style-table-wrap {
  flex: 1;
  min-width: 0;
}
.style-preview {
  width: 340px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 260px;
}
.sp-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 20px;
  color: var(--txt-dim);
}
.sp-empty i {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.sp-empty p {
  font-size: 12px;
  color: var(--txt-muted);
}
.sp-scroll {
  flex: 1;
  overflow-y: auto;
  display: none;
}
.sp-scroll.vis {
  display: block;
}
.sp-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.sp-x {
  float: right;
  margin: -32px 8px 0 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(12, 14, 22, 0.8);
  border: 1px solid var(--border);
  color: var(--txt-sec);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10.5px;
  position: relative;
  z-index: 2;
}
body.light-mode .sp-x {
  background: rgba(255, 255, 255, 0.85);
}
.sp-x:hover {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}
.sp-name {
  font-family: "Space Grotesk";
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  padding: 14px 16px 6px;
}
.sp-div {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-bdr),
    transparent
  );
  margin: 0 16px;
}
@media (max-width: 900px) {
  .style-layout {
    flex-direction: column;
  }
  .style-preview {
    width: 100%;
    max-height: 420px;
  }
}

.ms {
  color: #60a5fa;
}
.ma {
  color: #f87171;
}
.ml {
  color: #34d399;
}
.btn-print {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--txt-sec);
}
.btn-print:hover {
  border-color: #60a5fa;
  color: #60a5fa;
}
.btn-xls {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--txt-sec);
}
.btn-xls:hover {
  border-color: #34d399;
  color: #34d399;
}
.btn-approve {
  background: var(--accent);
  color: #0c0e16;
  padding: 8px 24px;
}
.btn-approve:hover {
  background: var(--accent-hover);
}
.btn-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--txt-sec);
}
.btn-reset:hover {
  border-color: var(--error);
  color: var(--error);
}
.btn-draft {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--txt-sec);
}
.btn-draft:hover {
  border-color: var(--warning);
  color: var(--warning);
}
.cpf-wrap {
  max-width: 960px;
  margin: 0 auto;
}
.cp-footer {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  transition:
    background 0.35s,
    border-color 0.35s;
}
.cp-footer .cp-hint {
  margin-right: auto;
  font-size: 10px;
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.cp-footer .cp-hint i {
  color: var(--accent);
  font-size: 9.5px;
}

@media (max-width: 1200px) {
  .dsplit {
    flex-direction: column;
  }
  .dleft,
  .dright {
    width: 100%;
    height: 50%;
    border-right: none;
  }
  .dleft {
    border-bottom: 1px solid var(--border);
  }
  #poDrawerPn {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}
@media (max-width: 768px) {
  .dg,
  .dg3,
  .dg4,
  .vr,
  .vr3 {
    grid-template-columns: 1fr;
  }
  .id-mod-wrap {
    flex-direction: column;
    align-items: center;
  }
  .milestone-grid,
  .milestone-grid.grid4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Production Department detail drawer — ported from
   base desing/Production Department.html (renderLP()/renderRP()), reusing the
   shared .dsplit/.dleft/.dright/.ds/.milestone-* building blocks above.
   Dedicated #prodDrawerOv/#prodDrawerPn ids (own drawer, distinct from
   #dPn/#poDrawerPn/#shipDrawerPn).
   ========================================================================== */
#prodDrawerOv {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}
#prodDrawerOv.show {
  display: block;
  opacity: 1;
}
#prodDrawerPn {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 1440px;
  max-width: 97vw;
  height: 90vh;
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  z-index: 101;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
#prodDrawerPn.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
#prodDrawerPn .dh {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  gap: 12px;
  border-radius: 14px 14px 0 0;
  flex-shrink: 0;
  position: static;
}
#prodDrawerPn .dh h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--txt);
}
#prodDrawerPn .db {
  flex: 1;
  display: flex;
  overflow: hidden;
  padding: 0;
  background: transparent;
  border-top: none;
}
@media (max-width: 1200px) {
  #prodDrawerPn {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* ==========================================================================
   Shipping Department detail drawer — ported from base desing/Shipping Department.html.
   Dedicated #shipDrawerOv/#shipDrawerPn ids (own drawer, distinct from #dPn/#poDrawerPn).
   ========================================================================== */
#shipDrawerOv {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}
#shipDrawerOv.show {
  display: block;
  opacity: 1;
}
#shipDrawerPn {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 95vw;
  max-width: 1440px;
  height: 88vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 101;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
#shipDrawerPn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
#shipDrawerPn .dh {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  gap: 12px;
  flex-shrink: 0;
}
#shipDrawerPn .dh h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--txt);
}
#shipDrawerPn .dh h2 .db {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(232, 168, 56, 0.15);
  color: var(--accent);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.ds2 {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.dl {
  width: 70%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s;
}
.dl-tb {
  display: none;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(232, 168, 56, 0.15);
  border-bottom: 1px solid rgba(232, 168, 56, 0.3);
  flex-shrink: 0;
}
.dl-tb.vis {
  display: flex;
}
.dl-tb .eh {
  margin-right: auto;
  font-size: 10.5px;
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dl-tb .eh i {
  color: var(--accent);
  font-size: 10.5px;
}
.dl-s {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px 20px;
}
.dr2 {
  width: 30%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--border);
  background: #111420;
}
.light-mode .dr2 {
  background: #f9fafb;
}
.dr-h {
  padding: 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
}
.dr-t {
  flex: 1;
  padding: 10px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--txt-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
  white-space: nowrap;
}
.dr-t:hover {
  color: var(--txt-sec);
  background: rgba(232, 168, 56, 0.04);
}
.dr-t.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(232, 168, 56, 0.08);
}
.dr-s {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

.sh-hero {
  background: linear-gradient(
    135deg,
    var(--surface),
    var(--card),
    var(--surface)
  );
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.sh-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.sh-hero-ico {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18.5px;
  flex-shrink: 0;
}
.sh-hero-ico.st-shipped {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: var(--green);
}
.sh-hero-ico.st-prod {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: var(--amber);
}
.sh-hero-ico.st-pending {
  background: rgba(139, 143, 163, 0.08);
  border: 1px solid rgba(139, 143, 163, 0.15);
  color: var(--txt-muted);
}
.sh-hero-ico.st-cancelled {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: #f87171;
}
.sh-hero-info {
  flex: 1;
  min-width: 0;
}
.sh-hero-po {
  font-family: "Space Grotesk", sans-serif;
  font-size: 17.5px;
  font-weight: 700;
  color: var(--txt);
}
.sh-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 5px;
  align-items: center;
}
.sh-hero-meta span {
  font-size: 10.5px;
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.sh-hero-meta span i {
  font-size: 8.5px;
}
.sh-hero-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.sh-hero-status {
  margin-left: auto;
  flex-shrink: 0;
}
.sh-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.sh-kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}
.sh-kpi::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
}
.sh-kpi.k-bk::after {
  background: linear-gradient(90deg, var(--info), transparent);
}
.sh-kpi.k-sq::after {
  background: linear-gradient(90deg, var(--green), transparent);
}
.sh-kpi.k-bl::after {
  background: linear-gradient(90deg, #f87171, transparent);
}
.sh-kpi.k-vl::after {
  background: linear-gradient(90deg, var(--accent), transparent);
}
.sh-kpi-label {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--txt-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.sh-kpi-val {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18.5px;
  font-weight: 700;
}
.sh-kpi-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0 5px;
  opacity: 0.5;
}
.sh-kpi-sub-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--txt-dim);
  font-weight: 600;
  margin-bottom: 2px;
  opacity: 0.8;
}
.sh-kpi-sub-val {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
}
.sh-kpi-sub-val.sv-blue {
  color: var(--info);
}
.sh-kpi-sub-val.sv-green {
  color: var(--green);
}
.sh-kpi-sub-val.sv-red {
  color: #f87171;
}
.sh-kpi-sub-val.sv-amber {
  color: var(--accent);
}
.sh-prog-wrap {
  margin-top: 14px;
}
.sh-prog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.sh-prog-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.sh-prog-pct {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
}
.sh-prog-track {
  height: 8px;
  background: var(--card);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.sh-prog-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s;
}
.sh-prog-fill.fill-green {
  background: linear-gradient(90deg, #059669, var(--green));
}
.sh-prog-fill.fill-yellow {
  background: linear-gradient(90deg, #d97706, var(--amber));
}
.sh-prog-fill.fill-red {
  background: linear-gradient(90deg, #dc2626, #f87171);
}
.sh-prog-fill.fill-gray {
  background: linear-gradient(90deg, var(--txt-dim), var(--txt-muted));
}
.sh-edit-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.sh-mod {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.sh-mod:hover {
  border-color: var(--txt-muted);
}
.sh-mod-head {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  flex-wrap: wrap;
}
.sh-mod-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
}
.sh-mod-head.hd-blue::before {
  background: var(--info);
}
.sh-mod-head.hd-green::before {
  background: var(--green);
}
.sh-mod-head.hd-purple::before {
  background: var(--purple);
}
.sh-mod-head.hd-amber::before {
  background: var(--amber);
}
.sh-mod-head.hd-teal::before {
  background: var(--teal);
}
.sh-mod-head.hd-rose::before {
  background: var(--rose);
}
.sh-mod-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 800;
  font-family: "Space Grotesk", sans-serif;
  flex-shrink: 0;
}
.sh-mod-num.n-blue {
  background: rgba(96, 165, 250, 0.1);
  color: var(--info);
  border: 1px solid rgba(96, 165, 250, 0.2);
}
.sh-mod-num.n-green {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.sh-mod-num.n-purple {
  background: rgba(167, 139, 250, 0.12);
  color: var(--purple);
  border: 1px solid rgba(167, 139, 250, 0.2);
}
.sh-mod-num.n-amber {
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.sh-mod-num.n-teal {
  background: rgba(45, 212, 191, 0.12);
  color: var(--teal);
  border: 1px solid rgba(45, 212, 191, 0.2);
}
.sh-mod-num.n-rose {
  background: rgba(251, 113, 133, 0.12);
  color: var(--rose);
  border: 1px solid rgba(251, 113, 133, 0.2);
}
.sh-mod-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--txt);
  flex: 1;
}
.sh-mod-badge {
  font-size: 8.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}
.sh-mod-badge.b-ok {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.sh-mod-badge.b-warn {
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.sh-mod-badge.b-err {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.sh-mod-badge.b-info {
  background: rgba(96, 165, 250, 0.08);
  color: var(--info);
  border: 1px solid rgba(96, 165, 250, 0.18);
}
.sh-mod-badge.b-na {
  background: rgba(139, 143, 163, 0.08);
  color: var(--txt-muted);
  border: 1px solid rgba(139, 143, 163, 0.15);
}
.sh-mod-body {
  padding: 14px 16px;
}
.sh-field-grid {
  display: grid;
  gap: 10px 14px;
}
.sh-field-grid.g3 {
  grid-template-columns: repeat(3, 1fr);
}
.sh-field-grid.g2 {
  grid-template-columns: repeat(2, 1fr);
}
.sh-fld {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sh-fld-label {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--txt-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sh-fld-label i {
  font-size: 7.5px;
  opacity: 0.6;
}
.sh-fld-val {
  font-size: 12px;
  color: var(--txt-sec);
  font-weight: 500;
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  word-break: break-word;
}
.sh-fld-val.mono {
  font-family: "Space Grotesk", monospace;
  font-weight: 600;
}
.sh-fld-val.highlight {
  color: var(--accent);
  font-weight: 700;
  font-family: "Space Grotesk", monospace;
  font-size: 12.5px;
}
.sh-fld-val.success {
  color: var(--green);
  font-weight: 600;
}
.sh-fld-val.danger {
  color: #f87171;
  font-weight: 600;
}
.sh-fld-val.muted {
  color: var(--txt-muted);
}
.sh-fld-val.blue {
  color: var(--info);
  font-weight: 600;
}
.sh-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.sh-doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sh-doc-ico {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  flex-shrink: 0;
}
.sh-doc-ico.doc-up {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.sh-doc-ico.doc-no {
  background: rgba(139, 143, 163, 0.08);
  color: var(--txt-dim);
  border: 1px solid rgba(139, 143, 163, 0.15);
}
.sh-doc-info {
  flex: 1;
  min-width: 0;
}
.sh-doc-title {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--txt-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sh-doc-sub {
  font-size: 9px;
  color: var(--txt-muted);
  margin-top: 1px;
}
.sh-fin-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.sh-fin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.sh-fin-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}
.sh-fin-card.f-bk::before {
  background: var(--info);
}
.sh-fin-card.f-sv::before {
  background: var(--green);
}
.sh-fin-card.f-fv::before {
  background: var(--accent);
}
.sh-fin-card-label {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--txt-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.sh-fin-card-val {
  font-family: "Space Grotesk", sans-serif;
  font-size: 16.5px;
  font-weight: 700;
}
.sh-fin-card-val.v-blue {
  color: var(--info);
}
.sh-fin-card-val.v-green {
  color: var(--green);
}
.sh-fin-card-val.v-amber {
  color: var(--accent);
}
.sh-remarks {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--txt-muted);
  line-height: 1.5;
  font-style: italic;
}
.sh-edit-hero {
  background: linear-gradient(
    135deg,
    var(--surface),
    var(--card),
    var(--surface)
  );
  border: 1px solid rgba(232, 168, 56, 0.3);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sh-edit-hero-ico {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(232, 168, 56, 0.15);
  border: 1px solid rgba(232, 168, 56, 0.3);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14.5px;
  flex-shrink: 0;
}
.sh-edit-hero h4 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--txt);
}
.sh-edit-hero p {
  font-size: 10.5px;
  color: var(--txt-muted);
  margin-top: 2px;
}
.sh-calc-panel {
  background: rgba(232, 168, 56, 0.08);
  border: 1px solid rgba(232, 168, 56, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sh-calc-item {
  text-align: center;
}
.sh-calc-item-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--txt-muted);
  font-weight: 700;
}
.sh-calc-item-val {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}
.sh-efld {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sh-efld-label {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--txt-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sh-efld-label i {
  font-size: 7.5px;
  opacity: 0.5;
}
.sh-efld-label .calc-icon {
  color: var(--accent);
  font-size: 8.5px;
  opacity: 1;
}
.auto-calc-hint {
  font-size: 7.5px;
  color: var(--accent);
  opacity: 0.7;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-left: 2px;
}
.cpi,
.cpi-d,
.cpi-s,
.cpi-t {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--txt);
  font-size: 11px;
  padding: 5px 8px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.cpi:focus,
.cpi-d:focus,
.cpi-s:focus,
.cpi-t:focus {
  border-color: var(--accent);
}
.cpi.ar {
  background: rgba(232, 168, 56, 0.15);
  color: var(--accent);
  font-family: "Space Grotesk", monospace;
  font-weight: 600;
  cursor: default;
  border-color: rgba(232, 168, 56, 0.3);
  font-size: 10.5px;
}
.cpi-d {
  cursor: pointer;
}
.cpi-s {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235c6078'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 22px;
}
.cpi-t {
  resize: vertical;
  min-height: 36px;
}

.sh-tl {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 4px 0;
}
.sh-tl-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  flex-shrink: 0;
}
.sh-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
  z-index: 1;
}
.sh-tl-dot.d-done {
  border-color: var(--green);
  background: rgba(52, 211, 153, 0.1);
}
.sh-tl-dot.d-active {
  border-color: var(--amber);
  background: rgba(251, 191, 36, 0.1);
}
.sh-tl-dot.d-pending {
  border-color: var(--txt-dim);
  background: rgba(61, 65, 86, 0.3);
}
.sh-tl-line {
  width: 2px;
  flex: 1;
  min-height: 16px;
  background: var(--border);
  margin: 2px 0;
}
.sh-tl-line.l-done {
  background: rgba(52, 211, 153, 0.1);
}
.sh-tl-vals {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.sh-tl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  min-height: 40px;
}
.sh-tl-date {
  width: 80px;
  flex-shrink: 0;
}
.sh-tl-date-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--txt-muted);
  font-weight: 600;
}
.sh-tl-date-val {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--txt-sec);
  font-family: "Space Grotesk", monospace;
}
.sh-tl-date-val.dash {
  color: var(--txt-dim);
}
.sh-comp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.sh-comp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.sh-comp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sh-comp-name {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.sh-comp-name i {
  font-size: 10.5px;
  opacity: 0.7;
}
.sh-comp-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sh-comp-detail span {
  font-size: 10.5px;
  color: var(--txt-sec);
}
.sh-comp-detail span.mono {
  font-family: "Space Grotesk", monospace;
  font-weight: 500;
  color: var(--txt);
}

/* Right-panel reference rows (rv/rvA/rvH pattern) */
.rv-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 10px;
}
.rv-row .rl {
  color: var(--txt-muted);
  font-size: 9px;
  flex-shrink: 0;
  margin-right: 8px;
}
.rv-row .rv {
  color: var(--txt-sec);
  font-weight: 500;
  text-align: right;
  max-width: 65%;
  word-break: break-word;
}
.rv-row .rv.wa {
  color: var(--accent);
  font-weight: 600;
  font-family: "Space Grotesk", monospace;
}
.rb {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.rbt {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--txt-sec);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ac {
  font-size: 9px;
  color: var(--txt-muted);
  font-style: italic;
  margin-top: 3px;
  padding: 3px 6px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}
.light-mode .ac {
  background: rgba(0, 0, 0, 0.03);
}
.ph {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  font-weight: 700;
  padding: 6px 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ph-sep {
  border: none;
  border-top: 1px solid rgba(232, 168, 56, 0.15);
  margin: 4px 0;
}
.csw {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Status badges (shipping's .sb pattern — reuses st-badge sizing but its own palette hooks) */
.sb2 {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  display: inline-block;
}
.s-ok {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.s-pe {
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.s-fl {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.s-cr {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
  animation: cpulse 2s ease infinite;
}
.s-it {
  background: rgba(96, 165, 250, 0.08);
  color: var(--info);
  border: 1px solid rgba(96, 165, 250, 0.18);
}
.s-na {
  background: rgba(139, 143, 163, 0.08);
  color: var(--txt-muted);
  border: 1px solid rgba(139, 143, 163, 0.15);
}
.fi-a {
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.fi-n {
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(139, 143, 163, 0.08);
  color: var(--txt-muted);
  border: 1px solid rgba(139, 143, 163, 0.15);
}

/* Grouped sticky table header (shipping's wide multi-module table) */
.stg th {
  background: var(--card) !important;
  font-size: 8px !important;
  letter-spacing: 1px;
  color: var(--accent) !important;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border) !important;
  font-weight: 700 !important;
}
.m1h,
.m2h,
.m3h,
.m4h,
.m5h,
.m6h {
  border-right: 1px solid rgba(232, 168, 56, 0.15) !important;
}

/* PDF / file viewer (report pages) */
.pdf-viewer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-height: 300px;
}
.pdf-bar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--txt-sec);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}
.pdf-bar i {
  color: #f87171;
  margin-right: 6px;
}
.pdf-bar a {
  color: var(--accent);
  text-decoration: none;
  font-size: 10px;
}
.pdf-frame {
  width: 100%;
  height: calc(88vh - 200px);
  border: none;
}
.pdf-empty {
  text-align: center;
  padding: 80px 20px;
  min-height: 260px;
}
.pdf-empty i {
  font-size: 40px;
  color: var(--border);
  margin-bottom: 16px;
}
.pdf-empty div {
  color: var(--txt-muted);
  font-size: 12px;
  margin-top: 4px;
}

/* Upload modal (report pages "Create/Upload" flow) */
#uploadOv {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
#uploadOv.show {
  display: flex;
}
#uploadPn {
  width: 95vw;
  max-width: 480px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.cm-h {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}
.cm-h h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--txt);
}
.cm-b {
  padding: 20px 24px;
}
.cm-ft {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface);
}
.fm-file-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 14px;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.fm-file-btn:hover {
  border-color: var(--accent);
  background: rgba(232, 168, 56, 0.06);
}
.fm-file-name {
  font-size: 11px;
  color: var(--txt-sec);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

@media (max-width: 1200px) {
  .sh-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .sh-fin-row {
    grid-template-columns: 1fr;
  }
  .sh-field-grid.g3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .sh-comp-grid,
  .sh-doc-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  #shipDrawerPn {
    width: 98vw;
    height: 94vh;
  }
  .ds2 {
    flex-direction: column !important;
  }
  .dl,
  .dr2 {
    width: 100% !important;
  }
  .dl {
    max-height: 55vh;
    border-bottom: 1px solid var(--border);
  }
  .dr2 {
    border-left: none !important;
  }
}

/* ---------- Generic form / card / modal (used by CRUD sheets, settings, login) ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 18px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.form-group label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--txt-muted);
  font-weight: 600;
}
.form-control {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--txt);
  font-size: 13px;
  outline: none;
  width: 100%;
}
.form-control:focus {
  border-color: var(--accent);
}
.modal-ov {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-ov.show {
  display: flex;
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 420px;

  max-width: 92vw;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: mIn 0.2s ease;
  transition:
    background 0.35s,
    border-color 0.35s;
}
.modal-box h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  margin-bottom: 16px;
  font-weight: 700;
  text-align: center;
}
.modal-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* Create-record modal (shipping report/quality pages) — ported from base desing/*.html's
   #cPn / .cm-h / .cm-b / .cm-ft header-body-footer panel and its .fm-grid two-column form
   layout. Scoped under #createOv so the generic .modal-ov/.modal-box used elsewhere is untouched. */
#createOv .create-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 680px;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: mIn 0.2s ease;
}
.cm-h {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  flex-shrink: 0;
}
.cm-h h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  text-align: left;
}
.cm-b {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 24px;
}
.cm-ft {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface);
  flex-shrink: 0;
}
.fm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.fm-full {
  grid-column: 1 / -1;
}
.fm-grp {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fm-lbl {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--txt-dim);
  font-weight: 700;
}
.fm-inp,
.fm-sel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 12px;
  color: var(--txt);
  font-size: 12px;
  outline: none;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.2s;
}
.fm-sel {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235c6078'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.fm-inp:focus,
.fm-sel:focus {
  border-color: var(--accent);
}
.fm-sec {
  grid-column: 1 / -1;
  padding: 10px 0 2px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
}
.fm-sec-title {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  font-weight: 700;
}
.fm-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fm-file-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 14px;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fm-file-name {
  font-size: 11px;
  color: var(--txt-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--txt);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  min-width: 240px;
}
.toast.err {
  border-left-color: #f87171;
}
.toast.ok {
  border-left-color: #34d399;
}

/* ==========================================================================
   PD Department — Fabric Sheet / Sample Sheet / WIP
   Ported from base desing/PD Department.html (excel-style editable grids,
   ocean=var(--info) secondary accent for WIP/file-upload elements).
   ========================================================================== */

/* Sidebar dynamic sub-nav (Fabric Sheet brand list, WIP category/brand/year tree) */
.sb-section {
  padding: 8px 18px 4px;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--txt-muted);
  font-weight: 700;
  margin-top: 6px;
}
.nav-group {
  position: relative;
}
.sb-chevron {
  font-size: 9px;
  transition: transform 0.2s;
  color: var(--txt-muted);
  margin-left: auto;
}
.nav-group.open > .nav-i.has-sub .sb-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}
.sb-sub-nav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
}
.light-mode .sb-sub-nav {
  background: rgba(15, 23, 42, 0.03);
}
.nav-group.open > .sb-sub-nav {
  max-height: 2000px;
}
.sub-i {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 9px 48px;
  color: var(--txt-sec);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  border-left: 3px solid transparent;
  margin: 1px 0;
}
.sub-i i {
  width: 15px;
  text-align: center;
  font-size: 10px;
  opacity: 0.8;
}
.sb-sub-nav .sb-sub-nav .sub-i {
  padding-left: 62px;
}
.sub-i:hover {
  color: var(--txt);
  background: rgba(232, 168, 56, 0.04);
}
.sub-i.active {
  color: var(--accent);
  background: rgba(232, 168, 56, 0.08);
  border-left-color: var(--accent);
  font-weight: 600;
}
.sub-i::before {
  content: "";
  width: 5px;
  height: 1px;
  background: var(--txt-muted);
}
.sub-i.active::before {
  background: var(--accent);
}
.sub-group .sb-sub-nav {
  /* background: rgba(0, 0, 0, 0.2); */
}
.sub-i.has-sub {
  justify-content: space-between;
  padding-right: 18px;
}
.sub-i.has-sub::before {
  display: none;
}
.brand-i {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 8px 66px;
  color: var(--txt-sec);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 11.5px;
  border-left: 3px solid transparent;
  margin: 1px 0;
}
.brand-i:hover {
  color: var(--txt);
  background: rgba(232, 168, 56, 0.04);
}
.brand-i.active {
  color: var(--accent);
  background: rgba(232, 168, 56, 0.08);
  border-left-color: var(--accent);
  font-weight: 600;
}
.brand-i::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--txt-muted);
  flex-shrink: 0;
}
.brand-i.active::before {
  background: var(--accent);
}
.brand-i.has-sub::before {
  display: none;
}
.sub-i.ocean,
.brand-i.ocean {
  color: var(--txt-sec);
}
.sub-i.ocean:hover,
.brand-i.ocean:hover {
  color: var(--info);
  background: rgba(232, 168, 56, 0.04);
}
.sub-i.ocean.active,
.brand-i.ocean.active {
  color: var(--info);
  background: rgba(96, 165, 250, 0.08);
  border-left-color: var(--info);
  font-weight: 600;
}
.sub-i.ocean::before,
.brand-i.ocean::before {
  background: var(--txt-muted);
}
.sub-i.ocean.active::before,
.brand-i.ocean.active::before {
  background: var(--info);
}
.sidebar-add-btn,
.sidebar-add-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--txt-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 11px;
  border-left: 3px solid transparent;
  margin: 1px 0;
  font-style: italic;
}
.sidebar-add-btn {
  padding: 7px 18px 7px 66px;
}
.sidebar-add-sub {
  padding: 8px 18px 8px 48px;
}
.sidebar-add-btn:hover,
.sidebar-add-sub:hover {
  color: var(--info);
  background: rgba(232, 168, 56, 0.04);
  border-left-color: var(--info);
}
.sidebar-add-btn::before,
.sidebar-add-sub::before {
  content: "+";
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  width: 11px;
  height: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--txt-muted);
  border-radius: 2px;
  flex-shrink: 0;
}
.sidebar-add-btn:hover::before,
.sidebar-add-sub:hover::before {
  border-color: var(--info);
  color: var(--info);
}
.nav-i .brand-delete,
.sub-i .sub-delete {
  margin-left: auto;
  font-size: 10px;
  color: var(--txt-muted);
  opacity: 0;
  transition: all 0.2s;
  cursor: pointer;
}
.brand-i:hover .brand-delete,
.sub-i:hover .sub-delete {
  opacity: 1;
  color: #f87171;
}

/* Excel-style editable sheet table (Fabric Sheet + Sample Sheet) */
.table-wrapper {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  margin-bottom: 24px;
}
.excel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.excel-table th,
.excel-table td {
  padding: 10px 14px;
  border: 1px solid rgba(42, 47, 66, 0.4);
  white-space: nowrap;
  text-align: left;
}
.excel-table thead th {
  background: linear-gradient(
    180deg,
    var(--bg-header-1) 0%,
    var(--bg-header-2) 100%
  );
  color: var(--pd-gold);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 5;
  font-family: "Rajdhani", "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 13px;
  border-bottom: 2px solid var(--pd-gold);
  user-select: none;
}
.excel-table thead th:first-child {
  z-index: 6;
  left: 0;
  border-right: 2px solid var(--pd-gold);
}
.excel-table tbody td:first-child {
  position: sticky;
  left: 0;
  background: linear-gradient(90deg, var(--bg-header-2) 0%, var(--card) 100%);
  color: var(--pd-gold);
  text-align: center;
  font-weight: 700;
  z-index: 3;
  font-family: "Rajdhani", "Space Grotesk", sans-serif;
  font-size: 15px;
  letter-spacing: 1px;
  border-right: 1px solid var(--border);
}
.excel-table tbody tr:hover td:first-child {
  background: var(--bg-header-1);
  color: var(--txt);
}
.excel-table tbody td {
  background: var(--card);
  color: var(--txt-sec);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  transition: all 0.15s;
}
.excel-table tbody tr:hover td {
  background: var(--surface);
}
.excel-table td[contenteditable="false"] {
  cursor: default;
  user-select: none;
}
.excel-table td[contenteditable="true"] {
  cursor: cell;
  user-select: text;
}
.excel-table td[contenteditable="true"]:focus {
  outline: 1px solid var(--pd-gold);
  outline-offset: -1px;
  background: var(--pd-gold-dim);
  color: var(--txt);
}
.row-total-cell {
  color: var(--pd-ocean);
  font-weight: 600;
  text-align: right;
}
.grand-total-row td {
  background: var(--bg-header-1) !important;
  border-top: 2px solid var(--pd-gold) !important;
  position: sticky;
  bottom: 0;
  z-index: 4;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}
.grand-total-row:hover td {
  background: var(--bg-header-1) !important;
}
.grand-total-value {
  color: var(--pd-gold);
  text-align: right;
  font-size: 14px;
}
.grand-total-stock {
  color: var(--pd-ocean);
  text-align: right;
  font-size: 14px;
}
.delete-row-btn {
  color: #f87171;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s;
}
.delete-row-btn:hover {
  transform: scale(1.2);
}

/* Excel-style column filter dropdown (Sample Sheet) */
.th-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  position: relative;
  gap: 5px;
  width: 100%;
}
.filter-icon {
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 10px !important;
  color: var(--txt-muted);
}
.filter-icon:hover {
  background: var(--pd-gold-dim);
  color: var(--pd-gold);
}
.filter-icon.active {
  color: var(--pd-gold);
  background: var(--pd-gold-dim);
}
.filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  font-family: "DM Sans", sans-serif;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}
.filter-dd-header {
  display: flex;
  gap: 5px;
  margin-bottom: 5px;
}
.filter-dd-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 11px;
  color: var(--txt);
  outline: none;
}
.filter-dd-search:focus {
  border-color: var(--pd-gold);
}
.filter-dd-actions {
  display: flex;
  gap: 5px;
  justify-content: space-between;
  margin-bottom: 5px;
}
.filter-dd-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.filter-dd-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.filter-dd-item:hover {
  background: var(--pd-gold-dim);
}
.filter-dd-item input[type="checkbox"] {
  accent-color: var(--pd-gold);
  width: 13px;
  height: 13px;
  cursor: pointer;
  flex-shrink: 0;
}
.filter-dd-item label {
  cursor: pointer;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--txt-sec);
}

/* Factory / fabric block headers, add buttons (Fabric Sheet) */
.factory-main-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  margin-top: 36px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.factory-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: var(--pd-ocean-dim);
  border: 1px solid var(--pd-ocean);
  border-radius: 8px;
  color: var(--pd-ocean);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.factory-name-text {
  font-weight: 700;
  letter-spacing: 0.5px;
}
.code-block-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding: 8px 18px;
  background: var(--bg-header-1);
  border: 1px solid var(--border);
  border-radius: 30px;
  color: var(--pd-gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.code-text {
  color: var(--txt);
  font-weight: 600;
}
.table-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.action-icon {
  cursor: pointer;
  font-size: 14px;
  color: var(--txt-sec);
  transition:
    color 0.2s,
    transform 0.2s;
}
.action-icon:hover {
  color: var(--pd-gold);
  transform: scale(1.15);
}
.delete-icon {
  color: #f87171;
}
.delete-icon:hover {
  color: #fca5a5;
}
.sample-header {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 10px;
}
.sample-header > :first-child {
  justify-self: start;
}
.sample-header > :last-child {
  justify-self: end;
}
.add-code-btn {
  margin-top: 10px;
  margin-bottom: 20px;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--txt-sec);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.add-code-btn:hover {
  border-color: var(--pd-gold);
  color: var(--pd-gold);
  background: var(--pd-gold-dim);
}
.add-factory-btn {
  margin-top: 24px;
  margin-bottom: 30px;
  width: 100%;
  padding: 15px;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--pd-gold);
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
}
.add-factory-btn:hover {
  border-color: var(--pd-gold);
  background: var(--pd-gold-dim);
}
.factory-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.factory-summary-card:hover {
  border-color: var(--pd-ocean);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

/* WIP file-upload cards */
.wip-page-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--txt);
}
.wip-page-title .fa-file-upload,
.wip-page-title .fa-gears,
.wip-page-title .fa-folder-open {
  color: var(--pd-ocean);
}
.wip-season-label {
  color: var(--pd-ocean);
}
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 10px;
}
.upload-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.upload-card:hover {
  border-color: var(--pd-ocean);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.upload-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  gap: 10px;
}
.upload-card-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  color: var(--pd-ocean);
  display: flex;
  align-items: center;
  gap: 8px;
}
.file-search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 11px;
  color: var(--txt);
  outline: none;
  width: 120px;
  transition:
    border-color 0.2s,
    width 0.2s;
}
.file-search-input:focus {
  border-color: var(--pd-ocean);
  width: 150px;
}
.upload-btn-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
}
.upload-btn {
  background: var(--pd-ocean);
  color: #0c0e16;
  padding: 7px 14px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  transition: all 0.2s;
}
.upload-btn:hover {
  background: var(--pd-ocean-light);
  box-shadow: 0 4px 12px var(--pd-ocean-dim);
}
.upload-btn input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid rgba(42, 47, 66, 0.4);
  border-radius: 4px;
  font-size: 12px;
  color: var(--txt-sec);
  transition: all 0.15s;
}
.file-item:hover {
  border-color: var(--pd-ocean);
}
.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.file-link {
  color: var(--pd-ocean);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-link:hover {
  color: var(--pd-ocean-light);
  text-decoration: underline;
}
.file-remove {
  color: #f87171;
  cursor: pointer;
  font-size: 12px;
  transition:
    color 0.2s,
    transform 0.2s;
  flex-shrink: 0;
}
.file-remove:hover {
  color: #fca5a5;
  transform: scale(1.2);
}
.no-files {
  color: var(--txt-muted);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}
.add-brand-card {
  background: transparent;
  border: 2px dashed var(--txt-muted);
  border-radius: 8px;
  padding: 30px 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 140px;
}
.add-brand-card:hover {
  border-color: var(--pd-ocean);
  background: var(--pd-ocean-dim);
}
.add-brand-card i {
  font-size: 28px;
  color: var(--txt-muted);
  transition: color 0.2s;
}
.add-brand-card:hover i {
  color: var(--pd-ocean);
}
.add-brand-card span {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  color: var(--txt-muted);
  font-weight: 600;
  transition: color 0.2s;
}
.add-brand-card:hover span {
  color: var(--pd-ocean);
}

/* WIP season tabs (bottom excel-style tab bar) */
.excel-tabs-container {
  position: sticky;
  bottom: 0;
  height: 36px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: none;
  align-items: stretch;
  padding: 0 4px 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  z-index: 40;
  flex-shrink: 0;
}
.excel-tab {
  padding: 0 18px;
  font-size: 11px;
  color: var(--txt-sec);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  margin-top: 6px;
}
.excel-tab:hover {
  color: var(--txt);
  background: rgba(232, 168, 56, 0.04);
}
.excel-tab.ocean.active {
  background: var(--bg);
  color: var(--info);
  border-color: var(--border);
  border-bottom-color: var(--bg);
  padding-top: 2px;
  box-shadow: inset 0 2px 0 var(--info);
}
.excel-tab .tab-delete {
  margin-left: 8px;
  font-size: 9px;
  color: var(--txt-muted);
  opacity: 0;
  transition: all 0.15s;
  cursor: pointer;
}
.excel-tab:hover .tab-delete {
  opacity: 1;
}
.excel-tab .tab-delete:hover {
  color: #f87171;
  transform: scale(1.3);
}
.excel-tab-add {
  padding: 0 14px;
  font-size: 14px;
  color: var(--txt-muted);
  background: transparent;
  border: 1px dashed transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  margin-top: 6px;
}
.excel-tab-add:hover {
  color: var(--info);
  border-color: var(--info);
  background: rgba(96, 165, 250, 0.06);
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpi-g {
    grid-template-columns: repeat(2, 1fr);
  }
  .ch-g {
    grid-template-columns: 1fr;
  }
  .tb-4search-grid {
    display: none;
  }
  .d-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-220px);
  }
  #sidebar.mo {
    transform: translateX(0);
  }
  #main {
    margin-left: 0 !important;
  }
  .kpi-g {
    grid-template-columns: 1fr;
  }
  .fr {
    flex-direction: column;
  }
  .fg {
    min-width: 100%;
  }
  #dPn {
    max-width: 98vw;
    max-height: 94vh;
    border-radius: 10px;
  }
  .d-summary {
    grid-template-columns: 1fr 1fr;
  }
  .pdf-grid,
  .pdf-grid.thirds {
    grid-template-columns: 1fr;
  }
  .page-wrap {
    padding: 16px;
  }
}
.btn-del {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--error);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-weight: 600;
}
.btn-del:hover {
  background: var(--error-bg);
  border-color: var(--error);
}
