/* ── Self-hosted local fonts (Phase 10) ────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/Inter-800.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-600.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-700.woff2') format('woff2');
}
:root {
  /* 3 named shadow levels */
  --shadow-flat: none;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .05), 0 3px 8px rgba(15, 23, 42, .03);
  --shadow-elevated: 0 10px 24px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);

  /* Type scale (exactly 6 sizes) */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 26px;
  /* Theme semantic color tokens */
  --color-brand: #2563eb;
  --color-brand-dark: #1e3a5f;
  --color-brand-hover: #1d4ed8;
  --color-brand-light: #eff6ff;
  --color-brand-lighter: #bfdbfe;
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-info: #2563eb;
  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;
  --color-open: #6b7280;
  --color-open-bg: #f3f4f6;
  --color-open-border: #e2e4ed;
  --color-surface: #ffffff;
  --color-muted: #9ca3af;

  /* Shared enterprise UI tokens: shell surfaces only, never business-state colors. */
  --app-surface: #ffffff;
  --app-surface-subtle: #f8fafc;
  --app-canvas: #f8fafc;
  --app-border: #cbd5e1;
  --app-border-strong: #94a3b8;
  --app-text-muted: #64748b;
  --app-focus: #2563eb;
  --app-radius-control: 6px;
  --app-radius-surface: 10px;
  --app-control-height: 34px;
  --motion-instant: 100ms;
  --motion-fast: 140ms;
  --motion-standard: 180ms;
  --motion-ease-out: cubic-bezier(.2, .8, .2, 1);
  --motion-ease-standard: cubic-bezier(.4, 0, .2, 1);
  --motion-focus-ring: 0 0 0 3px rgba(37, 99, 235, .22);
  --motion-lift-shadow: 0 7px 16px rgba(15, 76, 129, .12);
}

/* Theme tokens intentionally reuse this stylesheet's established palette. */
[data-theme="dark"] {
  color-scheme: dark;
  --color-brand: #bfdbfe;
  --color-brand-dark: #eff6ff;
  --color-brand-hover: #bfdbfe;
  --color-brand-light: rgb(38, 38, 38);
  --color-brand-lighter: #2563eb;
  --color-success: #bbf7d0;
  --color-success-bg: rgba(22, 163, 74, .20);
  --color-success-border: #16a34a;
  --color-danger: #fecaca;
  --color-danger-bg: rgba(220, 38, 38, .20);
  --color-danger-border: #dc2626;
  --color-warning: #fde68a;
  --color-warning-bg: rgba(217, 119, 6, .20);
  --color-warning-border: #d97706;
  --color-info: #bfdbfe;
  --color-info-bg: rgba(37, 99, 235, .22);
  --color-info-border: #2563eb;
  --color-open: #c9d5e3;
  --color-open-bg: rgb(45, 45, 45);
  --color-open-border: #64748b;
  --color-surface: rgb(35, 35, 35);
  --color-muted: #c9d5e3;
  --app-surface: rgb(28, 28, 28);
  --app-surface-subtle: rgb(38, 38, 38);
  --app-canvas: rgb(18, 18, 18);
  --app-border: rgba(255, 255, 255, .16);
  --app-border-strong: rgba(255, 255, 255, .28);
  --app-text-muted: #c9d5e3;
  --app-focus: #bfdbfe;
  --motion-focus-ring: 0 0 0 3px rgba(191, 219, 254, .3);
  --motion-lift-shadow: 0 7px 16px rgba(0, 0, 0, .32);
}

.project-title {
  color: var(--color-brand-dark);
  font-size:var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: clamp(280px, 34vw, 520px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-report-project-name { display: inline-flex; align-items: center; max-width: 100%; padding: 2px 10px; border-radius: 999px; background: rgba(248, 248, 246, 0.18); border: 1px solid rgba(254, 240, 138, 0.42); color: var(--color-warning-border); font-size:var(--text-sm); font-weight: 800; line-height: 1.2; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-coe-vc .stat-report-project-name { background: var(--color-brand-light); border-color: var(--color-brand-lighter); color: var(--color-brand-hover); }

/* Ensure sidebar has correct width and doesn't collapse */
/* Sidebar collapsed state */
#sidebar.collapsed {
  width: 56px !important;
  min-width: 56px !important;
}

#sidebar.collapsed .sidebar-logo-content {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

#sidebar.collapsed .sidebar-label {
  opacity: 0;
}

#sidebar.collapsed #projectList .project-label,
#sidebar.collapsed .sidebar-section-text,
#sidebar.collapsed p.text-\[10px\],
#sidebar.collapsed .sidebar-label {
  opacity: 0;
  pointer-events: none;
}

#sidebar.collapsed .flex-1.overflow-y-auto {
  overflow: hidden;
}

#sidebar.collapsed #filterSection,
#sidebar.collapsed [data-user-manager],
#sidebar.collapsed .px-3 button {
  display: none !important;
}

/* Tooltip for collapsed icons */
#sidebar.collapsed #projectList button {
  position: relative;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

#sidebar.collapsed .flex-1.overflow-y-auto {
  visibility: hidden;
  opacity: 0;
}

/* Fix any Tailwind border-l not showing */
.active-project {
  border-left-width: 3px !important;
}

/* Color feedback is intentionally limited to interactive controls below.
   Avoiding a global transition keeps tables and rapid tab changes immediate. */

/* Fix input focus rings site-wide */
input:focus, select:focus, textarea:focus {
  outline: 2px solid transparent !important;
  outline-offset: 2px !important;
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
  box-shadow: var(--shadow-card);
  --tw-ring-color: rgba(37, 99, 235, 0.2) !important;
  border-color: var(--color-brand) !important;
}

.share-access-dropdown-btn {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-brand-dark);
  font-size:var(--text-sm);
  font-family: inherit;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.share-access-dropdown-btn:hover {
  border-color: var(--color-brand-lighter);
}

.share-access-dropdown-btn.is-open,
.share-access-dropdown-btn:focus {
  outline: 2px solid transparent;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.share-access-dropdown-btn span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-access-dropdown-caret {
  flex: 0 0 auto;
  color: var(--color-brand-dark);
  font-size:var(--text-xs);
}

.share-access-floating-menu {
  position: fixed;
  z-index: 5000;
  display: none;
  max-height: 146px;
  overflow-y: auto;
  border: 1px solid var(--color-brand);
  border-radius: 4px;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  scrollbar-width: thin;
  scrollbar-color: var(--color-muted) var(--color-open-bg);
}

.share-access-floating-menu.is-open {
  display: block;
}

.share-access-floating-option {
  width: 100%;
  min-height: 35px;
  display: block;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--app-surface-subtle);
  background: var(--color-surface);
  color: var(--color-brand-dark);
  font-size:var(--text-sm);
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.share-access-floating-option:last-child {
  border-bottom: 0;
}

.share-access-floating-option:hover,
.share-access-floating-option.is-selected {
  background: var(--app-text-muted);
  color: var(--color-surface);
}

/* ── Password fields ── */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.password-field { position: relative; display: flex; align-items: center; }
.password-field input { width: 100%; padding-right: 42px !important; }
.password-toggle { position: absolute; right: 7px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--color-open); cursor: pointer; font-size:var(--text-sm); line-height: 1; transition: background-color var(--motion-instant) var(--motion-ease-standard), color var(--motion-instant) var(--motion-ease-standard), box-shadow var(--motion-instant) var(--motion-ease-out); }
.password-toggle:hover { background: var(--color-open-bg); color: var(--color-brand-dark); }
.is-invalid { border-color: var(--color-danger) !important; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12) !important; }

/* ── Role pill base (JS-generated content) ── */
.role-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size:var(--text-xs); font-weight: 600; text-transform: capitalize; }

/* ── Modal open/close ── */
.modal-overlay.open { display: flex !important; }
.modal { transition: transform 0.2s ease; }

/* ── Notification menu toggle ── */
#appTopbar { position: relative !important; z-index: 190 !important; overflow: visible !important; isolation: isolate; }
#dashboard { position: relative; z-index: 1; }
.notification-menu { z-index: 195 !important; top: calc(100% + 6px) !important; overflow: hidden; border-color: var(--color-brand-lighter) !important; background: var(--color-brand-light) !important; box-shadow: var(--shadow-elevated); transition: opacity 0.15s ease, transform 0.15s ease; }
.notification-popover-wrap::after { content: ''; display: none; position: absolute; z-index: 196; right: 17px; bottom: -6px; width: 2px; height: 6px; border-radius: 2px; background: var(--color-brand-lighter); pointer-events: none; }
.notification-popover-wrap:has(.notification-menu:not(.hidden))::after { display: block; }
.notification-menu.hidden { display: none !important; }
.notification-menu > div:first-child { border-color: var(--color-brand-lighter) !important; background: linear-gradient(135deg, var(--color-brand-light), var(--color-brand-light)); }
.notification-list { background: linear-gradient(180deg, var(--color-brand-light) 0%, var(--color-brand-light) 100%); }
.profile-menu { z-index: 195 !important; background: var(--color-surface) !important; border-color: var(--app-border) !important; box-shadow: var(--shadow-card); opacity: 1 !important; }
.profile-menu.hidden { display: none !important; }

/* ── Case modal status-only mode ── */
.status-only .btn-send-email { display: none !important; }

.developer-select-wrap,
.tester-select-wrap { position: relative; flex: 1; min-width: 0; z-index: 5; }
#caseAssignedToGroup { position: relative; z-index: 5; }
.developer-select-wrap input,
.tester-select-wrap input { width: 100%; }
.developer-multi-select {
  min-height: 38px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px 8px;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 6px;
  background: #f8fafc !important;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  cursor: text;
}
.developer-multi-select:hover {
  border-color: #94a3b8 !important;
  background: #ffffff !important;
}
.developer-multi-select:focus-within {
  border-color: #0284c7 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, .15) !important;
}
.developer-assignee-tokens {
  display: contents;
}
.developer-assignee-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 700;
}
.developer-assignee-token span {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.developer-assignee-remove {
  border: 0;
  background: transparent;
  color: var(--app-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 1px;
  font-size:var(--text-sm);
}

/* ── Person initials avatar circles (Phase 3) ── */
.user-avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  flex-shrink: 0;
  user-select: none;
  font-family: inherit;
}
.user-avatar-sm { width: 18px; height: 18px; font-size: 9px; }
.user-avatar-md { width: 22px; height: 22px; font-size: 10px; }
.user-avatar-color-0 { background: #2563eb; }
.user-avatar-color-1 { background: #0891b2; }
.user-avatar-color-2 { background: #059669; }
.user-avatar-color-3 { background: #b45309; }
.user-avatar-color-4 { background: #7c3aed; }
.user-avatar-color-5 { background: #db2777; }
.user-avatar-color-6 { background: #4f46e5; }
.user-avatar-color-7 { background: #0d9488; }

.developer-assignee-search {
  flex: 1 1 80px;
  min-width: 80px;
  border: 0 !important;
  padding: 3px 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 12px;
}
.tester-select-wrap .developer-multi-select {
  align-content: center;
  overflow: visible;
}
.tester-select-wrap .developer-assignee-search {
  flex: 1 1 170px;
  width: auto;
  min-width: min(170px, 100%);
}
.developer-select-wrap .developer-assignee-search {
  flex: 1 1 80px;
  width: auto;
  min-width: 80px;
}
.developer-suggestion-menu {
  position: absolute !important;
  z-index: 1000 !important;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 200px;
  overflow-y: auto;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15) !important;
}

/* ── Remove double nested borders in sidebar cards ── */
.case-sidebar-card #caseAssignmentHandoffCard,
#caseDefectHandoffCardWrap #caseAssignmentHandoffCard {
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
.developer-suggestion-header {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: -4px -4px 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-subtle);
  color: var(--app-text-muted);
  font-size:var(--text-xs);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.developer-suggestion-item {
  width: 100%;
  border: 0;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 9px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
}
.developer-suggestion-item:hover { background: var(--color-brand-light); }
.developer-suggestion-item.is-match {
  background: var(--color-brand-lighter);
  box-shadow: inset 3px 0 0 var(--color-brand);
}
.developer-suggestion-item.is-match:hover { background: var(--color-brand-lighter); }
.developer-suggestion-name { font-size:var(--text-xs); font-weight: 700; color: var(--color-brand-dark); }
.developer-suggestion-detail { font-size:var(--text-xs); color: var(--app-text-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.developer-suggestion-empty { padding: 9px; color: var(--app-text-muted); font-size:var(--text-xs); }
.tester-suggestion-source {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--color-brand-light);
  color: var(--color-brand);
  font-size:var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ── Sidebar mobile open ── */
@media (max-width: 680px) {
  .sidebar.open { transform: translateX(0) !important; }
}

/* ── Inline preview ── */
.inline-preview { display: none; }
.inline-preview.show { display: block; }

/* ── Delete confirm note states ── */
.delete-confirm-note.is-match { color: var(--color-success); }
.delete-confirm-note.is-error { color: var(--color-danger); }

/* ── Admin migration chip states ── */
.admin-migration-drop.is-drag-over { border-color: var(--color-brand); background: var(--color-brand-light); }
.admin-migration-drop.has-users { border-style: solid; }
.admin-migration-chip.is-moved { border-color: var(--color-success-border); background: var(--color-success-bg); cursor: pointer; }

/* ── Table row highlight ── */
.tc-table tbody tr.is-highlighted td { background: var(--color-warning-bg); }

/* ── Test case toolbar layout ── */
.case-table-toolbar {
  display: grid !important;
  grid-template-columns: minmax(170px, max-content) minmax(0, 1fr) minmax(190px, 200px);
  align-items: center;
  column-gap: 12px;
  row-gap: 14px;
}
.case-table-toolbar-title {
  min-width: 0;
}
.case-table-toolbar-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.case-table-toolbar-search {
  justify-self: end;
  width: min(100%, 200px) !important;
}
@media (max-width: 980px) {
  .case-table-toolbar {
    grid-template-columns: minmax(160px, 1fr) minmax(190px, 220px);
  }
  .case-table-toolbar-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
  .case-table-toolbar-search {
    grid-column: 2;
    grid-row: 1;
  }
}
@media (max-width: 640px) {
  .case-table-toolbar {
    grid-template-columns: 1fr;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .case-table-toolbar-actions,
  .case-table-toolbar-search {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }
  .case-table-toolbar-actions {
    justify-content: flex-start;
  }
  .case-table-toolbar-search {
    width: 100% !important;
  }
}

/* ── Professional contrast polish ────────────────────────────
   Shared neutral-surface refinement.  Business colours remain owned by their
   status components; these rules only make the surrounding workspace read
   with clearer hierarchy and a consistent active rail. */
:root {
  --app-canvas: #f8fafc;
  --app-surface-subtle: #f8fafc;
  --app-border: #cbd5e1;
  --app-border-strong: #94a3b8;
  --app-text-muted: #64748b;
}

body { color: var(--color-brand-dark); }
#appTopbar {
  box-shadow: var(--shadow-card);
}
#appTopbar::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--app-border-strong);
  pointer-events: none;
}
#topbarBreadcrumb { color: var(--app-text-muted) !important; letter-spacing: .11em; }
.project-title { color: var(--color-brand-dark); font-weight: 800; }

#sidebar {
  box-shadow: var(--shadow-card);
}
#sidebar > div:first-child { border-color: var(--app-border) !important; }
#sidebar .sidebar-section-text,
#sidebar p.text-\[10px\] { color: var(--app-text-muted) !important; font-weight: 700; }
#projectList button,
#sidebar [data-user-manager] button,
#sidebar #filterSection select {
  border-color: transparent;
}
#projectList button:hover,
#sidebar [data-user-manager] button:hover { background-color: var(--color-brand-light) !important; }
#projectList .active-project {
  position: relative;
  background: var(--color-brand-light) !important;
  box-shadow: inset 3px 0 0 var(--color-brand);
}
#projectList .active-project::after {
  content: '';
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--color-brand);
}
#sidebar select { background-color: var(--color-surface); color: var(--app-text-muted) !important; }
#sidebar select:hover { border-color: var(--app-border-strong) !important; }

/* Raised surfaces only: table edges, workspace cards and overlays. */
#statsBar,
.case-table-scroll,
.stat-report-table-panel,
.stat-report-chart-panel {
  box-shadow: var(--shadow-card);
}
.case-table-toolbar {
  border: 1px solid var(--app-border) !important;
  border-bottom-color: var(--app-border-strong) !important;
  border-radius: var(--app-radius-surface) var(--app-radius-surface) 0 0;
}
.case-table-toolbar-title > span:first-child { color: var(--app-text-muted) !important; font-weight: 750; }
#tableCount { color: var(--app-text-muted) !important; }
.assignment-summary-bar {
  border-right: 1px solid var(--app-border);
  border-left: 1px solid var(--app-border);
  color: var(--app-text-muted);
  background: var(--color-brand-light);
}
.tc-table thead th {
  background: var(--app-surface-subtle) !important;
  border-bottom: 1px solid var(--app-border-strong) !important;
  color: var(--app-text-muted) !important;
  font-weight: 750 !important;
}
.tc-table tbody td { border-bottom-color: var(--app-border); color: var(--color-brand-dark); }
.tc-table tbody tr:nth-child(even) td,
.tc-table tbody tr:nth-child(even) .tc-sticky-index,
.tc-table tbody tr:nth-child(even) .tc-sticky-id { background: var(--app-surface-subtle); }
.tc-table tbody tr:hover td,
.tc-table tbody tr:hover .tc-sticky-index,
.tc-table tbody tr:hover .tc-sticky-id { background: var(--color-brand-light) !important; }
.tc-id-link { font-weight: 700; }
#pagination {
  border-color: var(--app-border) !important;
  background: rgba(255, 255, 255, .78);
}
#pagination .page-info { color: var(--app-text-muted); font-weight: 600; }
#pagination .page-btn:not(.active) { background: var(--color-surface); border-color: var(--app-border); color: var(--app-text-muted); }

/* Forms and dialogs: deliberate grouping without changing their controls' roles. */
.modal:not(.timer-modal) {
  border-color: var(--app-border-strong) !important;
  box-shadow: var(--shadow-card);
}
.modal label,
.modal .form-label,
.modal .field-label {
  color: var(--app-text-muted);
  font-weight: 700;
  letter-spacing: .025em;
}
.modal input:not([type="checkbox"]):not([type="radio"]),
.modal select,
.modal textarea,
#dashboard input:not([type="checkbox"]):not([type="radio"]),
#dashboard select {
  background: var(--color-surface);
  color: var(--color-brand-dark);
}
.modal input:not([type="checkbox"]):not([type="radio"])::placeholder,
.modal textarea::placeholder,
#dashboard input::placeholder { color: var(--app-text-muted); }
.modal input:not([type="checkbox"]):not([type="radio"]):hover,
.modal select:hover,
.modal textarea:hover,
#dashboard input:not([type="checkbox"]):not([type="radio"]):hover,
#dashboard select:hover { border-color: var(--app-border-strong); }

/* Menus stay visually connected to their trigger, with quiet reading surfaces. */
.notification-menu {
  border-color: var(--app-border-strong) !important;
  background: var(--color-surface) !important;
  box-shadow: var(--shadow-elevated);
}
.notification-menu > div:first-child,
.notification-list { background: var(--color-brand-light) !important; }

/* End-of-cascade active rails: existing state classes only, so navigation and
   accessibility behavior stay exactly as implemented in JavaScript. */
#projectList .active-project { color: var(--color-brand-dark) !important; font-weight: 700; background: var(--color-brand-light) !important; box-shadow: inset 3px 0 0 var(--color-brand), inset 0 1px 0 rgba(255,255,255,.72); }
#projectList .active-project::after { background: var(--color-brand); }
.case-form-tab.is-active { position: relative; color: var(--color-brand-dark); font-weight: 800; box-shadow: inset 0 -2px 0 var(--color-brand-dark), 0 1px 3px rgba(15,23,42,.16); }
.case-form-tab.is-active::after { content: ''; position: absolute; top: 7px; bottom: 7px; left: 0; width: 2px; border-radius: 0 2px 2px 0; background: var(--color-brand); }
.notification-item { border-left-width: 3px; }
.notification-item.is-unread { background: var(--color-brand-light); border-left-color: var(--color-brand); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 2px 8px rgba(37,99,235,.11); }
.notification-item.is-unread .notification-item-title { color: var(--color-brand-dark); }
#statsBar { border-color: var(--app-border-strong) !important; }
#statsBar .stat-item { background: var(--color-surface); }
#statsBar .stat-item + .stat-item { border-left-color: var(--app-border); }
#statsBar .stat-num { color: var(--color-brand-dark); font-weight: 800; }
#statsBar .stat-num.green { color: var(--color-success) !important; }
#statsBar .stat-num.red { color: var(--color-danger) !important; }
#statsBar .stat-num.amber { color: var(--color-warning) !important; }
#statsBar .stat-num.indigo { color: var(--color-brand) !important; }
#statsBar .stat-lbl { color: var(--app-text-muted); font-weight: 750; letter-spacing: .075em; }
.modal .case-defect-section-heading,
.modal .form-section-heading { border-left: 3px solid var(--color-brand); }
#appTopbar { border-bottom-color: var(--app-border-strong) !important; box-shadow: var(--shadow-card); }
#sidebar { border-right-color: var(--app-border-strong) !important; box-shadow: var(--shadow-card); }
.notification-menu,
.profile-menu { box-shadow: var(--shadow-elevated); }
#caseModal.case-workspace-open > .modal { box-shadow: var(--shadow-card); }

/* Traceability Matrix: the open workspace record is a blue navigation state,
   deliberately separate from the neutral bulk-selection treatment. */
.tc-table tbody tr.is-case-workspace-active > td {
  background: #eef4ff !important;
  border-bottom-color: var(--color-brand-lighter) !important;
}
.tc-table tbody tr.is-case-workspace-active > .tc-sticky-index,
.tc-table tbody tr.is-case-workspace-active > .tc-id-cell {
  background: #eef4ff !important;
}
.tc-table tbody tr.is-case-workspace-active > :first-child {
  position: relative;
  box-shadow: inset 5px 0 0 #2563eb;
}
.tc-table tbody tr.is-case-workspace-active > .tc-id-cell .tc-id-identity::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.tc-table tbody tr.is-case-workspace-active > .tc-id-cell .tc-id-link,
.tc-table tbody tr.is-case-workspace-active:hover > .tc-id-cell .tc-id-link {
  color: var(--color-brand-hover) !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}
.tc-table tbody tr:has(.case-select-checkbox:checked):not(.is-case-workspace-active) > td { background: var(--color-open-bg); }
.tc-table tbody tr:has(.case-select-checkbox:checked):not(.is-case-workspace-active) > .tc-sticky-index,
.tc-table tbody tr:has(.case-select-checkbox:checked):not(.is-case-workspace-active) > .tc-sticky-id { background: var(--app-border); }
.tc-table tbody tr.is-case-workspace-focus > td { animation: case-workspace-row-focus 760ms ease-out both; }
@keyframes case-workspace-row-focus {
  0% { background-color: var(--color-brand-lighter); }
  100% { background-color: var(--color-brand-light); }
}
@media (prefers-reduced-motion: reduce) {
  .tc-table tbody tr.is-case-workspace-focus > td { animation: none; }
}

.tc-table tbody tr.is-case-save-flash > td { animation: case-save-row-flash 750ms ease-out both; }
@keyframes case-save-row-flash {
  0% { background-color: var(--color-brand-lighter); }
  100% { background-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .tc-table tbody tr.is-case-save-flash > td { animation: none; }
}



/* KPI figures retain their original semantic scan colors. */
#statsBar .stat-num.green { color: var(--color-success); }
#statsBar .stat-num.red { color: var(--color-danger); }
#statsBar .stat-num.amber { color: var(--color-warning); }
#statsBar .stat-num.indigo { color: var(--color-brand); }

/* Selection is expressed the same way across the working surfaces: a thin
   start rail, a cool-white surface, and a firmer label.  These selectors only
   enhance state classes already maintained by the application. */
#projectList .active-project {
  color: var(--color-brand-dark) !important;
  font-weight: 700;
  background: var(--color-brand-light) !important;
  box-shadow: inset 3px 0 0 var(--color-brand), inset 0 1px 0 rgba(255,255,255,.72);
}
#projectList .active-project::after { background: var(--color-brand); }


.case-form-tab.is-active {
  position: relative;
  color: var(--color-brand-dark);
  font-weight: 800;
  box-shadow: inset 0 -2px 0 var(--color-brand-dark), 0 1px 3px rgba(15,23,42,.16);
}
.case-form-tab.is-active::after {
  content: '';
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 0;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--color-brand);
}

.notification-item { border-left-width: 3px; }
.notification-item.is-unread {
  background: var(--color-brand-light);
  border-left-color: var(--color-brand);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 2px 8px rgba(37,99,235,.11);
}
.notification-item.is-unread .notification-item-title { color: var(--color-brand-dark); }

/* A compact neutral hierarchy ties labels, figures, and section separators
   together while preserving every existing semantic status treatment. */
#statsBar { border-color: var(--app-border-strong) !important; }
#statsBar .stat-item { background: var(--color-surface); }
#statsBar .stat-item + .stat-item { border-left-color: var(--app-border); }
#statsBar .stat-num { color: var(--color-brand-dark); font-weight: 800; }
#statsBar .stat-lbl { color: var(--app-text-muted); font-weight: 750; letter-spacing: .075em; }
.modal .case-defect-section-heading,
.modal .form-section-heading { border-left: 3px solid var(--color-brand); }
.modal label,
.modal .form-label,
.modal .field-label { color: var(--app-text-muted); }

/* Persistent shell = divider/subtle elevation; menus = medium elevation;
   workspace drawer keeps its purpose-built shadow and width behaviour. */
#appTopbar { border-bottom-color: var(--app-border-strong) !important; box-shadow: var(--shadow-card); }
#sidebar { border-right-color: var(--app-border-strong) !important; box-shadow: var(--shadow-card); }
.notification-menu,
.profile-menu { box-shadow: var(--shadow-elevated); }
#caseModal.case-workspace-open > .modal { box-shadow: var(--shadow-card); }
.notification-menu > div:first-child { border-bottom-color: var(--app-border) !important; }
.notification-item { border-color: var(--app-border) !important; }
.notification-item:hover { background: var(--color-brand-light) !important; }
.profile-menu { border-color: var(--app-border-strong) !important; }
.profile-menu button:hover { background: var(--color-brand-light) !important; }

@media (prefers-reduced-motion: no-preference) {
  #projectList button,
  .profile-menu button,
  .notification-item,
  #pagination .page-btn,
  .case-table-toolbar button {
    transition: background-color var(--motion-fast) var(--motion-ease-standard), border-color var(--motion-fast) var(--motion-ease-standard), color var(--motion-fast) var(--motion-ease-standard), box-shadow var(--motion-fast) var(--motion-ease-standard);
  }
}

.assignment-summary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 20px;
  border-bottom: 1px solid var(--app-border);
  background: var(--color-surface);
  font-size:var(--text-xs);
  color: var(--color-brand-dark);
}
.assignment-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.assignment-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}
.assignment-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}
.assignment-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 150px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--assignee-color) 38%, var(--color-surface));
  background: color-mix(in srgb, var(--assignee-color) 10%, var(--color-surface));
  color: var(--assignee-color);
  font-size:var(--text-xs);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assigned-developer-badge {
  --assignee-color: var(--color-brand);
}
.assigned-tester-badge {
  --assignee-color: var(--color-brand-dark);
}
.assignment-empty { color: var(--color-muted); }
.assignment-tester-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size:var(--text-sm);
  color: var(--color-brand-dark);
}



/* ── Notification item states ── */
.notification-item.is-unread { background: var(--color-brand-light); border-color: var(--color-brand-lighter); }

/* ── Role / status pills (for dynamic JS content) ── */
.role-admin { background: var(--color-warning-bg); color: var(--color-warning); }
.role-superadmin { background: var(--color-brand-light); color: var(--color-brand); }
.role-user { background: var(--color-success-bg); color: var(--color-success); }
.role-developer { background: var(--color-brand-light); color: var(--color-brand-dark); }
.role-coe_vc { background: var(--color-brand-light); color: var(--color-brand); }
.status-pill.active { background: var(--color-success-bg); color: var(--color-success); }
.status-pill.inactive { background: var(--color-danger-bg); color: var(--color-danger); }

/* ── Admin owner pill ── */
.admin-owner-pill { display: inline-flex; align-items: center; max-width: 100%; padding: 3px 8px; border-radius: 4px; background: var(--color-brand-light); border: 1px solid var(--color-brand-lighter); color: var(--color-brand); font-size:var(--text-xs); font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-owner-pill.is-missing { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning); }
.admin-owner-empty { color: var(--color-muted); font-weight: 400; }

/* ── Attachment items ── */
.attachment-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--color-open-border); border-radius: 8px; padding: 7px 10px; background: var(--color-surface); }
.attachment-item.removed { opacity: 0.6; background: var(--color-danger-bg); }
.attachment-wrapper.is-expanded .attachment-item { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
.attachment-link { border: none; background: transparent; padding: 0; color: var(--color-brand); text-decoration: none; font-size:var(--text-xs); cursor: pointer; font-weight: 500; }
.attachment-link:hover { text-decoration: underline; }
.attachment-remove { border: 1px solid var(--color-danger-border); background: var(--color-danger-bg); color: var(--color-danger); border-radius: 4px; padding: 4px 8px; font-size:var(--text-xs); cursor: pointer; flex-shrink: 0; font-weight: 500; }
.inline-preview { background: var(--color-surface); border: 1px solid var(--color-open-border); border-top: none; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; padding: 10px; margin-top: -1px; }
.inline-preview img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 4px; }
.inline-preview iframe { width: 100%; height: 360px; border: none; border-radius: 4px; }
.inline-preview pre { max-height: 260px; overflow: auto; font-size:var(--text-xs); background: var(--app-surface-subtle); padding: 10px; border-radius: 4px; white-space: pre-wrap; }

