/* Finea Viewer Exact Replica Customizations */

/* ============================================
   GLOBAL THEME & COLORS
   ============================================ */
:root {
  /* Cyan/Teal color scheme matching provided code */
  --finea-blue: #06b6d4;
  /* cyan-500 - active state */
  --finea-blue-light: #22d3ee;
  /* cyan-400 - hover text */
  --finea-blue-dark: #0891b2;
  /* cyan-600 - darker variant */
  --finea-cyan-hover: rgba(6, 182, 212, 0.2);
  /* cyan-500/20 - hover background */
  --finea-dark-bg: #1a1a1a;
  --finea-panel-bg: #2d2d2d;
  --finea-text: #ffffff;
  --finea-text-secondary: #9ca3af;
}

body {
  background-color: #000000;
  color: var(--finea-text);
}

/* Force all main containers to black background */
#root,
#root>div,
[class*="ViewerLayout"],
[class*="viewer-layout"],
[class*="App"] {
  background-color: #000000 !important;
}

/* Viewport grid background */
[class*="ViewportGrid"],
[class*="viewport-grid"],
[class*="grid"] {
  background-color: #000000 !important;
}

/* ============================================
   HEADER CUSTOMIZATIONS
   ============================================ */

/* Header background - BLACK */
.bg-primary-dark,
[class*="NavBar"],
[class*="NavBar"]>div {
  background-color: #000000 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Logo styling */
.finea-logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.finea-logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  /* rounded-xl equivalent */
  background: linear-gradient(to bottom right, var(--finea-blue), var(--finea-blue-light));
  /* gradient like in code */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
}

.finea-logo-text {
  font-size: 20px;
  font-weight: bold;
  color: var(--finea-text);
}

/* Navigation buttons in header center */
.finea-nav-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
}

.finea-nav-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  color: var(--finea-text);
  font-size: 14px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.finea-nav-button:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Navigation button icons - exact sizing */
