/* Modern Professional Enterprise Medical PACS Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --tp-bg-base: #06080e;
  --tp-bg-surface: #0c101c;
  --tp-bg-card: #121829;
  --tp-bg-card-hover: #172036;
  --tp-border-subtle: #1e293b;
  --tp-border-highlight: #334155;
  --tp-cyan-glow: #0ea5e9;
  --tp-cyan-bright: #38bdf8;
  --tp-blue-accent: #2563eb;
  --tp-text-primary: #f8fafc;
  --tp-text-secondary: #94a3b8;
  --tp-text-muted: #64748b;
  --tp-emerald: #10b981;
}

.tp-portal-root {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #0f172a 0%, #06080e 70%, #030508 100%);
  color: var(--tp-text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Header */
.tp-header {
  height: 64px;
  background: rgba(12, 16, 28, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.tp-brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tp-badge-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.35);
  letter-spacing: 0.5px;
}

.tp-brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #ffffff;
}

.tp-tag-admin {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
  text-transform: uppercase;
  margin-left: 10px;
}

.tp-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-nav-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: #0ea5e9;
  color: #ffffff;
  transform: translateY(-1px);
}

.tp-nav-btn-danger {
  background: rgba(153, 27, 27, 0.3);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.tp-nav-btn-danger:hover {
  background: rgba(220, 38, 38, 0.6);
  border-color: #ef4444;
  color: #ffffff;
}

/* Main Container */
.tp-main-container {
  flex: 1;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Profile Bar */
.tp-profile-bar {
  background: rgba(18, 24, 41, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(30, 41, 59, 0.8);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.tp-profile-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tp-avatar-shield {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(37, 99, 235, 0.15));
  border: 1px solid rgba(14, 165, 233, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.2);
}

/* Status Cards Grid */
.tp-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tp-metric-card {
  background: rgba(18, 24, 41, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(30, 41, 59, 0.8);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, border-color 0.2s;
}

.tp-metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.4);
}

.tp-metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tp-text-muted);
}

.tp-metric-value {
  font-size: 17px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #ffffff;
}

.tp-metric-status {
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #34d399;
}