/* ── Attachment item link in preview ── */
.attachment-item a { color: var(--color-brand); text-decoration: none; font-size:var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.attachment-item a:hover { text-decoration: underline; }

/* ── Table empty state ── */
.tc-table tbody tr td[colspan] { text-align: center; padding: 2rem; color: var(--color-muted); }

/* ── Test case table spacing ── */
.tc-table { table-layout: fixed; min-width: 1360px; }
.tc-table thead { position: sticky; top: 0; z-index: 60 !important; }
.tc-table thead th { position: sticky; top: 0; z-index: 60; padding-top: 9px; padding-bottom: 9px; }
.tc-table tbody tr { height: 38px; }
.tc-table tbody td { padding: 7px 14px; vertical-align: middle; border-bottom: 1px solid var(--app-border); background: var(--color-surface); transition: background-color 100ms ease; }
.tc-table tbody tr:last-child td { border-bottom: none; }
.tc-table tbody tr:hover td { background: var(--color-brand-light); }
.tc-table thead th:first-child,
.tc-table tbody td:first-child { padding-left: 10px; padding-right: 10px; text-align: center; }
.tc-table tbody .tc-id-cell { padding-left: 6px; padding-right: 5px; }
.is-superadmin .case-select-col { display: none; }
.tc-table .case-select-col { width: 42px; min-width: 42px; max-width: 42px; }
.tc-table .tc-sticky-index { width: 44px; min-width: 44px; max-width: 44px; }
.tc-table .tc-sticky-id { width: 132px; min-width: 132px; max-width: 132px; overflow: hidden; }
body[data-user-role="user"] .tc-table .case-select-col,
body[data-user-role="developer"] .tc-table .case-select-col { display: none; }

/* ── Table row rendering helper ── */
.tc-id-cell { font-family: 'JetBrains Mono', monospace; font-size:var(--text-xs); letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; }
.tc-id-identity { width: 100%; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.tc-id-link { box-sizing: border-box; width: auto; max-width: 100%; min-width: 0; flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: flex-start; overflow: hidden; white-space: nowrap; vertical-align: bottom; border: 0; border-radius: 4px; padding: 2px 0; margin: -2px 0; background: transparent; color: var(--color-brand); font: inherit; font-weight: 650; cursor: pointer; }
.tc-id-prefix { flex: 0 1 auto; min-width: 0; max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-id-suffix { flex: 0 0 auto; white-space: nowrap; }
.tc-incomplete-round-dot { width: 7px; height: 7px; flex: 0 0 7px; display: inline-block; border-radius: 50%; background: var(--color-danger); box-shadow: 0 0 0 3px rgba(220,38,38,.10); pointer-events: none; }
.tc-id-link:hover { text-decoration: underline; }
.tc-id-link:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; text-decoration: none; }

.summary-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--color-brand-dark); cursor: default; }
.module-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.module-pill { display: inline-flex; align-items: center; padding: 3px 10px 3px 8px; border-radius: 999px; font-size:var(--text-xs); font-weight: 500; background: var(--color-brand-light); border: 1px solid var(--color-brand-lighter); color: var(--color-brand); gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-pill::before { content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--color-brand); flex-shrink: 0; opacity: 0.5; }

/* ── Badge styles (Modern Zoho / Jira 2026 Palette) ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.25;
}
.badge-dot {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-pass {
  background: #ecfdf5;
  color: #047857;
}
.badge-pass .badge-dot { background: #10b981; }

.badge-fail {
  background: #fef2f2;
  color: #b91c1c;
}
.badge-fail .badge-dot { background: #ef4444; }

.badge-pending {
  background: #fffbeb;
  color: #b45309;
}
.badge-pending .badge-dot { background: #f59e0b; }

.badge-na {
  background: #f8fafc;
  color: #64748b;
}
.badge-na .badge-dot { background: #94a3b8; }

.badge-open {
  background: #f1f5f9;
  color: #334155;
}
.badge-open .badge-dot { background: #64748b; }

.badge-inprogress {
  background: #eff6ff;
  color: #1d4ed8;
}
.badge-inprogress .badge-dot {
  background: #2563eb;
  animation: pulse-dot 600ms ease-out 1;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.badge-reopen {
  background: #b45309;
  color: #ffffff;
  border-color: #b45309;
}
.badge-reopen .badge-dot { background: #ffffff; }

.badge-closed {
  background: #f0fdf4;
  color: #15803d;
}
.badge-closed .badge-dot { background: #22c55e; }

.badge-rejected {
  background: #fdf2f8;
  color: #be185d;
}
.badge-rejected .badge-dot { background: #ec4899; }

.badge-forever {
  background: #f5f3ff;
  color: #6d28d9;
}
.badge-forever .badge-dot { background: #8b5cf6; }

.badge-priority-critical {
  background: #c2410c;
  color: #ffffff;
  border-color: #c2410c;
}
.badge-priority-critical .badge-dot { background: #ffffff; }

.badge-priority-high {
  background: #fff7ed;
  color: #c2410c;
}
.badge-priority-high .badge-dot { background: #ea580c; }

.badge-priority-medium {
  background: #fefce8;
  color: #a16207;
}
.badge-priority-medium .badge-dot { background: #ca8a04; }

.badge-priority-low {
  background: #eff6ff;
  color: #2563eb;
}
.badge-priority-low .badge-dot { background: #3b82f6; }

.badge-severity-improvement {
  background: #eff6ff;
  color: #1d4ed8;
}
.badge-severity-improvement .badge-dot { background: #2563eb; }

.badge-severity-blocker {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}
.badge-severity-blocker .badge-dot { background: #ffffff; }

.badge-severity-critical {
  background: #c2410c;
  color: #ffffff;
  border-color: #c2410c;
}
.badge-severity-critical .badge-dot { background: #ffffff; }

.badge-severity-major {
  background: #fff7ed;
  color: #c2410c;
}
.badge-severity-major .badge-dot { background: #ea580c; }

.badge-severity-minor {
  background: #fefce8;
  color: #a16207;
}
.badge-severity-minor .badge-dot { background: #ca8a04; }

.badge-severity-trivial {
  background: #f8fafc;
  color: #475569;
}
.badge-severity-trivial .badge-dot { background: #94a3b8; }

.user-project-select-all {
  margin-bottom: 3px;
  padding: 5px 7px;
  min-height: 28px;
  border-radius: 6px;
  background: var(--color-brand-light) !important;
  border-color: var(--color-brand-lighter) !important;
  color: var(--color-brand-hover);
  font-weight: 700;
}
.case-select-help { min-height: 15px; font-size:var(--text-xs); line-height: 1.35; color: var(--color-open); }

/* ── Action buttons (for dynamic JS content) ── */
.actions-cell { white-space: nowrap; width: 1%; }
.action-group { display: flex; gap: 4px; flex-wrap: nowrap; align-items: center; }
.action-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 4px; border: 1px solid var(--color-open-border); background: var(--color-surface); color: var(--color-muted); cursor: pointer; font-size:var(--text-xs); font-weight: 500; line-height: 1; transition: background-color var(--motion-instant) var(--motion-ease-standard), border-color var(--motion-instant) var(--motion-ease-standard), color var(--motion-instant) var(--motion-ease-standard), box-shadow var(--motion-instant) var(--motion-ease-out); }
.action-btn:hover { background: var(--app-surface-subtle); color: var(--color-brand-dark); }
.action-view { color: var(--color-brand); }
.action-view:hover { background: var(--color-brand-light); border-color: var(--color-brand-lighter); color: var(--color-brand); }
.action-edit { color: var(--color-warning); }
.action-edit:hover { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning); }
.action-delete { color: var(--color-danger); }
.action-delete:hover { background: var(--color-danger-bg); border-color: var(--color-danger-border); color: var(--color-danger); }
.action-move { color: var(--color-brand); }
.action-move:hover { background: var(--color-brand-light); border-color: var(--color-brand-lighter); }
.action-disable { color: var(--color-warning); }
.action-disable:hover { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning); }
.action-enable { color: var(--color-success); }
.action-enable:hover { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success); }
.action-approve { color: var(--color-success); }
.action-approve:hover { background: var(--color-success-bg); border-color: var(--color-success-border); }

/* ── Stat items (for dynamic JS content) ── */
.stat-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 12px; gap: 4px; position: relative; }
.stat-item + .stat-item { border-left: 1px solid var(--color-open-border); }
.stat-item.is-zero-count {
  opacity: 0.45;
  filter: grayscale(0.5);
  transition: opacity 160ms ease, filter 160ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .stat-item.is-zero-count {
    transition: none !important;
  }
}
.stat-num { font-size:var(--text-2xl); font-weight: 700; font-family: 'JetBrains Mono', monospace; line-height: 1; letter-spacing: -0.03em; color: var(--color-brand-dark); }
.stat-num.green { color: var(--color-success); }
.stat-num.red { color: var(--color-danger); }
.stat-num.amber { color: var(--color-warning); }
.stat-num.blue { color: var(--color-brand); }
.stat-num.indigo { color: var(--color-brand); }
.stat-lbl { font-size:var(--text-xs); font-weight: 500; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }
.stat-pass-rate { display: inline-flex; align-items: center; gap: 8px; }
.stat-pass-bar { width: 48px; height: 5px; border-radius: 999px; background: var(--color-open-border); overflow: hidden; }
.stat-pass-fill { height: 100%; border-radius: 999px; background: var(--color-brand); transition: width 0.4s ease; }

/* ── Workspace chart legend (for dynamic JS content) ── */
#workspaceChartCard { max-width: min(100%, 430px); min-width: 0; }
#workspaceChartLegend { min-width: 0; max-width: 180px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; }
#workspaceChartLegend::-webkit-scrollbar { display: none; }
.workspace-legend-item { display: inline-flex; align-items: center; gap: 3px; font-size:var(--text-xs); color: var(--color-muted); white-space: nowrap; }
.workspace-legend-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.workspace-legend-empty { font-size:var(--text-xs); color: var(--color-muted); }

/* ── Statistical report modal charts ── */
#statisticalReportModal.statistical-report-modal-overlay { left:240px !important; right:0 !important; width:auto !important; padding:12px 18px !important; background:rgba(15,23,42,.14) !important; }
body:has(#sidebar.collapsed) #statisticalReportModal.statistical-report-modal-overlay { left:56px !important; }
body:has(#statisticalReportModal.open) #sidebar { z-index:270 !important; }
.statistical-report-modal-shell { width:min(1200px,calc(100vw - 278px)); height:auto; max-height:calc(100vh - 24px) !important; }
body:has(#sidebar.collapsed) .statistical-report-modal-shell { width:min(1200px,calc(100vw - 94px)); }
.statistical-report-modal-body { flex:0 1 auto; min-height:0; overflow:visible; }
.statistical-report-project-line { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.statistical-report-project-chip { display:inline-flex; align-items:center; min-height:18px; padding:2px 6px; border:1px solid rgba(255,255,255,.28); border-radius:5px; background:rgba(255,255,255,.12); color:var(--color-surface); font-size:var(--text-xs); font-weight:750; line-height:1; }
.statistical-report-project-chip.is-loading { border-color:rgba(253,230,138,.6); background:rgba(245,158,11,.22); }
.statistical-report-project-chip.is-error { border-color:rgba(254,202,202,.7); background:rgba(220,38,38,.24); }
#statisticalReportLoading.is-refreshing { position:sticky; top:0; z-index:4; margin:0 0 8px; padding:7px 10px !important; border:1px solid var(--color-brand-lighter); border-radius:7px; background:var(--color-brand-light); color:var(--color-brand-hover); font-size:var(--text-xs); font-weight:650; text-align:left; }
.stat-report-chart-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 220px;
  min-height: 0;
  border: 1px solid var(--color-open-border);
  border-radius: 8px;
  padding: 12px 12px 8px;
  background: var(--color-surface);
}
.stat-report-chart-panel-wide { min-height: 220px; }
.stat-report-chart-title {
  font-size:var(--text-xs);
  font-weight: 600;
  color: var(--color-brand-dark);
  text-align: center;
}
.stat-report-chart-canvas-wrap {
  position: relative;
  flex: none;
  height: 176px;
  min-height: 0;
}
.stat-report-chart-panel:has(#statProjectBarChart),
.stat-report-chart-panel:has(#coeStatProjectBarChart) { height:auto; min-height:220px; overflow-y:auto; }
.stat-report-chart-panel:has(#statProjectBarChart) .stat-report-chart-canvas-wrap,
.stat-report-chart-panel:has(#coeStatProjectBarChart) .stat-report-chart-canvas-wrap { min-height:220px; }
.statistical-report-close-btn { background:var(--color-surface) !important; color:var(--color-brand-dark) !important; border:2px solid var(--color-brand-lighter) !important; box-shadow: var(--shadow-card); }
.statistical-report-close-btn:hover { background:var(--color-brand-light) !important; border-color:var(--color-surface) !important; }
.statistical-report-close-btn:focus-visible { outline:3px solid var(--color-warning); outline-offset:2px; }
.stat-report-chart-canvas-wrap-wide { min-height: 240px; }
.stat-report-trend-panel { min-height: 230px; }
.stat-report-trend-canvas-wrap { min-height: 185px; }
.stat-report-chart-canvas-wrap canvas,
.stat-report-chart-canvas-wrap-wide canvas {
  width: 100% !important;
  height: 100% !important;
}
.stat-report-summary-card {
  border: 1px solid var(--color-open-border);
  border-radius: 8px;
  background: var(--color-surface);
  padding: 14px 16px;
}
.stat-report-summary-num {
  font-size:var(--text-xl);
  font-weight: 800;
  color: var(--color-brand-dark);
  line-height: 1.1;
}
.stat-report-summary-num.green { color: var(--color-success); }
.stat-report-summary-num.indigo { color: var(--color-brand); }
.stat-report-summary-lbl {
  margin-top: 4px;
  font-size:var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}
.statistical-report-table-scroll { max-height:220px; overflow-y:auto; }
@media (max-height:700px) and (min-width:641px) {
  .statistical-report-modal-shell { max-height:calc(100vh - 20px) !important; }
  .statistical-report-modal-body { overflow-y:auto; overscroll-behavior:contain; }
  .stat-report-chart-panel { height:190px; }
  .stat-report-chart-canvas-wrap { height:146px; }
  .statistical-report-table-scroll { max-height:150px; }
}
@media (max-width:640px) {
  #statisticalReportModal.statistical-report-modal-overlay,
  body:has(#sidebar.collapsed) #statisticalReportModal.statistical-report-modal-overlay,
  body:not(:has(#sidebar.collapsed)) #statisticalReportModal.statistical-report-modal-overlay { left:56px !important; right:0 !important; padding:8px !important; align-items:flex-end !important; background:rgba(15,23,42,.25) !important; }
  .statistical-report-modal-shell,
  body:has(#sidebar.collapsed) .statistical-report-modal-shell,
  body:not(:has(#sidebar.collapsed)) .statistical-report-modal-shell { width:calc(100vw - 72px); min-width:0; max-height:90vh !important; }
  body:has(#statisticalReportModal.open) #sidebar { position:relative; z-index:270 !important; box-shadow: var(--shadow-elevated); }
  .statistical-report-modal-head { padding:10px 12px !important; flex-wrap:wrap; gap:7px !important; }
  .statistical-report-modal-head > div:first-child { flex:1 1 180px; min-width:0; }
  .statistical-report-modal-head #statisticalReportDownloadBtn { order:3; width:100%; margin-left:0 !important; }
  .statistical-report-modal-body { overflow-y:auto; overscroll-behavior:contain; padding:12px !important; }
  .stat-report-chart-panel { height:210px; }
  .stat-report-chart-canvas-wrap { height:166px; }
  .statistical-report-table-scroll { max-height:190px; }
}


body[data-user-role="coe_vc"] #dashboard {
  overflow: hidden !important;
  padding-top: 14px;
  padding-bottom: 14px;
}
body[data-user-role="coe_vc"] .coe-report-dashboard {
  flex: 1;
  height: 100%;
  overflow: hidden;
}
body[data-user-role="coe_vc"] #coeStatisticalReportContent {
  display: flex !important;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}
body[data-user-role="coe_vc"] #coeStatisticalSummaryCards {
  margin-bottom: 12px !important;
}
body[data-user-role="coe_vc"] .stat-report-chart-grid {
  flex: 0 0 auto;
  margin-bottom: 12px !important;
}
body[data-user-role="coe_vc"] .stat-report-chart-panel {
  height: 230px;
  min-height: 0;
  padding: 10px 12px 6px;
}
body[data-user-role="coe_vc"] .stat-report-chart-canvas-wrap {
  min-height: 0;
  height: 190px;
}
body[data-user-role="coe_vc"] .stat-report-trend-panel {
  flex: 0 0 auto;
  height: 190px;
  min-height: 0;
  margin-bottom: 12px !important;
}
body[data-user-role="coe_vc"] .stat-report-trend-canvas-wrap {
  min-height: 0;
  height: 148px;
}
body[data-user-role="coe_vc"] .stat-report-table-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body[data-user-role="coe_vc"] .stat-report-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
body[data-user-role="coe_vc"] #coeStatisticalReportLoading {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--app-border-strong);
  border-radius: var(--app-radius-surface);
  background: var(--app-surface);
  color: var(--app-text-muted);
}

/* ── Pagination (for dynamic JS content) ── */
.page-btn { border: 1px solid var(--color-open-border); background: var(--color-surface); padding: 6px 11px; border-radius: 6px; cursor: pointer; font-size:var(--text-xs); font-family: 'Inter', system-ui, sans-serif; font-weight: 500; color: var(--app-text-muted); transition: background-color var(--motion-instant) var(--motion-ease-standard), border-color var(--motion-instant) var(--motion-ease-standard), color var(--motion-instant) var(--motion-ease-standard), box-shadow var(--motion-instant) var(--motion-ease-out); min-width: 32px; text-align: center; }
.page-btn:hover { background: var(--app-surface-subtle); border-color: var(--app-border); }
.page-btn.active { background: var(--color-brand); color: var(--color-surface); border-color: var(--color-brand); }
.page-btn:disabled { opacity: .35; cursor: default; }
.page-info { font-size:var(--text-xs); color: var(--color-muted); margin-right: 8px; font-weight: 400; }

/* ── Dashboard table workspace ── */
.case-dashboard-workspace {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 0 0 2px;
}
.case-table-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.case-table-scroll {
  width: 100%;
  height: 100%;
  border-radius: 8px 8px 0 0 !important;
  /* Routine wheel/table scrolling must never queue behind previous movement. */
  scroll-behavior: auto;
}
.case-table-navigation-region {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 0 30px;
  box-sizing: border-box;
}
.case-scroll-jump {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 45;
}
.case-scroll-jump.is-hidden {
  display: none;
}
.case-scroll-jump-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}
.opacity-40 {
  opacity: .4;
}
.left-\[42px\] {
  left: 42px;
}
.left-\[86px\] {
  left: 86px;
}
.z-30 {
  z-index: 30;
}
.shadow-\[4px_0_6px_-4px_rgba\(0\,0\,0\,0\.18\)\] {
  box-shadow: var(--shadow-card);
}
.case-scroll-jump-btn {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-open);
  font-size:var(--text-lg);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: var(--shadow-card);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, opacity 120ms ease;
}
.case-scroll-edge-btn {
  font-size:var(--text-sm);
  letter-spacing: -1px;
}
.case-scroll-jump-btn:first-child {
  transform: none;
}
.case-scroll-jump-btn:last-child {
  transform: none;
}
.case-scroll-jump-btn:hover:not(:disabled) {
  background: var(--app-surface-subtle);
  border-color: var(--app-border);
  color: var(--color-brand-dark);
}
.case-scroll-jump-btn:focus-visible {
  outline: 3px solid rgba(37,99,235,.35);
  outline-offset: 3px;
}
.case-scroll-jump-btn:disabled {
  opacity: .42;
  cursor: default;
  background: var(--app-surface-subtle);
  border-color: var(--app-border);
  color: var(--app-text-muted);
  box-shadow: var(--shadow-flat);
}

/* Frozen columns: # and Test Case ID. */
.tc-table .tc-sticky-index,
.tc-table .tc-sticky-id {
  position: sticky;
  overflow: hidden;
  background: var(--app-surface-subtle);
  background-clip: padding-box;
  transition: none;
  transform: translateZ(0);
}
.tc-table .tc-sticky-index {
  left: 0;
  z-index: 20;
  background: var(--app-surface-subtle);
  color: var(--color-brand-dark) !important;
  font-weight: 600;
  box-shadow: var(--shadow-flat);
}
.tc-table .tc-sticky-id {
  left: 44px;
  z-index: 21;
  background: var(--app-surface-subtle);
  border-right: 0;
  box-shadow: var(--shadow-card);
}
.tc-table thead .tc-sticky-index,
.tc-table thead .tc-sticky-id {
  top: 0;
  z-index: 70;
  background: var(--color-open-bg);
  border-bottom-color: var(--app-border);
}
.tc-table thead .tc-sticky-index {
  box-shadow: var(--shadow-flat);
}
.tc-table thead .tc-sticky-id {
  background: var(--color-open-bg);
  box-shadow: var(--shadow-card);
}
.is-superadmin .tc-table .tc-sticky-index { left: 0; }
.is-superadmin .tc-table .tc-sticky-id { left: 44px; }
.tc-table tbody tr:hover .tc-sticky-index,
.tc-table tbody tr:hover .tc-sticky-id { background: var(--color-open-bg); }
.tc-table tbody tr:has(.case-select-checkbox:checked) td { background: var(--color-brand-light); }
.tc-table tbody tr:has(.case-select-checkbox:checked) .tc-sticky-index,
.tc-table tbody tr:has(.case-select-checkbox:checked) .tc-sticky-id { background: var(--color-brand-lighter); }
.tc-table tbody tr.is-highlighted .tc-sticky-index,
.tc-table tbody tr.is-highlighted .tc-sticky-id { background: var(--color-warning-bg); }
.tc-table.guide-select-cases .case-select-col {
  background: var(--color-warning-bg) !important;
  box-shadow: inset 3px 0 0 var(--color-warning), inset -1px 0 0 var(--color-warning-border);
  animation: select-column-pulse 400ms ease-out 1;
}
.tc-table.guide-select-cases .case-select-checkbox {
  outline: 2px solid var(--color-warning);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(249, 115, 22, .16);
}
#assignCasesBtn.needs-selection {
  background: var(--color-brand-lighter);
  border-color: var(--color-brand-lighter);
  cursor: pointer;
}
@keyframes select-column-pulse {
  0%, 100% { background: var(--color-warning-bg); }
  50% { background: var(--color-warning-border); }
}
.tc-table .tc-sticky-id .tc-id-link {
  color: var(--color-brand-hover);
  font-weight: 750;
}
.tc-table tbody tr:hover .tc-sticky-id .tc-id-link {
  color: var(--color-brand-hover);
}

/* ── Modal & Drawer Sticky Headers (Combo 1: Deep Mediterranean Ocean Theme) ── */
#caseModal .case-modal-sticky-header,
.case-preview-drawer-header {
  background: #0284c7 !important;
  border-bottom: 1px solid #0369a1 !important;
}
#caseModal .case-modal-sticky-header {
  padding: 6px 16px !important;
  min-height: 40px !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
.case-preview-drawer-header,
.case-modal-sticky-header {
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25) !important;
}
.case-preview-drawer-header h2,
.case-modal-sticky-header #caseModalTitle {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-family: var(--font-sans) !important;
  letter-spacing: -0.015em !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.case-preview-drawer-header p,
.case-modal-sticky-header #caseModalSubtitle {
  color: #bae6fd !important;
}
.case-drawer-icon {
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
  backdrop-filter: blur(8px) !important;
}
.case-drawer-edit-btn,
.case-preview-drawer-header #viewModalHeaderEditBtn {
  background: #007fff !important;
  border: 1px solid #007fff !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(0, 127, 255, 0.35) !important;
}
.case-drawer-edit-btn:hover,
.case-preview-drawer-header #viewModalHeaderEditBtn:hover {
  background: #0066cc !important;
  border-color: #0066cc !important;
}
.case-drawer-close-btn,
.case-modal-close-btn,
.case-preview-drawer-header button:not(#viewModalHeaderEditBtn),
.case-modal-sticky-header button:not(.case-workspace-expand-btn) {
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
  backdrop-filter: blur(8px) !important;
}
.case-drawer-close-btn:hover,
.case-modal-close-btn:hover,
.case-preview-drawer-header button:not(#viewModalHeaderEditBtn):hover,
.case-modal-sticky-header button:not(.case-workspace-expand-btn):hover {
  background: rgba(255, 255, 255, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  color: #ffffff !important;
}
.case-header-state-control {
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  background: rgba(11, 37, 69, 0.45) !important;
  color: #ffffff !important;
  backdrop-filter: blur(6px) !important;
}
.case-header-state-label {
  color: #bae6fd !important;
}
#caseHeaderState {
  color: #ffffff !important;
}
.case-form-tabs {
  background: rgba(11, 37, 69, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(8px) !important;
}
.case-form-tab {
  color: rgba(255, 255, 255, 0.85) !important;
}
.case-form-tab.is-active {
  background: #ffffff !important;
  color: #0b2545 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
  font-weight: 750 !important;
}

/* ── Streamlined Content-First Header Layout ── */
.case-modal-sticky-header {
  padding: 10px 20px !important;
  min-height: 52px;
}
.case-modal-record-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.case-header-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.case-modal-sticky-header #caseModalTitle {
  font-size: 15px !important;
  font-weight: 800 !important;
}
/* Show header badge cluster and round status chip as in Pic 1 & Pic 2 */
#caseModal #caseHeaderBadges,
#caseModal.case-workspace-open #caseHeaderBadges,
#caseModal.case-workspace-preview-active #caseHeaderBadges {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}
#caseModal .case-modal-round-chip,
#caseModal.case-workspace-open .case-modal-round-chip,
#caseModal.case-workspace-preview-active .case-modal-round-chip {
  display: inline-flex !important;
  align-items: center !important;
}


.case-defect-section-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:3px; padding:7px 9px; border-top:1px solid var(--color-brand-lighter); border-bottom:1px solid var(--color-brand-lighter); background:var(--color-brand-light); color:var(--color-brand-dark); font-size:var(--text-xs); font-weight:800; letter-spacing:.09em; text-transform:uppercase; }
.case-defect-section-heading span:last-child { color:var(--app-text-muted); font-size:var(--text-xs); font-weight:600; letter-spacing:.03em; text-transform:none; }
.case-defect-field { padding-inline:2px; }
.case-defect-summary-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px 10px; min-height:20px; }
.defect-round-state-chip { display:inline-flex; align-items:center; min-height:22px; max-width:100%; padding:2px 8px; border:1px solid var(--app-border); border-radius:6px; background:var(--app-surface-subtle); color:var(--app-text-muted); font-size:var(--text-xs); font-weight:700; letter-spacing:.01em; overflow-wrap:anywhere; }
.defect-round-state-chip.is-current { border-color:var(--color-brand-lighter); background:var(--color-brand-light); color:var(--color-brand-hover); }
.defect-round-state-chip.is-new { border-color:var(--color-warning-border); background:var(--color-warning-bg); color:var(--color-warning); }
.defect-round-state-help { min-height:17px; color:var(--app-text-muted); font-size:var(--text-xs); line-height:1.45; }
.defect-round-state-help.is-current { color:var(--color-brand-hover); }
.defect-round-state-help.is-new { color:var(--color-warning); }
.defect-history-scroll { position:relative; max-height:none; overflow:visible; padding:4px 2px 2px; }
.defect-history-card { overflow:hidden; border-radius:10px; border:1px solid var(--app-border); background:var(--color-surface); box-shadow:0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03); }
.defect-history-title { min-height:30px; display:flex; align-items:center; padding:7px 12px !important; border-bottom:1px solid var(--app-border); border-left:3px solid var(--color-brand); border-radius:9px 9px 0 0; background:var(--app-surface-subtle); color:var(--app-text-muted); font-size:var(--text-xs); font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.defect-history-entry { padding:10px 14px !important; background:var(--color-surface); line-height:1.45; transition:background-color 150ms ease; }
.defect-history-entry + .defect-history-entry { border-top:1px solid var(--app-border); }
.defect-history-entry:hover { background:var(--app-surface-subtle); }
.defect-history-scroll .font-mono { color:var(--color-brand-dark); font-weight:700; letter-spacing:.01em; }
.defect-history-actions { flex:0 0 auto; max-width:100%; padding-right:2px; }
.defect-history-timeline-btn { flex:0 0 auto; min-width:58px; white-space:nowrap; }
.defect-history-more { width:100%; min-height:33px; display:flex; align-items:center; justify-content:center; gap:6px; padding:7px 12px; border:0; border-bottom:1px solid var(--app-border); background:var(--app-surface-subtle); color:var(--color-brand); font:700 var(--text-xs)/1.25 var(--font); cursor:pointer; transition:background 150ms ease, color 150ms ease; }
.defect-history-more:hover { background:var(--color-brand-light); }
.defect-history-more:focus-visible { position:relative; z-index:2; outline:2px solid var(--color-brand); outline-offset:-2px; }
.defect-history-earlier[hidden] { display:none !important; }
.defect-history-earlier.is-expanded { display:block; max-height:520px; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.defect-history-current { border-top:1px solid var(--color-brand-lighter); background:var(--app-surface-subtle); }
.defect-history-current > .defect-history-entry { border-top:0 !important; border-left:3.5px solid var(--color-brand); background:transparent; }
#caseModalChips { max-width:min(100%,760px); row-gap:5px; }
.case-modal-record-heading { display:flex; align-items:center; gap:10px; min-width:0; }
/* The identity stack follows the modal's left edge and keeps a stable local
   origin while Preview narrows and Details/Defect widen the body. */
#caseModal.case-workspace-open .case-modal-header-identity {
  position:relative;
  left:0;
  flex:1 1 auto;
  width:auto;
  max-width:none;
  margin:0 !important;
  align-self:center;
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  gap:8px !important;
  transform:none !important;
  transition:none !important;
}
.case-header-state-control { display:inline-flex; align-items:center; gap:5px; min-height:26px; padding:3px 6px 3px 8px; border:1px solid rgba(255,255,255,.32); border-radius:6px; background:rgba(15,23,42,.16); color:var(--color-surface); }
.case-header-state-label { font-size:var(--text-xs); font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:rgba(255,255,255,.68); }
.case-header-state-select-wrap { display:inline-flex; align-items:center; gap:5px; }
.case-header-state-dot { width:7px; height:7px; flex:0 0 auto; border-radius:50%; background:var(--color-brand-lighter); box-shadow:0 0 0 2px rgba(255,255,255,.12); }
.case-header-state-dot[data-state="open"] { background:var(--color-brand-lighter); }.case-header-state-dot[data-state="in-progress"] { background:var(--color-warning); }.case-header-state-dot[data-state="reopen"] { background:var(--color-warning-border); }.case-header-state-dot[data-state="closed"] { background:var(--color-success); }.case-header-state-dot[data-state="rejected"] { background:var(--color-danger); }.case-header-state-dot[data-state="forever"] { background:var(--color-brand-lighter); }
#caseHeaderState { max-width:128px; padding:1px 16px 1px 0; border:0; appearance:auto; background:transparent; color:var(--color-surface); font:700 var(--text-xs)/1.3 var(--font); cursor:pointer; }
#caseHeaderState:focus-visible { outline:2px solid var(--color-surface); outline-offset:3px; border-radius:2px; }
#caseHeaderState:disabled { cursor:not-allowed; opacity:.82; }
#caseHeaderState option { color:var(--color-brand-dark); background:var(--color-surface); }
.case-form-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(8px);
}
.case-form-tab {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font: 700 var(--text-xs)/1.2 var(--font);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.case-form-tab:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.case-form-tab:focus-visible {
  outline: 2px solid var(--color-surface);
  outline-offset: 2px;
}
.case-form-tab.is-active {
  background: #ffffff !important;
  color: var(--color-brand-dark) !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18) !important;
}
.case-form-tab-round { font-weight: 650; opacity: .78; }
.case-form-tab-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; }
.case-form-tab-panel[hidden] { display: none !important; }
.case-preview-tab-panel { display: block; }

/* ── Zoho BugTracker Record View — Compact density ── */
.case-preview-hero-card {
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--color-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-card);
}
.case-preview-hero-title {
  font-size: var(--text-sm);
  font-weight: 750;
  color: var(--color-brand-dark);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.case-preview-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: var(--text-xs);
  color: var(--app-text-muted);
}
.case-hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.case-hero-meta-lbl { color: var(--app-text-muted); font-weight: 500; }
.case-hero-meta-val { color: var(--color-brand-dark); font-weight: 700; }
.case-hero-meta-divider { color: var(--app-border); }

