@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --navy: #153868;
  --navy-dark: #0e274a;
  --ink: #0f172a;
  --muted: #475569;
  --teal: #1d4ed8;
  --teal-hover: #1e40af;
  --line: #cbd5e1;
  --line-light: #e2e8f0;
  --bg: #f8fafc;
  --gold: #b45309;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

button, input, select, textarea {
  font: inherit;
}

button, a, label.button {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .4;
  cursor: default;
}

a {
  color: var(--teal);
  text-decoration: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Sidebar */
.sidebar {
  width: 250px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: linear-gradient(175deg, #163e76 0%, #0d254b 100%);
  color: #fff;
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  z-index: 30;
  box-shadow: 2px 0 16px rgba(0,0,0,0.12);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  padding: 0 8px 26px;
}

.brand-logo {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 4px 10px 4px 6px;
  width: 190px;
  height: 64px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.brand-logo img {
  width: 116px;
  height: 52px;
  object-fit: contain;
}

.brand-logo strong {
  color: #1e3a63;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  border-left: 1.5px solid #cbd5e1;
  padding-left: 8px;
  margin-left: 4px;
}

.brand small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #cbd5e1;
}

.nav-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #93c5fd;
  padding: 0 12px;
  margin: 12px 0 10px;
  text-transform: uppercase;
}

.nav-label.second {
  margin-top: 28px;
}

.nav-item {
  border: 0;
  background: none;
  color: #e2e8f0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  margin: 3px 0;
  transition: all 0.15s ease;
}

.nav-item > span {
  font-size: 18px;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 4px 0 #60a5fa;
  color: #fff;
  font-weight: 700;
}

.nav-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
}

.nav-item b {
  margin-left: auto;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 5px;
  font-size: 11px;
  padding: 2px 7px;
  font-weight: 700;
  background: rgba(0,0,0,0.15);
}

.sector-nav {
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  border: 0;
  color: #e2e8f0;
  padding: 10px 14px;
  width: 100%;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.sector-nav:hover {
  background: rgba(255,255,255,0.08);
}

.sector-nav b {
  font-size: 11.5px;
  color: #bfdbfe;
  margin-left: auto;
  font-weight: 600;
}

.sector-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60a5fa;
}

.sector-dot.Endo { background: #fbbf24; }
.sector-dot.Ortho { background: #a78bfa; }
.sector-dot.IVD { background: #34d399; }
.sector-dot.Cardio { background: #f87171; }

.sidebar-bottom {
  margin-top: auto;
  font-size: 12px;
  color: #cbd5e1;
  padding: 18px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  line-height: 1.7;
}

.sidebar-bottom small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
}

.sidebar-bottom button {
  padding: 8px 0 0;
  border: 0;
  background: transparent;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  margin-right: 7px;
}

/* Shell & Topbar */
.main-shell {
  margin-left: 250px;
}

.topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  font-size: 14px;
}

.topbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar strong {
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: #1d4ed8;
}

.private-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

#mobileMenu {
  display: none;
}

main {
  padding: 32px 38px 40px;
  max-width: 1920px;
  margin: auto;
}

/* Page Heading */
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #1d4ed8;
  margin-bottom: 8px;
  text-transform: uppercase;
}

h1 {
  font-family: Manrope, Arial, sans-serif;
  font-size: 30px;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
  font-weight: 800;
  color: #0f172a;
}

.page-heading p {
  color: #475569;
  font-size: 14.5px;
  font-weight: 500;
  margin: 0;
  line-height: 1.6;
}

.heading-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  background: white;
  color: #0f172a;
  transition: all 0.15s ease;
}