/* Tabs Container */
.tp-tabs-card {
  background: rgba(18, 24, 41, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(30, 41, 59, 0.9);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.tp-tab-header {
  display: flex;
  background: rgba(10, 14, 25, 0.9);
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
  padding: 8px 16px 0 16px;
  gap: 8px;
}

.tp-tab-btn {
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tp-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tp-tab-btn:hover {
  color: #ffffff;
  background: rgba(30, 41, 59, 0.3);
}

.tp-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.08);
  font-weight: 700;
}

.tp-tab-body {
  padding: 32px;
}

/* Form Styles */
.tp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.tp-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.tp-input, .tp-select {
  width: 100%;
  padding: 11px 14px;
  background: #080c16;
  border: 1px solid #1e293b;
  border-radius: 10px;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.tp-input:focus, .tp-select:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
  background: #0b1120;
}

.tp-btn-primary {
  padding: 12px 24px;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.tp-btn-primary:active {
  transform: translateY(0);
}

/* Login Modal Card */
.tp-login-card {
  max-width: 440px;
  width: 100%;
  margin: 60px auto;
  background: rgba(18, 24, 41, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(30, 41, 59, 0.9);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(14, 165, 233, 0.1);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tp-login-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(37, 99, 235, 0.15));
  border: 1px solid rgba(14, 165, 233, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto;
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.25);
}

/* Footer */
.tp-footer {
  border-top: 1px solid rgba(30, 41, 59, 0.6);
  background: rgba(10, 14, 25, 0.7);
  padding: 16px 32px;
  text-align: center;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--tp-text-muted);
}

/* TPACS RBAC & Facility Navigation Styles */
.tp-user-nav-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 30;
}
.tp-role-badge-superadmin {
  background: rgba(168, 85, 247, 0.15) !important;
  color: #c084fc !important;
  border: 1px solid rgba(168, 85, 247, 0.4) !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.tp-role-badge-radiologist {
  background: rgba(14, 165, 233, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(14, 165, 233, 0.4) !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.tp-role-badge-radiographer {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.tp-facility-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0c101c;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 12px;
  color: #e2e8f0;
  white-space: nowrap;
}
.tp-user-menu-btn {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.tp-user-menu-btn:hover {
  background: #1e293b;
  border-color: #0ea5e9;
}
.tp-auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tp-select-compact {
  background: #080c16;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  outline: none;
}
.tp-select-compact:focus {
  border-color: #0ea5e9;
}

/* Split Viewer & Diagnostic Reporting Layout Styles */
.tp-viewer-split-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: #000000;
}
.tp-viewer-split-images {
  height: 100%;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.tp-viewer-split-report {
  height: 100%;
  border-left: 2px solid #1e293b;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 40;
}
.tp-report-header-bar {
  height: 48px;
  background: #0c101c;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: #f8fafc;
}
/* Collapsible Workspace Layout Trigger & Dropdown Card */
.tp-collapsible-layout-wrapper {
  display: inline-block;
  user-select: none;
}

.tp-collapsible-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(12, 16, 28, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 16px;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 10px rgba(14, 165, 233, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}

.tp-collapsible-trigger-btn:hover,
.tp-collapsible-trigger-btn.open {
  background: rgba(14, 165, 233, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.5);
}

.tp-collapsible-dropdown-card {
  position: absolute;
  width: 290px;
  background: rgba(11, 15, 25, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(14, 165, 233, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px;
  z-index: 100000;
  animation: tpFadeSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tpFadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tp-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
  margin-bottom: 10px;
}

.tp-dropdown-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.tp-dropdown-close-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

.tp-dropdown-section {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
  margin-bottom: 10px;
}

.tp-dropdown-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.tp-dropdown-option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 8px;
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
  box-sizing: border-box;
}

.tp-dropdown-option-row:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
}

.tp-dropdown-option-row.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(2, 132, 199, 0.15) 100%);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.25);
}

.tp-dropdown-swap-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
  box-sizing: border-box;
}

.tp-dropdown-swap-row:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
}

.tp-dropdown-preset-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
  box-sizing: border-box;
}

.tp-dropdown-preset-chip:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
}

.tp-dropdown-preset-chip.active {
  background: rgba(14, 165, 233, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
}

.tp-dropdown-save-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  color: #fbbf24;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
  box-sizing: border-box;
}

.tp-dropdown-save-row:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: #fbbf24;
}

.tp-dropdown-save-row.saved {
  border-color: #10b981;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
}

/* Hide old OHIF logo SVG permanently */
#toolbar-branding-open-health-imaging-foundation,
svg[viewBox="0 0 138 28"],
svg[viewBox="0 0 233 23"] {
  display: none !important;
}

/* Strictly hide and disable Capture Tool Button (Camera Icon) and Download Image Modal */
[data-cy="Capture"],
[id="Capture"],
[id*="Capture"],
button[aria-label*="Capture"],
button[title*="Capture"],
button:has(svg [d*="M8.64381845"]),
div[role="dialog"]:has(*:contains("Download High Quality Image")),
div[role="dialog"]:has(*:contains("Image size in pixels")) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Enterprise Workspace Action Buttons & Presets */
.tp-toolbar-divider {
  width: 1px;
  height: 18px;
  background: rgba(148, 163, 184, 0.3);
  margin: 0 4px;
}
.tp-toolbar-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.tp-toolbar-action-btn:hover {
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(14, 165, 233, 0.2);
}
.tp-toolbar-action-btn.active {
  color: #38bdf8;
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.25);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}
.tp-toast-pill {
  position: fixed;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: #064e3b;
  border: 1px solid #10b981;
  color: #a7f3d0;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
}

.tp-role-badge-consultant { background: rgba(20, 184, 166, 0.15) !important; color: #2dd4bf !important; border: 1px solid rgba(20, 184, 166, 0.4) !important; font-weight: 700; text-transform: uppercase; font-size: 10px; padding: 3px 8px; border-radius: 6px; }