.case-preview-status-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--app-border);
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.case-preview-status-strip.is-pass {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: #a7f3d0;
}
.case-preview-status-strip.is-pass .case-preview-status-title {
  color: #065f46;
}
.case-preview-status-strip.is-pass .case-preview-status-desc {
  color: #047857;
}
.case-preview-status-strip.is-fail {
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  border-color: #fecaca;
}
.case-preview-status-strip.is-fail .case-preview-status-title {
  color: #991b1b;
}
.case-preview-status-strip.is-fail .case-preview-status-desc {
  color: #b91c1c;
}
.case-preview-status-strip.is-reopen {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
}
.case-preview-status-strip.is-reopen .case-preview-status-title {
  color: #92400e;
}
.case-preview-status-strip.is-reopen .case-preview-status-desc {
  color: #b45309;
}
.case-preview-status-strip.is-pending {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border-color: #bfdbfe;
}
.case-preview-status-strip.is-pending .case-preview-status-title {
  color: #1e40af;
}
.case-preview-status-strip.is-pending .case-preview-status-desc {
  color: #1d4ed8;
}
.case-preview-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.case-preview-status-body { display: flex; flex-direction: column; gap: 1px; }
.case-preview-status-title { font-size: var(--text-xs); font-weight: 750; color: var(--color-brand-dark); line-height: 1.2; }
.case-preview-status-desc  { font-size: 11.5px; color: var(--app-text-muted); line-height: 1.3; font-weight: 500; }

/* Section cards — modern Jira/Zoho surface */
.preview-submitted-sheet {
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.preview-submitted-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #334155;
}
.preview-submitted-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}
.preview-submitted-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--app-border);
  border-bottom: 1px solid var(--app-border);
}
.preview-submitted-cell:nth-child(4n) { border-right: 0; }
.preview-submitted-cell.is-full {
  grid-column: 1 / -1;
  border-right: 0;
}
.preview-submitted-label {
  color: var(--app-text-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}
.preview-submitted-value {
  color: var(--color-brand-dark);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.preview-submitted-value.is-html { display: flex; align-items: center; min-height: 20px; }
.preview-submitted-cell.is-full .preview-submitted-value { white-space: pre-wrap; }
@media (max-width: 800px) {
  .preview-submitted-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-submitted-cell:nth-child(2n) { border-right: 0; }
  .preview-submitted-cell:nth-child(4n) { border-right: 1px solid var(--app-border); }
  .preview-submitted-cell:nth-child(4n):nth-child(2n) { border-right: 0; }
}
@media (max-width: 520px) {
  .preview-submitted-grid { grid-template-columns: 1fr; }
  .preview-submitted-cell { border-right: 0; }
}

/* Two-column paired card layout for Steps & Results */
.zoho-paired-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}
.zoho-content-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-right: 1px solid var(--app-border);
}
.zoho-content-card:last-child { border-right: 0; }
.zoho-content-card-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  background: var(--app-surface-subtle);
  border-bottom: 1px solid var(--app-border);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-brand-dark);
}
.zoho-content-card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.zoho-step-subblock { display: flex; flex-direction: column; gap: 2px; }
.zoho-step-subblock.is-dev-remarks {
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--color-warning-bg);
  border: none;
}
.zoho-sublabel {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--app-text-muted);
}
.zoho-subtext {
  font-size: var(--text-xs);
  color: var(--color-brand-dark);
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
}
.zoho-step-container {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-surface);
}
.case-defect-ident-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
@media (max-width: 640px) {
  .case-defect-ident-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
@media (max-width: 768px) {
  .zoho-paired-cards-grid { grid-template-columns: 1fr; }
  .zoho-content-card { border-right: 0; border-bottom: 1px solid var(--app-border); }
  .zoho-content-card:last-child { border-bottom: 0; }
}

/* ── Notion-Grade Issue Tracking Document Layout ── */
.notion-doc-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 960px;
  margin: 0 auto;
  padding: 4px 4px;
}

/* 1. Notion Page Title */
.notion-doc-header {
  padding-bottom: 2px;
}
.notion-doc-title {
  font-size: 19px;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
}

/* 2. Notion Properties Matrix (Clean borderless key-value list) */
.notion-props-table {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 0;
}

.notion-prop-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  min-height: 27px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background-color 120ms ease;
}
.notion-prop-row:hover {
  background-color: #f8fafc;
}

.notion-prop-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
}

.notion-prop-val {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.notion-doc-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 2px 0;
}

/* 3. Notion Callout Block */
.notion-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.notion-callout.is-pass {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.notion-callout.is-fail {
  background: #fef2f2;
  border-color: #fecaca;
}
.notion-callout.is-reopen {
  background: #fffbeb;
  border-color: #fde68a;
}
.notion-callout.is-pending {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.notion-callout-icon {
  margin-top: 1px;
  flex-shrink: 0;
}

.notion-callout-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notion-callout-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.notion-callout-desc {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

/* 4. Notion Document Blocks */
.notion-doc-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 2px;
}

.notion-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notion-block-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.notion-callout-subtle {
  padding: 8px 12px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  border-radius: 0 6px 6px 0;
  font-size: 12.5px;
  color: #334155;
  line-height: 1.5;
}

.notion-text-content {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 2px 2px;
}

/* Notion Outcomes 2-Column Block */
.notion-outcomes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 640px) {
  .notion-outcomes-grid {
    grid-template-columns: 1fr;
  }
}

.notion-outcome-card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  overflow: hidden;
}
.notion-outcome-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}
.notion-outcome-card-body {
  padding: 10px 12px;
  font-size: 12.5px;
  color: #1e293b;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Notion Defect Timeline / Activity Stream */
.notion-defect-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  padding-left: 6px;
}
.notion-defect-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  position: relative;
}
.notion-defect-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.notion-round-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.notion-defect-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
}
.notion-defect-date {
  font-size: 11px;
  color: #94a3b8;
}
.notion-defect-item-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.notion-defect-summary-text {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
  font-weight: 550;
}
.notion-defect-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #64748b;
}
.notion-callout-subtle.is-dev {
  background: #eff6ff;
  border-left-color: #3b82f6;
  color: #1e3a8a;
  border-radius: 6px;
  padding: 8px 10px;
}

/* Notion Attachments Grid & Pills */
.notion-attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.notion-attachment-card {
  display: inline-flex;
  min-width: 0;
}
.notion-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #334155;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.notion-attachment-pill:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.notion-attachment-title {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notion-attachment-title:hover {
  text-decoration: underline;
}
.notion-attachment-download {
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
  padding: 2px;
  border-radius: 4px;
}
.notion-attachment-download:hover {
  color: #334155;
  background: #f1f5f9;
}

/* ── Notion Form Section Headings (Details & Defects Tabs) ── */
.form-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
  margin-top: 14px;
  margin-bottom: 4px;
}
.form-section-heading > span:first-child {
  font-size: 12.5px;
  font-weight: 750;
  color: #1e293b;
  letter-spacing: -0.01em;
}
.form-section-heading > span:last-child {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
}

/* ── Notion Inputs & Form Controls for #caseModal ── */
#caseModal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
#caseModal textarea,
#caseModal select {
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  padding: 8px 12px !important;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease !important;
}
/* ── Notice-Board Inputs & Form Controls for #caseModal ── */
#caseModal input,
#caseModal textarea,
#caseModal select {
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  padding: 8px 12px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease !important;
}
#caseModal input:hover,
#caseModal textarea:hover,
#caseModal select:hover {
  border-color: #94a3b8 !important;
  background: #ffffff !important;
}
#caseModal input:focus,
#caseModal textarea:focus,
#caseModal select:focus {
  border-color: #0284c7 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
  outline: none !important;
}
#caseModal input::placeholder,
#caseModal textarea::placeholder {
  color: #94a3b8 !important;
  font-style: italic !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  opacity: 0.8 !important;
}
#caseModal label {
  font-size: 10.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
  color: #334155 !important;
  margin-bottom: 4px !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}
#caseModal label .text-danger {
  color: #ef4444 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.case-form-tab-panel {
  grid-column: span 2 / span 2 !important;
  width: 100% !important;
  min-width: 0 !important;
}
.case-form-tab-panel[hidden] {
  display: none !important;
}

/* ── Linear / GitHub 2-Column Split Workspace Layout ── */
.case-workspace-2col {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 300px !important;
  gap: 20px !important;
  align-items: start !important;
  width: 100% !important;
}

@media (max-width: 960px) {
  .case-workspace-2col {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

.case-workspace-main {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  min-width: 0 !important;
  width: 100% !important;
}

/* Defect Summary, Remarks, and Attachments use native form controls. Keep
   their left workspace pane above neighbouring section layers so it receives
   the same direct pointer interaction as the assignment controls. */
#caseDefectMainPane {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
#caseDefectMainPane .case-section-card,
#caseDefectMainPane .case-section-card-header,
#caseDefectMainPane input,
#caseDefectMainPane textarea,
#caseDefectMainPane select {
  pointer-events: auto;
}

.case-workspace-sidebar {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-width: 0 !important;
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ── Open, Breathable Notice-Board Document Sections ── */
.case-section-card {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.case-section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 900;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 7px;
  border-bottom: 2px solid #e2e8f0;
}

/* ── Sidebar Properties Panel (Notice-Board Clean Card) ── */
.case-sidebar-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.case-sidebar-card-header {
  font-size: 11px;
  font-weight: 900;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 6px;
  border-bottom: 1.5px solid #e2e8f0;
}

/* ── Micro-Icons & Form Labels ── */
.case-field-icon {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
#caseModal svg:not(.modal-close-icon) {
  max-width: 20px !important;
  max-height: 20px !important;
}

/* ── Outcomes Grid (50/50 Balanced Comparison in Details Tab) ── */
.case-outcomes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px) {
  .case-outcomes-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 50/50 Outcomes Cards (Bright & Luminous) ── */
.case-outcome-card {
  width: 100% !important;
  box-sizing: border-box !important;
  transition: border-color 120ms ease !important;
}
.case-outcome-card.is-expected {
  border: 1.5px solid #bbf7d0 !important;
  border-left: 4px solid #16a34a !important;
  background: #ffffff !important;
}
.case-outcome-card.is-actual {
  border: 1.5px solid #7dd3fc !important;
  border-left: 4px solid #0284c7 !important;
  background: #ffffff !important;
}
.case-outcome-card textarea,
.case-outcomes-grid textarea,
#fcActual,
#fcExpected {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
}

/* ── Triage Grid (4-Column Layout in Details Tab) ── */
.case-triage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 768px) {
  .case-triage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Notion Collapsible Additional Details ── */
.case-secondary-details {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
  margin-top: 10px;
}
.case-secondary-summary {
  padding: 8px 12px;
  cursor: pointer;
  background: #f8fafc;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  transition: background-color 120ms ease;
}
.case-secondary-summary:hover {
  background: #f1f5f9;
}
.case-secondary-chevron {
  transition: transform 150ms ease;
  display: inline-block;
  font-size: 10px;
  color: #64748b;
}
details[open] .case-secondary-chevron {
  transform: rotate(90deg);
}
.case-secondary-grid {
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

/* ── Notion Handoff Card (Defects Tab) ── */
.case-assignment-handoff-card,
#caseAssignmentHandoffCard {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
.btn-send-email {
  background: #007fff !important;
  border: 1px solid #007fff !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(0, 127, 255, 0.3) !important;
  transition: background-color 150ms ease, transform 100ms ease !important;
}
.btn-send-email:hover:not(:disabled) {
  background: #0066cc !important;
  transform: translateY(-1px);
}
#fcAttachments {
  border: 1.5px dashed #cbd5e1 !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  padding: 12px 14px !important;
  cursor: pointer !important;
  transition: border-color 150ms ease, background-color 150ms ease !important;
}
#fcAttachments:hover {
  border-color: #3b82f6 !important;
  background: #eff6ff !important;
}
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-warning);
  letter-spacing: 0.03em;
}
.zoho-dev-response-txt {
  font-size: var(--text-xs);
  color: var(--color-brand-dark);
  margin-top: 2px;
  white-space: pre-wrap;
}

.case-preview-empty-state {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px dashed var(--app-border-strong);
  border-radius: 7px;
  background: var(--app-surface-subtle);
  color: var(--app-text-muted);
  font-size: var(--text-xs);
}
.case-preview-empty-state strong { color: var(--color-brand-dark); font-size: var(--text-xs); }

/* ── Attachment Chips Gallery (Plan 1) ── */
.preview-attachment-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--color-surface);
}
.preview-attachment-chip {
  display: inline-flex;
  flex-direction: column;
  max-width: 100%;
}
.preview-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--app-surface-subtle);
  transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
.preview-attachment-pill:hover {
  border-color: var(--color-brand-lighter);
  background: var(--color-brand-light);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}
.preview-attachment-link {
  border: none;
  background: transparent;
  color: var(--color-brand);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-attachment-link:hover {
  text-decoration: underline;
}
.preview-attachment-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--app-text-muted);
  padding: 3px;
  border-radius: 4px;
  transition: color var(--motion-fast) ease, background-color var(--motion-fast) ease;
}
.preview-attachment-download:hover {
  color: var(--color-brand);
  background: rgba(37, 99, 235, 0.12);
}

/* Also pull the role-view stack tighter */
.case-preview-role-view { display: flex; flex-direction: column; gap: 0; }

/* ── Plan 2: Two-Column Dossier View ── */
.case-dossier-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}
.case-dossier-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.case-dossier-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  position: sticky;
  top: 0;
}
.dossier-sidebar-card {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.dossier-sidebar-heading {
  padding: 7px 12px;
  background: var(--app-surface-subtle);
  border-bottom: 1px solid var(--app-border);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-brand-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dossier-sidebar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}
.dossier-sidebar-cell {
  padding: 7px 10px;
  border-bottom: 1px solid var(--app-border);
  border-right: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  min-width: 0;
  background: var(--color-surface);
}
.dossier-sidebar-cell:nth-child(2n) {
  border-right: none;
}
.dossier-sidebar-cell:last-child,
.dossier-sidebar-cell:nth-last-child(2):nth-child(odd) {
  border-bottom: none;
}
.dossier-sidebar-cell.is-full {
  grid-column: span 2;
  border-right: none;
}
.dossier-sidebar-label {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #64748b;
  line-height: 1.2;
}
.dossier-sidebar-val {
  font-family: var(--font-sans);
  font-size: 12px;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.35;
  display: flex;
  align-items: center;
  min-height: 20px;
}
.tabular-date {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.text-muted-italic {
  font-style: italic;
  color: #94a3b8;
  font-weight: 500;
  font-size: 11.5px;
}
.badge-unassigned {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.badge-unassigned .badge-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #94a3b8;
}
@media (max-width: 860px) {
  .case-dossier-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .case-dossier-sidebar {
    position: static;
  }
}

[data-theme="dark"] .case-preview-hero-card,
[data-theme="dark"] .case-preview-status-strip,
[data-theme="dark"] .preview-submitted-sheet {
  background: rgb(28, 28, 28);
  border-color: rgba(255, 255, 255, 0.14);
}
[data-theme="dark"] .preview-submitted-cell { background: transparent; }
[data-theme="dark"] .zoho-content-card { background: rgb(28, 28, 28); }
[data-theme="dark"] .zoho-defect-iteration-card {
  background: rgb(38, 38, 38);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .zoho-content-card-header,
[data-theme="dark"] .preview-submitted-heading {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .case-preview-status-icon { background: rgb(45, 45, 45); }
  body:has(#sidebar.collapsed) #caseModal.case-workspace-open.case-workspace-preview-active > .modal { width:100% !important; height:calc(100vh - 16px) !important; max-height:calc(100vh - 16px) !important; border-radius:10px !important; }
  #caseModal.case-workspace-open .case-modal-header-identity,
  #caseModal.case-workspace-open:not(.case-workspace-preview-active) #caseModalChips { transform:none !important; }
  #caseModal.case-workspace-open > .modal > .case-modal-body { padding:16px !important; }
  #caseModal.case-workspace-open #caseFormFields { padding:16px; border-radius:10px; }
  #caseModal.case-workspace-open .case-modal-save-footer { padding:10px 16px !important; border-radius:0 0 10px 10px; }
  .case-preview-navigation { order:3; width:100%; justify-content:flex-end; margin-left:0; }
}
.btn-send-email { white-space:nowrap; }
.btn-send-email:disabled { border-color:var(--app-border-strong) !important; background:var(--app-border) !important; color:var(--app-text-muted) !important; cursor:not-allowed !important; opacity:1; box-shadow: var(--shadow-flat); }
.case-action-help.is-handoff-blocked { color:var(--color-warning); font-weight:650; }
.case-action-help { color:var(--app-text-muted); font-size:var(--text-xs); line-height:1.35; }
.case-assignment-handoff-card,
#caseAssignmentHandoffCard { position: relative; z-index: 25; display:flex; flex-direction:column; gap:9px; padding:0 !important; border:none !important; background:transparent !important; box-shadow:none !important; }
#caseAssignedDateGroup { position: relative !important; z-index: 1 !important; }
.case-assignment-handoff .btn-send-email { min-width:0; }
.tester-reassign-panel { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 10px; border:1px solid var(--color-brand-lighter); border-radius:7px; background:var(--color-brand-light); color:var(--color-brand-dark); font-size:var(--text-xs); }
.tester-reassign-panel > div:first-child { display:flex; flex-direction:column; gap:2px; }
.tester-reassign-panel > div:first-child span { color:var(--app-text-muted); font-size:var(--text-xs); }
.tester-reassign-actions { display:flex; align-items:center; gap:7px; }
.tester-reassign-actions select { min-width:190px; height:32px; padding:0 8px; border:1px solid var(--app-border-strong); border-radius:6px; background:var(--color-surface); font-size:var(--text-xs); }
.tester-reassign-actions button { height:32px; padding:0 11px; border:1px solid var(--color-brand); border-radius:6px; background:var(--color-brand); color:var(--color-surface); font-size:var(--text-xs); font-weight:700; }
.case-modal-save-footer { align-items:center; flex-wrap:wrap; }
.case-normal-save-help { margin-right:auto; max-width:430px; color:var(--app-text-muted); font-size:var(--text-xs); line-height:1.35; }
.case-modal-chip { min-width:0; max-width:100%; min-height:20px; display:inline-flex; align-items:center; gap:4px; padding:3px 7px; border:1px solid rgba(255,255,255,.3); border-radius:6px; background:rgba(255,255,255,.12); color:var(--app-surface-subtle); font-size:var(--text-xs); font-weight:650; line-height:1.2; overflow-wrap:anywhere; }
.case-modal-chip-dot { width:5px; height:5px; flex:0 0 auto; border-radius:50%; background:var(--color-brand-lighter); }
.case-modal-round-chip { min-height:24px; padding:4px 9px; border-width:1px; font-weight:850; letter-spacing:.01em; box-shadow: var(--shadow-card); }
.case-modal-round-chip.is-awaiting { border-color:var(--color-warning-border); background:var(--color-warning-bg); color:var(--color-warning); }
.case-modal-round-chip.is-responded { border-color:var(--color-success-border); background:var(--color-success-bg); color:var(--color-success); }
.case-modal-round-chip.is-action-required { border-color:var(--color-warning-border); background:var(--color-warning-bg); color:var(--color-warning); box-shadow:0 0 0 2px rgba(251,146,60,.2); }

/* ── Phase 1: Sticky Header Badges ── */
.case-header-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.case-header-badge.badge {
  font-size: 11px;
  font-weight: 650;
  padding: 2px 8px 2px 6px;
  border-radius: 9999px;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  border-width: 1px;
}
.case-header-dev-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(4px);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.case-header-dev-badge.is-unassigned {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.22);
}
.case-header-dev-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-brand-lighter, #93c5fd);
  flex-shrink: 0;
}
.case-header-dev-badge.is-unassigned .case-header-dev-dot {
  background: rgba(255, 255, 255, 0.4);
}
[data-theme="dark"] .case-header-dev-badge {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
}
[data-theme="dark"] .case-header-dev-badge.is-unassigned {
  background: rgba(30, 41, 59, 0.4);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.15);
}

/* ── Details Tab Narrative Flow & Outcomes Arena (Plan A) ── */
.case-field-label-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--app-text-muted);
}
.case-outcomes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.case-outcomes-grid textarea {
  min-height: 96px;
  font-size: var(--text-xs);
  line-height: 1.45;
}
.case-triage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
@media (max-width: 900px) {
  .case-triage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .case-outcomes-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .case-triage-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ── Modal Inline Empty States (Phase 4) ── */
.modal-inline-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 14px;
  border: 1px dashed var(--app-border-strong);
  border-radius: 8px;
  background: var(--app-surface-subtle);
  text-align: center;
  gap: 4px;
}
.modal-inline-empty-icon {
  width: 22px;
  height: 22px;
  color: var(--app-text-muted);
  margin-bottom: 2px;
}
.modal-inline-empty-title {
  font-size: var(--text-xs);
  font-weight: 750;
  color: var(--color-brand-dark);
}
.modal-inline-empty-desc {
  font-size: 11px;
  color: var(--app-text-muted);
  max-width: 280px;
  line-height: 1.35;
}
[data-theme="dark"] .modal-inline-empty-state {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.2);
}