.finea-nav-button svg,
.finea-nav-button [class*="Icon"] svg,
.finea-nav-button [class*="icon"] {
  width: 18px !important;
  height: 18px !important;
  color: #ffffff !important;
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

.finea-nav-button span {
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 400;
}

/* Header height */
[class*="h-\\[48px\\]"] {
  height: 48px !important;
}

/* All header icons - ensure white color */
[class*="Header"] svg,
[class*="header"] svg,
[class*="NavBar"] svg {
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* Icon component default styling */
[class*="Icon"] svg {
  color: inherit;
  fill: currentColor;
}

/* Ensure icons in header are white */
[class*="Header"] [class*="Icon"] svg,
[class*="NavBar"] [class*="Icon"] svg {
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* Force all SVG icons to use proper fill/stroke */
svg {
  fill: currentColor;
  stroke: currentColor;
}

/* Override for specific icon colors */
svg[fill="none"] {
  stroke: currentColor;
  fill: none;
}

/* White icons for active/selected states (NO blue colors) */
[class*="active"] svg,
[class*="selected"] svg,
[aria-pressed="true"] svg {
  color: #ffffff !important;
  /* White icons, no blue */
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* Diagnostic Report toolbar – dark charcoal icons (override global white svg rules) */
.ohif-diagnostic-report-toolbar,
.ohif-diagnostic-report-toolbar button,
.ohif-diagnostic-report-toolbar span {
  color: #343A40 !important;
}

.ohif-diagnostic-report-toolbar svg {
  color: #343A40 !important;
  stroke: #343A40 !important;
}

.ohif-diagnostic-report-toolbar svg line,
.ohif-diagnostic-report-toolbar svg path {
  stroke: #343A40 !important;
}

.ohif-diagnostic-report-toolbar svg circle,
.ohif-diagnostic-report-toolbar svg text {
  fill: #343A40 !important;
  stroke: #343A40 !important;
}

/* TipTap/ProseMirror report editor placeholder and focus */
.ohif-diagnostic-report-tiptap .ProseMirror.is-editor-empty:first-child::before,
.ohif-diagnostic-report-tiptap .tiptap.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: #9ca3af;
  pointer-events: none;
  height: 0;
}

.ohif-diagnostic-report-tiptap .ProseMirror {
  outline: none;
}

/* Create New Report view – white panel covering full center, dark text and faded grey icon */
.ohif-create-new-report-view {
  background-color: #ffffff !important;
}

.ohif-create-new-report-view,
.ohif-create-new-report-panel,
.ohif-create-new-report-panel h2,
.ohif-create-new-report-panel p {
  color: inherit !important;
}

.ohif-create-new-report-panel h2 {
  color: #374151 !important;
}

.ohif-create-new-report-panel p {
  color: #4b5563 !important;
}

/* Icon only – no black box; ensure no global black background applies */
.ohif-create-new-report-icon,
.ohif-create-new-report-panel .ohif-create-new-report-icon {
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

.ohif-create-new-report-icon,
.ohif-create-new-report-icon svg,
.ohif-create-new-report-icon svg * {
  color: #9ca3af !important;
  fill: #9ca3af !important;
  stroke: #9ca3af !important;
}

/* Cancel button – reference: white bg, light gray border, dark gray text */
.ohif-diagnostic-report-cancel-btn {
  color: #1f2937 !important;
  background-color: #ffffff !important;
  border-color: #d1d5db !important;
}

/* Save Report button – white text and icon (gradient set in override below to beat generic button rules) */
.ohif-diagnostic-report-save-btn svg,
.ohif-diagnostic-report-save-btn svg * {
  color: #ffffff !important;
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* ============================================
   VIEWPORT OVERLAY
   ============================================ */
.viewport-wrapper {
  position: relative;
}

.viewport-wrapper::after {
  content: 'Not For Diagnostic Use';
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ============================================
   PANEL CUSTOMIZATIONS
   ============================================ */

/* Left panel (Studies) - BLACK */
[class*="SidePanel"][class*="left"],
[class*="SidePanel"][class*="left"]>div,
[class*="panel"][class*="left"] {
  background-color: #000000 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Right panel (Measurements, Segmentation, Write a report) - BLACK */
.ohif-side-panel-right,
[class*="SidePanel"][class*="right"],
[data-side-panel="right"],
[class*="panel"][class*="right"] {
  background-color: #000000 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Right panel tab bar: keep icon strip visible (tab-like row at top) */
.ohif-side-panel-right > div:first-child,
[data-side-panel="right"] > div:first-child {
  background-color: #1a1a1a !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 36px !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Right panel closed state: icon column (reveal + 3 tab icons) */
.ohif-side-panel-right .mt-3.flex.flex-col,
[data-side-panel="right"] .mt-3.flex.flex-col {
  display: flex !important;
  visibility: visible !important;
  min-height: 120px;
}

/* Panel headers */
[class*="panel-header"],
[class*="PanelHeader"] {
  color: var(--finea-text) !important;
  font-weight: 600;
  font-size: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Panel content */
[class*="panel-content"],
[class*="PanelContent"] {
  color: var(--finea-text);
}

/* Empty state message */
.measurement-table-empty,
[class*="empty-state"] {
  padding: 24px 16px;
  text-align: center;
  color: var(--finea-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================
   BOTTOM DISCLAIMER BANNER
   ============================================ */
[class*="InvestigationalUseDialog"],
.finea-disclaimer-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #000000 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.finea-disclaimer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.finea-disclaimer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.finea-disclaimer-label {
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
}

/* ============================================
   TOOLBAR ICONS - EXACT MATCH TO SCREENSHOT
   ============================================ */

/* Toolbar container - alignment as in screenshot (horizontal, vertically centered, even spacing) */
.finea-toolbar-container {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
  margin: 0 !important;
  padding: 4px 0 !important;
  min-height: 36px !important;
}

/* Ensure header/nav bar area behind toolbar is black */
[class*="NavBar"],
nav[class*="flex"][class*="items-center"] {
  background-color: #000000 !important;
}

/* Toolbar item wrapper - uniform alignment */
.finea-toolbar-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 28px !important;
}


[class*="ToolbarButton"],
[class*="toolbar-button"],
button[class*="ToolbarButton"],
[class*="IconButton"][size="toolbar"],
button[size="toolbar"] {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  color: #ffffff !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.15s ease !important;
}

/* Selected/hover toolbar icon - dark blue rounded rect + light blue outline (match 1st/2nd screenshot) */
.finea-toolbar-item button.finea-toolbar-selected,
.finea-toolbar-item button.rounded-md.finea-toolbar-selected {
  /* background-color: #1e4d5c !important; */
  /* color: #5ec4d4 !important; */
  /* border: 1px solid rgba(94, 196, 212, 0.5) !important; */
  /* border-radius: 5px !important; */
}
.finea-toolbar-item button.finea-toolbar-selected svg,
.finea-toolbar-item button.rounded-md.finea-toolbar-selected svg {
  /* color: #5ec4d4 !important; */
  /* fill: #5ec4d4 !important; */
  /* stroke: #5ec4d4 !important; */
}

/* Toolbar button hover - subtle white overlay (NO blue colors) */
[class*="ToolbarButton"]:hover,
[class*="toolbar-button"]:hover,
button[class*="ToolbarButton"]:hover,
[class*="IconButton"][size="toolbar"]:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  /* Subtle white overlay, no blue */
}

/* Toolbar button hover - keep icons white (NO blue colors) */
[class*="ToolbarButton"]:hover svg,
[class*="toolbar-button"]:hover svg,
button[class*="ToolbarButton"]:hover svg,
[class*="IconButton"][size="toolbar"]:hover svg {
  color: #ffffff !important;
  /* White icons, no blue */
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* Toolbar icon SVG sizing - 14px to match 1st/2nd screenshot (not too large) */
[class*="ToolbarButton"] svg,
[class*="toolbar-button"] svg,
[class*="ToolbarButton"] [class*="Icon"] svg,
button[class*="ToolbarButton"] svg,
[class*="IconButton"][size="toolbar"] svg,
[class*="IconButton"][size="toolbar"] [class*="Icon"] svg,
button[size="toolbar"] svg,
[class*="IconButton"] svg,
svg[class*="w-\\[28px\\]"],
svg[class*="h-\\[28px\\]"],
svg[class*="w-4"],
svg[class*="h-4"],
svg.w-4,
svg.h-4,
[class*="ToolbarButton"] svg.w-4,
[class*="ToolbarButton"] svg.h-4,
[class*="IconButton"] svg.w-4,
[class*="IconButton"] svg.h-4 {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  color: #ffffff !important;
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* Active toolbar button - BLACK background with WHITE icon (NO blue colors) */
[class*="ToolbarButton"][class*="active"],
[class*="toolbar-button"][class*="active"],
button[class*="ToolbarButton"][class*="active"],
[class*="ToolbarButton"][aria-pressed="true"],
button[aria-pressed="true"],
[class*="bg-primary-light"],
[class*="text-primary-active"],
[class*="bg-cyan-500"],
button[class*="bg-cyan-500"],
[class*="bg-black"] {
  /* background-color: #000000 !important; */
  /* Black background, no blue */
  color: #ffffff !important;
  /* White text */
}

/* Active toolbar icon - WHITE color (NO blue colors) */
[class*="ToolbarButton"][class*="active"] svg,
[class*="toolbar-button"][class*="active"] svg,
button[class*="ToolbarButton"][class*="active"] svg,
[class*="ToolbarButton"][aria-pressed="true"] svg,
button[aria-pressed="true"] svg,
[class*="text-primary-active"] svg,
[class*="bg-primary-light"] svg,
[class*="bg-cyan-500"] svg,
button[class*="bg-cyan-500"] svg,
[class*="bg-black"] svg {
  color: #ffffff !important;
  /* White icons, no blue */
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* Override any blue backgrounds on active states - force black */
[class*="ToolbarButton"][class*="active"],
[class*="bg-primary-light"],
button[class*="active"],
[class*="rounded"][class*="bg-primary-light"],
[class*="bg-cyan-500"] {
  background-color: #000000 !important;
  background: #000000 !important;
}

/* Ensure active state text is white, not blue or black */
[class*="ToolbarButton"][class*="active"],
[class*="text-black"][class*="bg-primary-light"],
button[class*="active"][class*="text-black"],
[class*="bg-cyan-500"] {
  color: #ffffff !important;
  /* White text, no blue */
}

[class*="ToolbarButton"][class*="active"] svg,
[class*="text-black"][class*="bg-primary-light"] svg,
[class*="bg-cyan-500"] svg {
  color: #ffffff !important;
  /* White icons, no blue */
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* Match 2nd screenshot: all toolbar/header icons white line-art, no filled blue/cyan */
[class*="SplitButton"] [class*="Primary"],
[class*="SplitButton"] [class*="Secondary"],
[class*="split-button"]>div {
  background-color: transparent !important;
}

[class*="SplitButton"] [class*="Primary"][class*="rounded"],
button[class*="ToolbarButton"].rounded,
[class*="SplitButton"] .rounded-md {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

[class*="SplitButton"] svg,
[class*="finea-toolbar"] svg,
nav [class*="IconButton"] svg {
  color: #ffffff !important;
  fill: none !important;
  stroke: #ffffff !important;
}

/* Split button styling */
[class*="SplitButton"],
[class*="split-button"] {
  display: inline-flex !important;
  gap: 0 !important;
}

[class*="SplitButton"] [class*="ToolbarButton"],
[class*="split-button"] [class*="toolbar-button"] {
  width: 28px !important;
  /* h-7 w-7 = 28px matching provided code */
  height: 28px !important;
}

/* Override Tailwind's display:block on svg for split-button chevron down icon */
[class*="SplitButton"] [class*="Secondary"] svg,
[data-cy$="split-button-secondary"] svg {
  display: inline-block !important;
}

/* ============================================
   USER INFO IN HEADER
   ============================================ */
[class*="HeaderPatientInfo"],
[class*="patient-info"] {
  color: var(--finea-text) !important;
}

[class*="HeaderPatientInfo"] svg,
[class*="patient-info"] svg,
[class*="HeaderPatientInfo"] [class*="Icon"] svg {
  width: 20px !important;
  height: 20px !important;
  color: var(--finea-blue) !important;
  fill: var(--finea-blue) !important;
}

/* Settings icon in header */
[class*="options-settings-icon"] svg,
[class*="settings"] svg {
  width: 20px !important;
  height: 20px !important;
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* ============================================
   STUDY BROWSER / LEFT PANEL
   ============================================ */
[class*="StudyBrowser"],
[class*="study-browser"] {
  background-color: #000000 !important;
}

[class*="StudyItem"],
[class*="study-item"] {
  color: var(--finea-text) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[class*="StudyItem"]:hover,
[class*="study-item"]:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Selected study - BLACK with blue border */
[class*="StudyItem"][class*="selected"],
[class*="study-item"][class*="selected"] {
  background-color: #000000 !important;
  border-left: 3px solid var(--finea-blue);
}

/* Thumbnail grid */
[class*="thumbnail"],
[class*="Thumbnail"] {
  border: 2px solid transparent;
  border-radius: 4px;
}

[class*="thumbnail"][class*="active"],
[class*="Thumbnail"][class*="active"] {
  border-color: var(--finea-blue) !important;
}

/* Study browser toolbar: active state = dark grey rounded rectangle (match 2nd screenshot) */
.finea-study-browser-btn-active {
  background-color: #3f3f46 !important;
  border-radius: 6px;
  color: #ffffff !important;
}

.finea-study-browser-btn-active svg {
  color: #ffffff !important;
}

/* Study browser toolbar icons: outline only (no fill) so grid matches filter/list */
[data-cy="studyBrowser-panel"] button svg {
  fill: none !important;
  stroke: #ffffff !important;
  color: #ffffff !important;
}

[data-cy="studyBrowser-panel"] .finea-study-browser-btn-active svg {
  stroke: #ffffff !important;
  fill: none !important;
}

/* Study browser dropdowns – match screenshot: pill shape, dark grey bg, white text, light border */
.finea-study-browser-dropdowns .finea-study-browser-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-height: 36px;
  padding: 8px 36px 8px 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  color: #ffffff !important;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.finea-study-browser-dropdowns .finea-study-browser-select:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.finea-study-browser-dropdowns .finea-study-browser-select:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

/* Light grey chevron (dropdown arrow) */
.finea-study-browser-dropdowns .finea-study-browser-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 16px 16px !important;
}

/* Option styling where supported (open dropdown) */
.finea-study-browser-dropdowns .finea-study-browser-select option {
  background-color: #2d2d2d;
  color: #ffffff;
  font-size: 14px;
  padding: 8px 12px;
}

/* Diagnostic Report card in study browser – match screenshot: dark card, light blue icon, white title, gray date */
.ohif-document-report-card {
  background-color: #2d2d2d !important;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ohif-document-report-card:hover {
  background-color: #3f3f46 !important;
}
.ohif-document-report-card svg {
  color: #22d3ee !important;
  fill: none !important;
  stroke: #22d3ee !important;
}
.ohif-document-report-card .text-white {
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 600;
}
.ohif-document-report-card .text-gray-400 {
  color: #9ca3af !important;
  font-size: 0.75rem;
}

/* Panel icons - consistent sizing */
[class*="SidePanel"] svg,
[class*="panel"] svg,
[class*="Panel"] svg {
  width: 20px !important;
  height: 20px !important;
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* Right panel tab icons: 16px, outline only (no fill) */
.ohif-side-panel-right [data-cy*="-btn"] svg,
.ohif-side-panel-right .flex.flex-wrap svg,
.ohif-side-panel-right .flex.flex-col svg,
[data-side-panel="right"] [data-cy*="-btn"] svg,
[data-side-panel="right"] .flex.flex-wrap svg,
[data-side-panel="right"] .flex.flex-col svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  fill: none !important;
  stroke: currentColor !important;
}
.ohif-side-panel-right [data-cy*="-btn"] img,
.ohif-side-panel-right .flex.flex-wrap img,
.ohif-side-panel-right .flex.flex-col img,
[data-side-panel="right"] [data-cy*="-btn"] img,
[data-side-panel="right"] .flex.flex-wrap img,
[data-side-panel="right"] .flex.flex-col img {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  display: block !important;
  visibility: visible !important;
  object-fit: contain;
  filter: none !important;
}
/* Right panel tab icons: outline only, no fill - use stroke color for visibility */
.ohif-side-panel-right .flex.flex-wrap svg,
.ohif-side-panel-right .flex.flex-col svg,
[data-side-panel="right"] .flex.flex-wrap svg,
[data-side-panel="right"] .flex.flex-col svg {
  fill: none !important;
  stroke: currentColor !important;
  color: rgba(255, 255, 255, 0.75);
}
.ohif-side-panel-right .flex.flex-wrap img,
.ohif-side-panel-right .flex.flex-col img,
[data-side-panel="right"] .flex.flex-wrap img,
[data-side-panel="right"] .flex.flex-col img {
  filter: none !important;
  opacity: 0.85;
}
/* Active tab: light blue fill + darker blue border (match 1st screenshot) */
.ohif-side-panel-right .bg-customblue-40,
[data-side-panel="right"] .bg-customblue-40 {
  background-color: #2D6F77 !important;
  border: 1px solid #1e4d5c !important;
  border-radius: 6px !important;
}
.ohif-side-panel-right .bg-customblue-40 svg,
[data-side-panel="right"] .bg-customblue-40 svg {
  fill: none !important;
  stroke: currentColor !important;
  color: #ffffff !important;
}
.ohif-side-panel-right .bg-customblue-40 img,
[data-side-panel="right"] .bg-customblue-40 img {
  filter: none !important;
  opacity: 1;
}

/* Right panel tab tooltips: teal box, white bold label (match 1st screenshot) */
.finea-right-panel-tab-tooltip {
  background-color: #2D6F77 !important;
  border: 1px solid rgba(109, 215, 209, 0.4) !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
  min-width: 110px !important;
  max-width: 120px !important;
  min-height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.finea-right-panel-tab-tooltip > div:first-of-type {
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  text-align: center !important;
}
.finea-right-panel-tab-tooltip > svg {
  display: none !important;
}

/* Right panel: tab buttons ~32px when 3 tabs (match 1st screenshot) */
.ohif-side-panel-right .ohif-side-panel-tab-strip [data-cy$="-btn"],
[data-side-panel="right"] .ohif-side-panel-tab-strip [data-cy$="-btn"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  min-width: 32px !important;
  min-height: 32px !important;
}
.ohif-side-panel-right [data-cy="measure-btn"],
.ohif-side-panel-right [data-cy="panelSegmentation-btn"],
.ohif-side-panel-right [data-cy="reporting-btn"],
[data-side-panel="right"] .mt-3.flex.flex-col [data-cy*="-btn"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  min-width: 32px !important;
  min-height: 32px !important;
}

/* Tab strip: horizontal row of 3 icons - ensure grid doesn’t collapse */
.ohif-side-panel-tab-grid,
.ohif-side-panel-right .flex.grow .flex.flex-wrap,
[data-side-panel="right"] .flex.grow .flex.flex-wrap {
  min-width: 130px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  flex-direction: row !important;
}

/* Tab strip icons: 16px */
.ohif-side-panel-right .ohif-side-panel-tab-strip img,
.ohif-side-panel-right .ohif-side-panel-tab-strip svg,
[data-side-panel="right"] .ohif-side-panel-tab-strip img,
[data-side-panel="right"] .ohif-side-panel-tab-strip svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  object-fit: contain;
}
/* Tab strip icons: outline only, no fill */
.ohif-side-panel-right .ohif-side-panel-tab-strip svg,
[data-side-panel="right"] .ohif-side-panel-tab-strip svg {
  fill: none !important;
  stroke: currentColor !important;
  color: rgba(255, 255, 255, 0.75);
}
.ohif-side-panel-right .ohif-side-panel-tab-strip .bg-customblue-40 svg,
[data-side-panel="right"] .ohif-side-panel-tab-strip .bg-customblue-40 svg {
  fill: none !important;
  stroke: currentColor !important;
  color: #ffffff !important;
}
.ohif-side-panel-right .ohif-side-panel-tab-strip img,
[data-side-panel="right"] .ohif-side-panel-tab-strip img {
  filter: none !important;
  opacity: 0.85;
}
.ohif-side-panel-right .ohif-side-panel-tab-strip .bg-customblue-40 img,
[data-side-panel="right"] .ohif-side-panel-tab-strip .bg-customblue-40 img {
  filter: none !important;
  opacity: 1;
}

/* Panel header icons */
[class*="panel-header"] svg,
[class*="PanelHeader"] svg {
  width: 18px !important;
  height: 18px !important;
  color: #ffffff !important;
}

/* ============================================
   MEASUREMENT TABLE
   ============================================ */
[class*="MeasurementTable"],
[class*="measurement-table"] {
  background-color: transparent !important;
}

[class*="MeasurementTable"] [class*="header"],
[class*="measurement-table"] [class*="header"] {
  background-color: #000000 !important;
  color: var(--finea-text) !important;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Measurement table icons */
[class*="MeasurementTable"] svg,
[class*="measurement-table"] svg,
[class*="MeasurementItem"] svg {
  width: 16px !important;
  height: 16px !important;
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* ============================================
   SCROLLBARS
   ============================================ */
.ohif-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.ohif-scrollbar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.ohif-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.ohif-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */
button,
[class*="Button"] {
  transition: all 0.2s ease;
}

button:hover,
[class*="Button"]:hover {
  opacity: 0.9;
}

/* Primary buttons - Keep cyan-500 for action buttons only */
[class*="Button"][class*="primary"]:not([class*="ToolbarButton"]),
button[class*="primary"]:not([class*="ToolbarButton"]) {
  /* background: linear-gradient(to right, var(--finea-blue), var(--finea-blue-light)) !important; */
  /* gradient like in code */
  color: #fff !important;
}

[class*="Button"][class*="primary"]:not([class*="ToolbarButton"]):hover,
button[class*="primary"]:not([class*="ToolbarButton"]):hover {
  /* background: linear-gradient(to right, var(--finea-blue-dark), var(--finea-blue)) !important; */
}

/* ============================================
   DROPDOWNS & MENUS
   ============================================ */
[class*="Dropdown"],
[class*="dropdown"] {
  background-color: #000000 !important;
}

[class*="Dropdown"] [class*="item"],
[class*="dropdown"] [class*="item"] {
  color: var(--finea-text) !important;
}

[class*="Dropdown"] [class*="item"]:hover,
[class*="dropdown"] [class*="item"]:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* ============================================
   ADDITIONAL BLACK BACKGROUND OVERRIDES
   ============================================ */

/* Ensure all panel content areas are black */
[class*="SidePanel"] > div,
[class*="panel"] > div,
[class*="Panel"] > div {
  background-color: #000000 !important;
}
/* Right panel tab bar (first row) stays visible with darker grey - override above */
.ohif-side-panel-right > div:first-child,
[data-side-panel="right"] > div:first-child {
  background-color: #1a1a1a !important;
}

/* Study browser content */
[class*="StudyBrowser"]>*,
[class*="study-browser"]>* {
  background-color: #000000 !important;
}

/* Measurement panel content */
[class*="MeasurementTable"]>*,
[class*="measurement-table"]>* {
  background-color: #000000 !important;
}

/* Toolbar container */
[class*="Toolbar"],
[class*="toolbar"] {
  background-color: transparent !important;
}

/* Viewport container */
[class*="Viewport"],
[class*="viewport"] {
  background-color: #000000 !important;
}

/* Remove any blue backgrounds from buttons except primary action buttons */
button:not([class*="primary"]):not(.finea-logo-circle),
[class*="Button"]:not([class*="primary"]) {
  background-color: transparent !important;
}

/* Hover states for non-primary buttons - subtle white overlay (NO blue colors) */
button:not([class*="primary"]):not(.finea-logo-circle):hover,
[class*="Button"]:not([class*="primary"]):hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  /* Subtle white overlay, no blue */
}

/* Hover text color - white (NO blue colors) */
button:not([class*="primary"]):not(.finea-logo-circle):hover svg,
[class*="Button"]:not([class*="primary"]):hover svg {
  color: #ffffff !important;
  /* White icons, no blue */
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* Diagnostic Report Save button – gradient + no border (override generic button rules) */
button.ohif-diagnostic-report-save-btn,
.ohif-diagnostic-report-save-btn {
  background: linear-gradient(to right, #3b82f6, #22d3ee) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

button.ohif-diagnostic-report-save-btn:hover,
.ohif-diagnostic-report-save-btn:hover {
  background: linear-gradient(to right, #2563eb, #06b6d4) !important;
  opacity: 0.95;
}

/* Layout dropdown modal - solid dark grey, no background show-through (match 2nd screenshot) */
.tooltip-box:has(.finea-layout-modal),
.tooltip-box .finea-layout-modal {
  background-color: #1e2228 !important;
  opacity: 1 !important;
}
.tooltip-box:has(.finea-layout-modal) {
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}
.tooltip-box:has(.finea-layout-modal) > div:first-of-type {
  background-color: #1e2228 !important;
  opacity: 1 !important;
}
.tooltip-box:has(.finea-layout-modal) > svg {
  display: none !important;
}

.finea-layout-modal {
  display: flex !important;
  flex-direction: row !important;
  background-color: #1e2228 !important;
  border-radius: 8px !important;
  border: none !important;
  padding: 12px !important;
  min-width: 320px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  opacity: 1 !important;
}
.finea-layout-modal-left {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding-right: 12px !important;
  min-width: 140px !important;
}
.finea-layout-modal-right {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding-left: 12px !important;
  border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
  min-width: 140px !important;
}
.finea-layout-modal-heading {
  color: #ffffff !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.finea-layout-modal-common {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.finea-layout-modal-divider {
  height: 1px !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
  margin: 2px 0 !important;
}
.finea-layout-modal-advanced {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.finea-layout-preset {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  padding: 6px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  background-color: transparent !important;
  border: 1px solid transparent !important;
  color: #ffffff !important;
  transition: background-color 0.15s ease, border-color 0.15s ease !important;
}
.finea-layout-preset:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(109, 215, 209, 0.4) !important;
  color: #6DD7D1 !important;
}
.finea-layout-preset:hover svg,
.finea-layout-preset:active svg {
  color: #6DD7D1 !important;
  stroke: #6DD7D1 !important;
  fill: #6DD7D1 !important;
}
.finea-layout-preset-advanced {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 8px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  background-color: transparent !important;
  color: #ffffff !important;
  font-size: 0.875rem !important;
}
.finea-layout-preset-advanced:hover:not(.ohif-disabled) {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #6DD7D1 !important;
}
.finea-layout-preset-advanced:hover:not(.ohif-disabled) svg {
  color: #6DD7D1 !important;
  stroke: #6DD7D1 !important;
}
.finea-layout-modal-custom-grid {
  border-radius: 6px !important;
  overflow: hidden !important;
}
.finea-layout-modal-custom-grid [style*="grid"] {
  border-radius: 6px !important;
}
.finea-layout-modal-custom-grid > div {
  border-radius: 6px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}
.finea-layout-modal-custom-grid [class*="border"] {
  border-color: rgba(255, 255, 255, 0.12) !important;
}
.finea-layout-modal-custom-grid [style*="backgroundColor"] {
  background-color: #0d2847 !important;
}
/* Layout button when dropdown is open - match toolbar selected style (1st/2nd screenshot) */
.finea-toolbar-item button.finea-layout-open {
  background-color: #1e4d5c !important;
  color: #5ec4d4 !important;
  border: 1px solid rgba(94, 196, 212, 0.5) !important;
  border-radius: 5px !important;
}
.finea-toolbar-item button.finea-layout-open svg {
  color: #5ec4d4 !important;
  fill: #5ec4d4 !important;
  stroke: #5ec4d4 !important;
}
.finea-layout-modal-hint {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.6875rem !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  max-width: 100px !important;
}

/* Toolbar tooltips (Zoom, Window Level, etc.): smaller font sizes, compact padding - match 1st/2nd screenshot */
.finea-zoom-tooltip {
  background-color: #2D6F77 !important;
  border: 1px solid rgba(109, 215, 209, 0.4) !important;
  border-radius: 4px !important;
  padding: 5px 8px !important;
}
.finea-zoom-tooltip > div:first-of-type {
  color: #FFFFFF !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  line-height: 1.3 !important;
}
.finea-zoom-tooltip > div:nth-of-type(2) {
  color: #5ec4d4 !important;
  font-size: 0.6875rem !important;
  margin-top: 1px !important;
  line-height: 1.3 !important;
}
.finea-zoom-tooltip > svg {
  display: none !important;
}

/* ============================================
   DOWNLOAD HIGH-RESOLUTION IMAGE MODAL
   ============================================ */
.ReactModal__Content:has([data-cy="file-name"]) {
  background: #1e4d5c !important;
  border: 1px solid #5ec4d4 !important;
  border-radius: 10px !important;
  color: #fff;
  max-height: 90vh;
  overflow-y: auto;
}

/* Header: download icon (arrow down into tray) matching screenshot */
.ReactModal__Content:has([data-cy="file-name"]) header {
  background: transparent !important;
  color: #5ec4d4 !important;
  padding-left: 44px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235ec4d4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 18px center !important;
  background-size: 20px 20px !important;
}

.ReactModal__Content:has([data-cy="file-name"]) header [data-cy="modal-header"] {
  color: #5ec4d4 !important;
}

.ReactModal__Content:has([data-cy="file-name"]) header .text-primary-active {
  color: #e5e7eb !important;
}

.ReactModal__Content:has([data-cy="file-name"]) section {
  background: transparent !important;
}

/* Download form: labels and inputs – alignment to match screenshot */
.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form .finea-download-label,
.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form label,
.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form [class*="Label"] {
  color: #e5e7eb !important;
}

.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form input[type="text"],
.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form input[type="number"] {
  background: #2F3235 !important;
  border: 1px solid rgba(94, 196, 212, 0.4) !important;
  border-radius: 6px !important;
  color: #e5e7eb !important;
  width: 100% !important;
}

.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form input:focus {
  border-color: #5ec4d4 !important;
  outline: none !important;
}

/* Format radio group – aligned with label above */
.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form .finea-format-option {
  color: #e5e7eb !important;
}

.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form .finea-format-radio,
.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form input[type="radio"] {
  accent-color: #5ec4d4;
}

/* Remove extra margin when Input has empty label */
.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form input[data-cy="file-name"] {
  margin-top: 0;
}

/* Toggle switches (checkbox styled as switch) */
.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form .finea-toggle-input {
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #4b5563;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form .finea-toggle-input::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form .finea-toggle-input:checked {
  background: #5ec4d4;
}

.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form .finea-toggle-input:checked::after {
  transform: translateX(20px);
}

/* Cancel button: outline */
.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form [data-cy="cancel-btn"] {
  background: transparent !important;
  border: 1px solid #5ec4d4 !important;
  color: #e5e7eb !important;
}

.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form [data-cy="cancel-btn"]:hover {
  background: rgba(94, 196, 212, 0.15) !important;
}

/* Download button: gradient */
.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form [data-cy="download-btn"] {
  background: linear-gradient(90deg, #5ec4d4, #3ACEEF) !important;
  border: none !important;
  color: #fff !important;
}

.ReactModal__Content:has([data-cy="file-name"]) .finea-download-form [data-cy="download-btn"]:hover:not(:disabled) {
  opacity: 0.95;
}

/* Hide image preview in download modal to match screenshot */
.ReactModal__Content:has([data-cy="file-name"]) [data-cy="image-preview"] {
  display: none !important;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1024px) {
  .finea-nav-buttons {
    gap: 4px;
  }

  .finea-nav-button {
    padding: 4px 8px;
    font-size: 12px;
  }
}