.button:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.button.primary {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.button.primary:hover {
  background: #1e40af;
}

.text-button {
  background: transparent;
  color: #1d4ed8;
  border: 0;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  padding: 8px 12px;
}

.text-button:hover {
  text-decoration: underline;
}

/* Stats Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 20px 24px;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.stat-label {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-icon {
  font-size: 20px;
  color: #1d4ed8;
}

.stat-card strong {
  font-family: Manrope, Arial, sans-serif;
  font-size: 32px;
  font-weight: 800;
  display: block;
  line-height: 1.2;
  color: #0f172a;
}

.stat-foot {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  margin-top: 10px;
}

/* Data note */
.data-note {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 13.5px;
}

.note-icon {
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.data-note strong {
  font-size: 14px;
  font-weight: 700;
  color: #1e3a8a;
}

.data-note p {
  margin: 4px 0 0;
  line-height: 1.6;
  color: #3b82f6;
  font-size: 13px;
}

.data-note button {
  margin-left: auto;
  background: none;
  border: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
}

/* Panel & Search */
.panel {
  background: white;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.search-panel {
  padding: 22px 24px;
  margin-bottom: 20px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-wrap input {
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 13px 60px 13px 44px;
  width: 100%;
  min-height: 48px;
  font-size: 15.5px;
  font-weight: 500;
  color: #0f172a;
  transition: all 0.15s ease;
}

.search-wrap input:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-wrap input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 24px;
  color: #64748b;
  pointer-events: none;
}

.search-wrap kbd {
  position: absolute;
  right: 14px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  text-align: center;
  line-height: 19px;
  background: white;
}

.clear {
  position: absolute;
  right: 44px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 22px;
  display: none;
}

.filters {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: 18px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filters select {
  width: 100%;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  height: 42px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.filters select:focus {
  border-color: #2563eb;
}

/* Table */
.table-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1.5px solid var(--line);
  background: #fafbfc;
}

h2 {
  font-family: Manrope, Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

h2 span {
  margin-left: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  border-radius: 6px;
}

.table-hint {
  color: #64748b;
  font-size: 12.5px;
  font-weight: 500;
}

.table-scroll {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 1050px;
}

th {
  font-size: 12.5px;
  font-weight: 800;
  color: #334155;
  background: #f1f5f9;
  padding: 15px 18px;
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

th button {
  font: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-weight: inherit;
}

th button span {
  margin-left: 6px;
  color: #2563eb;
}

td {
  font-size: 14px;
  padding: 18px 18px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  line-height: 1.6;
  color: #0f172a;
}

tbody tr:hover {
  background: #f8fafc;
}

.review-col {
  width: 60px;
  text-align: center;
}

td:first-child:has(input[type=checkbox]) {
  text-align: center;
}

input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

/* Product Code */
.code-link {
  background: none;
  border: 0;
  padding: 0;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
}

.code-link:hover {
  text-decoration: underline;
  color: #1e40af;
}

/* Product Name & Description */
.product-name {
  max-width: 320px;
  min-width: 180px;
}

.product-name .description {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.5;
}

.family-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  margin-top: 4px;
}

.subtext {
  display: block;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 4px;
}

/* Division & Single Risk Class */
.sector-tag {
  font-size: 13.5px;
  font-weight: 800;
  color: #1e293b;
  display: inline-block;
  margin-right: 8px;
}

.class-badge {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 28px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  border: 1.5px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.class-badge.A {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.class-badge.B {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

.class-badge.C {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

.class-badge.D {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Registration Numbers */
.reg-number {
  font-size: 14px;
  font-weight: 700;
  color: #0f2c59;
  max-width: 280px;
  overflow-wrap: anywhere;
  display: block;
  line-height: 1.5;
}

.status-basis {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 5px;
  color: #854d0e;
}

.status-basis:before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-basis.exact {
  color: #059669;
}

.missing-tag {
  display: inline-block;
  color: #b45309;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 5px;
  white-space: nowrap;
}

.edit-flag {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

/* Download Buttons in table */
.cell-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.cell-downloads a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.08);
}

.cell-downloads a:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.row-open {
  font-size: 22px;
  font-weight: 800;
  color: #64748b;
  background: transparent;
  border: 0;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.row-open:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  gap: 14px;
  border-top: 1.5px solid var(--line);
  background: #fafbfc;
}

.pagination > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pagination label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.pagination select {
  font-size: 13.5px;
  font-weight: 700;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  background: white;
}

.pagination button {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: white;
  color: #1e293b;
  font-size: 16px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.pagination button:not(:disabled):hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* Documents View */
.download-hub {
  padding: 26px 30px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  margin-bottom: 26px;
}

.download-hub h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 10px;
  color: #1e3a8a;
}

.download-hub p, .library-status {
  font-size: 14px;
  font-weight: 500;
  color: #3b82f6;
  line-height: 1.7;
}

.download-packages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.download-package {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: white;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: all 0.15s ease;
}

.download-package:hover {
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.download-package strong {
  font-size: 14.5px;
  font-weight: 800;
  color: #1d4ed8;
}

.download-package small {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
}

.library-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1.5px solid var(--line);
  background: #fafbfc;
}

.library-tools .search-wrap {
  flex: 1 1 340px;
}

.library-tools select {
  height: 44px;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  padding: 0 14px;
  background: white;
  font-size: 13.5px;
  font-weight: 600;
}

.document-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.doc-card {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.doc-card h3 {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
  margin: 0 0 8px;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.doc-card > p {
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.doc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.file-icon {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
}

.doc-sector {
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 10px;
}

.source-actions a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}

.source-actions a:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.link-like {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 0;
  text-align: left;
  cursor: pointer;
}

.link-like:hover {
  text-decoration: underline;
}

/* Drawer */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 50;
  backdrop-filter: blur(3px);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(820px, 96vw);
  height: 100vh;
  overflow: auto;
  z-index: 60;
  background: #fff;
  box-shadow: -20px 0 60px rgba(0,0,0,0.2);
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1.5px solid var(--line);
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.drawer-header h2 {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: white;
  color: #475569;
  font-size: 22px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.icon-button:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.drawer-content {
  padding: 28px 32px;
}

.detail-description {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.8;
  color: #1e293b;
  margin: 0 0 20px;
}

.detail-section {
  border-top: 1.5px solid var(--line);
  padding: 24px 0;
}

.detail-section h3 {
  font-family: Manrope, Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 16px;
  color: #0f172a;
}

.detail-kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  font-size: 14px;
  padding: 8px 0;
  line-height: 1.6;
}

.detail-kv > span {
  color: #475569;
  font-weight: 600;
}

.detail-kv strong, .detail-kv div {
  color: #0f172a;
  font-weight: 700;
}

.doc-link-block {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 16px 18px;
  margin: 12px 0;
  background: #f8fafc;
}

.doc-link-block strong {
  font-size: 15px;
  font-weight: 800;
  color: #0f2c59;
}

.doc-link-block p {
  margin: 8px 0;
  color: #334155;
  font-size: 13.5px;
  line-height: 1.6;
}

.source-row {
  display: block;
  font-size: 13.5px;
  color: #334155;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 10px 0;
  line-height: 1.7;
}

.source-row strong {
  font-size: 14.5px;
  font-weight: 700;
  color: #1d4ed8;
}

.source-row small {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* Edit form in drawer */
.edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.edit-form label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-form input, .edit-form select, .edit-form textarea {
  min-height: 42px;
  font-size: 14px;
  border: 1.5px solid #cbd5e1;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  width: 100%;
}

.edit-form textarea {
  min-height: 90px;
  resize: vertical;
}

.edit-form .full {
  grid-column: 1 / -1;
}

.edit-form .checkline {
  flex-direction: row;
  align-items: center;
  color: #0f172a;
  font-size: 14px;
}

.edit-form .checkline input {
  width: 18px;
  min-height: 18px;
}

/* Footer & Toast */
.main-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
  padding: 28px 0 0;
  border-top: 1.5px solid var(--line);
  margin-top: 30px;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: calc(50% + 120px);
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 14px 26px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 100;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.toast.show {
  opacity: 1;
}

body.modal-open {
  overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 1250px) {
  .sidebar { width: 220px; }
  .main-shell { margin-left: 220px; }
  main { padding: 24px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .document-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-shell { margin-left: 0; }
  #mobileMenu { display: inline-block; font-size: 24px; }
  .stat-grid { grid-template-columns: 1fr; }
  .document-grid { grid-template-columns: 1fr; }
  .toast { left: 50%; }
}

/* ENHANCED BULK CHECKLIST & TEMPLATE STYLING */
.bulk-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.bulk-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0;
}
.bulk-subtitle {
  font-size: 14.5px;
  color: #475569;
  margin: 4px 0 0 0;
  max-width: 820px;
  line-height: 1.5;
}
.template-btn {
  background: #059669 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 14.5px !important;
  padding: 10px 18px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25) !important;
  transition: all 0.2s ease !important;
  border: none !important;
  cursor: pointer;
}
.template-btn:hover {
  background: #047857 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35) !important;
}
.bulk-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 960px) {
  .bulk-input-grid {
    grid-template-columns: 1fr;
  }
}
.bulk-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}
.bulk-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.bulk-box-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bulk-box-title h3 {
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}
.box-icon {
  font-size: 20px;
  line-height: 1;
}
.code-count-badge {
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.bulk-box-desc {
  font-size: 13.5px;
  color: #64748b;
  margin: 0 0 14px 0;
  line-height: 1.45;
}
.textarea-wrapper {
  flex: 1;
}
#bulkInput {
  width: 100%;
  height: 175px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.6;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  background: #ffffff;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#bulkInput:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.bulk-run-btn {
  padding: 10px 20px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  background: #1d4ed8 !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}
.bulk-run-btn:hover {
  background: #1e40af !important;
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.35) !important;
  transform: translateY(-1px);
}
.drop-zone {
  border: 2px dashed #93c5fd;
  background: #f8fafc;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 175px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
  border-style: solid;
}
.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.drop-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.drop-text strong {
  font-size: 14.5px;
  font-weight: 700;
  color: #1e293b;
  display: block;
}
.drop-text span {
  font-size: 13px;
  color: #64748b;
}
.drop-browse-link {
  background: none;
  border: none;
  color: #2563eb;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}
.drop-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}
.template-download-inline {
  margin-top: 14px;
  font-size: 13.5px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.template-inline-link {
  background: none;
  border: none;
  color: #059669;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.template-inline-link:hover {
  color: #047857;
}
.bulk-summary-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.bulk-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}
.bulk-summary-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 4px 0 0 0;
}
.export-excel-btn {
  background: #059669 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  border: none !important;
}
.export-excel-btn:hover {
  background: #047857 !important;
}
.bulk-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.bulk-metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.bulk-metric-card.total {
  border-left: 4px solid #3b82f6;
}
.bulk-metric-card.total .bulk-metric-val {
  color: #1d4ed8;
}
.bulk-metric-card.good {
  border-left: 4px solid #10b981;
}
.bulk-metric-card.good .bulk-metric-val {
  color: #047857;
}
.bulk-metric-card.ref {
  border-left: 4px solid #06b6d4;
}
.bulk-metric-card.ref .bulk-metric-val {
  color: #0e7490;
}
.bulk-metric-card.missing {
  border-left: 4px solid #f43f5e;
}
.bulk-metric-card.missing .bulk-metric-val {
  color: #e11d48;
}
.bulk-metric-label {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bulk-metric-val {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin: 4px 0 2px 0;
}
.bulk-metric-hint {
  font-size: 12px;
  color: #94a3b8;
}
.bulk-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.bulk-table th {
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 14px;
  border-bottom: 2px solid #cbd5e1;
}
.bulk-table td {
  padding: 12px 14px;
  font-size: 14.5px;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}
.bulk-table tr:hover td {
  background-color: #f8fafc;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  white-space: nowrap;
}
.status-badge.found {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.status-badge.ref {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}
.status-badge.missing {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.code-missing {
  color: #dc2626;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.row-missing td {
  background-color: #fffbfa;
}

/* SYNC BRIDGE & MODAL STYLES */
.top-sync-pill {
  background: #f0fdf4 !important;
  color: #15803d !important;
  border: 1.5px solid #86efac !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  padding: 6px 14px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
  margin-right: 8px;
}
.top-sync-pill:hover {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}
.sync-nav-item {
  color: #047857 !important;
  font-weight: 700 !important;
  border-left: 3px solid #10b981 !important;
  background: #f0fdf4 !important;
}
.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  transition: background 0.3s ease;
}
.sync-dot.live {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse-dot 2s infinite;
}
.sync-dot.busy {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}
@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sync-banner-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.08);
}
.sync-banner-left {
  flex: 1;
  min-width: 300px;
}
.sync-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: #047857;
  letter-spacing: 0.05em;
  background: #d1fae5;
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 8px;
}
.sync-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #059669;
  animation: pulse-dot 1.8s infinite;
}
.sync-banner-title {
  font-size: 14.5px;
  color: #0f172a;
  margin-bottom: 6px;
}
.sync-banner-title code {
  background: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 13.5px;
  font-weight: 700;
  color: #047857;
}
.sync-banner-desc {
  font-size: 13.5px;
  color: #475569;
  margin: 0;
  line-height: 1.45;
}
.sync-banner-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.sync-big-btn {
  background: #059669 !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  padding: 12px 22px !important;
  border-radius: 9px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3) !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
  border: none !important;
}
.sync-big-btn:hover {
  background: #047857 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4) !important;
}
.sync-bridge-status {
  font-size: 12.5px;
  font-weight: 600;
  color: #047857;
}

/* Modal Dialog */
.sync-modal-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 680px;
  width: 95%;
  background: #ffffff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
}
.sync-modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}
.sync-modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-radius: 16px 16px 0 0;
}
.sync-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sync-modal-icon {
  font-size: 26px;
}
.sync-modal-title h2 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}
.sync-modal-title p {
  font-size: 13px;
  color: #64748b;
  margin: 2px 0 0 0;
}
.sync-modal-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}
.sync-info-box {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
}
.info-label {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.info-folder-path {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  word-break: break-all;
}
.info-note {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 8px;
  line-height: 1.45;
}
.sync-bridge-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
  background: #fafafa;
}
.sync-bridge-card.connected {
  border-color: #86efac;
  background: #f0fdf4;
}
.bridge-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bridge-indicator-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bridge-status-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
}
.bridge-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #475569;
}
.bridge-badge.online {
  background: #dcfce7;
  color: #15803d;
}
.bridge-status-desc {
  font-size: 13px;
  color: #64748b;
  margin: 6px 0 0 0;
}
.sync-actions-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.sync-execute-btn {
  background: #059669 !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  padding: 12px 24px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer;
}
.sync-execute-btn:hover {
  background: #047857 !important;
}
.sync-log-container {
  background: #0f172a;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
}
.sync-log-header {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid #334155;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.sync-log-pre {
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.sync-manual-help {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}
.sync-manual-help h4 {
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 12px 0;
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .help-grid { grid-template-columns: 1fr; }
}
.help-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}
.help-card.highlight {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.help-card strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 4px;
}
.help-card p {
  font-size: 12.5px;
  color: #475569;
  margin: 0;
  line-height: 1.4;
}
.help-card code {
  font-weight: 700;
  background: #ffffff;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}