/* ── Phase 5: Severity-Driven Field Collapsing ── */
.case-secondary-details {
  border: 1px solid var(--app-border, rgba(226, 232, 240, 0.9));
  border-radius: 10px;
  background: var(--app-surface-subtle, rgba(248, 250, 252, 0.5));
  padding: 12px 16px;
  margin-top: 14px;
}
.case-secondary-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  list-style: none;
  padding: 2px 0;
}
.case-secondary-summary::-webkit-details-marker {
  display: none;
}
.case-secondary-summary:hover {
  opacity: 0.85;
}
.case-secondary-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--app-surface, #ffffff);
  border: 1px solid var(--app-border, #e2e8f0);
  font-size: 10px;
  color: var(--app-text-muted, #64748b);
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1), background 160ms ease;
}
.case-secondary-summary:hover .case-secondary-chevron {
  background: var(--color-brand-light, #eff6ff);
  border-color: var(--color-brand-lighter, #bfdbfe);
}
@media (prefers-reduced-motion: reduce) {
  .case-secondary-chevron {
    transition: none !important;
  }
}
.case-secondary-details[open] .case-secondary-chevron {
  transform: rotate(90deg);
}
.case-secondary-grid {
  animation: caseSecondaryFadeIn 180ms ease-out;
}
@keyframes caseSecondaryFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .case-secondary-grid {
    animation: none !important;
  }
}
[data-theme="dark"] .case-secondary-details {
  border-color: rgba(51, 65, 85, 0.8);
  background: rgba(15, 23, 42, 0.3);
}
[data-theme="dark"] .case-secondary-chevron {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

/* ── Phase 6: Defects Tab Visual Round Tracker ── */
.defect-round-tracker {
  padding: 14px 16px 10px;
  background: linear-gradient(135deg, var(--app-surface, #ffffff) 0%, var(--app-surface-subtle, #f8fafc) 100%);
  border: 1px solid var(--app-border, #e2e8f0);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow-x: auto;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.defect-round-tracker-track {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 100%;
}
.defect-tracker-step {
  display: inline-flex;
  align-items: center;
  position: relative;
  flex: 1 0 auto;
}
.defect-tracker-step:last-child {
  flex: 0 0 auto;
}
.defect-tracker-connector {
  flex: 1 1 auto;
  height: 3px;
  min-width: 24px;
  background: var(--app-border, #e2e8f0);
  margin-inline: 3px;
  border-radius: 2px;
}
.defect-tracker-step.is-completed .defect-tracker-connector,
.defect-tracker-step.is-responded .defect-tracker-connector {
  background: var(--color-brand-light, #93c5fd);
}
.defect-tracker-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background 160ms ease, transform 160ms ease;
}
.defect-tracker-node:hover {
  background: var(--app-surface-subtle, #f8fafc);
  transform: translateY(-1px);
}
.defect-tracker-node:focus-visible {
  outline: 2px solid var(--color-brand, #2563eb);
  outline-offset: 2px;
}
.defect-tracker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--app-text-muted, #94a3b8);
  border: 2px solid var(--app-surface, #ffffff);
  box-shadow: 0 0 0 1.5px var(--app-border, #cbd5e1);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.defect-tracker-step.is-completed .defect-tracker-dot {
  background: var(--color-success, #16a34a);
  box-shadow: 0 0 0 2.5px rgba(22, 163, 74, 0.2);
}
.defect-tracker-step.is-responded .defect-tracker-dot {
  background: var(--color-brand, #2563eb);
  box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.2);
}
.defect-tracker-step.is-awaiting .defect-tracker-dot {
  background: var(--color-warning, #d97706);
  box-shadow: 0 0 0 2.5px rgba(217, 119, 6, 0.25);
}
.defect-tracker-step.is-current .defect-tracker-dot {
  transform: scale(1.3);
}
.defect-tracker-step.is-current.is-awaiting .defect-tracker-dot {
  animation: defectTrackerPulse 2s ease-in-out infinite;
}
@keyframes defectTrackerPulse {
  0%, 100% { box-shadow: 0 0 0 2.5px rgba(217, 119, 6, 0.25); }
  50% { box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.12); }
}
.defect-tracker-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--app-text-muted, #64748b);
  letter-spacing: 0.03em;
}
.defect-tracker-step.is-current .defect-tracker-label {
  color: var(--color-brand-dark, #1e3a8a);
  font-weight: 800;
}
.defect-history-entry.is-tracker-focused {
  outline: 2px solid var(--color-brand, #2563eb);
  outline-offset: -2px;
  background-color: var(--color-brand-light, rgba(239, 246, 255, 0.6)) !important;
  transition: background-color 200ms ease, outline 200ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .defect-tracker-node,
  .defect-tracker-dot,
  .defect-history-entry.is-tracker-focused {
    transition: none !important;
  }
  .defect-tracker-node:hover {
    transform: none;
  }
  .defect-tracker-step.is-current.is-awaiting .defect-tracker-dot {
    animation: none !important;
  }
}
[data-theme="dark"] .defect-round-tracker {
  background: linear-gradient(135deg, var(--app-surface) 0%, rgba(38, 38, 38, 0.8) 100%);
  border-color: var(--app-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .defect-tracker-dot {
  border-color: var(--app-surface);
}
[data-theme="dark"] .defect-tracker-node:hover {
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .defect-history-entry.is-tracker-focused {
  background-color: rgba(37, 99, 235, 0.15) !important;
}



@media (max-width:640px) { .case-modal-record-heading { align-items:flex-start; flex-direction:column; gap:5px; } #caseModalChips { align-items:flex-start; max-width:100%; } .case-form-tabs { width:100%; } .case-form-tab { flex:1 1 0; padding-inline:7px; } .case-form-tab-round { display:block; margin-top:2px; } .case-form-tab-panel { grid-template-columns:minmax(0,1fr); gap:12px; } .case-form-tab-panel > .col-span-2 { grid-column:span 1 / span 1; } .tester-reassign-panel,.tester-reassign-actions { align-items:stretch; flex-direction:column; } .tester-reassign-actions select { min-width:0; width:100%; } .btn-send-email { white-space:normal; line-height:1.15; } .case-normal-save-help { flex:1 0 100%; max-width:none; } .case-modal-chip { white-space:normal; } .case-modal-round-chip { flex-basis:auto; } }

/* Expanded testcase workspace: tab switches retain one fixed frame and scroller. */
#caseModal.case-workspace-open.case-workspace-expanded.case-workspace-preview-active {
  left:0 !important; right:0 !important; top:0 !important; bottom:0 !important;
  padding:14px 16px !important; align-items:center !important; justify-content:center !important;
  background:rgba(15,23,42,.18) !important;
}
#caseModal.case-workspace-open.case-workspace-expanded > .modal,
#caseModal.case-workspace-open:not(.case-workspace-preview-active) > .modal,
body:has(#sidebar.collapsed) #caseModal.case-workspace-open.case-workspace-expanded > .modal,
body:has(#sidebar.collapsed) #caseModal.case-workspace-open:not(.case-workspace-preview-active) > .modal {
  width:min(1100px, calc(100vw - 32px)) !important;
  max-width:1100px !important;
  height:calc(100vh - 28px) !important;
  max-height:calc(100vh - 28px) !important;
  border-radius:14px !important;
  transform:none !important;
  transition:box-shadow .24s ease !important;
}
#caseModal.case-workspace-open.case-workspace-expanded.case-workspace-preview-active .case-modal-sticky-header { border-radius:12px 12px 0 0 !important; }
#caseModal.case-workspace-open.case-workspace-expanded.case-workspace-preview-active .case-modal-save-footer { border-radius:0 0 12px 12px !important; }
#caseModal.case-workspace-open > .modal > .case-modal-body { overflow-y:auto; min-height:0; scrollbar-gutter:stable; }
.case-modal-header-actions { display:flex; align-items:center; gap:7px; flex:0 0 auto; }
.case-workspace-expand-btn { min-height:28px; display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:4px 9px; border:1px solid rgba(255,255,255,.3); border-radius:6px; background:rgba(255,255,255,.14); color:var(--color-surface); font:700 var(--text-xs)/1 var(--font); cursor:pointer; }
.case-workspace-expand-btn:hover { background:rgba(255,255,255,.24); }
.case-workspace-expand-btn:focus-visible { outline:2px solid var(--color-surface); outline-offset:2px; }
.case-form-tab[hidden] { display:none !important; }

#caseFormFields input:not([type="hidden"]):not([type="checkbox"]):not([type="file"]):not(.developer-assignee-search),
#caseFormFields select:not(.tester-reassign-actions select) {
  height: 38px;
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid var(--app-border, #e2e8f0);
  background: var(--color-surface, #ffffff);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
#caseFormFields textarea {
  min-height: 4.5rem;
  border-radius: 7px;
  border: 1px solid var(--app-border, #e2e8f0);
  background: var(--color-surface, #ffffff);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
#caseFormFields input:not([type="hidden"]):not([type="checkbox"]):not([type="file"]):hover,
#caseFormFields select:hover,
#caseFormFields textarea:hover {
  border-color: var(--app-border-strong, #cbd5e1);
}
#caseFormFields input:not([type="hidden"]):not([type="checkbox"]):not([type="file"]):focus,
#caseFormFields select:focus,
#caseFormFields textarea:focus {
  border-color: var(--color-brand, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}
#caseFormFields label {
  font-weight: 750;
  letter-spacing: 0.06em;
  color: var(--app-text-muted, #64748b);
}

#caseFormFields .case-field-reserved { display:flex !important; min-height:var(--case-reserved-height, 64px); }
#caseFormFields #caseDeveloperRemarksGroup.case-field-reserved { min-height:90px; }
#caseFormFields #caseTimerPanel.case-field-reserved { min-height:64px; }
#caseFormFields #testerReassignPanel.case-field-reserved { min-height:58px; }
#testerReassignPanel,
.tester-reassign-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 10px 12px !important;
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  border-radius: 8px !important;
}
#testerReassignPanel > div:first-child {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  width: 100% !important;
}
#testerReassignPanel strong {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #0369a1 !important;
  line-height: 1.3 !important;
}
#testerReassignPanel span {
  font-size: 11px !important;
  color: #64748b !important;
  line-height: 1.4 !important;
}
.tester-reassign-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
#testerReassignSelect {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 0 !important;
  height: 30px !important;
  padding: 2px 6px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}
.tester-reassign-actions button {
  flex: 0 0 auto !important;
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: #0284c7 !important;
  border: 1px solid #0284c7 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: background-color 120ms ease !important;
  white-space: nowrap !important;
}
.tester-reassign-actions button:hover {
  background: #0369a1 !important;
  border-color: #0369a1 !important;
}
#caseFormFields .case-field-reserved.is-reserved-hidden {
  visibility:hidden;
  opacity:0;
  pointer-events:none;
  user-select:none;
}

/* Expanded desktop workspace: persistent section rail and one continuous page. */
@media (min-width:901px) {
  #caseModal.case-workspace-open.case-workspace-expanded #caseModalChips {
    display:none !important;
  }
  #caseModal.case-workspace-open.case-workspace-expanded > .modal > .case-modal-body {
    display:grid;
    grid-template-columns:180px minmax(0,1fr);
    gap:16px;
    padding:16px 10px 16px 16px !important;
    background:var(--app-canvas);
    overflow:hidden;
  }
  #caseModal.case-workspace-open.case-workspace-expanded #caseExpandedRail {
    display:block !important;
  }
  .case-expanded-rail {
    min-width:0;
    padding:12px 10px;
    border:1px solid var(--app-border);
    border-radius:10px;
    background:var(--app-surface-subtle);
    box-shadow: var(--shadow-card);
    align-self:stretch;
  }
  .case-expanded-rail[hidden] { display:none !important; }
  .case-expanded-rail-title {
    padding:4px 10px 9px;
    color:var(--app-text-muted);
    font-size:var(--text-xs);
    font-weight:800;
    letter-spacing:.12em;
    text-transform:uppercase;
  }
  .case-expanded-rail-item {
    position:relative;
    width:100%;
    min-height:38px;
    display:flex;
    align-items:center;
    gap:9px;
    margin:2px 0;
    padding:0 10px;
    border:1px solid transparent;
    border-radius:7px;
    background:transparent;
    color:var(--app-text-muted);
    font:700 var(--text-xs)/1 var(--font);
    text-align:left;
    cursor:pointer;
    transition:background .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease;
  }
  .case-expanded-rail-item:hover { border-color:var(--color-brand-lighter); background:var(--color-brand-light); color:var(--color-brand-hover); }
  .case-expanded-rail-item:focus-visible { outline:2px solid var(--color-brand); outline-offset:2px; }
  .case-expanded-rail-item.is-active {
    border-color:var(--color-brand);
    background:linear-gradient(135deg,var(--color-brand-dark) 0%,var(--color-brand) 100%);
    color:var(--color-surface);
    box-shadow: var(--shadow-card);
  }
  .case-expanded-rail-icon {
    width:18px;
    height:18px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    border:1px solid currentColor;
    border-radius:5px;
    font-size:var(--text-xs);
    font-weight:800;
    opacity:.88;
  }
  .case-expanded-rail-dot {
    width:7px;
    height:7px;
    margin-left:auto;
    flex:0 0 auto;
    border:2px solid var(--color-surface);
    border-radius:50%;
    background:var(--color-warning);
    box-shadow:0 0 0 2px rgba(249,115,22,.22);
  }
  .case-tab-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 6px;
    flex: 0 0 auto;
    border: 1.5px solid var(--app-surface, #ffffff);
    border-radius: 50%;
    background: var(--color-warning);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.22);
    vertical-align: middle;
  }
  .case-tab-dot.is-required {
    background: var(--color-danger);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.22);
  }
  .case-tab-dot[hidden] {
    display: none !important;
  }
  #caseModal.case-workspace-open.case-workspace-expanded #caseFormFields {
    width:100%;
    max-width:none;
    height:100%;
    min-height:0;
    margin:0;
    padding:0 6px 44px 0;
    display:block;
    overflow-y:auto;
    overscroll-behavior:contain;
    scroll-behavior:smooth;
    scroll-padding-top:0;
    scrollbar-gutter:stable;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:18px;
    min-width:0;
    margin-top:16px;
    padding:18px;
    border:1px solid var(--app-border);
    border-radius:10px;
    background:var(--app-surface);
    box-shadow: var(--shadow-card);
    scroll-margin-top:0;
    position:relative;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section:first-child,
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section:first-of-type {
    margin-top:0;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section > :not(.case-expanded-section-heading) {
    min-width:0;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-preview-tab-panel > :not(.case-expanded-section-heading) {
    grid-column:1 / -1;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section + .case-expanded-section {
    margin-top:20px;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section-heading {
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:12px;
    grid-column:1 / -1 !important;
    position:sticky !important;
    top:0 !important;
    z-index:60 !important;
    margin:-18px -18px 0 !important;
    padding:14px 18px 10px !important;
    background:var(--app-surface) !important;
    border-bottom:1px solid var(--app-border);
    border-radius:9px 9px 0 0;
    box-shadow: var(--shadow-card);
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section-heading > span:first-child { color:var(--color-brand-dark); font-size:var(--text-base); font-weight:800; letter-spacing:-.01em; }
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section-heading > span:last-child { color:var(--app-text-muted); font-size:var(--text-xs); font-weight:600; }
  #caseModal.case-workspace-open.case-workspace-expanded .form-section-heading,
  #caseModal.case-workspace-open.case-workspace-expanded .case-defect-section-heading {
    margin:8px 0 2px;
    padding:9px 10px;
    border:1px solid var(--app-border);
    border-left:3px solid var(--color-brand);
    border-radius:7px;
    background:var(--app-surface-subtle);
  }
  #caseModal.case-workspace-open.case-workspace-expanded #caseDetailsPanel > .form-section-heading:not(:first-of-type),
  #caseModal.case-workspace-open.case-workspace-expanded #caseDefectPanel > .case-defect-section-heading:not(:first-of-type) {
    margin-top:18px;
  }
  #caseModal.case-workspace-open.case-workspace-expanded #caseAssignmentHandoffCard,
  #caseModal.case-workspace-open.case-workspace-expanded #caseAssignedToGroup,
  #caseModal.case-workspace-open.case-workspace-expanded .developer-select-wrap {
    z-index: 5 !important;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-preview-navigation { display:none !important; }
}
.case-expanded-section-heading { display:none; }
@media (min-width:901px) and (prefers-reduced-motion:reduce) {
  #caseModal.case-workspace-open.case-workspace-expanded #caseFormFields { scroll-behavior:auto; }
  .case-expanded-rail-item { transition:none; }
}
@media (max-width:900px) {
  #caseModal.case-workspace-open,
  #caseModal.case-workspace-open.case-workspace-preview-active,
  body:has(#sidebar.collapsed) #caseModal.case-workspace-open { left:56px !important; padding:8px !important; }
  #caseModal.case-workspace-open > .modal,
  #caseModal.case-workspace-open.case-workspace-preview-active > .modal,
  body:has(#sidebar.collapsed) #caseModal.case-workspace-open > .modal,
  body:has(#sidebar.collapsed) #caseModal.case-workspace-open.case-workspace-preview-active > .modal {
    width:100% !important; max-width:1100px !important;
    height:calc(100vh - 16px) !important; max-height:calc(100vh - 16px) !important;
    border-radius:10px !important;
  }
  .case-workspace-expand-btn { display:none !important; }
}
#fcDeveloperStatus.is-response-editable { background:var(--color-surface); border-color:var(--color-brand-lighter); color:var(--color-brand-dark); font-weight:650; box-shadow:0 0 0 3px rgba(37,99,235,.08); cursor:pointer; }
#fcDeveloperStatus.is-response-editable:hover { border-color:var(--color-brand); }
.defect-id-cell { font-family:var(--mono); font-size:var(--text-xs); vertical-align:middle; }
.defect-id-value { display:block; color:var(--color-brand-dark); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.case-defect-round-meta { display:flex; align-items:flex-start; flex-direction:column; gap:3px; margin-top:4px; font-family:var(--font); }
.defect-round-table-chip,.defect-round-action-badge { display:inline-flex; align-items:center; width:max-content; max-width:100%; padding:3px 7px; border-radius:6px; font-size:var(--text-xs); font-weight:700; line-height:1.25; white-space:nowrap; }
.defect-round-table-chip.is-awaiting { background:var(--color-brand-light); color:var(--color-brand-hover); border:1px solid var(--color-brand-lighter); }
.defect-round-table-chip.is-responded { background:var(--color-success-bg); color:var(--color-success); border:1px solid var(--color-success-border); }
.defect-round-action-badge { min-height:24px; padding-inline:9px; background:var(--color-warning-bg); color:var(--color-warning); border:1px solid var(--color-warning-border); font-size:var(--text-xs); }
.admin-maintenance-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:32px; padding:7px 10px; border:1px solid var(--color-warning-border); border-radius:8px; background:var(--color-warning-bg); color:var(--color-warning); font:600 var(--text-xs)/1 var(--font); cursor:pointer; transition:background .15s,border-color .15s,box-shadow .15s; }
.admin-maintenance-btn:hover { background:var(--color-warning-bg); border-color:var(--color-warning); }
.admin-maintenance-btn:focus-visible { outline:3px solid rgba(245,158,11,.25); outline-offset:2px; }
.admin-maintenance-btn:disabled { opacity:.55; cursor:wait; }
.maintenance-result-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:8px 0 14px; }
.maintenance-result-grid>div { padding:10px 6px; border:1px solid var(--app-border); border-radius:7px; background:var(--app-surface-subtle); text-align:center; }
.maintenance-result-grid strong { display:block; color:var(--color-brand-dark); font-size:var(--text-lg); }
.maintenance-result-grid span { display:block; margin-top:2px; color:var(--app-text-muted); font-size:var(--text-xs); text-transform:uppercase; letter-spacing:.06em; }
.maintenance-result-clean { color:var(--color-success); font-size:var(--text-xs); }
.maintenance-result-errors { max-height:130px; overflow:auto; padding:9px 10px; border:1px solid var(--color-danger-border); border-radius:7px; background:var(--color-danger-bg); color:var(--color-danger); font-size:var(--text-xs); text-align:left; }
.maintenance-result-errors strong { display:block; margin-bottom:4px; }
.bulk-case-action-btn { display:inline-flex; align-items:center; justify-content:center; min-height:32px; padding:6px 10px; border:1px solid var(--color-brand-lighter); border-radius:7px; background:var(--color-brand-light); color:var(--color-brand-hover); font:650 var(--text-xs)/1 var(--font); cursor:pointer; transition:background .15s,border-color .15s,color .15s; }
.bulk-case-action-btn:hover:not(:disabled) { background:var(--color-brand-lighter); border-color:var(--color-brand-lighter); color:var(--color-brand-hover); }
.bulk-case-action-btn.is-round { border-color:var(--color-warning-border); background:var(--color-warning-bg); color:var(--color-warning); }
.bulk-case-action-btn.is-round:hover:not(:disabled) { background:var(--color-warning-bg); border-color:var(--color-warning); }
.bulk-case-action-btn:focus-visible { outline:3px solid rgba(37,99,235,.22); outline-offset:2px; }
.bulk-case-action-btn:disabled { opacity:.42; cursor:not-allowed; }
.bulk-result-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:4px 0 12px; }
.bulk-result-summary>div { padding:9px; border:1px solid var(--app-border); border-radius:7px; background:var(--app-surface-subtle); text-align:center; }
.bulk-result-summary strong { display:block; color:var(--color-brand-dark); font-size:var(--text-lg); }
.bulk-result-summary span { color:var(--app-text-muted); font-size:var(--text-xs); text-transform:uppercase; letter-spacing:.05em; }
.bulk-result-summary .is-skipped { border-color:var(--color-warning-border); background:var(--color-warning-bg); }
.bulk-result-summary .is-skipped strong { color:var(--color-warning); }
.bulk-result-summary .is-error { border-color:var(--color-danger-border); background:var(--color-danger-bg); }
.bulk-result-summary .is-error strong { color:var(--color-danger); }
.bulk-result-list { max-height:240px; overflow:auto; border:1px solid var(--app-border); border-radius:7px; text-align:left; }
.bulk-result-row { display:grid; grid-template-columns:minmax(110px,.7fr) minmax(0,1.3fr); gap:10px; padding:7px 9px; color:var(--app-text-muted); font-size:var(--text-xs); }
.bulk-result-row + .bulk-result-row { border-top:1px solid var(--app-border); }
.bulk-result-row strong { display:flex; flex-direction:column; gap:1px; font-weight:650; overflow-wrap:anywhere; }
.bulk-result-row strong small { color:var(--app-text-muted); font-size:var(--text-xs); font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
.bulk-result-row.is-success strong { color:var(--color-success); }
.bulk-result-row.is-skipped { background:var(--color-warning-bg); }
.bulk-result-row.is-skipped strong { color:var(--color-warning); }
.bulk-result-row.is-skipped strong small { color:var(--color-warning); }
.bulk-result-row.is-error strong { color:var(--color-danger); }
.bulk-result-empty { padding:12px; color:var(--app-text-muted); font-size:var(--text-xs); text-align:center; }
@media (max-width:700px) { .case-defect-section-heading span:last-child { display:none; } .case-defect-summary-heading { align-items:flex-start; justify-content:flex-start; } .case-defect-summary-heading label { flex-basis:100%; } .maintenance-result-grid { grid-template-columns:repeat(2,1fr); } }

#pagination {
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--app-border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--app-surface-subtle);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
#pagination .page-info {
  margin-right: auto;
  color: var(--app-text-muted);
  font-weight: 700;
}
#pagination .page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-color: var(--app-border-strong);
  color: var(--color-brand-dark);
  font-weight: 650;
}
#pagination .page-btn:hover:not(:disabled) { border-color: var(--color-brand-lighter); background: var(--color-brand-light); color: var(--color-brand-hover); }
#pagination .page-btn.active { border-color: var(--color-brand); background: var(--color-brand); color: var(--color-surface); box-shadow: var(--shadow-card); }
#pagination .page-btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }


.case-modal-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
}
.case-header-back-btn {
  min-height: 26px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: var(--color-surface);
  font-size:var(--text-xs);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.case-header-back-btn:hover {
  background: rgba(255,255,255,.24);
  border-color: rgba(255,255,255,.42);
  transform: translateY(-1px);
}
.user-name-column,
#userAdminBody > tr > td:first-child { padding-left: 18px !important; }

@media (max-width: 680px) {
  #pagination { justify-content: center; }
  #pagination .page-info { width: 100%; margin: 0 0 3px; text-align: center; }
}

/* ── Detail grid (for dynamic JS content) ── */
.detail-grid { display: grid; grid-template-columns: 130px 1fr; gap: 0; border: 1px solid var(--color-open-border); border-radius: 8px; overflow: hidden; background: var(--color-surface); }
.detail-row { display: contents; }
.detail-row .dl { padding: 10px 14px; font-size:var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); background: var(--app-surface-subtle); border-bottom: 1px solid var(--color-open-bg); }
.detail-row .dv { padding: 10px 14px; font-size:var(--text-sm); border-bottom: 1px solid var(--color-open-bg); white-space: pre-wrap; word-break: break-word; color: var(--app-text-muted); }
.detail-row .dv.dv-html { white-space: normal; }
.preview-defect-history-item { padding: 2px 0; }
.preview-defect-history-item + .preview-defect-history-item { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--app-border); }
.detail-row:last-child .dl, .detail-row:last-child .dv { border-bottom: none; }
.preview-section { margin-top: 12px; overflow: hidden; border: 1px solid var(--app-border); border-radius: 5px; background: var(--app-surface-subtle); font-size:var(--text-xs); }
.preview-section-title { padding: 7px 8px; color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.preview-defect-history-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px; border-top: 1px solid var(--app-border); }
.preview-defect-history-main { min-width: 0; flex: 1; }
.preview-section-actions { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.preview-section-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 0 9px; border: 1px solid var(--color-brand-lighter); border-radius: 4px; background: var(--color-brand-light); color: var(--color-brand); font-size:var(--text-xs); font-weight: 700; cursor: pointer; }
.preview-section-btn:hover:not(:disabled) { background: var(--color-brand-lighter); }
.preview-section-btn.is-disabled,
.preview-section-btn:disabled { opacity: .5; cursor: default; }
.preview-attachment-list { display: grid; gap: 8px; padding: 0 8px 8px; border-top: 1px solid var(--app-border); }

/* ── Delete confirm note states ── */
.delete-confirm-note { min-height: 18px; font-size:var(--text-xs); color: var(--color-muted); }

/* ── Move request items (for dynamic JS content) ── */
.move-request-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px; border: 1px solid var(--color-open-border); border-radius: 6px; background: var(--color-surface); }
.move-request-copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.move-request-copy strong { font-size:var(--text-xs); color: var(--color-brand-dark); }
.move-request-copy span, .move-request-empty { font-size:var(--text-xs); color: var(--color-muted); }
.move-request-copy .move-req-admin-name { color: var(--color-brand); font-weight: 700; background: var(--color-brand-light); padding: 1px 5px; border-radius: 3px; }
.move-request-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── User project option (for dynamic JS content) ── */
.user-project-option { min-height: 24px; display: flex; align-items: center; gap: 7px; padding: 2px 4px; font-size:var(--text-xs); line-height: 1.25; color: var(--app-text-muted); }
.user-project-option input { width: 14px; height: 14px; accent-color: var(--color-brand); }
.user-project-empty { color: var(--color-muted); font-size:var(--text-xs); padding: 4px 0; }

/* ── User cell names (for dynamic JS content) ── */
.user-cell-name { font-weight: 600; color: var(--color-brand-dark); }
.user-cell-sub { color: var(--color-open); font-size:var(--text-xs); line-height: 1.3; margin-top: 2px; }
.user-cell-email { color: var(--color-muted); font-size:var(--text-xs); line-height: 1.3; margin-top: 1px; }

/* ── User admin table polish ── */
.user-admin-table thead { position: sticky; top: 0; z-index: 10; }
.user-admin-table thead th { position: sticky; top: 0; z-index: 12; background: var(--app-surface-subtle); }
.user-admin-table tbody tr { border-bottom: 1px solid var(--app-surface-subtle); }
.user-admin-table tbody tr:hover { background: var(--app-surface-subtle); }
.user-admin-table tbody td { min-height: 72px; vertical-align: middle; color: var(--color-brand-dark); font-size:var(--text-sm); }
.user-admin-table .user-name-column,
.user-admin-table tbody tr > td:first-child { padding-left: 18px !important; }
.user-project-cell { max-width: 290px; }
.user-project-list { display: flex; align-items: center; flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 5px; color: var(--color-brand-dark); font-size:var(--text-sm); line-height: 1.25; }
.user-project-name { display: inline-flex; max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; padding: 2px 7px; border-radius: 999px; background: var(--color-brand-light); border: 1px solid var(--color-brand-lighter); color: var(--color-brand-hover); font-size:var(--text-xs); font-weight: 700; }
.user-project-empty-state { color: var(--color-muted); font-size:var(--text-sm); font-style: italic; }
.user-manager-text { color: var(--color-brand-dark); font-size:var(--text-sm); font-weight: 500; }
.user-manager-empty { color: var(--color-muted); font-size:var(--text-sm); }

/* ── Admin migration chips (for dynamic JS content) ── */
.admin-migration-chip { display: flex; flex-direction: column; align-items: flex-start; width: 100%; gap: 2px; margin-bottom: 4px; padding: 7px 9px; border: 1px solid var(--color-open-border); border-radius: 4px; background: var(--color-surface); color: var(--color-brand-dark); cursor: grab; text-align: left; }
.admin-migration-chip.is-moved { width: auto; margin-bottom: 0; border-color: var(--color-success-border); background: var(--color-success-bg); cursor: pointer; }
.admin-migration-chip span { font-size:var(--text-xs); font-weight: 600; }
.admin-migration-chip small { color: var(--color-muted); font-size:var(--text-xs); }
.admin-migration-empty { color: var(--color-muted); font-size:var(--text-xs); padding: 6px 2px; }

/* ── User action group ── */
.user-action-group { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; }
.user-action-menu-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.user-action-trigger { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--color-open); font-size:var(--text-lg); line-height: 1; cursor: pointer; transition: background 120ms ease, border-color 120ms ease, color 120ms ease; }
.user-action-trigger:hover,
.user-action-trigger[aria-expanded="true"] { background: var(--color-open-bg); border-color: var(--app-border); color: var(--color-brand-dark); }
.user-action-menu { position: absolute; right: 0; top: calc(100% + 4px); width: 132px; padding: 4px 0; border: 1px solid var(--app-border); border-radius: 8px; background: var(--color-surface); box-shadow: var(--shadow-elevated); z-index: 60; }
.user-action-menu-item { display: block; width: 100%; padding: 8px 12px; border: 0; background: transparent; color: var(--color-brand-dark); font-size:var(--text-xs); font-weight: 500; line-height: 1.2; text-align: left; cursor: pointer; }
.user-action-menu-item:hover { background: var(--app-surface-subtle); color: var(--color-brand-dark); }
.user-action-menu-item.is-danger { color: var(--color-danger); }
.user-action-menu-item.is-danger:hover { background: var(--color-danger-bg); color: var(--color-danger); }

/* ── Move user summary ── */
.move-user-name { font-size:var(--text-sm); font-weight: 600; color: var(--color-brand-dark); }
.move-user-meta { margin-top: 2px; font-size:var(--text-xs); color: var(--color-muted); }

/* ── Notification items (for dynamic JS content) ── */
.notification-item { position: relative; width: 100%; display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; padding: 10px 11px; border: 1px solid var(--app-border); border-left: 3px solid var(--app-border-strong); border-radius: 8px; background: var(--color-surface); text-align: left; font-family: 'Inter', system-ui, sans-serif; cursor: pointer; box-shadow: var(--shadow-card); transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease; }
.notification-item:last-child { margin-bottom: 0; }
.notification-item:hover { background: var(--color-brand-light); border-color: var(--color-brand-lighter); box-shadow: var(--shadow-card); }
.notification-item.is-unread { background: var(--color-brand-light); border-color: var(--color-brand-lighter); border-left-color: var(--color-brand); box-shadow: var(--shadow-card); }
.notification-item.is-unread::after { content: ''; position: absolute; top: 12px; right: 10px; width: 7px; height: 7px; border-radius: 999px; background: var(--color-brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.notification-item-title { font-size:var(--text-xs); font-weight: 650; color: var(--color-brand-dark); }
.notification-item.is-unread .notification-item-title { padding-right: 16px; color: var(--color-brand-dark); font-weight: 800; }
.notification-item-body { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size:var(--text-xs); line-height: 1.45; color: var(--app-text-muted); }
.notification-item.is-unread .notification-item-body { color: var(--color-brand-dark); }
.notification-item-meta, .notification-empty { font-size:var(--text-xs); color: var(--app-text-muted); }
.notification-item.is-unread .notification-item-meta { color: var(--color-brand); font-weight: 700; }
.notification-empty { padding: 20px 12px; text-align: center; }

/* Defect trend calendar */
#defectTrendModal.defect-trend-modal-overlay { left: 240px !important; right: 0 !important; width: auto !important; padding: 12px 18px !important; align-items: flex-start !important; justify-content: center !important; background: rgba(15,23,42,.14) !important; }
body:has(#sidebar.collapsed) #defectTrendModal.defect-trend-modal-overlay { left: 56px !important; }
.defect-trend-modal-shell { width: min(760px, calc(100vw - 278px)); max-height: calc(100vh - 24px) !important; }
body:has(#sidebar.collapsed) .defect-trend-modal-shell { width: min(760px, calc(100vw - 94px)); }
.defect-trend-modal-head { padding: 12px 16px !important; }
.defect-trend-modal-body { padding: 14px !important; }
.defect-trend-loading,
.defect-trend-empty { padding: 34px 16px; text-align: center; color: var(--app-text-muted); font-size:var(--text-sm); }
.defect-trend-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.defect-trend-eyebrow { color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.defect-trend-title-group { min-width: 0; }
.defect-trend-month-row { margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.defect-trend-month { min-width: 108px; margin-left: 4px; color: var(--color-brand-dark); font-size:var(--text-base); font-weight: 800; }
.defect-trend-nav-button,
.defect-trend-today-button { height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--app-border); border-radius: 6px; background: var(--color-surface); color: var(--app-text-muted); font: inherit; font-size:var(--text-xs); font-weight: 700; cursor: pointer; transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease; }
.defect-trend-nav-button { width: 28px; padding: 0; font-size:var(--text-xl); line-height: 1; }
.defect-trend-today-button { padding: 0 9px; }
.defect-trend-nav-button:hover,
.defect-trend-today-button:hover { border-color: var(--color-brand-lighter); background: var(--color-brand-light); color: var(--color-brand-hover); }
.defect-trend-nav-button:focus-visible,
.defect-trend-today-button:focus-visible { outline: none; border-color: var(--color-brand); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.defect-trend-head-status { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.defect-trend-legend { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 700; }
.defect-trend-legend span { display: inline-flex; align-items: center; gap: 5px; }
.defect-trend-legend i { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }
.defect-trend-legend i.created { background: var(--color-brand); }
.defect-trend-legend i.completed { background: var(--color-success); }
.defect-trend-legend i.reopened { background: var(--color-warning); }
.defect-trend-summary { min-height: 27px; padding: 5px 8px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid; border-radius: 7px; font-size:var(--text-xs); line-height: 1.2; white-space: nowrap; }
.defect-trend-summary strong { color: var(--color-brand-dark); font-weight: 800; }
.defect-trend-summary span { padding-left: 7px; border-left: 1px solid currentColor; font-weight: 800; }
.defect-trend-summary.pending { border-color: var(--color-warning-border); background: var(--color-warning-bg); color: var(--color-warning); }
.defect-trend-summary.complete { border-color: var(--color-success-border); background: var(--color-success-bg); color: var(--color-success); }
.defect-trend-weekdays,
.defect-trend-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.defect-trend-weekdays { margin-bottom: 5px; }
.defect-trend-weekdays div { color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 800; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.defect-trend-day { min-width: 0; min-height: 56px; padding: 6px; border: 1px solid var(--app-border); border-radius: 7px; background: var(--color-surface); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease; }
.defect-trend-day:hover { transform: translateY(-1px); border-color: var(--color-brand-lighter); box-shadow: var(--shadow-card); }
.defect-trend-day:focus-visible { outline: none; border-color: var(--color-brand); box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.defect-trend-day.selected { border-color: var(--color-brand); box-shadow: inset 0 0 0 1px var(--color-brand), 0 6px 16px rgba(37,99,235,.14); }
.defect-trend-day.muted { background: var(--app-surface-subtle); color: var(--app-text-muted); }
.defect-trend-day.today { box-shadow: inset 0 0 0 2px rgba(37,99,235,.25); }
.defect-trend-day.low { background: var(--color-brand-light); border-color: var(--color-brand-lighter); }
.defect-trend-day.medium { background: var(--color-brand-light); border-color: var(--color-brand-lighter); }
.defect-trend-day.high { background: var(--color-brand-lighter); border-color: var(--color-brand-lighter); }
.defect-trend-day-num { color: var(--color-brand-dark); font-size:var(--text-xs); font-weight: 800; }
.defect-trend-day.muted .defect-trend-day-num { color: var(--app-text-muted); }
.defect-trend-counts { margin-top: 6px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.defect-trend-counts span { min-width: 18px; height: 17px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: var(--color-surface); font-size:var(--text-xs); font-weight: 800; line-height: 1; }
.defect-trend-counts .created { background: var(--color-brand); }
.defect-trend-counts .completed { background: var(--color-success); }
.defect-trend-counts .reopened { background: var(--color-warning); }
.defect-trend-pending-panel { margin-top: 12px; overflow: hidden; border: 1px solid var(--app-border); border-radius: 9px; background: var(--color-surface); }
.defect-trend-pending-head { padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--app-surface-subtle); background: var(--app-surface-subtle); }
.defect-trend-pending-head h4 { margin: 2px 0 0; color: var(--color-brand-dark); font-size:var(--text-xs); font-weight: 800; line-height: 1.2; }
.defect-trend-pending-head > span { flex: 0 0 auto; padding: 3px 7px; border: 1px solid var(--color-warning-border); border-radius: 999px; background: var(--color-warning-bg); color: var(--color-warning); font-size:var(--text-xs); font-weight: 800; }
.defect-trend-pending-list { max-height: 145px; overflow-y: auto; overscroll-behavior: contain; }
.defect-trend-pending-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(118px, auto); gap: 10px; padding: 9px 11px; border-left: 3px solid var(--color-warning); }
.defect-trend-pending-item + .defect-trend-pending-item { border-top: 1px solid var(--app-surface-subtle); }
.defect-trend-pending-main { min-width: 0; }
.defect-trend-pending-main p { margin: 3px 0 0; color: var(--color-brand-dark); font-size:var(--text-xs); line-height: 1.35; overflow-wrap: anywhere; }
.defect-trend-pending-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 800; letter-spacing: .04em; text-align: right; text-transform: uppercase; }
.defect-trend-pending-empty { padding: 18px 12px; color: var(--app-text-muted); font-size:var(--text-xs); text-align: center; }
.defect-trend-day-dialog { position: fixed; inset: 0 0 0 240px; z-index: 280; padding: 20px; align-items: center; justify-content: center; background: rgba(15,23,42,.28); }
body:has(#sidebar.collapsed) .defect-trend-day-dialog { left: 56px; }
.defect-trend-day-panel { width: min(560px, 100%); max-height: min(74vh, 620px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--app-border-strong); border-radius: 12px; background: var(--app-surface-subtle); box-shadow: var(--shadow-elevated); }
.defect-trend-day-panel-head { padding: 16px 18px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--app-border); background: var(--color-surface); }
.defect-trend-day-panel-eyebrow { color: var(--color-brand); font-size:var(--text-xs); font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.defect-trend-day-panel h4 { margin: 3px 0 0; color: var(--color-brand-dark); font-size:var(--text-lg); line-height: 1.3; font-weight: 800; }
.defect-trend-day-panel-totals { margin-top: 9px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.defect-trend-day-panel-totals > span { min-height: 23px; padding: 3px 7px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--app-border); border-radius: 6px; background: var(--app-surface-subtle); color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 700; }
.defect-trend-day-panel-totals i,
.defect-trend-activity-group-head i { width: 8px; height: 8px; display: inline-block; flex: 0 0 auto; border-radius: 50%; }
.defect-trend-day-panel-totals .created i,
.defect-trend-activity-group.created .defect-trend-activity-group-head i { background: var(--color-brand); }
.defect-trend-day-panel-totals .completed i,
.defect-trend-activity-group.completed .defect-trend-activity-group-head i { background: var(--color-success); }
.defect-trend-day-panel-totals .reopened i,
.defect-trend-activity-group.reopened .defect-trend-activity-group-head i { background: var(--color-warning); }
.defect-trend-day-panel-totals strong { color: var(--color-brand-dark); font-weight: 800; }
.defect-trend-day-panel-close { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid var(--app-border); border-radius: 7px; background: var(--color-surface); color: var(--app-text-muted); font: inherit; font-size:var(--text-sm); cursor: pointer; transition: border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease; }
.defect-trend-day-panel-close:hover { border-color: var(--color-brand-lighter); background: var(--color-brand-light); color: var(--color-brand-hover); }
.defect-trend-day-panel-close:focus-visible { outline: none; border-color: var(--color-brand); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.defect-trend-day-panel-body { min-height: 160px; padding: 14px 16px 18px; overflow-y: auto; overscroll-behavior: contain; }
.defect-trend-activity-group + .defect-trend-activity-group { margin-top: 16px; }
.defect-trend-activity-group-head { margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.defect-trend-activity-group-head h5 { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--color-brand-dark); font-size:var(--text-xs); font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.defect-trend-activity-group-head > span { min-width: 22px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--app-border); border-radius: 6px; background: var(--color-surface); color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 800; }
.defect-trend-activity-list { border: 1px solid var(--app-border); border-radius: 9px; overflow: hidden; background: var(--color-surface); }
.defect-trend-activity { padding: 10px 12px; border-left: 3px solid var(--app-border-strong); background: var(--color-surface); }
.defect-trend-activity + .defect-trend-activity { border-top: 1px solid var(--app-surface-subtle); }
.defect-trend-activity-group.created .defect-trend-activity { border-left-color: var(--color-brand); }
.defect-trend-activity-group.completed .defect-trend-activity { border-left-color: var(--color-success); }
.defect-trend-activity-group.reopened .defect-trend-activity { border-left-color: var(--color-warning); }
.defect-trend-activity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.defect-trend-activity-ids { min-width: 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.defect-trend-tc-id,
.defect-trend-defect-id { font-family: 'JetBrains Mono', monospace; font-size:var(--text-xs); font-weight: 700; overflow-wrap: anywhere; }
.defect-trend-tc-id { color: var(--color-brand-hover); }
.defect-trend-defect-id { color: var(--color-brand-dark); }
.defect-trend-defect-id::before { content: '/'; margin-right: 7px; color: var(--app-text-muted); }
.defect-trend-activity time { flex: 0 0 auto; color: var(--app-text-muted); font-family: 'JetBrains Mono', monospace; font-size:var(--text-xs); font-weight: 600; white-space: nowrap; }
.defect-trend-activity-meta { margin-top: 5px; color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.defect-trend-activity p { margin: 3px 0 0; color: var(--color-brand-dark); font-size:var(--text-xs); line-height: 1.45; overflow-wrap: anywhere; }
.defect-trend-day-empty { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 18px; border: 1px dashed var(--app-border-strong); border-radius: 9px; background: var(--color-surface); text-align: center; }
.defect-trend-day-empty strong { color: var(--color-brand-dark); font-size:var(--text-sm); }
.defect-trend-day-empty span { margin-top: 4px; color: var(--app-text-muted); font-size:var(--text-xs); }

@media (max-width: 640px) {
  #defectTrendModal.defect-trend-modal-overlay { left: 0 !important; padding: 10px !important; align-items: flex-end !important; background: rgba(15,23,42,.34) !important; }
  .defect-trend-modal-shell { width: 100%; max-height: 88vh !important; }
  .defect-trend-head { align-items: stretch; flex-direction: column; }
  .defect-trend-head-status { align-items: flex-start; }
  .defect-trend-legend { justify-content: flex-start; }
  .defect-trend-summary { white-space: normal; }
  .defect-trend-month-row { flex-wrap: wrap; }
  .defect-trend-pending-item { grid-template-columns: 1fr; }
  .defect-trend-pending-meta { align-items: flex-start; text-align: left; }
  .defect-trend-day-dialog { inset: 0; padding: 10px; align-items: flex-end; }
  .defect-trend-day-panel { max-height: 86vh; border-radius: 12px 12px 8px 8px; }
  .defect-trend-day-panel-head { padding: 14px; }
  .defect-trend-day-panel-body { padding: 12px; }
  .defect-trend-activity-head { gap: 7px; }
}

/* Time tracking */
.timer-cell { text-align: center; }
.timer-icon-wrap { position: relative; display: inline-flex; }
.timer-icon-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--color-brand-lighter); border-radius: 8px; background: var(--color-brand-light); color: var(--color-brand); cursor: pointer; transition: transform 120ms ease, background 120ms ease, border-color 120ms ease; }
.timer-icon-btn:hover { transform: translateY(-1px); background: var(--color-brand-lighter); border-color: var(--color-brand-lighter); }
.timer-icon-btn svg { width: 15px; height: 15px; }
.timer-reminder-count-badge { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--color-danger); color: var(--color-surface); font-size:var(--text-xs); font-weight: 700; line-height: 1; box-shadow: var(--shadow-card); }
.case-timer-panel { border: 1px solid var(--color-brand-lighter); border-radius: 10px; padding: 10px 12px; background: linear-gradient(135deg, var(--color-brand-light), var(--color-success-bg)); }
.case-timer-panel-label { color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.case-timer-panel-value { margin-top: 4px; display: flex; align-items: center; gap: 7px; color: var(--color-brand-dark); font-family: 'JetBrains Mono', monospace; font-size:var(--text-sm); font-weight: 700; }
.case-timer-clock { color: var(--color-brand); font-size:var(--text-base); }
.timer-modal { min-height: 360px; }
.timer-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; background: linear-gradient(135deg, var(--color-brand-dark), var(--color-brand)); color: var(--color-surface); }
.timer-modal-header h3 { margin: 3px 0 0; font-size:var(--text-lg); line-height: 1.3; font-weight: 700; }
.timer-modal-eyebrow { color: rgba(255,255,255,.68); font-size:var(--text-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.timer-modal-close { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; background: rgba(255,255,255,.13); color: var(--color-surface); cursor: pointer; }
.timer-modal-body { padding: 18px 20px; overflow-y: auto; background: var(--app-surface-subtle); flex: 1; }
.timer-loading, .timer-empty { padding: 38px 16px; text-align: center; color: var(--app-text-muted); font-size:var(--text-sm); }
.timer-round { position: relative; padding: 14px 15px 14px 44px; border: 1px solid var(--app-border); border-radius: 12px; background: var(--color-surface); box-shadow: var(--shadow-card); }
.timer-round + .timer-round { margin-top: 12px; }
.timer-round::before { content: ''; position: absolute; left: 20px; top: 20px; bottom: -13px; width: 2px; background: var(--color-brand-lighter); }
.timer-round:last-of-type::before { bottom: 20px; }
.timer-round-dot { position: absolute; left: 14px; top: 17px; width: 14px; height: 14px; border: 3px solid var(--color-brand-lighter); border-radius: 50%; background: var(--color-brand); }
.timer-round-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.timer-round-title { color: var(--color-brand-dark); font-size:var(--text-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.timer-reassigned { padding: 3px 7px; border: 1px solid var(--color-danger-border); border-radius: 999px; background: var(--color-danger-bg); color: var(--color-danger); font-size:var(--text-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.timer-entry { display: grid; grid-template-columns: minmax(170px, 1fr) auto auto; align-items: center; gap: 10px; min-height: 34px; padding: 6px 0; border-top: 1px solid var(--app-surface-subtle); }
.timer-entry:first-of-type { border-top: 0; }
.timer-person { min-width: 0; display: flex; align-items: center; gap: 7px; color: var(--color-brand-dark); font-size:var(--text-xs); }
.timer-person-icon { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: var(--color-brand-light); color: var(--color-brand); font-size:var(--text-xs); }
.timer-person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.timer-running-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.timer-reminder-controls { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.timer-reminder-select, .timer-reminder-custom { height: 26px; border: 1px solid var(--color-brand-lighter); border-radius: 7px; background: var(--color-surface); color: var(--color-brand-dark); font-size:var(--text-xs); font-weight: 700; outline: none; }
.timer-reminder-select { padding: 0 6px; min-width: 92px; }
.timer-reminder-custom { width: 78px; padding: 0 8px; }
.timer-reminder-select:focus, .timer-reminder-custom:focus { border-color: var(--color-brand-lighter); box-shadow: 0 0 0 3px rgba(96,165,250,.18); }
.timer-reminder-btn { height: 26px; padding: 0 9px; border: 1px solid var(--color-brand-lighter); border-radius: 7px; background: var(--color-brand-light); color: var(--color-brand-hover); font-size:var(--text-xs); font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease; }
.timer-reminder-btn:hover:not(:disabled) { background: var(--color-brand-lighter); border-color: var(--color-brand-lighter); }
.timer-reminder-btn:disabled { cursor: not-allowed; opacity: .7; }
.timer-reminder-btn.sent { border-color: var(--color-success-border); background: var(--color-success-bg); color: var(--color-success); }
.timer-reminder-btn.completed { border-color: var(--app-border); background: var(--app-surface-subtle); color: var(--app-text-muted); }
.timer-reminder-state { width: 100%; color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 600; text-align: right; }
.timer-duration { color: var(--app-text-muted); font-family: 'JetBrains Mono', monospace; font-size:var(--text-xs); white-space: nowrap; }
.timer-duration.running { color: var(--color-brand); font-weight: 700; }
.timer-result { min-width: 48px; text-align: right; }
.defect-timeline-responder { display: inline-flex; align-items: center; gap: 6px; margin: -2px 0 7px; padding: 4px 8px; border-radius: 999px; background: var(--color-success-bg); border: 1px solid var(--color-success-border); color: var(--color-success); font-size:var(--text-xs); font-weight: 700; }
.defect-timeline-responder span { color: var(--app-text-muted); font-weight: 700; }
.defect-timeline-responder em { font-style: normal; color: var(--color-success); }
.defect-participant-summaries { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin:-2px 0 7px; }
.defect-participant-summary { display:inline-flex; align-items:center; gap:5px; min-height:25px; padding:4px 8px; border:1px solid var(--app-border-strong); border-radius:999px; background:var(--app-surface-subtle); color:var(--color-brand-dark); font-size:var(--text-xs); line-height:1.2; }
.defect-participant-summary span { color:var(--app-text-muted); font-weight:700; }
.defect-participant-summary strong { font-weight:750; }
.defect-participant-summary em { padding-left:5px; border-left:1px solid var(--app-border-strong); color:var(--color-success); font-style:normal; font-weight:800; }
.defect-participant-summary.is-developer { border-color:var(--color-success-border); background:var(--color-success-bg); }
.defect-participant-summary.is-tester { border-color:var(--color-brand-lighter); background:var(--color-brand-light); }
.defect-timeline-entry.is-round-responder { background:var(--color-success-bg); }
.defect-round-elapsed { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; margin:0 0 7px; padding:5px 8px; border:1px solid var(--color-brand-lighter); border-radius:6px; background:var(--color-brand-light); color:var(--app-text-muted); font-size:var(--text-xs); }
.defect-round-elapsed strong { color:var(--color-brand-dark); font-variant-numeric:tabular-nums; }
.timer-total { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timer-total-item { padding: 11px 12px; border: 1px solid var(--app-border); border-radius: 10px; background: var(--color-surface); }
.timer-total-label { color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.timer-total-value { margin-top: 3px; color: var(--color-brand-dark); font-family: 'JetBrains Mono', monospace; font-size:var(--text-sm); font-weight: 700; }
.timer-modal-footer { padding: 12px 20px; display: flex; justify-content: flex-end; border-top: 1px solid var(--app-border); background: var(--color-surface); }
.timer-modal-done { padding: 7px 15px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--color-surface); color: var(--app-text-muted); font-size:var(--text-xs); font-weight: 600; cursor: pointer; }
.defect-timeline-panel { display:none; overflow:visible; opacity:0; transform:translateY(-4px); transition:opacity .18s ease, transform .18s ease, margin-top .18s ease; }
.defect-timeline-panel.is-open { display:block; max-height:none; overflow:visible; padding-right:0; opacity:1; transform:translateY(0); margin-top:7px; }
.defect-inline-timeline-card { margin: 0; padding-top: 12px; padding-bottom: 12px; box-shadow: var(--shadow-flat); background: var(--color-brand-light); }
@media (max-width:640px) {
  .defect-history-scroll { max-height:none; overflow:visible; padding-right:2px; }
  .defect-history-entry > .flex:first-child { align-items:flex-start; flex-wrap:wrap; }
  .defect-history-actions { width:100%; justify-content:flex-end; }
  .defect-timeline-panel.is-open { max-height:none; overflow:visible; padding-right:0; }
  .defect-timeline-panel .timer-round { padding:11px 10px 11px 34px; }
  .defect-timeline-panel .timer-round-dot { left:10px; }
  .defect-timeline-panel .timer-round::before { left:16px; }
  .defect-timeline-panel .timer-entry { grid-template-columns:minmax(0,1fr); align-items:start; gap:4px; }
  .defect-timeline-panel .timer-result { text-align:left; }
  .defect-timeline-panel .timer-running-actions { justify-content:flex-start; }
}
.defect-timeline-entry { background: rgba(255,255,255,.72); }
.app-toast-region { position: fixed; z-index: 2147483000; top: 76px; right: 18px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: min(390px, calc(100vw - 32px)); pointer-events: none; }
.app-toast { display: grid; grid-template-columns: 28px minmax(0,1fr) 24px; align-items: start; gap: 10px; padding: 13px 12px; border: 1px solid var(--app-border); border-left: 4px solid var(--color-brand); border-radius: 10px; background: var(--color-surface); box-shadow: var(--shadow-elevated); color: var(--color-brand-dark); opacity: 0; transform: translateX(18px); transition: opacity 180ms ease, transform 180ms ease; pointer-events: auto; }
.app-toast.is-visible { opacity: 1; transform: translateX(0); }
.app-toast.is-leaving { opacity: 0; transform: translateX(18px); }
.app-toast--success { border-left-color: var(--color-success); }.app-toast--warning { border-left-color: var(--color-warning); }.app-toast--error { border-left-color: var(--color-danger); }
.app-toast-icon { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; border-radius: 50%; background: var(--color-brand-light); color: var(--color-brand); font-weight: 800; line-height: 1; }.app-toast--success .app-toast-icon { background: var(--color-success-bg); color: var(--color-success); }.app-toast--warning .app-toast-icon { background: var(--color-warning-bg); color: var(--color-warning); }.app-toast--error .app-toast-icon { background: var(--color-danger-bg); color: var(--color-danger); }
.app-toast-copy { min-width: 0; padding-top: 1px; }.app-toast-copy strong { display: block; color: var(--color-brand-dark); font-size:var(--text-sm); line-height: 1.3; font-weight: 750; }.app-toast-copy p { margin: 3px 0 0; color: var(--app-text-muted); font-size:var(--text-xs); line-height: 1.45; overflow-wrap: anywhere; }
.app-toast-close { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--app-text-muted); font-size:var(--text-xl); line-height: 1; cursor: pointer; }.app-toast-close:hover, .app-toast-close:focus-visible { background: var(--app-surface-subtle); color: var(--color-brand-dark); outline: none; }.app-toast-close:focus-visible { box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
@media (prefers-reduced-motion: reduce) { .app-toast { transition: none; } }
@media (max-width: 640px) { .app-toast-region { top: 70px; right: 12px; width: calc(100vw - 24px); } }
.defect-timeline-entry .timer-running-actions { justify-content: flex-end; }
.defect-timeline-entry .timer-reminder-controls { max-width: 100%; }
.defect-timeline-loading,
.defect-timeline-empty { padding: 10px 12px; border: 1px dashed var(--app-border-strong); border-radius: 8px; background: var(--app-surface-subtle); color: var(--app-text-muted); font-size:var(--text-xs); }
@media (max-width: 640px) {
  .timer-entry { grid-template-columns: 1fr auto; }
  .timer-result { grid-column: 2; }
  .timer-reminder-controls { justify-content: flex-start; }
  .timer-reminder-state { text-align: left; }
  .timer-total { grid-template-columns: 1fr; }
}

/* ── Quiet enterprise interaction layer ───────────────────────
   Applies only to working surfaces: it adds feedback without changing size,
   positioning, tab-switching logic, permissions, or touch layout. */
#sidebar,
#sidebar .sidebar-logo-content,
#sidebar .sidebar-label,
#sidebar #projectList .project-label,
#sidebar .sidebar-section-text {
  transition: width var(--motion-standard) var(--motion-ease-out), opacity var(--motion-fast) var(--motion-ease-out), color var(--motion-fast) var(--motion-ease-standard);
}

#sidebar button,
#appTopbar button,
#dashboard button,
.modal button,
.notification-menu button,
.profile-menu button,
.share-access-dropdown-btn,
.share-access-floating-option,
.user-action-trigger,
.user-action-menu-item,
.action-btn,
.page-btn,
.preview-section-btn,
.case-preview-nav-btn,
.case-header-back-btn,
.app-toast-close {
  transition: background-color var(--motion-fast) var(--motion-ease-standard), border-color var(--motion-fast) var(--motion-ease-standard), color var(--motion-fast) var(--motion-ease-standard), box-shadow var(--motion-fast) var(--motion-ease-out), transform var(--motion-fast) var(--motion-ease-out), opacity var(--motion-fast) var(--motion-ease-standard);
}

/* Form controls remain crisp while making affordance and keyboard focus clear. */
#dashboard input:not([type="checkbox"]):not([type="radio"]),
#dashboard select,
#dashboard textarea,
.modal input:not([type="checkbox"]):not([type="radio"]),
.modal select,
.modal textarea,
.share-access-dropdown-btn {
  transition: border-color var(--motion-fast) var(--motion-ease-standard), background-color var(--motion-fast) var(--motion-ease-standard), box-shadow var(--motion-fast) var(--motion-ease-out), color var(--motion-fast) var(--motion-ease-standard);
}

#dashboard input:not([type="checkbox"]):not([type="radio"]):focus-visible,
#dashboard select:focus-visible,
#dashboard textarea:focus-visible,
.modal input:not([type="checkbox"]):not([type="radio"]):focus-visible,
.modal select:focus-visible,
.modal textarea:focus-visible,
#sidebar button:focus-visible,
#appTopbar button:focus-visible,
#dashboard button:focus-visible,
.modal button:focus-visible,
.notification-menu button:focus-visible,
.profile-menu button:focus-visible,
.share-access-dropdown-btn:focus-visible,
.share-access-floating-option:focus-visible,
.user-action-menu-item:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  box-shadow: var(--shadow-card);
}

/* Navigation, menus, table IDs, and rows use color/elevation instead of motion
   on touch devices. The lift is mouse-only, so it cannot stick after a tap. */
#sidebar #projectList > button,
#sidebar [data-project-id],
#sidebar nav button,
.notification-item,
.user-action-menu-item,
.share-access-floating-option,
.tc-table tbody tr,
.user-admin-table tbody tr,
.case-table-toolbar,
.stat-report-summary-card,
.defect-history-card,
.timer-round,
.app-toast {
  transition: background-color var(--motion-fast) var(--motion-ease-standard), border-color var(--motion-fast) var(--motion-ease-standard), box-shadow var(--motion-fast) var(--motion-ease-out), color var(--motion-fast) var(--motion-ease-standard), transform var(--motion-fast) var(--motion-ease-out), opacity var(--motion-standard) var(--motion-ease-out);
}

.tc-table .tc-id-link,
.tc-table a[href],
#dashboard a[href] {
  transition: color var(--motion-fast) var(--motion-ease-standard), text-decoration-color var(--motion-fast) var(--motion-ease-standard), background-color var(--motion-fast) var(--motion-ease-standard);
}

@media (hover: hover) and (pointer: fine) {
  #sidebar #projectList > button:hover,
  #sidebar [data-project-id]:hover,
  #sidebar nav button:hover {
    background-color: var(--color-brand-light);
    color: var(--color-brand-hover);
  }

  #dashboard input:not([type="checkbox"]):not([type="radio"]):hover,
  #dashboard select:hover,
  #dashboard textarea:hover,
  .modal input:not([type="checkbox"]):not([type="radio"]):hover,
  .modal select:hover,
  .modal textarea:hover {
    border-color: var(--color-brand-lighter);
  }

  #dashboard button:not(:disabled):hover,
  .modal button:not(:disabled):hover,
  #appTopbar button:not(:disabled):hover {
    transform: translateY(-1px);
  }

  /* Rows remain stationary to protect dense-table scanning; cards may lift one pixel. */
  .stat-report-summary-card:hover,
  .defect-history-card:hover,
  .timer-round:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
  }

  .tc-table tbody tr:hover .tc-id-link,
  .tc-table tbody tr:hover a[href] {
    color: var(--color-brand-hover);
    text-decoration-color: currentColor;
  }
}

/* Expanded desktop Defects: Developer Status leads; assignment and the
   handoff action share the next row without changing the drawer layout. */
@media (min-width:901px) {
  #caseModal.case-workspace-open.case-workspace-expanded #caseDefectPanel #caseDeveloperStatusGroup {
    grid-column:1;
    align-self:start;
  }
  #caseModal.case-workspace-open.case-workspace-expanded #caseDefectPanel #caseAssignmentHandoffCard {
    display:flex !important;
    flex-direction:column !important;
    gap:9px !important;
    grid-column:1 / -1;
  }
  #caseModal.case-workspace-open.case-workspace-expanded #caseAssignmentHandoffCard #caseAssignedToGroup,
  #caseModal.case-workspace-open.case-workspace-expanded #caseAssignmentHandoffCard #caseAssignmentHandoffGroup,
  #caseModal.case-workspace-open.case-workspace-expanded #caseAssignmentHandoffCard #assignmentHandoffHelp {
    grid-column:auto;
    grid-row:auto;
    width:100%;
  }
  #caseModal.case-workspace-open.case-workspace-expanded #caseDefectPanel #caseAssignedDateGroup {
    grid-column:1;
    align-self:start;
  }
}

/* Defects owns these optional whole rows; hidden rows must not leave a gap. */
#caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section .case-field-reserved.is-reserved-hidden,
#caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section [style*="display:none"],
#caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section [style*="display: none"],
#caseModal #caseDefectPanel #caseDeveloperRemarksGroup.case-field-reserved.is-reserved-hidden,
#caseModal #caseDefectPanel #caseTimerPanel.case-field-reserved.is-reserved-hidden,
#caseModal #caseDefectPanel #testerReassignPanel.case-field-reserved.is-reserved-hidden {
  display:none !important;
  min-height:0 !important;
  height:0 !important;
  margin:0 !important;
  padding:0 !important;
}

/* Report accessibility summaries are intentionally non-visual; scope this
   defensively so injected report text cannot escape a chart canvas. */
#statisticalReportModal [data-report-key="people-summary"].sr-only,
#statisticalReportModal [data-report-key="state-summary"].sr-only,
body[data-user-role="coe_vc"] #dashboard [data-report-key="people-summary"].sr-only,
body[data-user-role="coe_vc"] #dashboard [data-report-key="state-summary"].sr-only {
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  margin:-1px !important;
  padding:0 !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}

/* Inline COE report follows the same single-scroll chart rule as the modal. */
@media (min-width:641px) {
  body[data-user-role="coe_vc"] #dashboard .stat-report-chart-panel:has(#coeStatProjectBarChart) {
    height:230px;
    min-height:230px;
    overflow-y:visible;
  }
  body[data-user-role="coe_vc"] #dashboard .stat-report-chart-panel:has(#coeStatProjectBarChart) .stat-report-chart-canvas-wrap {
    height:190px !important;
    min-height:0 !important;
  }
}

/* Statistical report: the modal body owns the one desktop scroll path. */
@media (min-width:641px) {
  #statisticalReportModal .statistical-report-modal-body {
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  #statisticalReportModal .stat-report-chart-panel:has(#statProjectBarChart),
  #statisticalReportModal .stat-report-chart-panel:has(#coeStatProjectBarChart) {
    height:220px;
    min-height:220px;
    overflow-y:visible;
  }
  #statisticalReportModal .stat-report-chart-panel:has(#statProjectBarChart) .stat-report-chart-canvas-wrap,
  #statisticalReportModal .stat-report-chart-panel:has(#coeStatProjectBarChart) .stat-report-chart-canvas-wrap {
    height:176px !important;
    min-height:0 !important;
  }
}

/* Press feedback is small and never animated long enough to queue clicks. */
#sidebar button:not(:disabled):active,
#appTopbar button:not(:disabled):active,
#dashboard button:not(:disabled):active,
.modal button:not(:disabled):active,
.notification-menu button:not(:disabled):active,
.profile-menu button:not(:disabled):active {
  transform: translateY(0) scale(.98);
}

/* Workspace tabs deliberately never move: switching must stay visually anchored
   even during rapid Preview / Details / Defect navigation. */
.case-form-tab,
.case-form-tab:hover,
.case-form-tab:active,
.case-header-state-select,
.case-header-state-select:hover,
.case-header-state-select:active {
  transform: none !important;
}

/* Menus and overlays receive a compact entrance without moving workspace tabs. */
.notification-menu:not(.hidden),
.profile-menu:not(.hidden),
.user-action-menu,
.share-access-floating-menu.is-open {
  animation: app-menu-enter var(--motion-fast) var(--motion-ease-out) both;
}

.modal-overlay.open:not(#caseModal) > .modal,
#caseModal.case-workspace-open > .modal {
  animation: app-surface-enter var(--motion-standard) var(--motion-ease-out) both;
}


@keyframes app-menu-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes app-surface-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Only purpose-built loading surfaces may pulse; aria-busy alone is semantic and
   must not animate a whole form, table, dialog, or live region. */
.app-loading-surface[aria-busy="true"],
.app-skeleton[aria-busy="true"] { animation: app-loading-pulse 1.2s var(--motion-ease-standard) infinite alternate; }
@keyframes app-loading-pulse { from { opacity: .72; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── Production shell cohesion ───────────────────────────────
   Compact, dependable workspace rules for shared application surfaces. */
body { background: var(--app-canvas); }
#appTopbar {
  min-height: 62px;
  background: var(--app-surface) !important;
  border-color: var(--app-border) !important;
}
#sidebar { background: var(--app-surface); border-color: var(--app-border) !important; }
.case-table-toolbar { background: var(--app-surface); border-color: var(--app-border) !important; }
.case-table-scroll,
.stat-report-table-panel,
.stat-report-chart-panel,
#caseModal.case-workspace-open > .modal { border-color: var(--app-border) !important; }
.case-table-scroll { scrollbar-gutter: stable both-edges; }
.case-table-scroll::-webkit-scrollbar,
.stat-report-table-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.case-table-scroll::-webkit-scrollbar-thumb,
.stat-report-table-scroll::-webkit-scrollbar-thumb { background: var(--app-border-strong); border: 2px solid var(--app-surface); border-radius: 8px; }

/* Controls share a predictable desktop footprint while remaining finger-safe on small screens. */
#dashboard input:not([type="checkbox"]):not([type="radio"]),
#dashboard select,
#dashboard button,
.modal input:not([type="checkbox"]):not([type="radio"]),
.modal select,
.modal button { min-height: var(--app-control-height); }
#dashboard select,
.modal select { border-radius: var(--app-radius-control); border-color: var(--app-border); }
#dashboard input:not([type="checkbox"]):not([type="radio"]),
.modal input:not([type="checkbox"]):not([type="radio"]),
#dashboard textarea,
.modal textarea { border-color: var(--app-border); border-radius: var(--app-radius-control); }
:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--app-focus) !important;
  outline-offset: 2px;
}

/* Table rows are numerous: color feedback only, never layout/compositing transitions. */
.tc-table tbody tr,
.tc-table tbody tr td,
.user-admin-table tbody tr,
.user-admin-table tbody tr td { transition: background-color var(--motion-instant) var(--motion-ease-standard), color var(--motion-instant) var(--motion-ease-standard); }
.tc-table tbody tr:hover { transform: none !important; box-shadow: var(--shadow-flat); }

/* Small screens keep primary account and notification controls visible, while optional header actions compact. */
@media (max-width: 900px) {
  #appTopbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  #appTopbar > button { display: inline-flex !important; flex: 0 0 auto; }
  #topbarBreadcrumb { font-size:var(--text-xs); }
  .project-title { max-width: min(40vw, 280px); font-size:var(--text-xl); }
  #appTopbar #statisticalReportBtn,
  #appTopbar #defectTrendBtn,
  #appTopbar #helpdeskBtn { width: 34px; min-width: 34px; padding-left: 0; padding-right: 0; overflow: hidden; white-space: nowrap; color: transparent; }
  #appTopbar #statisticalReportBtn::before { content: 'Report'; color: var(--app-text-muted); font-size:var(--text-xs); }
  #appTopbar #defectTrendBtn::before { content: 'Timeline'; color: var(--app-text-muted); font-size:var(--text-xs); }
  #appTopbar #helpdeskBtn::before { content: '?'; color: var(--color-brand); font-size:var(--text-base); font-weight: 800; }
  #profileMenuButton { padding-left: 5px !important; padding-right: 5px !important; }
  #profileMenuButton > .flex { display: none; }
  #profileMenuButton > span:last-child { display: none; }
  .case-table-toolbar { padding: 10px 12px; }
  .case-table-toolbar-actions { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .case-table-toolbar-search { order: 2; flex: 1 1 180px; }
  .case-table-navigation-region { padding: 0 4px; }
  .case-scroll-jump { display: none; }
  .stat-report-table-scroll { -webkit-overflow-scrolling: touch; }
}
@media (max-width: 640px) {
  :root { --app-control-height: 40px; --app-topbar-mobile-height: 56px; }
  #appTopbar { min-height: var(--app-topbar-mobile-height); height: var(--app-topbar-mobile-height); }
  #topbarBreadcrumb { display: none; }
  .project-title { max-width: 42vw; font-size:var(--text-lg); }
  #notificationBell { min-width: 36px; min-height: 36px; }
  .notification-menu { position: fixed !important; top: calc(env(safe-area-inset-top, 0px) + var(--app-topbar-mobile-height)) !important; right: 12px !important; width: min(20rem, calc(100vw - 24px)) !important; max-height: calc(100dvh - 74px); }
  .notification-menu .notification-list { max-height: calc(100dvh - 140px) !important; }
  .notification-popover-wrap::after { display: none !important; }
  .case-table-toolbar-title { width: 100%; }
}

/* ── Project dashboard density ───────────────────────────────
   The dashboard is the working surface: compact its hierarchy without changing
   the global shell, case workspace, report surfaces, or table behaviour. */
body:not([data-user-role="coe_vc"]) #dashboard {
  gap: 12px !important;
  padding: 14px 16px !important;
}

body:not([data-user-role="coe_vc"]) #dashboard #statsBar {
  min-height: 84px;
  border-color: var(--app-border);
}
body:not([data-user-role="coe_vc"]) #dashboard .stat-item {
  min-height: 82px;
  padding: 13px 12px;
  gap: 2px;
}
body:not([data-user-role="coe_vc"]) #dashboard .stat-num { font-size:var(--text-2xl); }
body:not([data-user-role="coe_vc"]) #dashboard .stat-lbl { margin-top: 2px; }
body:not([data-user-role="coe_vc"]) #dashboard .stat-pass-rate { margin-top: 1px; }

body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar {
  grid-template-columns: minmax(160px, max-content) minmax(0, 1fr) minmax(190px, 200px);
  column-gap: 10px;
  row-gap: 10px;
  padding: 10px 16px !important;
}
body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar-actions { gap: 8px; }
body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar-search { width: min(100%, 200px) !important; }

body:not([data-user-role="coe_vc"]) #dashboard .assignment-summary-bar {
  min-height: 30px;
  gap: 7px;
  padding: 5px 16px;
  font-size:var(--text-xs);
}
body:not([data-user-role="coe_vc"]) #dashboard .assignment-badge { padding: 1px 7px; }

body:not([data-user-role="coe_vc"]) #dashboard .case-table-navigation-region { padding-right: 16px; padding-left: 16px; }
body:not([data-user-role="coe_vc"]) #dashboard .tc-table thead th { padding-top: 8px; padding-bottom: 8px; }
body:not([data-user-role="coe_vc"]) #dashboard .tc-table tbody tr { height: 36px; }
body:not([data-user-role="coe_vc"]) #dashboard .tc-table tbody td { padding: 6px 12px; }

body:not([data-user-role="coe_vc"]) #dashboard #pagination {
  min-height: 46px;
  padding: 8px 14px;
}
body:not([data-user-role="coe_vc"]) #dashboard #pagination .page-btn {
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0 8px;
}

@media (max-width: 980px) {
  body:not([data-user-role="coe_vc"]) #dashboard { padding: 14px !important; }
  body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar {
    grid-template-columns: minmax(160px, 1fr) minmax(190px, 220px);
    padding: 10px 14px !important;
  }
  body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
  body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar-search {
    grid-column: 2;
    grid-row: 1;
  }
}
@media (max-width: 640px) {
  body:not([data-user-role="coe_vc"]) #dashboard { gap: 10px !important; padding: 12px !important; }
  body:not([data-user-role="coe_vc"]) #dashboard #statsBar { min-height: 82px; overflow-x: auto; }
  body:not([data-user-role="coe_vc"]) #dashboard .stat-item { min-width: 108px; }
  body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar {
    grid-template-columns: 1fr;
    padding: 10px 12px !important;
  }
  body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar-actions,
  body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar-search {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }
  body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar-actions { justify-content: flex-start; }
  body:not([data-user-role="coe_vc"]) #dashboard .case-table-toolbar-search { width: 100% !important; }
  body:not([data-user-role="coe_vc"]) #dashboard .assignment-summary-bar { padding-right: 12px; padding-left: 12px; }
  body:not([data-user-role="coe_vc"]) #dashboard .case-table-navigation-region { padding-right: 4px; padding-left: 4px; }
  body:not([data-user-role="coe_vc"]) #dashboard #pagination { min-height: 48px; }
  body:not([data-user-role="coe_vc"]) #dashboard #pagination .page-btn { min-width: 36px; min-height: 36px; height: 36px; }
}

/* Keep the shared contrast layer last in the cascade; component rules above are
   intentionally more local but should inherit this consistent neutral finish. */
#appTopbar { box-shadow: var(--shadow-card); }
#sidebar { box-shadow: var(--shadow-card); }
.case-table-toolbar { border: 1px solid var(--app-border) !important; border-bottom-color: var(--app-border-strong) !important; border-radius: var(--app-radius-surface) var(--app-radius-surface) 0 0; }
.assignment-summary-bar { border-right: 1px solid var(--app-border); border-left: 1px solid var(--app-border); color: var(--app-text-muted); background: var(--color-brand-light); }
.tc-table thead th { background: var(--color-brand-light) !important; border-bottom-color: var(--app-border-strong) !important; color: var(--app-text-muted) !important; font-weight: 750 !important; }
.tc-table tbody td { border-bottom-color: var(--app-border); color: var(--color-brand-dark); }
.tc-table tbody tr:hover td { background: var(--color-brand-light); }
.tc-table tbody tr:hover .tc-sticky-index,
.tc-table tbody tr:hover .tc-sticky-id { background: var(--color-brand-light); }
#pagination { border-color: var(--app-border) !important; background: rgba(255,255,255,.78); }
.modal:not(.timer-modal) { border-color: var(--app-border-strong) !important; box-shadow: var(--shadow-card); }
.notification-menu { border-color: var(--app-border-strong) !important; background: var(--color-surface) !important; box-shadow: var(--shadow-elevated); }
.notification-menu > div:first-child,
.notification-list { background: var(--color-brand-light) !important; }

/* Active rails are deliberately applied only to the state classes the app
   already owns; this makes selection clear without altering interaction. */
#projectList .active-project { color: var(--color-brand-dark) !important; font-weight: 700; background: var(--color-brand-light) !important; box-shadow: inset 3px 0 0 var(--color-brand), inset 0 1px 0 rgba(255,255,255,.72); }
#projectList .active-project::after { background: var(--color-brand); }
.case-form-tab.is-active { position: relative; color: var(--color-brand-dark); font-weight: 800; box-shadow: inset 0 -2px 0 var(--color-brand-dark), 0 1px 3px rgba(15,23,42,.16); }
.case-form-tab.is-active::after { content: ''; position: absolute; top: 7px; bottom: 7px; left: 0; width: 2px; border-radius: 0 2px 2px 0; background: var(--color-brand); }
.notification-item { border-left-width: 3px; }
.notification-item.is-unread { background: var(--color-brand-light); border-left-color: var(--color-brand); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 2px 8px rgba(37,99,235,.11); }
.notification-item.is-unread .notification-item-title { color: var(--color-brand-dark); }
#statsBar { border-color: var(--app-border-strong) !important; }
#statsBar .stat-item { background: var(--color-surface); }
#statsBar .stat-item + .stat-item { border-left-color: var(--app-border); }
#statsBar .stat-num { color: var(--color-brand-dark); font-weight: 800; }
#statsBar .stat-lbl { color: var(--app-text-muted); font-weight: 750; letter-spacing: .075em; }
.modal .case-defect-section-heading,
.modal .form-section-heading { border-left: 3px solid var(--color-brand); }
#appTopbar { border-bottom-color: var(--app-border-strong) !important; box-shadow: var(--shadow-card); }
#sidebar { border-right-color: var(--app-border-strong) !important; box-shadow: var(--shadow-card); }
.notification-menu,
.profile-menu { box-shadow: var(--shadow-elevated); }
#caseModal.case-workspace-open > .modal { box-shadow: var(--shadow-card); }

/* Details and defect rounds use a calm, nearly-flat white workspace. */
#caseModal.case-workspace-open:not(.case-workspace-preview-active) > .modal {
  background: var(--color-surface) !important;
  box-shadow: 0 0 0 1px rgba(15,23,42,.04), 0 6px 20px rgba(15,23,42,.08) !important;
}
#caseModal.case-workspace-open:not(.case-workspace-preview-active) > .modal > .case-modal-body,
#caseModal.case-workspace-open:not(.case-workspace-preview-active) #caseDetailsPanel,
#caseModal.case-workspace-open:not(.case-workspace-preview-active) #caseDefectPanel {
  background: var(--color-surface);
}
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:2px 0 1px;
  padding:7px 9px;
  border-top:1px solid var(--color-brand-lighter);
  border-bottom:1px solid var(--app-border);
  background:var(--color-brand-light);
  color:var(--color-brand-dark);
  font-size:var(--text-xs);
  font-weight:800;
  letter-spacing:.09em;
  line-height:1.2;
  text-transform:uppercase;
}
#caseModal.case-workspace-open .form-section-heading span:last-child {
  color:var(--app-text-muted);
  font-size:var(--text-xs);
  font-weight:650;
  letter-spacing:.02em;
  text-transform:none;
}
.defect-history-round-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.defect-history-round-label {
  color: var(--color-brand-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.defect-history-round-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .01em;
  line-height: 1.2;
}
.defect-history-round-status.is-completed {
  border: 1px solid var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success);
}
.defect-history-round-status.is-responded {
  border: 1px solid var(--color-brand-lighter);
  background: var(--color-brand-light);
  color: var(--color-brand-hover, var(--color-brand));
}
.defect-history-round-status.is-awaiting {
  border: 1px solid var(--color-warning-border);
  background: var(--color-warning-bg);
  color: var(--color-warning);
}
.defect-history-entry > .text-gray-600 {
  margin-top: 6px;
  color: var(--app-text-muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}
.defect-history-entry > .mt-1.text-gray-500 {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--app-border, var(--app-surface-subtle));
  color: var(--app-text-muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}
@media (max-width:640px) {
  #caseModal.case-workspace-open .case-modal-sticky-header { min-height:0; padding:11px 14px !important; }
  #caseModal.case-workspace-open .form-section-heading { align-items:flex-start; flex-direction:column; gap:3px; }
  .case-modal-round-chip { max-width:100%; }
}

/* Final expanded-workspace layout guard. Keep this late so generic modal/body
   utilities cannot leave the rail hidden while the horizontal tabs are gone. */
@media (min-width:901px) {
  #caseModal.case-workspace-open.case-workspace-expanded .case-modal-sticky-header {
    display:flex !important;
    width:100% !important;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-modal-header-identity {
    flex:1 1 auto !important;
    width:auto !important;
    max-width:none !important;
    transform:none !important;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-modal-header-actions {
    margin-left:auto !important;
  }
  #caseModal.case-workspace-open.case-workspace-expanded > .modal > .case-modal-body {
    display:grid !important;
    grid-template-columns:180px minmax(0,1fr) !important;
    gap:16px !important;
    padding:16px 10px 16px 16px !important;
    overflow:hidden !important;
  }
  #caseModal.case-workspace-open.case-workspace-expanded #caseExpandedRail { display:block !important; }
  #caseModal.case-workspace-open.case-workspace-expanded #caseFormFields {
    display:block;
    width:100%;
    max-width:none;
    height:100%;
    min-height:0;
    margin:0;
    overflow-y:auto;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-form-tab-panel:not([hidden]) { display:grid !important; }
}
@media (max-width:900px) {
  #caseExpandedRail { display:none !important; }
}

/* ── Dark-theme component compatibility ─────────────────────────────── */
/* Tailwind utilities are used in the server-rendered shell.  These token-based
   overrides keep those shared surfaces readable without changing structure. */
[data-theme="dark"] body {
  background: var(--app-canvas) !important;
  color: var(--color-brand-dark);
}
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .bg-gray-100,
[data-theme="dark"] .bg-slate-50 {
  background-color: var(--app-surface) !important;
}
[data-theme="dark"] .bg-blue-50,
[data-theme="dark"] .bg-indigo-50,
[data-theme="dark"] .bg-cyan-50 { background-color: var(--color-info-bg) !important; }
[data-theme="dark"] .bg-green-50 { background-color: var(--color-success-bg) !important; }
[data-theme="dark"] .bg-red-50 { background-color: var(--color-danger-bg) !important; }
[data-theme="dark"] .bg-amber-50,
[data-theme="dark"] .bg-orange-50 { background-color: var(--color-warning-bg) !important; }
[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300,
[data-theme="dark"] .border-slate-100,
[data-theme="dark"] .border-slate-200 {
  border-color: var(--app-border) !important;
}
[data-theme="dark"] .border-blue-100,
[data-theme="dark"] .border-cyan-100 { border-color: var(--color-info-border) !important; }
[data-theme="dark"] .border-green-100 { border-color: var(--color-success-border) !important; }
[data-theme="dark"] .border-red-100 { border-color: var(--color-danger-border) !important; }
[data-theme="dark"] .border-amber-100,
[data-theme="dark"] .border-orange-100 { border-color: var(--color-warning-border) !important; }
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-slate-900,
[data-theme="dark"] .text-slate-800,
[data-theme="dark"] .text-slate-700 {
  color: var(--color-brand-dark) !important;
}
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-gray-400,
[data-theme="dark"] .text-slate-600,
[data-theme="dark"] .text-slate-500,
[data-theme="dark"] .text-slate-400 {
  color: var(--app-text-muted) !important;
}
[data-theme="dark"] .text-blue-500,
[data-theme="dark"] .text-blue-600,
[data-theme="dark"] .text-blue-700,
[data-theme="dark"] .text-cyan-500,
[data-theme="dark"] .text-cyan-600,
[data-theme="dark"] .text-cyan-700,
[data-theme="dark"] .text-indigo-500,
[data-theme="dark"] .text-indigo-600,
[data-theme="dark"] .text-indigo-700 { color: var(--color-info) !important; }
[data-theme="dark"] .text-green-500,
[data-theme="dark"] .text-green-600,
[data-theme="dark"] .text-green-700 { color: var(--color-success) !important; }
[data-theme="dark"] .text-red-500,
[data-theme="dark"] .text-red-600,
[data-theme="dark"] .text-red-700 { color: var(--color-danger) !important; }
[data-theme="dark"] .text-amber-500,
[data-theme="dark"] .text-amber-600,
[data-theme="dark"] .text-amber-700,
[data-theme="dark"] .text-orange-500,
[data-theme="dark"] .text-orange-600,
[data-theme="dark"] .text-orange-700 { color: var(--color-warning) !important; }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  color: var(--color-brand-dark) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--color-muted) !important; }
[data-theme="dark"] .hover\:bg-gray-50:hover,
[data-theme="dark"] .hover\:bg-gray-100:hover { background-color: var(--app-surface-subtle) !important; }
[data-theme="dark"] .hover\:text-gray-700:hover,
[data-theme="dark"] .hover\:text-gray-900:hover { color: var(--color-brand-dark) !important; }
[data-theme="dark"] .notification-menu,
[data-theme="dark"] .profile-menu,
[data-theme="dark"] .modal > .modal-content,
[data-theme="dark"] .modal .modal-content { background: var(--app-surface) !important; border-color: var(--app-border) !important; }
[data-theme="dark"] .swal2-popup {
  background: var(--app-surface) !important;
  color: var(--color-brand-dark) !important;
  border: 1px solid var(--app-border) !important;
}
[data-theme="dark"] .swal2-title,
[data-theme="dark"] .swal2-html-container { color: var(--color-brand-dark) !important; }
[data-theme="dark"] .swal2-input,
[data-theme="dark"] .swal2-textarea,
[data-theme="dark"] .swal2-select { background: var(--app-surface-subtle) !important; color: var(--color-brand-dark) !important; border-color: var(--app-border) !important; }
[data-theme="dark"] .swal2-close { color: var(--app-text-muted) !important; }
[data-theme="dark"] .swal2-backdrop-show { background: rgba(0, 0, 0, .56) !important; }


/* Expanded Defects refinement: optional controls should never become a blank
   reservation between the round helper and the actionable assignment fields. */
@media (min-width:901px) {
  #caseModal.case-workspace-open.case-workspace-expanded > .modal > .case-modal-body,
  #caseModal.case-workspace-open.case-workspace-expanded #caseFormFields {
    background:var(--app-canvas) !important;
  }
  #caseModal.case-workspace-open.case-workspace-expanded #caseExpandedRail {
    background:var(--app-surface-subtle) !important;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section {
    background:var(--app-surface);
  }
  #caseModal.case-workspace-open.case-workspace-expanded #caseDefectPanel .case-field-reserved.is-reserved-hidden {
    display:none !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
  }
}

/* Keep every expanded section's cards beneath its own opaque sticky title. */
@media (min-width:901px) {
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section {
    position:relative;
    isolation:isolate;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section-heading {
    background:var(--app-surface) !important;
  }
  #caseModal.case-workspace-open.case-workspace-expanded .case-expanded-section > :not(.case-expanded-section-heading) {
    position:relative;
    z-index:0;
  }
}

/* Keep dark shell tokens authoritative after the legacy second :root block. */
[data-theme="dark"] {
  --app-surface: rgb(28, 28, 28);
  --app-surface-subtle: rgb(38, 38, 38);
  --app-canvas: rgb(18, 18, 18);
  --app-border: rgba(255, 255, 255, .16);
  --app-border-strong: rgba(255, 255, 255, .28);
  --app-text-muted: #c9d5e3;
}
[data-theme="dark"] #pagination { background: var(--app-surface) !important; }

/* Preview is a focused drawer: retain its geometry, but keep every owned
   surface opaque and dark instead of inheriting the light workspace header. */
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active > .modal,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active > .modal > .case-modal-body,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active #caseFormFields,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-preview-tab-panel,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .preview-submitted-sheet,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-preview-metadata-item,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-preview-assignment-item,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-preview-empty-state,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-modal-save-footer {
  background: var(--app-surface) !important;
}
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-modal-sticky-header {
  background: var(--app-surface) !important;
  border-bottom: 1px solid var(--app-border-strong) !important;
}
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active #caseModalTitle,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active #caseHeaderState,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-modal-sticky-header > button,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-workspace-expand-btn {
  color: var(--color-brand-dark) !important;
}
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active #caseModalSubtitle,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active #caseModalEyebrow,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-header-state-label {
  color: var(--app-text-muted) !important;
}
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-header-state-control,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-form-tabs,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-modal-sticky-header > button,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-workspace-expand-btn {
  background: var(--app-surface-subtle) !important;
  border-color: var(--app-border) !important;
}
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active #caseHeaderState option {
  background: var(--app-surface);
  color: var(--color-brand-dark);
}
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-form-tab { color: var(--app-text-muted); }
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-form-tab.is-active,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-preview-nav-btn,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-modal-save-footer button[onclick="closeModal('caseModal')"] {
  background: var(--app-surface-subtle) !important;
  border-color: var(--app-border) !important;
  color: var(--color-brand-dark) !important;
}
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-preview-nav-position,
[data-theme="dark"] #caseModal.case-workspace-open.case-workspace-preview-active .case-normal-save-help {
  color: var(--app-text-muted) !important;
}
[data-theme="dark"] .tc-table tbody tr.is-case-workspace-active > td,
[data-theme="dark"] .tc-table tbody tr.is-case-workspace-active > .tc-sticky-index,
[data-theme="dark"] .tc-table tbody tr.is-case-workspace-active > .tc-id-cell {
  background: var(--color-brand-light) !important;
}
[data-theme="dark"] .tc-table tbody tr.is-case-workspace-active > :first-child {
  box-shadow: inset 5px 0 0 var(--color-brand);
}

/* Light workspace polish: preserve structure while letting surfaces, rather
   than outlines, establish hierarchy. Dark-theme selectors above stay intact. */
html:not([data-theme="dark"]) #projectList .active-project {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
  box-shadow: inset 3px 0 0 var(--color-brand) !important;
}
html:not([data-theme="dark"]) #statsBar {
  border-color: transparent !important;
  box-shadow: var(--shadow-card);
}
html:not([data-theme="dark"]) #statsBar .stat-item + .stat-item {
  border-left-color: var(--app-border) !important;
}
html:not([data-theme="dark"]) #appTopbar::after {
  background: var(--app-border) !important;
}
html:not([data-theme="dark"]) .case-table-toolbar {
  border-color: transparent !important;
  border-bottom-color: var(--app-border) !important;
  box-shadow: var(--shadow-card);
}
html:not([data-theme="dark"]) .assignment-summary-bar {
  border-right-color: transparent;
  border-left-color: transparent;
  background: var(--app-surface-subtle);
}
html:not([data-theme="dark"]) .tc-table thead th {
  background: var(--app-surface-subtle) !important;
  border-bottom-color: var(--app-border) !important;
}

/* Late light-only divider cleanup.  Borders remain structural, but use the
   quiet cool-gray token so the workspace never resolves to harsh black lines. */
html:not([data-theme="dark"]) #appTopbar,
html:not([data-theme="dark"]) #sidebar,
html:not([data-theme="dark"]) #appTopbar::after,
html:not([data-theme="dark"]) #statsBar,
html:not([data-theme="dark"]) .case-table-toolbar,
html:not([data-theme="dark"]) .assignment-summary-bar,
html:not([data-theme="dark"]) .case-table-scroll {
  border-color: var(--app-border) !important;
}
html:not([data-theme="dark"]) #statsBar .stat-item + .stat-item {
  border-left-color: var(--app-border) !important;
}
html:not([data-theme="dark"]) .case-table-toolbar {
  border-bottom-color: var(--app-border) !important;
}
html:not([data-theme="dark"]) .assignment-summary-bar {
  border-right-color: var(--app-border) !important;
  border-left-color: var(--app-border) !important;
}
html:not([data-theme="dark"]) .tc-table thead th,
html:not([data-theme="dark"]) .tc-table thead .tc-sticky-index,
html:not([data-theme="dark"]) .tc-table thead .tc-sticky-id,
html:not([data-theme="dark"]) .tc-table tbody td {
  border-color: var(--app-border) !important;
}
html:not([data-theme="dark"]) .tc-table .tc-sticky-index,
html:not([data-theme="dark"]) .tc-table .tc-sticky-id {
  box-shadow: inset -1px 0 0 var(--app-border) !important;
}
html:not([data-theme="dark"]) .tc-table tbody tr.is-case-workspace-active > :first-child {
  box-shadow: inset 5px 0 0 var(--color-brand), inset -1px 0 0 var(--app-border) !important;
}
html:not([data-theme="dark"]) #caseModal.case-workspace-open.case-workspace-preview-active > .modal {
  box-shadow: 0 0 0 1px var(--app-border), var(--shadow-card) !important;
}
html:not([data-theme="dark"]) #caseModal.case-workspace-open.case-workspace-preview-active .case-modal-sticky-header,
html:not([data-theme="dark"]) #caseModal.case-workspace-open.case-workspace-preview-active .case-modal-save-footer {
  border-color: var(--app-border) !important;
}

/* ── Rich Modern SaaS Dashboard Styling (Notion / Mediterranean Ocean Theme) ── */
#dashboard {
  background-color: #f8fafc !important;
}

#statsBar {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
  overflow: hidden !important;
  display: flex !important;
}

/* Stat Item 1: Total */
#statsBar .stat-item:nth-child(1) {
  border-top: 3.5px solid #0369a1 !important;
  background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%) !important;
}
#statsBar .stat-item:nth-child(1) .stat-num {
  color: #0b2545 !important;
  font-weight: 800 !important;
}
#statsBar .stat-item:nth-child(1) .stat-lbl {
  color: #0369a1 !important;
  font-weight: 750 !important;
  letter-spacing: 0.06em !important;
}

/* Stat Item 2: Pass */
#statsBar .stat-item:nth-child(2) {
  border-top: 3.5px solid #16a34a !important;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%) !important;
}
#statsBar .stat-item:nth-child(2) .stat-num {
  color: #15803d !important;
  font-weight: 800 !important;
}
#statsBar .stat-item:nth-child(2) .stat-lbl {
  color: #16a34a !important;
  font-weight: 750 !important;
  letter-spacing: 0.06em !important;
}

/* Stat Item 3: Fail */
#statsBar .stat-item:nth-child(3) {
  border-top: 3.5px solid #dc2626 !important;
  background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%) !important;
}
#statsBar .stat-item:nth-child(3) .stat-num {
  color: #b91c1c !important;
  font-weight: 800 !important;
}
#statsBar .stat-item:nth-child(3) .stat-lbl {
  color: #dc2626 !important;
  font-weight: 750 !important;
  letter-spacing: 0.06em !important;
}

/* Stat Item 4: Pending */
#statsBar .stat-item:nth-child(4) {
  border-top: 3.5px solid #f59e0b !important;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%) !important;
}
#statsBar .stat-item:nth-child(4) .stat-num {
  color: #b45309 !important;
  font-weight: 800 !important;
}
#statsBar .stat-item:nth-child(4) .stat-lbl {
  color: #d97706 !important;
  font-weight: 750 !important;
  letter-spacing: 0.06em !important;
}

/* Stat Item 5: Pass Rate */
#statsBar .stat-item:nth-child(5) {
  border-top: 3.5px solid #007fff !important;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%) !important;
}
#statsBar .stat-item:nth-child(5) .stat-num {
  color: #0284c7 !important;
  font-weight: 800 !important;
}
#statsBar .stat-item:nth-child(5) .stat-lbl {
  color: #0284c7 !important;
  font-weight: 750 !important;
  letter-spacing: 0.06em !important;
}
#statsBar .stat-pass-bar {
  background: #e2e8f0 !important;
  height: 6px !important;
  border-radius: 999px !important;
}
#statsBar .stat-pass-fill {
  background: linear-gradient(90deg, #0284c7, #007fff) !important;
  border-radius: 999px !important;
}

/* Zero-count visibility refinement (never washed-out) */
.stat-item.is-zero-count {
  opacity: 0.9 !important;
  filter: none !important;
}
.stat-item.is-zero-count .stat-num {
  opacity: 0.65 !important;
}

/* Traceability Matrix Toolbar & Table Card */
.case-table-toolbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-top-left-radius: 14px !important;
  border-top-right-radius: 14px !important;
  padding: 12px 20px !important;
}
.case-table-toolbar-title span:first-child {
  color: #0b2545 !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
}
#tableCount {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #0369a1 !important;
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  padding: 1px 8px !important;
  border-radius: 999px !important;
  width: fit-content !important;
}

.case-table-scroll {
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
  background: #ffffff !important;
}
.tc-table thead th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  color: #334155 !important;
  font-weight: 750 !important;
  border-bottom: 2px solid #cbd5e1 !important;
  font-size: 10.5px !important;
  letter-spacing: 0.05em !important;
}
.tc-table tbody tr:hover {
  background-color: #f0f7ff !important;
}
.tc-table thead th,
.tc-table thead th .case-sort-button {
  color: #475569 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}
.tc-table tbody .tc-sticky-id button,
.tc-table tbody .tc-sticky-id a {
  color: #0284c7 !important;
  font-weight: 700 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}
.tc-table tbody .tc-sticky-id button:hover,
.tc-table tbody .tc-sticky-id a:hover {
  color: #007fff !important;
  text-decoration: underline !important;
}

/* ── Option 1: Elevated Slate Canvas (High-Contrast Jira/Notion Style) ── */
body,
.app-main-wrap,
#dashboard,
.case-dashboard-workspace,
#emptyState,
.projects-hub-container {
  background-color: #e9eef5 !important;
  background: #e9eef5 !important;
}

#appTopbar {
  background-color: #ffffff !important;
  background: #ffffff !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

.case-table-pane {
  background: transparent !important;
}

.case-table-scroll {
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

/* ── Calm Mediterranean Ocean Blue Professional Sidebar (Fatigue-Free High-Density) ── */
#sidebar {
  background: linear-gradient(180deg, #f0f7ff 0%, #e6f2fc 100%) !important;
  border-right: 1px solid #bfdbfe !important;
  box-shadow: 2px 0 8px rgba(2, 132, 199, 0.05) !important;
}

#sidebar .sidebar-scroll-region {
  scrollbar-width: thin;
  scrollbar-color: #bfdbfe transparent;
}
#sidebar .sidebar-scroll-region::-webkit-scrollbar {
  width: 4px;
}
#sidebar .sidebar-scroll-region::-webkit-scrollbar-thumb {
  background: #bfdbfe;
  border-radius: 4px;
}

#sidebar > div:first-child {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 16px 14px 14px 14px !important;
}

.sidebar-brand-lockup,
.sidebar-logo-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  gap: 6px !important;
}

.sidebar-brand-lockup [role="img"][aria-label="COEMPT"],
.sidebar-brand-lockup > div:first-child,
.sidebar-logo-content [role="img"][aria-label="COEMPT"] {
  width: 150px !important;
  height: 32px !important;
  min-width: 150px !important;
  min-height: 32px !important;
  position: relative !important;
  display: block !important;
  flex-shrink: 0 !important;
}

#sidebar .sidebar-label {
  color: #334155 !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  text-align: center !important;
  letter-spacing: -0.01em !important;
  line-height: 1.3 !important;
}

#sidebar p.text-\[10px\] {
  color: #0284c7 !important;
  font-weight: 800 !important;
  font-size: 9.5px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  padding: 4px 6px 2px 6px !important;
  margin-bottom: 2px !important;
}

/* ── Sidebar Projects Hub Navigation Button ── */
#sidebarProjectsHubBtn {
  background: #ffffff !important;
  border: 1px solid #bfdbfe !important;
  color: #0c4a6e !important;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.04) !important;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease !important;
}

#sidebarProjectsHubBtn:hover {
  background: #e0f2fe !important;
  border-color: #7dd3fc !important;
  color: #0369a1 !important;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.08) !important;
}

#sidebarProjectsHubBtn.bg-blue-50,
#sidebarProjectsHubBtn.bg-sky-100 {
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  border-left: 3px solid #2563eb !important;
  color: #1d4ed8 !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08) !important;
}

#sidebarProjectsHubBtn.bg-blue-50 span.truncate,
#sidebarProjectsHubBtn.bg-sky-100 span.truncate {
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}

#sidebarProjectsHubBtn.bg-blue-50 #sidebarTotalProjectBadge,
#sidebarProjectsHubBtn.bg-sky-100 #sidebarTotalProjectBadge {
  background-color: #dbeafe !important;
  color: #2563eb !important;
}

/* ── Projects Directory Hub Container ── */
.projects-hub-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  background-color: #e9eef5 !important;
  background: #e9eef5 !important;
  padding: 24px 32px;
}

#emptyState[style*="display: none"],
#emptyState[style*="display:none"],
.projects-hub-container[style*="display: none"],
.projects-hub-container[style*="display:none"] {
  display: none !important;
}

.projects-hub-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  max-width: 1400px !important;
  width: 100% !important;
  margin: 0 auto !important;
}

/* Header & Search Toolbar */
.projects-hub-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  padding-bottom: 18px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.projects-hub-title-block {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.projects-hub-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  background: #e0f2fe !important;
  color: #0284c7 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.1) !important;
  flex-shrink: 0 !important;
}
.projects-hub-icon svg {
  width: 20px !important;
  height: 20px !important;
}

.projects-hub-title-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.projects-hub-title-row h2 {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.projects-hub-counter {
  font-size: 11.5px !important;
  font-weight: 750 !important;
  padding: 2px 9px !important;
  border-radius: 9999px !important;
  background: #eff6ff !important;
  color: #0369a1 !important;
  border: 1px solid #bfdbfe !important;
}

.projects-hub-subtitle {
  font-size: 12.5px !important;
  color: #64748b !important;
  margin: 4px 0 0 0 !important;
}

.projects-hub-actions-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.projects-hub-search-wrap {
  position: relative !important;
  min-width: 280px !important;
}
.projects-hub-search-wrap svg {
  position: absolute !important;
  left: 11px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 14px !important;
  height: 14px !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
}
.projects-hub-search-input {
  width: 100% !important;
  padding: 7px 12px 7px 32px !important;
  font-size: 12.5px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  outline: none !important;
  transition: border-color 140ms ease, box-shadow 140ms ease !important;
}
.projects-hub-search-input:focus {
  border-color: #007fff !important;
  box-shadow: 0 0 0 3px rgba(0, 127, 255, 0.12) !important;
}

.projects-hub-create-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  background: #007fff !important;
  color: #ffffff !important;
  border: 1px solid #007fff !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 127, 255, 0.25) !important;
  transition: filter 140ms ease, transform 100ms ease !important;
}
.projects-hub-create-btn:hover {
  filter: brightness(1.08) !important;
}
.projects-hub-create-btn:active {
  transform: scale(0.98) !important;
}
.projects-hub-create-btn svg {
  width: 14px !important;
  height: 14px !important;
}

/* ── 3-Column Responsive Grid ── */
.projects-hub-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 16px !important;
  margin-top: 4px !important;
}

/* ── Project Cards ── */
.proj-hub-card {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 16px 18px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  transition: transform 120ms ease, box-shadow 140ms ease, border-color 140ms ease !important;
}
.proj-hub-card:hover {
  transform: translateY(-2px) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}
.proj-hub-card:hover .proj-hub-card-name {
  color: #0284c7 !important;
}
.proj-hub-card:hover .proj-hub-card-open-link {
  color: #007fff !important;
  transform: translateX(2px) !important;
}

.proj-hub-card-selected {
  border-color: #007fff !important;
  box-shadow: 0 0 0 2px rgba(0, 127, 255, 0.2), 0 4px 12px rgba(0, 127, 255, 0.1) !important;
}

.proj-hub-card-body {
  display: flex !important;
  flex-direction: column !important;
}

.proj-hub-card-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
}

.proj-hub-card-brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.proj-hub-card-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  font-family: ui-monospace, monospace !important;
  font-weight: 800 !important;
  font-size: 11.5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.25) !important;
  letter-spacing: 0.02em !important;
}

.proj-hub-card-titles {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}

.proj-hub-card-prefix {
  font-size: 10px !important;
  font-weight: 800 !important;
  color: #0369a1 !important;
  font-family: ui-monospace, monospace !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

.proj-hub-card-name {
  font-size: 14px !important;
  font-weight: 750 !important;
  color: #0f172a !important;
  margin: 1px 0 0 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.3 !important;
  transition: color 120ms ease !important;
}

.proj-hub-card-menu-wrap {
  position: relative !important;
}
.proj-hub-card-menu-btn {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease !important;
}
.proj-hub-card-menu-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

.proj-hub-card-dropdown {
  position: absolute !important;
  right: 0 !important;
  top: 28px !important;
  z-index: 30 !important;
  min-width: 150px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1) !important;
  padding: 4px !important;
}
.proj-hub-dropdown-item {
  width: 100% !important;
  text-align: left !important;
  padding: 6px 10px !important;
  font-size: 11.5px !important;
  font-weight: 550 !important;
  color: #334155 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 5px !important;
  cursor: pointer !important;
  transition: background-color 100ms ease !important;
}
.proj-hub-dropdown-item:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}
.proj-hub-dropdown-item-danger {
  color: #ef4444 !important;
}
.proj-hub-dropdown-item-danger:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

.proj-hub-card-desc {
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.45 !important;
  margin: 4px 0 12px 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  min-height: 35px !important;
}
.proj-hub-card-client {
  font-weight: 650 !important;
  color: #334155 !important;
}

.proj-hub-card-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding-top: 10px !important;
  border-top: 1px solid #f1f5f9 !important;
  margin-top: auto !important;
}

.proj-hub-card-tags {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.proj-hub-card-count-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  color: #334155 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  padding: 2px 7px !important;
}
.proj-hub-card-count-badge svg {
  width: 12px !important;
  height: 12px !important;
  color: #64748b !important;
}

.proj-hub-card-status {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
}
.proj-card-status-active {
  background: #eff6ff !important;
  color: #0284c7 !important;
  border: 1px solid #bfdbfe !important;
}
.proj-card-status-completed {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}

.proj-hub-card-open-link {
  font-size: 12px !important;
  font-weight: 750 !important;
  color: #0284c7 !important;
  transition: transform 120ms ease, color 120ms ease !important;
  white-space: nowrap !important;
}

/* Empty Search State */
.projects-hub-empty-search {
  text-align: center !important;
  padding: 60px 20px !important;
}
.projects-hub-empty-icon {
  font-size: 32px !important;
  margin-bottom: 8px !important;
}
.projects-hub-empty-title {
  font-size: 15px !important;
  font-weight: 750 !important;
  color: #1e293b !important;
}
.projects-hub-empty-subtitle {
  font-size: 12.5px !important;
  color: #64748b !important;
  margin-top: 4px !important;
}

/* Zero State */
.projects-zero-state {
  margin: auto !important;
  max-width: 400px !important;
  padding: 40px 24px !important;
  text-align: center !important;
}
.projects-zero-logo {
  display: flex !important;
  justify-content: center !important;
  margin-bottom: 16px !important;
}
.projects-zero-title {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin-bottom: 8px !important;
}
.projects-zero-divider {
  width: 60px !important;
  height: 4px !important;
  margin: 0 auto 16px auto !important;
  border-radius: 9999px !important;
  background: linear-gradient(90deg, #0284c7, #38bdf8) !important;
}
.projects-zero-badge {
  font-size: 10px !important;
  font-weight: 750 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #64748b !important;
  margin-bottom: 12px !important;
}
.projects-zero-heading {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin-bottom: 8px !important;
}
.projects-zero-description {
  font-size: 13px !important;
  color: #64748b !important;
  line-height: 1.5 !important;
  margin-bottom: 20px !important;
}
.projects-zero-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  background: #007fff !important;
  color: #ffffff !important;
  border: 1px solid #007fff !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0, 127, 255, 0.25) !important;
  transition: filter 140ms ease !important;
}
.projects-zero-btn:hover {
  filter: brightness(1.08) !important;
}

/* ── Traceability Matrix Single-Line Enterprise Toolbar ── */
.case-table-toolbar-container {
  background: #ffffff !important;
  border-radius: 10px 10px 0 0 !important;
  border: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  margin-bottom: 0 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  overflow: hidden !important;
}

.case-table-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 6px 12px !important;
  flex-wrap: nowrap !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}
.case-table-toolbar::-webkit-scrollbar {
  display: none !important;
}

.case-table-toolbar-actions {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
}

.case-table-toolbar-actions button,
.case-table-toolbar-actions select,
.case-table-toolbar-actions input,
.case-table-toolbar-actions label {
  height: 28px !important;
  font-size: 11.5px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.case-search-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
}

.case-search-icon {
  position: absolute !important;
  left: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 13px !important;
  height: 13px !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

#quickSearch {
  padding-left: 27px !important;
  padding-right: 8px !important;
  height: 28px !important;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
}

#exportGroup {
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}
#exportFormat {
  height: 28px !important;
  border-radius: 6px 0 0 6px !important;
  border: 1px solid #cbd5e1 !important;
  border-right: none !important;
  padding: 0 4px !important;
  font-size: 11px !important;
  background: #ffffff !important;
}
#exportGroup > button {
  height: 28px !important;
  border-radius: 0 6px 6px 0 !important;
  border: 1px solid #cbd5e1 !important;
  padding: 0 8px !important;
  font-size: 11.5px !important;
}

#addCaseBtn {
  height: 28px !important;
  background-color: #007fff !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #007fff !important;
  border-radius: 6px !important;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  box-shadow: 0 1px 2px rgba(0, 127, 255, 0.2) !important;
}
#addCaseBtn:hover {
  background-color: #0066cc !important;
  border-color: #0066cc !important;
}

#assignCasesBtn {
  height: 28px !important;
  background-color: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 1px solid #0284c7 !important;
  border-radius: 6px !important;
  padding: 0 9px !important;
  display: inline-flex !important;
  align-items: center !important;
}
#assignCasesBtn:disabled {
  background-color: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
}

#importBtn {
  height: 28px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  border-radius: 6px !important;
  padding: 0 8px !important;
}

#assignmentAssigneeFilter {
  height: 28px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 0 6px !important;
  color: #334155 !important;
  background: #ffffff !important;
}

/* Saved Views in Toolbar */
.saved-view-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.saved-view-note {
  font-size: 11px !important;
  color: #94a3b8 !important;
  font-weight: 500 !important;
  padding: 2px 6px !important;
}

.saved-view-chip {
  display: inline-flex !important;
  align-items: center !important;
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 6px !important;
  padding: 1px 4px !important;
  gap: 2px !important;
}

.saved-view-apply {
  font-size: 11px !important;
  font-weight: 650 !important;
  color: #0369a1 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 2px 4px !important;
}

.saved-view-edit, .saved-view-delete {
  font-size: 10px !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 2px !important;
}
.saved-view-delete:hover {
  color: #ef4444 !important;
}

/* ── High-Contrast Dashboard Canvas & KPI Bar ── */
#dashboard {
  background-color: #eef2f6 !important;
}

#statsBar {
  display: flex !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06) !important;
  overflow: hidden !important;
  margin-bottom: 14px !important;
}

.stat-item {
  flex: 1 1 0% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  padding: 12px 18px 10px 18px !important;
  border-right: 1.5px solid #e2e8f0 !important;
  position: relative !important;
  cursor: default !important;
  transition: all 120ms ease !important;
}
.stat-item:last-child {
  border-right: none !important;
}

.stat-item:nth-child(1) {
  background: linear-gradient(180deg, #ffffff 30%, #eff6ff 100%) !important;
}
.stat-item:nth-child(2) {
  background: linear-gradient(180deg, #ffffff 30%, #f0fdf4 100%) !important;
}
.stat-item:nth-child(3) {
  background: linear-gradient(180deg, #ffffff 30%, #fef2f2 100%) !important;
}
.stat-item:nth-child(4) {
  background: linear-gradient(180deg, #ffffff 30%, #fffbeb 100%) !important;
}
.stat-item:nth-child(5) {
  background: linear-gradient(180deg, #ffffff 30%, #f0f9ff 100%) !important;
}

/* Rich colored top stripe lines */
.stat-item::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 4px !important;
  display: block !important;
}
.stat-item:nth-child(1)::before {
  background: #2563eb !important;
}
.stat-item:nth-child(2)::before {
  background: #16a34a !important;
}
.stat-item:nth-child(3)::before {
  background: #dc2626 !important;
}
.stat-item:nth-child(4)::before {
  background: #ea580c !important;
}
.stat-item:nth-child(5)::before {
  background: #0284c7 !important;
}

.stat-num {
  font-size: 26px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
  color: #0f172a !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  letter-spacing: -0.02em !important;
}
.stat-num.green {
  color: #15803d !important;
}
.stat-num.red {
  color: #b91c1c !important;
}
.stat-num.amber {
  color: #c2410c !important;
}
.stat-num.indigo {
  color: #0369a1 !important;
}

.stat-lbl {
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  color: #1e293b !important;
  margin-top: 2px !important;
}

.stat-pass-rate {
  margin-top: 5px !important;
  width: 100% !important;
}
.stat-pass-bar {
  height: 5px !important;
  background: #cbd5e1 !important;
  border-radius: 9999px !important;
  overflow: hidden !important;
}
.stat-pass-fill {
  height: 100% !important;
  background: #0284c7 !important;
  border-radius: 9999px !important;
}

/* ── High Contrast Traceability Table Surface ── */
.case-table-toolbar-container {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-bottom: 1.5px solid #cbd5e1 !important;
  border-radius: 10px 10px 0 0 !important;
}

.case-table-scroll {
  border: 1.5px solid #cbd5e1 !important;
  border-top: none !important;
  border-radius: 0 0 10px 10px !important;
  background: #ffffff !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06) !important;
}

.tc-table {
  background: #ffffff !important;
}

.tc-table thead th,
.tc-table thead .tc-sticky-index,
.tc-table thead .tc-sticky-id {
  background-color: #e2e8f0 !important;
  background: #e2e8f0 !important;
  color: #0f172a !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
  padding: 11px 12px !important;
  border-bottom: 2.5px solid #94a3b8 !important;
}

/* ── High-Contrast Visible Zebra Striping ── */
.tc-table tbody tr {
  transition: background-color 100ms ease !important;
}

.tc-table tbody tr:nth-child(even),
.tc-table tbody tr:nth-child(even) td,
.tc-table tbody tr:nth-child(even) .tc-sticky-index,
.tc-table tbody tr:nth-child(even) .tc-sticky-id {
  background-color: #ffffff !important;
  background: #ffffff !important;
}

.tc-table tbody tr:nth-child(odd),
.tc-table tbody tr:nth-child(odd) td,
.tc-table tbody tr:nth-child(odd) .tc-sticky-index,
.tc-table tbody tr:nth-child(odd) .tc-sticky-id {
  background-color: #f8fafc !important;
  background: #f8fafc !important;
}

.tc-table tbody tr:hover,
.tc-table tbody tr:hover td,
.tc-table tbody tr:hover .tc-sticky-index,
.tc-table tbody tr:hover .tc-sticky-id {
  background-color: #dbeafe !important;
  background: #dbeafe !important;
}

.tc-table tbody tr.is-tracked-row,
.tc-table tbody tr.is-tracked-row td,
.tc-table tbody tr.is-tracked-row .tc-sticky-index,
.tc-table tbody tr.is-tracked-row .tc-sticky-id {
  background-color: #dcfce7 !important;
  background: #dcfce7 !important;
  border-left: 4px solid #15803d !important;
}

.tc-table tbody td {
  padding: 10px 12px !important;
  border-bottom: 1px solid #cbd5e1 !important;
  font-size: 13px !important;
  color: #0f172a !important;
  font-weight: 550 !important;
}

.tc-table tbody .tc-sticky-id button,
.tc-table tbody .tc-sticky-id a {
  color: #0066cc !important;
  font-weight: 750 !important;
  font-size: 13px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

/* Module badge */
.module-badge, .tc-table [class*="bg-sky-50"] {
  background: #dbeafe !important;
  color: #1e40af !important;
  border: 1.5px solid #93c5fd !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  padding: 2px 8px !important;
}

/* Assigned user avatar tokens */
.developer-token, .tester-token, .assigned-user-chip {
  background: #e0f2fe !important;
  border: 1.5px solid #7dd3fc !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  color: #0369a1 !important;
  padding: 2px 8px !important;
}

/* Modals backdrop & glass elevation */
.modal-overlay {
  backdrop-filter: blur(4px) !important;
  background-color: rgba(15, 23, 42, 0.45) !important;
}

/* ── Clean High-Contrast Assignee Summary Strip ── */
.assignment-summary-bar {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 8px 14px !important;
  background: #f8fafc !important;
  border-bottom: 1.5px solid #cbd5e1 !important;
  font-size: 12px !important;
  color: #334155 !important;
  flex-wrap: wrap !important;
}

.assignment-summary-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  background: transparent !important;
  border: none !important;
  color: #1e293b !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 0 !important;
  cursor: default !important;
  box-shadow: none !important;
  text-decoration: none !important;
  user-select: text !important;
}
.assignment-summary-chip:hover {
  text-decoration: none !important;
  color: #0f172a !important;
}

.assignment-summary-chip.is-selected-pill {
  color: #15803d !important;
  font-weight: 700 !important;
  cursor: default !important;
}

.assignment-avatar-dot {
  display: none !important;
}

.assignment-chip-count {
  font-weight: 800 !important;
  color: #0f172a !important;
}
.assignment-summary-chip.is-active .assignment-chip-count {
  color: #0284c7 !important;
}

/* ── Side Drawer Preview Header Edit Button (Pic 2) ── */
.case-drawer-edit-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  background: #0284c7 !important;
  color: #ffffff !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  cursor: pointer !important;
  transition: background-color 120ms ease !important;
}
.case-drawer-edit-btn:hover {
  background-color: #0369a1 !important;
}

/* ── Notion-Grade Case Modal Header Tabs ── */
.case-form-tabs {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 3px !important;
  background: rgba(0, 0, 0, 0.22) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 8px !important;
  backdrop-filter: blur(8px) !important;
}

.case-form-tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 11px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.82) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 140ms ease !important;
  user-select: none !important;
  line-height: 1.2 !important;
}

.case-form-tab:hover:not(.is-active) {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.14) !important;
}

.case-form-tab.is-active,
.case-form-tab[aria-selected="true"] {
  background: #ffffff !important;
  color: #0284c7 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.case-form-tab.is-active svg,
.case-form-tab[aria-selected="true"] svg {
  stroke: #0284c7 !important;
}

.case-tab-dot {
  display: inline-block !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: #f59e0b !important;
  margin-left: 2px !important;
}

.case-tab-dot.is-required {
  background: #ef4444 !important;
}

/* ── Case Modal Header Top-Right Preview Action ── */
.case-workspace-expand-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 11px !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 120ms ease !important;
}
.case-workspace-expand-btn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

/* ── Modern Enterprise Clean Footer ── */
.case-modal-save-footer,
.modal-footer,
.timer-modal-footer,
#viewModal .modal-footer,
.case-drawer-footer,
#viewModal .case-drawer-footer,
.case-table-footer,
#pagination {
  background: #f8fafc !important;
  border-top: 1px solid #cbd5e1 !important;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.02) !important;
  position: relative !important;
  z-index: 30 !important;
}

.case-modal-save-footer .case-normal-save-help {
  color: #64748b !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

.case-modal-save-footer button:not(#caseSaveBtn),
.timer-modal-footer button,
#viewModal .modal-footer button:not(.btn-brand),
.case-drawer-footer button:not(#viewEditBtn),
#viewModal .case-drawer-footer button:not(#viewEditBtn) {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: all 120ms ease !important;
}

.case-modal-save-footer button:not(#caseSaveBtn):hover:not(:disabled),
.timer-modal-footer button:hover:not(:disabled),
#viewModal .modal-footer button:not(.btn-brand):hover:not(:disabled),
.case-drawer-footer button:not(#viewEditBtn):hover:not(:disabled),
#viewModal .case-drawer-footer button:not(#viewEditBtn):hover:not(:disabled) {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

#caseSaveBtn,
#viewEditBtn,
.modal-footer .btn-brand,
#viewModal .modal-footer .btn-brand,
#viewModal .case-drawer-footer #viewEditBtn {
  background: #0284c7 !important;
  border: 1px solid #0369a1 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25) !important;
  transition: all 120ms ease !important;
}

#caseSaveBtn:hover,
#viewEditBtn:hover,
.modal-footer .btn-brand:hover,
#viewModal .modal-footer .btn-brand:hover,
#viewModal .case-drawer-footer #viewEditBtn:hover {
  background: #0369a1 !important;
  border-color: #075985 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35) !important;
}

/* ── Notion-Grade Table Pagination Bar ── */
.case-table-footer, #pagination {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 8px 14px !important;
  background: #f8fafc !important;
  border-top: 1px solid #cbd5e1 !important;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.02) !important;
}

.page-info {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  margin-right: 8px !important;
}

.page-btn {
  min-width: 26px !important;
  height: 26px !important;
  padding: 0 6px !important;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #475569 !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background-color 100ms ease, border-color 100ms ease !important;
}
.page-btn:hover:not(:disabled) {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
.page-btn.active {
  background-color: #007fff !important;
  border-color: #007fff !important;
  color: #ffffff !important;
  font-weight: 750 !important;
  box-shadow: 0 1px 2px rgba(0, 127, 255, 0.25) !important;
}
.page-btn:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
}

/* ── Distinct Quick Access Shelf: RECENT PROJECTS ── */
#recentProjectsSection {
  margin-bottom: 12px !important;
}

#recentProjectList {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid #bae6fd !important;
  border-radius: 8px !important;
  padding: 3px !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.04) !important;
}

#recentProjectList > div {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  margin-bottom: 1.5px !important;
  padding: 3.5px 7px !important;
  height: 27px !important;
  min-height: 27px !important;
  box-shadow: none !important;
  transition: background-color 100ms ease, color 100ms ease !important;
}

#recentProjectList > div span.truncate {
  color: #334155 !important;
  font-weight: 550 !important;
  font-size: 11.5px !important;
}

#recentProjectList > div span.rounded-full {
  background: #f1f5f9 !important;
  color: #64748b !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  border: none !important;
  padding: 0.5px 5px !important;
  min-width: 16px !important;
}

#recentProjectList > div:hover {
  background: #f3f4f6 !important;
}

#recentProjectList > div:hover span.truncate {
  color: #1d4ed8 !important;
}

/* Active Recent Project (Consistent #2563eb accent & #eff6ff bg) */
#recentProjectList > div.bg-blue-50,
#recentProjectList > div.recent-proj-item.bg-sky-100\/90,
#recentProjectList > div.recent-proj-item.bg-blue-50 {
  background: #eff6ff !important;
  border: 1px solid transparent !important;
  border-left: 3px solid #2563eb !important;
  border-radius: 6px !important;
  height: 27px !important;
  min-height: 27px !important;
  box-shadow: none !important;
}

#recentProjectList > div.bg-blue-50 span.truncate,
#recentProjectList > div.recent-proj-item.bg-sky-100\/90 span.truncate,
#recentProjectList > div.recent-proj-item.bg-blue-50 span.truncate {
  color: #2563eb !important;
  font-weight: 600 !important;
  font-size: 11.5px !important;
}

#recentProjectList > div.bg-blue-50 span.rounded-full,
#recentProjectList > div.recent-proj-item.bg-sky-100\/90 span.rounded-full,
#recentProjectList > div.recent-proj-item.bg-blue-50 span.rounded-full {
  background: #dbeafe !important;
  color: #2563eb !important;
  font-weight: 600 !important;
}

/* ── Full Workspace Catalog: PROJECTS ── */
#projectList > div {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  margin-bottom: 1px !important;
  padding: 4.5px 8px !important;
  height: 30px !important;
  min-height: 30px !important;
  box-shadow: none !important;
  transition: background-color 100ms ease, color 100ms ease !important;
}

#projectList > div span.truncate {
  color: #1e293b !important;
  font-weight: 550 !important;
  font-size: 12.5px !important;
}

#projectList > div span.rounded-full {
  background: #f3f4f6 !important;
  color: #6b7280 !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  border: none !important;
  padding: 1px 5.5px !important;
  min-width: 18px !important;
}

/* Hover on Catalog Items */
#projectList > div:hover {
  background: #f3f4f6 !important;
}

#projectList > div:hover span.truncate {
  color: #1d4ed8 !important;
}

/* Primary Active Project in Catalog */
#projectList > div.bg-blue-50 {
  background: #eff6ff !important;
  border: 1px solid transparent !important;
  border-left: 3px solid #2563eb !important;
  border-radius: 6px !important;
  height: 30px !important;
  min-height: 30px !important;
  box-shadow: none !important;
}

#projectList > div.bg-blue-50 span.truncate {
  color: #2563eb !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
}

#projectList > div.bg-blue-50 span.bg-blue-100,
#projectList > div.bg-blue-50 span.rounded-full {
  background-color: #dbeafe !important;
  color: #2563eb !important;
  font-weight: 600 !important;
  border: none !important;
  box-shadow: none !important;
}

/* Three dots project actions button */
#projectList [data-project-menu-wrap] > button {
  opacity: 0.35;
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 4px !important;
  transition: opacity 120ms ease, background-color 120ms ease, color 120ms ease !important;
}
#projectList > div:hover [data-project-menu-wrap] > button {
  opacity: 1;
}
#projectList [data-project-menu-wrap] > button:hover {
  background: #ffffff !important;
  color: #0369a1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

/* New Project Button */
#sidebar [data-project-manager] button,
#sidebar button[onclick*="openProjectModal"] {
  background: transparent !important;
  border: 1px dashed #7dd3fc !important;
  color: #0284c7 !important;
  font-weight: 700 !important;
  font-size: 11.5px !important;
  padding: 5px 8px !important;
  border-radius: 6px !important;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease !important;
}
#sidebar [data-project-manager] button:hover,
#sidebar button[onclick*="openProjectModal"]:hover {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
}

/* Administration Button */
#sidebar [data-user-manager] button {
  background: #ffffff !important;
  border: 1px solid #bfdbfe !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 5.5px 10px !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.04) !important;
}
#sidebar [data-user-manager] button:hover {
  background: #e0f2fe !important;
  border-color: #7dd3fc !important;
}

/* Sidebar Toggle */
#sidebar-toggle {
  background-color: #ffffff !important;
  border: 1px solid #bfdbfe !important;
  color: #0284c7 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15) !important;
}
#sidebar-toggle:hover {
  background-color: #007fff !important;
  border-color: #007fff !important;
  color: #ffffff !important;
}

/* Sidebar Filter Controls */
#sidebar #filterSection select {
  background-color: #ffffff !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 6px !important;
  color: #0c4a6e !important;
  font-weight: 550 !important;
  padding: 4.5px 8px !important;
  font-size: 11.5px !important;
}
#sidebar #filterSection select:hover,
#sidebar #filterSection select:focus {
  border-color: #007fff !important;
  box-shadow: 0 0 0 2.5px rgba(0, 127, 255, 0.15) !important;
  outline: none !important;
}

/* ── App Topbar Polish ── */
#appTopbar {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
}

#topbarBreadcrumb {
  color: #0284c7 !important;
  font-weight: 750 !important;
  letter-spacing: 0.08em !important;
}

#topbarTitle {
  color: #0b2545 !important;
  font-weight: 800 !important;
}

#globalCaseSearch {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
}
#globalCaseSearch:focus {
  background-color: #ffffff !important;
  border-color: #007fff !important;
  box-shadow: 0 0 0 3px rgba(0, 127, 255, 0.12) !important;
}

#commandPaletteTrigger {
  background-color: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
  border-radius: 6px !important;
}
#commandPaletteTrigger:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Topbar Buttons */
#statisticalReportBtn,
#defectTrendBtn,
#helpdeskBtn {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  font-weight: 650 !important;
  border-radius: 8px !important;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease !important;
}
#statisticalReportBtn:hover,
#defectTrendBtn:hover,
#helpdeskBtn:hover {
  background-color: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #0284c7 !important;
}

#profileMenuButton {
  border: 1px solid #cbd5e1 !important;
  background-color: #ffffff !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}
#profileMenuButton:hover {
  border-color: #93c5fd !important;
}

#topbarUserAvatar {
  background: linear-gradient(135deg, #0b2545, #007fff) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 127, 255, 0.3) !important;
}

#topbarUserRole {
  color: #0284c7 !important;
  font-weight: 800 !important;
}

/* Project Users has one deliberate scroll owner: the table region. */
#projectUsersModal .project-users-modal {
  max-height: calc(100dvh - 48px) !important;
  overflow: hidden !important;
}
#projectUsersModal .project-users-modal-body {
  min-height: 0;
  overflow: hidden;
}
#projectUsersModal .project-users-table-region {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border-color: var(--app-border) !important;
}
#projectUsersModal .project-users-table-region thead th {
  background: var(--app-surface-subtle) !important;
  border-bottom-color: var(--app-border) !important;
}
#projectUsersModal .project-users-table-region tbody td {
  border-bottom-color: var(--app-border) !important;
}
#projectUsersModal .project-users-modal-footer {
  border-top-color: var(--app-border) !important;
  background: var(--app-surface);
}
@media (max-width: 640px) {
  #projectUsersModal { padding: 16px !important; }
  #projectUsersModal .project-users-modal { max-height: calc(100dvh - 32px) !important; }
  #projectUsersModal .project-users-modal-body { padding: 16px !important; }
  #projectUsersModal .project-users-modal-footer { padding: 12px 16px !important; }
}
[data-theme="dark"] #projectUsersModal .project-users-modal-header {
  background: var(--app-surface) !important;
  border-bottom: 1px solid var(--app-border-strong) !important;
}
[data-theme="dark"] #projectUsersModal .project-users-modal-header h3 { color: var(--color-brand-dark) !important; }
[data-theme="dark"] #projectUsersModal .project-users-modal-header p { color: var(--app-text-muted) !important; }
[data-theme="dark"] #projectUsersModal .project-users-modal-header button {
  background: var(--app-surface-subtle) !important;
  border-color: var(--app-border) !important;
  color: var(--color-brand-dark) !important;
}

/* ── Global Case Search (Topbar) ──────────────────────────────── */
.global-case-search-wrap {
  position: relative;
  flex: 0 1 240px;
  width: 240px;
  min-width: 160px;
  height: 32px;
}
.global-case-search-icon {
  position: absolute;
  top: 50%;
  left: 9px;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  stroke: var(--app-text-muted, #64748b);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.global-case-search-input {
  width: 100% !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 10px 0 30px !important;
  margin: 0 !important;
  border: 1px solid var(--app-border, #dbe4ee) !important;
  border-radius: 6px !important;
  background: var(--app-surface-subtle, #f8fafc) !important;
  color: var(--color-brand-dark, #1e3a5f) !important;
  font: 500 12px/1.25 var(--font-sans, inherit) !important;
  outline: none !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.global-case-search-input:focus {
  background: #ffffff !important;
  border-color: var(--color-brand, #2563eb) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1) !important;
}
.global-case-search-input::placeholder {
  color: var(--app-text-muted, #64748b) !important;
  opacity: 0.85;
}
.global-case-search-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  z-index: 260;
  width: min(440px, calc(100vw - 28px));
  max-height: min(56vh, 420px);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--app-border-strong, #c9d5e3);
  border-radius: 8px;
  background: var(--app-surface, #ffffff);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}
.global-case-search-note {
  padding: 12px 10px;
  color: var(--app-text-muted, #64748b);
  font-size: 12px;
  text-align: center;
}
.global-case-search-note.is-error {
  color: var(--color-danger, #dc2626);
}
.global-case-search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-brand-dark, #1e3a5f);
  text-align: left;
  cursor: pointer;
}
.global-case-search-result:hover,
.global-case-search-result.is-active {
  background: var(--color-brand-light, #eff6ff);
}
.global-case-search-result:focus-visible {
  outline: 2px solid var(--color-brand, #2563eb);
  outline-offset: -2px;
}
.global-case-search-result-id {
  align-self: start;
  color: var(--color-brand, #2563eb);
  font: 700 10px/1.35 var(--font-mono, monospace);
  white-space: nowrap;
}
.global-case-search-result-copy {
  min-width: 0;
}
.global-case-search-result-copy strong,
.global-case-search-result-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Topbar information hierarchy ─────────────────────────────── */
#appTopbar {
  gap: 12px;
  padding-inline: 18px;
  background: var(--app-surface, #fff);
}
.topbar-context-zone {
  flex: 1 1 auto;
  max-width: 520px;
  min-width: 160px;
}
#topbarBreadcrumb {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: .095em;
}
.project-title {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px !important;
  font-weight: 750 !important;
}
.topbar-search-command {
  display: flex;
  align-items: center;
  flex: 0 1 180px;
  min-width: 130px;
  gap: 6px;
  transition: flex-basis 140ms ease;
}
.topbar-search-command:focus-within {
  flex: 0 1 240px;
}
#appTopbar .global-case-search-wrap {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
}
.global-case-search-input {
  padding-right: 12px !important;
  border-radius: 7px !important;
}
.command-palette-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 58px;
  height: 32px;
  padding: 0 7px;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: var(--app-surface-subtle);
  color: var(--app-text-muted);
  cursor: pointer;
  transition: border-color var(--motion-instant) var(--motion-ease-standard), color var(--motion-instant) var(--motion-ease-standard), background-color var(--motion-instant) var(--motion-ease-standard);
}
.command-palette-trigger:hover { color: var(--color-brand); border-color: var(--color-brand); background: var(--color-brand-light); }
.command-palette-trigger svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.command-palette-trigger kbd { font: 700 10px/1 var(--font-mono, monospace); white-space: nowrap; }
.topbar-utility-zone { gap: 8px; }
.topbar-utility-cluster {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-subtle);
}
.topbar-utility-cluster > button {
  width: 27px;
  height: 27px;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  box-shadow: none !important;
}
.topbar-utility-cluster > button:hover { background: var(--app-surface) !important; color: var(--color-brand) !important; }
.topbar-utility-cluster #theme-toggle-secondary,
.topbar-theme-persistent,
#theme-toggle { display: none !important; }
.topbar-action-buttons { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.topbar-action-buttons > button {
  white-space: nowrap;
  box-shadow: none;
  height: 32px !important;
  padding-inline: 10px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
}
.topbar-secondary-overflow,
.topbar-action-overflow,
.topbar-secondary-menu { display: contents; }
.topbar-secondary-overflow > summary,
.topbar-action-overflow > summary { display: none; }
#notificationBell { width: 32px; height: 32px; padding: 0; border-color: var(--app-border); box-shadow: none; }
.topbar-profile-wrap { min-width: 0; flex: 0 1 auto; }
#profileMenuButton { max-width: 184px; min-width: 0; }
#topbarUserName { max-width: 112px; }
[data-theme="dark"] #appTopbar { background: var(--app-surface) !important; }
[data-theme="dark"] .command-palette-trigger,
[data-theme="dark"] .topbar-utility-cluster { background: var(--app-surface-subtle); border-color: var(--app-border); }
[data-theme="dark"] .topbar-theme-persistent #theme-toggle { color: var(--color-brand-dark) !important; border-color: var(--app-border-strong) !important; background: var(--app-surface-subtle) !important; }

@media (max-width: 1200px) {
  #appTopbar { gap: 8px; padding-inline: 12px; }
  .topbar-context-zone { flex: 1 1 auto; max-width: 420px; min-width: 140px; }
  .topbar-search-command { flex: 0 1 160px; min-width: 120px; }
  .topbar-action-buttons { gap: 4px; }
  .topbar-action-buttons > button { padding-inline: 8px !important; font-size: 11px !important; }
  #profileMenuButton { max-width: 154px; }
  #topbarUserName { max-width: 82px; }
}

@media (max-width: 960px) {
  .topbar-context-zone { flex: 1 1 auto; max-width: 320px; min-width: 100px; }
  .topbar-search-command { flex: 0 1 130px; min-width: 100px; }
  .command-palette-trigger { min-width: 32px; width: 32px; padding: 0; }
  .command-palette-trigger kbd { display: none; }
  .topbar-action-buttons { gap: 2px; }
  .topbar-action-buttons > button { min-width: 32px; padding-inline: 6px !important; font-size: 10.5px !important; }
  #profileMenuButton { max-width: 38px; padding-inline: 5px !important; }
  #profileMenuButton > .flex, #profileMenuButton > span:last-child { display: none; }
}

@media (max-width: 640px) {
  #appTopbar { gap: 6px; padding-inline: 8px; }
  .topbar-context-zone { flex: 1 1 0; min-width: 0; max-width: none; }
  .project-title { font-size: var(--text-sm); }
  #appTopbar .topbar-search-command { display: flex; flex: 0 0 112px; min-width: 112px; gap: 4px; }
  #appTopbar .global-case-search-wrap { flex: 0 0 76px; width: 76px; }
  #appTopbar .global-case-search-input { padding-right: 5px !important; font-size: 11px !important; }
  .command-palette-trigger { width: 32px; min-width: 32px; padding: 0; }
  .command-palette-trigger kbd { display: none; }
  .topbar-utility-zone { gap: 4px; flex: 0 0 auto; }
  .topbar-theme-persistent { flex: 0 0 32px; }
  .topbar-secondary-overflow,
  .topbar-action-overflow { display: block; position: relative; flex: 0 0 32px; }
  .topbar-secondary-overflow > summary,
  .topbar-action-overflow > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    list-style: none;
    border: 1px solid var(--app-border);
    border-radius: 7px;
    background: var(--app-surface-subtle);
    color: var(--app-text-muted);
    cursor: pointer;
  }
  .topbar-secondary-overflow > summary::-webkit-details-marker,
  .topbar-action-overflow > summary::-webkit-details-marker { display: none; }
  .topbar-secondary-overflow > summary svg,
  .topbar-action-overflow > summary svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .topbar-secondary-menu,
  .topbar-action-buttons { display: none; }
  .topbar-secondary-overflow[open] .topbar-secondary-menu,
  .topbar-action-overflow[open] .topbar-action-buttons {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 220;
    display: flex;
    gap: 6px;
    padding: 7px;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: var(--app-surface);
    box-shadow: var(--shadow-card);
  }
  .topbar-secondary-overflow[open] .topbar-secondary-menu { align-items: center; }
  .topbar-action-overflow[open] .topbar-action-buttons { flex-direction: column; align-items: stretch; min-width: 156px; }
  .topbar-action-overflow[open] .topbar-action-buttons > button { width: 100%; min-width: 0; padding-inline: 10px !important; color: var(--color-brand-dark) !important; }
  #profileMenuButton { width: 38px; min-width: 38px; }
}

@media (max-width: 420px) {
  #appTopbar .topbar-search-command { flex-basis: 104px; min-width: 104px; }
  #appTopbar .global-case-search-wrap { flex-basis: 68px; width: 68px; }
  .topbar-context-zone { max-width: 62px; }
}

/* ── Command palette overlay ───────────────────────────────────── */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: none;
  place-items: start center;
  padding: min(12vh, 112px) 18px 24px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(2px);
  overflow: auto;
}
.command-palette-overlay.is-open { display: grid !important; }
.command-palette-dialog {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: min(680px, calc(100dvh - 42px));
  overflow: hidden;
  border: 1px solid var(--app-border-strong);
  border-radius: 12px;
  background: var(--app-surface);
  color: var(--color-brand-dark);
  box-shadow: 0 24px 64px rgba(15, 23, 42, .24);
}
.command-palette-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
}
.command-palette-heading h2 { margin: 0; color: var(--color-brand-dark); font-size: var(--text-sm); font-weight: 800; letter-spacing: -.01em; }
.command-palette-close {
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--app-border);
  border-radius: 5px;
  background: var(--app-surface-subtle);
  color: var(--app-text-muted);
  font: 700 10px/1 var(--font-mono, monospace);
  cursor: pointer;
}
.command-palette-input {
  width: auto;
  min-height: 40px;
  margin: 0 12px 10px;
  padding: 0 12px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-subtle);
  color: var(--color-brand-dark);
  font: 500 13px/1.3 var(--font-sans, inherit);
}
.command-palette-input:focus { border-color: var(--color-brand); background: var(--app-surface); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-brand) 16%, transparent); outline: none; }
.command-palette-results { min-height: 0; overflow: auto; padding: 2px 8px 10px; }
.command-palette-group { padding: 7px 4px 3px; }
.command-palette-group > p { margin: 0 0 5px; color: var(--app-text-muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.command-palette-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-brand-dark);
  font: 600 12px/1.2 var(--font-sans, inherit);
  text-align: left;
  cursor: pointer;
}
.command-palette-result:hover,
.command-palette-result:focus-visible,
.command-palette-result.is-active,
.command-palette-result[aria-selected="true"] { background: var(--color-brand-light); color: var(--color-brand); outline: none; }
.command-palette-result small, .command-palette-result kbd { color: var(--app-text-muted); font: 700 10px/1 var(--font-mono, monospace); }
.command-palette-empty { display: block; padding: 9px; color: var(--app-text-muted); font-size: 12px; }
[data-theme="dark"] .command-palette-overlay { background: rgba(2, 6, 23, .66); }
[data-theme="dark"] .command-palette-dialog { background: var(--app-surface); border-color: var(--app-border-strong); }
[data-theme="dark"] .command-palette-input { background: var(--app-surface-subtle); color: var(--color-brand-dark); }
@media (prefers-reduced-motion: no-preference) { .command-palette-dialog { animation: command-palette-in var(--motion-instant) var(--motion-ease-standard); } }
@keyframes command-palette-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) {
  .command-palette-overlay { padding: 58px 10px 12px; align-items: start; }
  .command-palette-dialog { max-height: calc(100dvh - 70px); border-radius: 10px; }
}
.global-case-search-result-copy strong {
  font-size: 12px;
  font-weight: 700;
}
.global-case-search-result-copy small {
  margin-top: 2px;
  color: var(--app-text-muted, #64748b);
  font-size: 10px;
}

/* ── Attachment drag-and-drop drop zone ── */
.attachment-drop-zone.is-drag-active {
  border-color: var(--color-brand) !important;
  background: var(--color-brand-light) !important;
}

/* ── Table Header & Sorting (Clean Alignment) ─────────────────── */
.tc-table thead th {
  height: 38px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  vertical-align: middle !important;
  line-height: 1.2 !important;
}
.case-sort-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  max-width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  text-align: inherit !important;
  text-transform: inherit !important;
  line-height: inherit !important;
  cursor: pointer !important;
  vertical-align: middle !important;
}
.case-sort-button:hover, .case-sort-button.is-active { color: var(--color-brand); }
.case-sort-indicator { display: inline-flex; width: 10px; height: 12px; color: var(--app-text-muted); }
.case-sort-indicator svg { width: 100%; height: 100%; overflow: visible; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.case-sort-indicator path { opacity: .28; }
.case-sort-button[data-sort-direction="asc"] .case-sort-up,
.case-sort-button[data-sort-direction="desc"] .case-sort-down { opacity: 1; stroke-width: 2; }
.case-sort-button.is-active .case-sort-indicator { color: currentColor; }

/* ── Comfortable density overrides (Phase 4) ─────────────────────────── */
html[data-density="comfortable"] body:not([data-user-role="coe_vc"]) #dashboard #statsBar,
body[data-density="comfortable"]:not([data-user-role="coe_vc"]) #dashboard #statsBar {
  min-height: 94px;
}
html[data-density="comfortable"] body:not([data-user-role="coe_vc"]) #dashboard .stat-item,
body[data-density="comfortable"]:not([data-user-role="coe_vc"]) #dashboard .stat-item {
  min-height: 90px;
  padding: 16px 14px;
  gap: 4px;
}
html[data-density="comfortable"] body:not([data-user-role="coe_vc"]) #dashboard .stat-lbl,
body[data-density="comfortable"]:not([data-user-role="coe_vc"]) #dashboard .stat-lbl {
  font-size: var(--text-sm);
}
html[data-density="comfortable"] body:not([data-user-role="coe_vc"]) #dashboard .assignment-summary-bar,
body[data-density="comfortable"]:not([data-user-role="coe_vc"]) #dashboard .assignment-summary-bar {
  min-height: 38px;
  padding: 8px 16px;
}
html[data-density="comfortable"] body:not([data-user-role="coe_vc"]) #dashboard .tc-table thead th,
body[data-density="comfortable"]:not([data-user-role="coe_vc"]) #dashboard .tc-table thead th {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}
html[data-density="comfortable"] body:not([data-user-role="coe_vc"]) #dashboard .tc-table tbody tr,
body[data-density="comfortable"]:not([data-user-role="coe_vc"]) #dashboard .tc-table tbody tr {
  height: 44px;
}
html[data-density="comfortable"] body:not([data-user-role="coe_vc"]) #dashboard .tc-table tbody td,
body[data-density="comfortable"]:not([data-user-role="coe_vc"]) #dashboard .tc-table tbody td {
  padding: 10px 14px;
}
html[data-density="comfortable"] body .defect-history-entry,
body[data-density="comfortable"] .defect-history-entry {
  padding: 12px 14px;
}
html[data-density="comfortable"] body .notification-item,
body[data-density="comfortable"] .notification-item {
  padding: 12px 16px;
}

/* ── In-App Help & Onboarding (Phase 13) ────────────────────── */
.help-drawer {
  background: var(--app-surface, #ffffff);
  color: var(--app-text, #111827);
}
[data-theme="dark"] .help-drawer {
  background: #111827;
  border-left-color: #374151;
  color: #f9fafb;
}
[data-theme="dark"] .help-drawer .help-topic {
  background: #1f2937;
  border-color: #374151;
}
[data-theme="dark"] .help-drawer .help-topic summary {
  color: #f3f4f6;
}
[data-theme="dark"] .help-drawer .help-topic > div {
  border-top-color: #374151;
  color: #9ca3af;
}
[data-theme="dark"] #onboardingModal .modal {
  background: #111827;
  border-color: #374151;
}
  padding: 12px 16px;
}

/* ── In-App Help & Onboarding (Phase 13) ────────────────────── */
.help-drawer {
  background: var(--app-surface, #ffffff);
  color: var(--app-text, #111827);
}
[data-theme="dark"] .help-drawer {
  background: #111827;
  border-left-color: #374151;
  color: #f9fafb;
}
[data-theme="dark"] .help-drawer .help-topic {
  background: #1f2937;
  border-color: #374151;
}
[data-theme="dark"] .help-drawer .help-topic summary {
  color: #f3f4f6;
}
[data-theme="dark"] .help-drawer .help-topic > div {
  border-top-color: #374151;
  color: #9ca3af;
}
[data-theme="dark"] #onboardingModal .modal {
  background: #111827;
  border-color: #374151;
}
[data-theme="dark"] #onboardingModal .bg-white {
  background: #111827;
  border-color: #374151;
}

/* ── Test Case Right-Side Preview Drawer (Matches Help Drawer UX) ── */
.case-preview-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 250;
  transition: opacity 0.3s ease;
}
.case-preview-drawer-overlay.open {
  opacity: 1 !important;
  pointer-events: auto !important;
}
#viewModal.case-preview-drawer,
.case-preview-drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  width: 100% !important;
  max-width: 580px !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--app-surface, #ffffff) !important;
  z-index: 260 !important;
  box-shadow: -4px 0 28px rgba(0, 0, 0, 0.18) !important;
  display: flex !important;
  flex-direction: column !important;
  border-left: 1px solid var(--app-border, #e5e7eb) !important;
  border-radius: 0 !important;
  transform: translateX(100%) !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  overflow: hidden !important;
  pointer-events: auto !important;
}
#viewModal.case-preview-drawer.open,
.case-preview-drawer.open {
  transform: translateX(0) !important;
}
[data-theme="dark"] .case-preview-drawer {
  background: #111827;
  border-color: #374151;
}
[data-theme="dark"] .case-preview-drawer #viewModalBody {
  background: #0f172a;
}
[data-theme="dark"] .case-preview-drawer .bg-white {
  background: #1e293b;
  border-color: #374151;
}
@media (max-width: 640px) {
  .case-preview-drawer {
    max-width: 100% !important;
  }
}

/* ── Dark mode refinements for Defects & Details tabs ── */
[data-theme="dark"] .defect-history-card {
  background: var(--app-surface);
  border-color: var(--app-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] .defect-history-title {
  background: var(--app-surface-subtle);
  border-bottom-color: var(--app-border);
  color: var(--app-text-muted);
}
[data-theme="dark"] .defect-history-entry {
  background: var(--app-surface);
  border-top-color: var(--app-border);
}
[data-theme="dark"] .defect-history-entry:hover {
  background: var(--app-surface-subtle);
}
[data-theme="dark"] .defect-history-current {
  background: rgba(38, 38, 38, 0.6);
  border-top-color: var(--color-brand-lighter);
}
[data-theme="dark"] .defect-history-more {
  background: var(--app-surface-subtle);
  border-bottom-color: var(--app-border);
  color: var(--color-brand);
}
[data-theme="dark"] .defect-history-more:hover {
  background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .defect-history-actions button {
  background: var(--app-surface-subtle);
  border-color: var(--app-border);
  color: var(--color-brand-dark);
}
[data-theme="dark"] .defect-history-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .defect-history-timeline-btn {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
  color: #93c5fd;
}
[data-theme="dark"] .defect-history-timeline-btn:hover {
  background: rgba(37, 99, 235, 0.25);
}
[data-theme="dark"] .defect-timeline-panel {
  border-top-color: var(--app-border);
}

/* ── Print stylesheet (Phase 15) ── */
@media print {
  #sidebar, .sidebar, #appTopbar, .app-topbar, .sidebar-toggle, #sidebar-toggle,
  button, .btn, .page-btn, .app-toast-region, .app-toast,
  .command-palette, .command-palette-overlay, #commandPaletteModal,
  .modal-backdrop, .modal-overlay:not(#caseModal), .case-workspace-actions,
  #helpDrawer, #helpDrawerOverlay, #viewModal, #viewModalOverlay, #onboardingModal,
  .notification-popover-wrap, .profile-menu, #notificationMenu,
  .case-table-toolbar, .case-table-footer, .pagination-controls,
  [data-print-hide="true"] {
    display: none !important;
  }
  html, body {
    background: #ffffff !important;
    color: #111827 !important;
    overflow: visible !important;
    height: auto !important;
  }
  #dashboard, .main-wrap, .flex-1 {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    display: block !important;
  }
  * {
    color: #111827 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  table {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
    page-break-inside: auto;
  }
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  thead {
    display: table-header-group;
  }
  table, th, td {
    border: 1px solid #d1d5db !important;
  }
  th, td {
    padding: 6px 8px !important;
  }
  .stat-report-chart-panel, .statistical-report-table-panel, .stat-item {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #e5e7eb !important;
  }
  #caseModal.open {
    display: block !important;
    position: static !important;
    overflow: visible !important;
    max-height: none !important;
    padding: 0 !important;
    background: transparent !important;
  }
  #caseModal.open > .modal {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
  }
  #caseModal.open .case-modal-sticky-header,
  #caseModal.open .case-modal-save-footer,
  #caseModal.open #caseModalChips {
    display: none !important;
  }
  .case-workspace-open, .preview-overlay {
    position: static !important;
    overflow: visible !important;
    max-height: none !important;
  }
  a[href]::after {
    content: none !important;
  }
}

/* ════════════════════════════════════════════════════════════
   PRO UPLIFT — Zoho/Jira-grade polish across every surface
   v1022 — additive-only, no existing rules removed
   ════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────
   1. THIN CUSTOM SCROLLBARS — "The silent quality signal"
   Every Zoho/Jira app has 4–6px branded scrollbars.
   ────────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--app-border-strong) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--app-border-strong);
  border-radius: 6px;
  border: 1px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--app-text-muted); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* ──────────────────────────────────────────────────────────
   2. INPUT FIELDS — "Resting depth + precise focus ring"
   Zoho/Jira inputs have inset shadow at rest, no hard ring,
   a tight blue glow only on focus.
   ────────────────────────────────────────────────────────── */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06) !important;
  border-color: var(--app-border) !important;
  transition: border-color var(--motion-fast) var(--motion-ease-standard),
              box-shadow var(--motion-fast) var(--motion-ease-standard) !important;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
  border-color: var(--app-border-strong) !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus,
textarea:focus {
  border-color: var(--color-brand) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14), inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  outline: none !important;
}
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22) !important;
}
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  box-shadow: 0 0 0 3px rgba(191, 219, 254, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.14) !important;
}

/* ──────────────────────────────────────────────────────────
   3. SIDEBAR CHROME — "Enterprise left-rail feel"
   Zoho has: section label at 9px/wider tracking, nav items
   with a slightly taller hit area, bottom hairlines between
   sections, and a heavier active state font.
   ────────────────────────────────────────────────────────── */
#sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--app-border-strong);
}
/* Section header labels — tighter, more professional */
#sidebar p.text-\[10px\],
#sidebar .sidebar-section-text {
  font-size: 9px !important;
  letter-spacing: .14em !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  color: var(--app-text-muted) !important;
  padding-bottom: 4px !important;
}
/* Project list items — taller, clearer typography */
#projectList button,
#sidebar [data-user-manager] button {
  border-radius: 6px !important;
  font-size: var(--text-xs) !important;
  font-weight: 600 !important;
  letter-spacing: .01em !important;
  min-height: 33px !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  color: var(--color-brand-dark) !important;
}
/* Active project: bolder font and subtle bg gradient */
#projectList .active-project {
  font-weight: 750 !important;
  background: linear-gradient(90deg, var(--color-brand-light) 0%, rgba(239,246,255,.5) 100%) !important;
}
/* Sidebar logo brand text */
.sidebar-label {
  font-size: var(--text-xs) !important;
  letter-spacing: -.01em !important;
  color: var(--color-brand-dark) !important;
}

/* ──────────────────────────────────────────────────────────
   4. TOPBAR CHROME — "Sticky shelf with glass depth"
   Jira topbar has: frosted glass on scroll, crisp bottom rule,
   app name in heavier weight, breadcrumb lighter.
   ────────────────────────────────────────────────────────── */
#appTopbar {
  backdrop-filter: blur(10px) saturate(1.6) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.6) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid var(--app-border-strong) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07), 0 0 0 1px var(--app-border) !important;
}
[data-theme="dark"] #appTopbar {
  background: rgba(28, 28, 28, 0.92) !important;
}
.project-title { letter-spacing: -.025em !important; }
#topbarBreadcrumb {
  font-size: 10px !important;
  letter-spacing: .1em !important;
  font-weight: 700 !important;
}

/* ──────────────────────────────────────────────────────────
   5. STATS BAR KPI BAND — "Tabular number density"
   Zoho KPI strip: tabular nums, tighter padding, subtle shelf.
   ────────────────────────────────────────────────────────── */
#statsBar {
  border-top: 2px solid var(--color-brand-lighter) !important;
  background: var(--color-surface) !important;
}
.stat-item {
  padding: 13px 12px !important;
}
.stat-num {
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.04em !important;
  line-height: 1 !important;
}
.stat-lbl {
  font-size: 9px !important;
  letter-spacing: .1em !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
}
/* Pass-rate bar: brand tint */
.stat-pass-fill {
  background: linear-gradient(90deg, var(--color-brand) 0%, #60a5fa 100%) !important;
}

/* ──────────────────────────────────────────────────────────
   6. DATA TABLE — "Jira grid header + sticky shadow"
   Jira table headers: 10px ALL CAPS, tabular nums, sticky
   header with a drop shadow cast downward.
   ────────────────────────────────────────────────────────── */
.tc-table thead th {
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
  color: var(--app-text-muted) !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  user-select: none;
}
.tc-table thead {
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08) !important;
}
/* Tighter rows */
.tc-table tbody tr { height: 36px !important; }
.tc-table tbody td {
  padding: 6px 12px !important;
  font-size: var(--text-xs) !important;
}
/* ID cell: mono look */
.tc-id-link { font-size: 11px !important; letter-spacing: -0.02em !important; }
/* Summary cell: slightly stronger */
.summary-cell { font-weight: 600 !important; color: var(--color-brand-dark) !important; }
/* Table scroll wrapper: top rounded clip */
.case-table-scroll { border-radius: 0 0 10px 10px !important; }

/* ──────────────────────────────────────────────────────────
   7. BADGE SYSTEM — "Crisper Jira-style chips"
   Jira badges are square-cornered, uppercase, tight padding.
   ────────────────────────────────────────────────────────── */
.badge {
  border-radius: 4px !important;
  padding: 2px 7px 2px 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .05em !important;
  text-transform: uppercase !important;
}
.badge-dot {
  width: 4px !important;
  height: 4px !important;
}
/* Module pill refinement */
.module-pill {
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .03em !important;
  padding: 2px 7px 2px 6px !important;
}
/* Role pill */
.role-pill {
  border-radius: 4px !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  letter-spacing: .05em !important;
  text-transform: uppercase !important;
  padding: 2px 7px !important;
}

/* ──────────────────────────────────────────────────────────
   8. FORM ANATOMY — "Section heading with top separator"
   Zoho groups fields under visual bands: a top rule, CAPS
   label, 2px left accent. More structured than a bare label.
   ────────────────────────────────────────────────────────── */
.modal .form-section-heading,
.modal .case-defect-section-heading {
  padding-top: 10px !important;
  margin-top: 4px !important;
  border-top: 1px solid var(--app-border) !important;
  border-left: 3px solid var(--color-brand) !important;
  padding-left: 8px !important;
  font-size: 10px !important;
  letter-spacing: .1em !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  color: var(--app-text-muted) !important;
}
/* Field labels: sharper micro-type */
.modal label,
.modal .form-label,
.modal .field-label {
  font-size: 11px !important;
  font-weight: 750 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  color: var(--app-text-muted) !important;
}
/* Inside the case defect heading (existing): keep its existing background band */
.case-defect-section-heading {
  border-top: 1px solid var(--color-brand-lighter) !important;
  padding-top: 7px !important;
}

/* ──────────────────────────────────────────────────────────
   9. ACTION BUTTONS — "CTA depth hierarchy"
   Zoho: primary button has subtle drop shadow, secondary is
   outlined without shadow, ghost is transparent.
   ────────────────────────────────────────────────────────── */
/* Table row action buttons: slightly smaller, crisper */
.action-btn {
  height: 26px !important;
  min-width: 26px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
}
/* Footer save button: primary depth */
.case-modal-save-footer button[type="submit"],
.case-modal-save-footer button:not([type]):not([onclick*="close"]) {
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.24), 0 0 0 1px rgba(37, 99, 235, 0.12) !important;
}
.case-modal-save-footer button[type="submit"]:hover,
.case-modal-save-footer button:not([type]):not([onclick*="close"]):hover {
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3), 0 0 0 1px rgba(37, 99, 235, 0.16) !important;
}
/* Pagination buttons: refined */
#pagination .page-btn {
  border-radius: 5px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  height: 28px !important;
  min-width: 28px !important;
}
#pagination .page-btn.active {
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2) !important;
}

/* ──────────────────────────────────────────────────────────
   10. TOOLBAR + MODAL CONTAINER — "Tight surface borders"
   Zoho: workspace surfaces have a `1px` border, no glow, and
   a very subtle inner shadow on the content card.
   ────────────────────────────────────────────────────────── */
.case-table-toolbar {
  background: var(--color-surface) !important;
}
/* Search input in toolbar: minimal pill */
.case-table-toolbar-search input {
  border-radius: 20px !important;
  padding-left: 10px !important;
  font-size: var(--text-xs) !important;
}
/* Workspace form card: subtle inner inset */
#caseModal.case-workspace-open #caseFormFields {
  box-shadow: 0 0 0 1px var(--app-border), inset 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}
/* Attachment items: uniform Zoho card style */
.attachment-item {
  border-radius: 6px !important;
  border-color: var(--app-border) !important;
}
/* Developer token chips: tighter */
.developer-assignee-token {
  padding: 2px 6px !important;
  font-size: 11px !important;
  border-radius: 4px !important;
  border-width: 1px !important;
}

/* ──────────────────────────────────────────────────────────
   11. PROFILE / NOTIFICATION MENUS — "Dropdown polish"
   ────────────────────────────────────────────────────────── */
.profile-menu,
.notification-menu {
  border-radius: 10px !important;
  border-width: 1px !important;
  overflow: hidden !important;
}
.profile-menu button {
  border-radius: 0 !important;
  font-size: var(--text-xs) !important;
  font-weight: 600 !important;
}

/* ──────────────────────────────────────────────────────────
   12. ASSIGNMENT SUMMARY BAR — "Compact attribution strip"
   ────────────────────────────────────────────────────────── */
.assignment-summary-bar {
  padding: 5px 18px !important;
  font-size: 11px !important;
  background: var(--app-surface-subtle) !important;
  border-top: 1px solid var(--app-border) !important;
  border-bottom: 1px solid var(--app-border) !important;
}
.assignment-badge {
  border-radius: 4px !important;
  font-size: 11px !important;
  padding: 1px 6px !important;
  font-weight: 700 !important;
}

/* ──────────────────────────────────────────────────────────
   REDUCED MOTION — guard for all new transitions above
   ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  input, select, textarea,
  .action-btn, #pagination .page-btn,
  .profile-menu button {
    transition: none !important;
  }
}

/* ──────────────────────────────────────────────────────────
   DARK MODE adjustments for new rules
   ────────────────────────────────────────────────────────── */
[data-theme="dark"] #appTopbar {
  border-bottom-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] #statsBar {
  border-top-color: rgba(37, 99, 235, 0.4) !important;
}
[data-theme="dark"] .tc-table thead {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}
[data-theme="dark"] *::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  background-clip: content-box;
}
[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
  background-clip: content-box;
}

/* ──────────────────────────────────────────────────────────
   CEILING LEVEL 1: LINEAR SINGLE-LINE COMMAND BAR (Electric Azure #0284c7)
   ────────────────────────────────────────────────────────── */
#caseModal .case-modal-sticky-header {
  padding: 6px 16px !important;
  min-height: 40px !important;
  background: #0284c7 !important;
  border-bottom: 1px solid #0369a1 !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
#caseModal .case-modal-header-identity {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
#caseModal #caseModalTitle {
  font-size: 13px !important;
  font-weight: 800 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  margin: 0 !important;
  line-height: 1 !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.18) !important;
  padding: 3px 8px !important;
  border-radius: 5px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  flex-shrink: 0 !important;
}
#caseModal #caseModalChips {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}
#caseModal .case-form-tabs {
  display: inline-flex !important;
  align-items: center !important;
  background: rgba(0, 0, 0, 0.22) !important;
  padding: 2.5px !important;
  border-radius: 6px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
  gap: 3px !important;
}
#caseModal .case-form-tab {
  height: 24px !important;
  padding: 0 10px !important;
  font-size: 11.5px !important;
  font-weight: 650 !important;
  color: #ffffff !important;
  border-radius: 4px !important;
  border: none !important;
  background: transparent !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  transition: all 120ms ease !important;
}
#caseModal .case-form-tab:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.2) !important;
}
#caseModal .case-form-tab[aria-selected="true"],
#caseModal .case-form-tab.is-active {
  color: #0284c7 !important;
  background: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}
#caseModal .case-modal-record-heading {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  margin: 0 !important;
}
#caseModal .case-header-state-control {
  border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
  background: rgba(0, 0, 0, 0.22) !important;
  border-radius: 5px !important;
  padding: 1px 6px !important;
  height: 25px !important;
  display: inline-flex !important;
  align-items: center !important;
}
#caseModal .case-header-state-control select {
  height: 21px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 0 4px !important;
  border-radius: 3px !important;
  background: transparent !important;
  color: #ffffff !important;
  border: none !important;
}
#caseModal .case-header-state-control select option {
  color: #0f172a !important;
  background: #ffffff !important;
}
#caseModal .case-header-badges .badge {
  font-size: 10px !important;
  font-weight: 750 !important;
  padding: 2px 7px !important;
  height: 22px !important;
  line-height: 18px !important;
  border-radius: 5px !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}
#caseModal #caseModalSubtitle {
  display: none !important;
}

#caseModal .case-modal-save-footer {
  padding: 6px 18px !important;
  min-height: 44px !important;
  background: #f1f5f9 !important;
  border-top: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
#caseModal .case-normal-save-help {
  font-size: 10.5px !important;
  line-height: 1.25 !important;
  color: #475569 !important;
  font-weight: 550 !important;
  margin: 0 !important;
}
#caseModal #caseDraftStatus {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  color: #b45309 !important;
}
#caseModal .case-modal-save-footer button {
  height: 30px !important;
  padding: 0 13px !important;
  font-size: 11.5px !important;
  font-weight: 650 !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease !important;
}
#caseModal .case-modal-save-footer button:not(#caseSaveBtn) {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
#caseModal .case-modal-save-footer button:not(#caseSaveBtn):hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  transform: none !important;
}
#caseModal #caseSaveBtn {
  font-weight: 700 !important;
  background: #0284c7 !important;
  border: 1px solid #0369a1 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.25) !important;
}
#caseModal #caseSaveBtn:hover {
  background: #0369a1 !important;
  transform: none !important;
}
#caseModal button:hover {
  transform: none !important;
}
