/* =============================================================================
   CSS Variables for consistent theming
   ============================================================================= */
:root {
  --theme-color: #1a2632;
  --theme-hover: #233445;
  --theme-active: #2d4559;
  --theme-accent: var(--primary-color);
  --theme-contrast: #ecf0f1;
  --primary-color: var(--theme-color);
  --primary-hover: var(--theme-hover);
  --primary-active: var(--theme-active);
  --primary-gradient: linear-gradient(135deg, var(--theme-color) 0%, var(--theme-active) 100%);
  --primary-shadow: 0 2px 8px rgba(26, 38, 50, 0.3);
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --border-color: #dee2e6;
  --text-color: #333;
  --background-color: #ffffff;
}

/* =============================================================================
   Animations
   ============================================================================= */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 500px; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* =============================================================================
   html
   ============================================================================= */
html {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* =============================================================================
   body
   ============================================================================= */
body {
  background-color: #ffffff;
  color: #2e3a46;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1rem;
  margin: 0;
  padding: 0;
  display: flex;
  height: 100vh;
  visibility: hidden;
}

/* body > Login Page Styles (body.login-page) */
body.login-page {
  background: var(--primary-gradient);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: visible;
}

body.login-page > .login-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  margin: 20px;
}

body.login-page > .login-container > .login-header {
  text-align: center;
  margin-bottom: 30px;
}

body.login-page > .login-container > .login-header > .login-logo {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
}

body.login-page > .login-container > .login-header > h1 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 28px;
  font-weight: 600;
}

body.login-page > .login-container > .login-header > p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

body.login-page > .login-container > .login-form-container {
  margin-bottom: 30px;
}

body.login-page > .login-container > .login-form-container > .login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

body.login-page > .login-container > .login-form-container > .login-form .form-group {
  display: flex;
  flex-direction: column;
}

body.login-page > .login-container > .login-form-container > .login-form .form-group label {
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

body.login-page > .login-container > .login-form-container > .login-form .form-group input {
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s ease;
  background-color: #fff;
}

body.login-page > .login-container > .login-form-container > .login-form .form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body.login-page > .login-container > .login-form-container > .login-form .login-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

body.login-page > .login-container > .login-form-container > .login-form .login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--primary-shadow);
}

body.login-page > .login-container > .login-form-container > .login-form .login-btn:active:not(:disabled) {
  transform: translateY(0);
}

body.login-page > .login-container > .login-form-container > .login-form .login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

body.login-page > .login-container > .login-form-container > .login-form .error-message {
  background-color: #fee;
  color: #c33;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #fcc;
  font-size: 14px;
  text-align: center;
}

body.login-page > .login-container > .login-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #e1e5e9;
}

body.login-page > .login-container > .login-footer > p {
  margin: 0;
  color: #666;
  font-size: 12px;
}

body > nav#navbar {
  width: 68px;
  background: var(--theme-color);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 4px;
  flex-shrink: 0;
  z-index: 20;
}

body > nav#navbar > a {
  width: 62px;
  min-height: 58px;
  background: transparent;
  border-radius: 6px;
  text-decoration: none;
  color: var(--theme-contrast);
  transition: background-color 0.2s ease, color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  gap: 5px;
  padding: 6px 4px;
  box-sizing: border-box;
}

body > nav#navbar > a .menu-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

body > nav#navbar > a span {
  max-width: 62px;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  color: var(--theme-contrast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

body > nav#navbar > a:hover,
body > nav#navbar > a.active {
  background-color: rgba(255, 255, 255, 0.1);
}

body > nav#navbar > a.active {
  box-shadow: inset 3px 0 0 var(--theme-accent);
}

/* body > main */
body > main {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background-color: #f1f5f9;
}

body > main > .content {
  display: none;
  transition: width 0.3s;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  height: auto;
  min-height: 0;
  max-height: none;
}

body > main > .content.active {
  display: flex;
}

/* body > main > div#dashboard */
body > main > div#dashboard {
  padding: 20px;
}

body > main > div#dashboard > h2 {
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

body > main > div#dashboard > div#dashboard-status-console {
  width: 100%;
  height: 200px;
  overflow-y: scroll;
  border: 1px solid #ccc;
}

body > main > div#dashboard > div.dashboard-quick-select-container {
}

body > main > div#dashboard > div#dashboard-plots-container {
}

/* Dashboard Pipeline Messages */
.dashboard-pipelines-list .loading-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-style: italic;
}

.dashboard-pipelines-list .error-message {
  text-align: center;
  padding: 40px 20px;
  color: #dc3545;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin: 20px 0;
}

.dashboard-pipelines-list .no-data-message {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
  font-style: italic;
}

/* Dashboard Pipeline Table */
.pipeline-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
}

.pipeline-table th {
  background: var(--primary-color);
  color: white;
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #138496;
}

.pipeline-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #dee2e6;
  vertical-align: middle;
}

.pipeline-table tbody tr:hover {
  background-color: #f8f9fa;
}

.pipeline-table tbody tr:last-child td {
  border-bottom: none;
}

.pipeline-table th:first-child,
.pipeline-table td:first-child {
  width: 180px;
}

.pipeline-table th:nth-child(2),
.pipeline-table td:nth-child(2) {
  width: 200px;
}

.pipeline-table th:nth-child(3),
.pipeline-table td:nth-child(3) {
  width: 150px;
}

.pipeline-table th:nth-child(4),
.pipeline-table td:nth-child(4) {
  width: 80px;
  text-align: center;
}

.pipeline-table th:nth-child(5),
.pipeline-table td:nth-child(5) {
  width: 120px;
}

.pipeline-table th:last-child,
.pipeline-table td:last-child {
  width: 100px;
  text-align: center;
}

/* Checkbox styling */
.checkbox-container {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 22px;
  user-select: none;
  text-align: center;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 20px;
  width: 20px;
  background-color: #eee;
  border: 2px solid #ccc;
  border-radius: 3px;
}

.checkbox-container:hover input ~ .checkmark {
  background-color: #ccc;
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: #ccc;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 6px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  min-width: 60px;
}

.status-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-unknown {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-never {
  background-color: #e2e3e5;
  color: #383d41;
  border: 1px solid #d6d8db;
}

/* Button styling in table */
.pipeline-table .btn {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}

.pipeline-table .btn-sm {
  padding: 2px 6px;
  font-size: 11px;
}

/* body > main > div#data-sources */
body > main > div#data-sources > h1 {
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
  padding: 20px;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .loading-message {
  text-align: center;
  color: #6c757d;
  padding: 40px;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-header > h3 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.3em;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-header > .status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-header > .status-badge.running {
  background-color: #d4edda;
  color: #155724;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-header > .status-badge.stopped {
  background-color: #fff3cd;
  color: #856404;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-header > .status-badge.disabled {
  background-color: #f8d7da;
  color: #721c24;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-body {
  margin-bottom: 15px;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-body > .data-source-description {
  color: #666;
  margin-bottom: 15px;
  line-height: 1.5;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-body > .data-source-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-body > .data-source-info > .info-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-body > .data-source-info > .info-item > .info-label {
  font-weight: 600;
  color: #495057;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-body > .data-source-info > .info-item > .info-value {
  color: #212529;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-actions > .btn-action {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-actions > .btn-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-actions > .btn-start {
  background-color: var(--success-color);
  color: white;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-actions > .btn-start:not(:disabled):hover {
  background-color: #218838;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-actions > .btn-stop {
  background-color: var(--warning-color);
  color: #333;
}

body > main > div#data-sources > div#data-sources-container.data-sources-grid > .data-source-card > .data-source-actions > .btn-stop:not(:disabled):hover {
  background-color: #e0a800;
}

/* body > main > div#data-selection */
body > main > div#data-selection.content.active {
  display: flex !important;
  flex-direction: row;
  gap: 10px;
  height: 100%;
  position: relative;
}

body > main > div#data-selection.content:not(.active) {
  display: none !important;
}

body > main > div#data-selection > div#data-selection-table {
  width: 100% !important;
  height: 100% !important;
  border-radius: 2px;
  border: 1px solid var(--primary-color);
  user-select: none;
}

body > main > div#data-selection > div#plugin-container {
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 2px;
}

body > main > div#data-selection > div#plugin-container > div#plugin-tab-headers {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  height: auto;
  min-height: 0px;/*fit-content;*/
  flex-shrink: 0;
  margin-bottom: -1px;
  border-radius: 1px;
}

body > main > div#data-selection > div#plugin-container > div#plugin-tab-headers > .plot-tab {
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 8px;
  color: #777;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: 0 2px 8px rgba(26, 38, 50, 0.2);
  border-radius: 8px 8px 0 0;
  border: 1px solid #ccc;
}

body > main > div#data-selection > div#plugin-container > div#plugin-tab-headers > .plot-tab:hover {
  border-color: #ccc;
  background-color: #f8f8f8;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

body > main > div#data-selection > div#plugin-container > div#plugin-tab-headers > .plot-tab.active {
  border: 1px solid var(--primary-color);
  background-color: #ffffff;
  color: black;
  transform: none;
  box-shadow: none;
  border-bottom: 1px solid #ffffff;
  margin-bottom: -1px;
  z-index: 1;
  position: relative;
}

body > main > div#data-selection > div#plugin-container > div#plugin-tab-headers > .plot-tab > img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

body > main > div#data-selection > div#plugin-container > div#plugin-tab-headers > .plot-tab > span {
  font-size: 14px;
  font-weight: 500;
}

body > main > div#data-selection > div#plugin-container > div#plugin-panels {
  border: 1px solid var(--primary-color);
  background-color: #ffffff;
  margin-top: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* body > main > div#data-processing */
body > main > div#data-processing {
  height: 100%;
}

body > main > div#data-processing > .data-processing-workspace {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body > main > div#data-processing > .data-processing-workspace > .pipeline-toolbar {
  background: var(--light-color);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

body > main > div#data-processing > .data-processing-workspace > .pipeline-toolbar > button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s;
}

body > main > div#data-processing > .data-processing-workspace > .pipeline-toolbar > button:hover {
  background: var(--primary-hover);
}

body > main > div#data-processing > .data-processing-workspace > .pipeline-canvas-container {
  flex: 1;
  background: white;
  position: relative;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

body > main > div#data-processing > .data-processing-workspace > .pipeline-canvas-container > canvas#pipeline-canvas {
  border: none;
  outline: none;
  display: block;
  margin: 0;
  padding: 0;
  background: #fafafa;
}

/* body > main > div#plots */
body > main > div#plots.content.active {
  display: flex !important;
  flex-direction: column;
  overflow-y: auto;
  align-items: stretch;
  justify-content: flex-start;
  height: 100%;
  min-height: 100%;
  max-height: none;
}

body > main > div#plots.content:not(.active) {
  display: none !important;
}

/* body > main > div#report */
body > main > div#report > div#report-controls.report-controls {
}

body > main > div#report > div#report-controls.report-controls > input#report-basename {
}

body > main > div#report > div#report-controls.report-controls > button#save-report-btn {
}

body > main > div#report > div#report-content {
}

/* body > main > div#alerts */
body > main > div#alerts > h2 {
}

body > main > div#alerts > .settings-section {
  background: white;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body > main > div#alerts > .settings-section > h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 2px solid #e1e5e9;
  padding-bottom: 10px;
}

body > main > div#alerts > .settings-section > p {
}

body > main > div#alerts > .settings-section > .alarm-form {
  background: linear-gradient(135deg, #fff5f5 0%, #ffeaea 100%);
  border: 2px solid #fecaca;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

body > main > div#alerts > .settings-section > .alarm-form::before {
  content: '⚠️';
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 24px;
  opacity: 0.3;
}

body > main > div#alerts > .settings-section > .alarm-form > .form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}

body > main > div#alerts > .settings-section > .alarm-form > .form-row > .form-group {
  flex: 1;
  min-width: 220px;
  position: relative;
}

body > main > div#alerts > .settings-section > .alarm-form > .form-row > .form-group > label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
  letter-spacing: 0.3px;
}

body > main > div#alerts > .settings-section > .alarm-form > .form-row > .form-group > input,
body > main > div#alerts > .settings-section > .alarm-form > .form-row > .form-group > select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: #ffffff;
  box-sizing: border-box;
}

body > main > div#alerts > .settings-section > .alarm-form > .form-row > .form-group > input:focus,
body > main > div#alerts > .settings-section > .alarm-form > .form-row > .form-group > select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 38, 50, 0.1), 0 2px 8px rgba(26, 38, 50, 0.15);
  transform: translateY(-1px);
}

body > main > div#alerts > .settings-section > .alarm-form > button#create-alarm-btn {
}

body > main > div#alerts > .settings-section > .alarm-form > div#alarm-create-message {
}

body > main > div#alerts > .settings-section > div#alarms-list-container {
}

/* body > main > div#settings */
body > main > div#settings > h2 {
}

body > main > div#settings > .settings-tabs-container {
  display: flex;
  gap: 3px;
  margin: 20px 0;
  overflow-x: auto;
  overflow-y: hidden;
  height: auto;
  min-height: 0px;/*fit-content;*/
  flex-shrink: 0;
  border-radius: 1px;
}

body > main > div#settings > .settings-tabs-container > .settings-tab {
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  color: #777;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: none;
  border-radius: 8px 8px 0 0;
  border: 1px solid #ccc;
  background-color: #f2f2f2;
  min-width: 120px;
}

body > main > div#settings > .settings-tabs-container > .settings-tab:hover {
  border-color: #ccc;
  background-color: #f8f8f8;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

body > main > div#settings > .settings-tabs-container > .settings-tab.active {
  border-color: #ccc;
  background-color: #ffffff;
  color: black;
  transform: none;
  box-shadow: none;
  border-bottom: 1px solid #ffffff;
  margin-bottom: -1px;
  z-index: 1;
  position: relative;
}

body > main > div#settings > .settings-tabs-container > .settings-tab > img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

body > main > div#settings > .settings-tabs-container > .settings-tab .tab-icon {
  width: 24px;
  height: 24px;
  color: var(--primary-color);
  flex-shrink: 0;
}

body > main > div#settings > .settings-tabs-container > .settings-tab.active .tab-icon {
  color: #333;
}

body > main > div#settings > .settings-tabs-container > .settings-tab > span {
  font-size: 12px;
  font-weight: 500;
}

body > main > div#settings > .settings-content {
  border: 1px solid #ccc;
  background-color: #ffffff;
  padding: 20px;
  margin-top: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

body > main > div#settings > .settings-content > .settings-panel {
  display: none;
}

body > main > div#settings > .settings-content > .settings-panel.active {
  display: block;
}

body > main > div#settings > .settings-content > .settings-panel > h3 {
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section {
  margin-bottom: 32px;
  padding: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: 12px 12px 0 0;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 3px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > h3 {
  margin: 0 0 24px 0;
  color: #2c3e50;
  font-size: 20px;
  font-weight: 700;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 12px;
  position: relative;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--primary-gradient);
  border-radius: 1px;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > h4 {
  margin: 0 0 18px 0;
  color: #495057;
  font-size: 16px;
  font-weight: 600;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .form-group {
  flex: 1;
  min-width: 220px;
  position: relative;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .form-group > label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
  letter-spacing: 0.3px;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .form-group > input,
body > main > div#settings > .settings-content > .settings-panel > .settings-section > .form-group > select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: #ffffff;
  box-sizing: border-box;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .form-group > input:focus,
body > main > div#settings > .settings-content > .settings-panel > .settings-section > .form-group > select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 38, 50, 0.1), 0 2px 8px rgba(26, 38, 50, 0.15);
  transform: translateY(-1px);
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .form-group > input:hover,
body > main > div#settings > .settings-content > .settings-panel > .settings-section > .form-group > select:hover {
  border-color: #ced4da;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .form-group > input[type="checkbox"] {
  width: auto;
  margin-right: 12px;
  transform: scale(1.2);
  accent-color: var(--primary-color);
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > button.btn-primary {
  padding: 12px 24px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(26, 38, 50, 0.3), 0 2px 4px rgba(26, 38, 50, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > button.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > button.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 38, 50, 0.4), 0 3px 8px rgba(26, 38, 50, 0.3);
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > button.btn-primary:hover::before {
  left: 100%;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > button.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26, 38, 50, 0.3), 0 1px 3px rgba(26, 38, 50, 0.2);
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > button.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .message {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border-left: 4px solid;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .message::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0.7;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .message.success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border-left-color: #28a745;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .message.error {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border-left-color: #dc3545;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid #e9ecef;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .user-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .user-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 12px 0 0 12px;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .user-item > .user-info {
  flex: 1;
  margin-left: 16px;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .user-item > .user-info > h5 {
  margin: 0 0 8px 0;
  color: #2c3e50;
  font-size: 16px;
  font-weight: 600;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .user-item > .user-info > p {
  margin: 0;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .user-item > .user-actions {
  display: flex;
  gap: 12px;
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .user-item > .user-actions > .btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .user-item > .user-actions > .btn-danger:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

body > main > div#settings > .settings-content > .settings-panel > .settings-section > .user-item > .user-actions > .btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(220, 53, 69, 0.3);
}

/* body > div#contextMenu (popup menus) */
body > div#contextMenu.contextMenu {
  display: none;
  position: absolute;
  z-index: 1000;
  background-color: #ffffff;
  border: 1px solid #ccc;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 1px;
  padding: 5px 5px;
}

body > div#contextMenu.contextMenu > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.625rem;
}

body > div#contextMenu.contextMenu > ul > li {
  padding: 2px 4px;
  cursor: pointer;
  white-space: nowrap;
}

body > div#contextMenu.contextMenu > ul > li:hover {
  background-color: #f5f5f5;
}

body > div#contextMenu.contextMenu > ul > li:active {
  background-color: #ddd;
}

body > div#contextMenu.contextMenu > ul > hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 4px 0;
}

/* Context menu visibility overrides */
.contextMenu.show,
.contextMenu[style*="display: block"],
.contextMenu[style*="display:block"],
#contextMenu[style*="display: block"],
#contextMenu[style*="display:block"] {
  display: block !important;
}

/* =============================================================================
   Utility Classes and Components (non-hierarchical)
   ============================================================================= */

/* Table components */
table thead tr {
  height: 1rem;
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: var(--primary-shadow);
  line-height: 1rem;
  font-size: 0.9rem;
}

.table-header-row-1 td {
  vertical-align: middle;
  height: 32px;
  text-align: center;
  font-weight: bold;
}

.table-header-row-1 td:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #5a8ca0 50%, var(--primary-hover) 100%);
  color: #ffffff;
}

.table-header-row-2 td {
  vertical-align: middle;
  padding: 0px 0px 8px 6px;
}

.table-header-row-2 td input {
  vertical-align: middle;
  line-height: 1rem;
}

.table-container th,
.table-container td {
  text-align: left;
  background-clip: padding-box;
}

.table-header-button,
.column-filter {
  width: 100%;
  padding: 2px 4px;
  text-align: left;
  border-radius: 0px;
  box-sizing: border-box;
  justify-content: left;
  outline: none;
}

.column-filter {
  border: 1px solid #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.column-filter:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(90, 124, 138, 0.25);
}

.table-container {
  flex: 0 0 auto;
}

.table-filter-controls {
  margin-bottom: 10px;
  display: flex;
  justify-content: flex-start;
}

/* Group components */
.group-settings-dropdown {
  display: none;
  position: absolute;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1000;
  min-width: 150px;
  max-height: 200px;
  overflow-y: auto;
}

.group-settings-dropdown-list {
  padding: 0;
  margin: 0;
}

.group-settings-dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f8f9fa;
  transition: background-color 0.2s ease;
  font-size: 0.875rem;
}

.group-settings-dropdown-item:hover {
  background-color: #f8f9fa;
}

.group-settings-dropdown-item:last-child {
  border-bottom: none;
}

.group-radio-options {
  margin-top: 0;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.group-option-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  min-width: 160px;
  position: relative;
}

.group-option-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}

.group-option-name {
  font-weight: bold;
  font-size: 16px;
  color: white;
  text-align: center;
  padding: 6px 10px;
  border-radius: 2px;
  min-width: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.group-option-remove {
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  position: absolute;
  top: 8px;
  right: 8px;
}

.group-option-remove:hover {
  background-color: #c82333;
}

.group-option-remove:active {
  background-color: #a71e2a;
}

.group-option-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.option-control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.option-control-label {
  font-size: 11px;
  font-weight: 500;
  color: #495057;
  text-align: center;
}

.option-control-select {
  padding: 6px 8px;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  font-size: 12px;
  background-color: #ffffff;
  color: #495057;
  cursor: pointer;
  transition: border-color 0.2s;
}

.option-control-select:hover {
  border-color: #4682b4;
}

.option-control-select:focus {
  outline: none;
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Button components */
.add-to-group-btn {
  padding: 10px 16px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--primary-shadow);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.add-to-group-btn:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #5a8ca0 50%, var(--primary-hover) 100%);
  box-shadow: 0 4px 12px rgba(26, 38, 50, 0.4);
  transform: translateY(-1px);
}

.add-to-group-btn:active {
  background: linear-gradient(135deg, var(--primary-active) 0%, var(--primary-color) 50%, var(--primary-active) 100%);
  box-shadow: 0 2px 4px rgba(26, 38, 50, 0.5);
  transform: translateY(0);
}

.remove-group-btn {
  padding: 10px 16px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.remove-group-btn:hover {
  background-color: #c82333;
}

.remove-group-btn:active {
  background-color: #bd2130;
}

.clear-all-groups-btn {
  padding: 10px 16px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.clear-all-groups-btn:hover {
  background-color: #5a6268;
}

.clear-all-groups-btn:active {
  background-color: #545b62;
}

.generate-plot-btn {
  margin-top: 15px;
  padding: 10px 20px;
  background-color: #4682b4;
  color: white;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.generate-plot-btn:hover {
  background-color: #0056b3;
}

.generate-plot-btn:active {
  background-color: #004085;
}

.save-dashboard-btn {
  padding: 8px 16px;
  background-color: #17a2b8;
  color: white;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.save-dashboard-btn:hover {
  background-color: #138496;
}

.save-dashboard-btn:active {
  background-color: #117a8b;
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.btn-secondary:hover {
  opacity: 0.9;
}

/* Dialog components */
.dialog-input-group {
  margin-bottom: 20px;
}

.dialog-input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

.dialog-input-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 2px;
  font-size: 14px;
}

.dialog-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dialog-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.dialog-btn-cancel {
  background-color: #6c757d;
  color: white;
}

.dialog-btn-cancel:hover {
  background-color: #5a6268;
}

.dialog-btn-save {
  background-color: #28a745;
  color: white;
}

.dialog-btn-save:hover {
  background-color: #218838;
}

/* Plot components */
.plot-container {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  background-color: #f8f9fa;
}

.plot-container h3 {
  margin-top: 0;
  color: #495057;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

.plot-info {
  background-color: white;
  padding: 15px;
  border-radius: 2px;
  margin: 15px 0;
  border: 1px solid #e9ecef;
}

.plot-info p {
  margin: 5px 0;
  font-weight: 500;
}

.plot-data {
  background-color: white;
  padding: 15px;
  border-radius: 2px;
  border: 1px solid #e9ecef;
}

.plot-data pre {
  background-color: #f8f9fa;
  padding: 10px;
  border-radius: 2px;
  overflow-x: auto;
  font-size: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.plot-actions-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-top: 20px;
}

.config-panels {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  min-height: 0;
}

.config-panel {
  margin-bottom: 20px;
}

/* Favorites components */
.favorites-section {
  flex: 1;
  margin: 20px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 2px;
}

.favorites-inputs {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  align-items: center;
}

.favorite-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.favorite-input-group label {
  font-size: 12px;
  font-weight: 500;
  color: #495057;
}

.favorite-input {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  font-size: 14px;
  min-width: 200px;
}

.favorite-input:focus {
  outline: none;
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.favorites-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* Date/Time Selection */
.date-time-selection {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 16px;
  background-color: #ffffff;
  min-width: 200px;
  align-items: center;
  flex-wrap: wrap;
}

.date-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-filter-item label {
  font-weight: 500;
  color: #333;
  font-size: 14px;
  min-width: 30px;
}

.top-controls-row {
  gap: 20px;
  align-items: flex-start;
}

/* Status messages */
.loading {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: #6c757d;
}

.error {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: #dc3545;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 2px;
}

.disabled-message {
  color: #6c757d;
  font-style: italic;
  text-align: center;
}

.no-data-sources {
  text-align: center;
  color: #6c757d;
  padding: 40px;
  font-size: 1.1em;
}

/* Form row utility (for alerts) */
.form-row {
  display: flex;
  gap: 12px;
  align-items: end;
}

.form-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.form-row input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Groups selector dialog */
.groups-selector-dialog {
  font-family: Arial, sans-serif;
  user-select: none;
}

.groups-selector-dialog h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #333;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

.groups-selector-dialog .groups-list {
  background: #f8f9fa;
  border-radius: 4px;
}

.groups-selector-dialog .group-item-container {
  background: white;
  border-radius: 4px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.groups-selector-dialog .group-item-header {
  transition: background-color 0.2s ease;
}

.groups-selector-dialog .group-item-header:hover {
  background-color: #e9ecef !important;
}

.groups-selector-dialog .expand-arrow {
  transition: transform 0.2s ease;
  display: inline-block;
  width: 20px;
}

.groups-selector-dialog .sensor-list {
  animation: slideDown 0.2s ease-out;
}

.groups-selector-dialog .group-item label {
  display: flex;
  align-items: center;
}

.groups-selector-dialog button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.groups-selector-dialog .select-all-btn,
.groups-selector-dialog .deselect-all-btn {
  background: #6c757d;
  color: white;
}

.groups-selector-dialog .select-all-btn:hover,
.groups-selector-dialog .deselect-all-btn:hover {
  background: #5a6268;
}

.groups-selector-dialog .ok-btn {
  background: #4CAF50;
  color: white;
}

.groups-selector-dialog .ok-btn:hover {
  background: #45a049;
}

.groups-selector-dialog .cancel-btn {
  background: #e0e0e0;
  color: #333;
}

.groups-selector-dialog .cancel-btn:hover {
  background: #d0d0d0;
}

/* Drawflow context menu */
.drawflow-context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 220px;
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #111827;
  border-radius: 4px; /* Matched node border radius */
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  padding: 0; /* Reduced padding */
  display: none;
  user-select: none;
  font: 14px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
}

.drawflow-context-menu.show {
  display: block;
}

.drawflow-context-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.drawflow-context-menu li {
  padding: 6px 12px 6px 14px; /* Reduced vertical padding */
  cursor: default;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.drawflow-context-menu li:last-child {
  border-bottom: none;
}

.drawflow-context-menu li:hover {
  background: #374151;
}

.drawflow-context-menu .has-sub {
  position: relative;
  padding-right: 28px;
}

.drawflow-context-menu .has-sub::after {
  content: "›";
  position: absolute;
  right: 10px;
  top: 6px; /* Adjusted for reduced li padding */
  opacity: .7;
}

/* Submenu */
.drawflow-context-menu .submenu {
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 200px;
  background: #1f2937;
  border: 1px solid #111827;
  border-radius: 4px; /* Matched node border radius */
  padding: 0; /* Reduced padding */
  display: none;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  z-index: 10001;
}

.drawflow-context-menu .has-sub:hover > .submenu {
  display: block;
}

/* Show submenu on left side if parent has submenu-left class */
.drawflow-context-menu .has-sub.submenu-left:hover > .submenu {
  left: auto;
  right: 100%;
}

/* Drawflow static container - subtle checkboard pattern */
.drawflow {
  background-color: #ffffff !important;
  background-image: 
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%) !important;
  background-size: 20px 20px !important;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px !important;
}

/* Remove background from all inner Drawflow elements (the moving canvas) */
.drawflow > div {
  background: transparent !important;
}

/* Drawflow nodes - fully opaque */
.drawflow .drawflow-node {
  padding: 2px 8px !important; /* Controlled by inner wrapper */
  border-radius: 4px;
  background: var(--primary-color) !important;
  opacity: 1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  width: auto !important; /* Allow node to grow with content in X */
  min-width: 160px;
  max-width: none !important; /* Remove max-width constraint */
}

.drawflow .drawflow-node .input,
.drawflow .drawflow-node .output {
  width: 20px !important;
  height: 20px !important;
  background: white !important;
  border: 2px solid var(--primary-color) !important;
  box-sizing: border-box;
  z-index: 100; /* Ensure ports are on top */
}

.drawflow .drawflow-node .output {
  right: 0px !important;
  top: 0px !important;
}

.drawflow .drawflow-node .input {
  left: -18px !important; /* Adjusted for 8px padding + 15px ports: -(8 + 7.5 + 2.5) */
}

.drawflow_content_node {
  padding: 0 !important;
  border-radius: 4px;
  overflow: visible !important;
  opacity: 1 !important;
  background: inherit;
}

/* Node header bar */
.node-header {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center; /* Center content horizontally */
  position: relative;
  padding: 0 35px; /* Leave room for absolute buttons */
  border-bottom: 1px solid rgba(255,255,255,0.2);
  box-sizing: border-box;
}

.node-title {
  font-size: 14px;
  font-weight: bold;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 32px; /* Center vertically */
  flex: 1;
}

/* Base style for header control buttons (Toggle and Delete) */
.node-toggle,
.node-delete {
  position: absolute;
  top: 6px; /* (32 - 20) / 2 = 6px for perfect centering */
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  z-index: 5;
  font-family: Arial, sans-serif;
  line-height: 1;
}

.node-toggle {
  left: 6px;
  font-size: 16px; 
}

.node-delete {
  right: 6px;
  font-size: 16px;
}

.node-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.node-delete:hover {
  background: #ef4444 !important;
  color: white;
  transform: scale(1.1);
}

/* Node parameters section */
.node-params {
  padding: 10px;
  overflow-x: auto; /* Enable horizontal scrolling if needed to avoid port overlap */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Node Tab Bar */
.node-tab-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.15);
  padding: 2px;
  gap: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.node-tab-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  text-align: center;
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: 2px;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  user-select: none;
}

.node-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
}

.node-tab-btn.active {
  background: #ffffff;
  color: var(--primary-color); /* Theme blue */
  font-weight: bold;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Tab content visibility */
.node-tab-content {
  display: none;
  padding: 10px;
}

.node-tab-content.active {
  display: block;
}

/* General (non-tabbed) params section */
.node-params-general {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
}

.node-params-general:empty {
  display: none;
}

.node-params::-webkit-scrollbar {
  width: 6px;
}

.node-params::-webkit-scrollbar-track {
  background: transparent;
}

.node-params::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.node-params::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Drawflow dialog (for groups selector) */
.drawflow-dialog {
  animation: fadeIn 0.2s ease-in-out;
}

/* Input styling */
input[type="range"] {
  width: 100%;
  margin: 0;
}

input[type="checkbox"] {
  margin: 0;
}

select {
  width: 100%;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 2px;
  background-color: white;
}

/* =============================================================================
   Tabulator Table Styling
   ============================================================================= */
.tabulator .tabulator-header {
  background: var(--primary-gradient) !important;
  border-bottom: 2px solid var(--primary-color);
}

.tabulator .tabulator-header .tabulator-col {
  background: transparent !important;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-title {
  color: white !important;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  outline: none;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter {
  color: white !important;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .tabulator-arrow {
  border-top-color: white !important;
}

.tabulator-menu {
  max-height: 400px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.tabulator-menu .tabulator-menu-item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.tabulator-menu .tabulator-menu-item i.fa-square {
  color: #ccc;
  transition: color 0.2s ease;
}

.tabulator-menu .tabulator-menu-item i.fa-check-square {
  color: var(--primary-color);
}

.tabulator-menu .tabulator-menu-item:hover i.fa-square {
  color: var(--primary-color);
}

.tabulator-menu .menu-item-filtered {
  background-color: #4CAF50 !important;
  color: white !important;
}

.tabulator-menu .menu-item-filtered:hover {
  background-color: #45a049 !important;
  color: white !important;
}

.tabulator-tableholder {
  background-color: #f6f6f6;
}

/* =============================================================================
   Misc utility classes
   ============================================================================= */
main-content {
  visibility: hidden;
}

.contextMenu .submenu {
  position: absolute;
  left: 100%;
  top: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 1001;
  min-width: 150px;
  display: none;
  padding: 0;
  margin: 0;
  list-style: none;
}

.contextMenu .submenu li {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
  margin: 0;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.contextMenu .submenu li:hover {
  background-color: #f8f9fa;
}

.contextMenu .submenu li:last-child {
  border-bottom: none;
}

.quick-select-container.show,
.quick-select-container[style*="display: block"],
.quick-select-container[style*="display:block"] {
  display: block !important;
}

.quick-select-container[style*="display: block"],
.quick-select-container[style*="display:block"] {
  display: block !important;
}

.quick-select-container[style*="display: block"] .quick-select-list,
.quick-select-container[style*="display:block"] .quick-select-list,
.quick-select-container.show .quick-select-list {
  visibility: visible !important;
}

.quick-select-container[style*="display: block"] *,
.quick-select-container[style*="display:block"] *,
.quick-select-container.show * {
  visibility: visible !important;
}

.quick-select-container[style*="display: block"] .quick-select-header,
.quick-select-container[style*="display: block"] .quick-select-list,
.quick-select-container[style*="display: block"] .quick-select-item,
.quick-select-container[style*="display: block"] .quick-select-item-text,
.quick-select-container[style*="display: block"] .quick-select-item-remove {
  visibility: visible !important;
}

.quick-select-container[style*="display: block"] [style*="visibility: hidden"] {
  visibility: visible !important;
}

/* Module menu components (hidden) */
.module-menu-bar {
  display: none;
}

.module-menu-item {
  position: relative;
  border-right: 1px solid var(--border-color);
}

.module-menu-item:last-child {
  border-right: none;
}

.menu-label {
  display: block;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.menu-label:hover {
  background: var(--primary-color);
  color: white;
}

.module-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 1000;
}

.module-menu-item:hover .module-dropdown {
  display: block;
}

.module-dropdown .module-item {
  padding: 6px 12px;
  font-size: 12px;
  cursor: grab;
  user-select: none;
  display: flex;
  align-items: center;
}

.module-dropdown .module-item:hover {
  background: #f8f9fa;
  border-left: 3px solid var(--primary-color);
  padding-left: 9px;
}

.module-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
  cursor: grab;
  transition: background-color 0.2s ease;
  user-select: none;
}

.module-item:last-child {
  border-bottom: none;
}

.module-item:hover {
  background: #f8f9fa;
  border-left: 3px solid var(--primary-color);
  padding-left: 9px;
}

.module-item:active {
  cursor: grabbing;
}

.module-item i {
  margin-right: 8px;
  color: var(--primary-color);
  font-size: 12px;
}

/* =============================================================================
   Pipeline Tabs (Plots Section)
   ============================================================================= */
.pipeline-tabs-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.pipeline-tabs-header {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: auto;
  min-height: fit-content;
  flex-shrink: 0;
  margin-bottom: 0;
  padding: 8px 52px 0 8px;
  background-color: #f1f5f9; /* Soft light background */
  border-bottom: 1px solid #cbd5e1;
  border-radius: 6px 6px 0 0;
}

.pipeline-tabs-list {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.pipeline-tab {
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: none;
  border-radius: 6px 6px 0 0;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  background-color: #e2e8f0;
  min-width: 140px;
  position: relative;
  font-weight: 500;
  margin-bottom: -1px;
}

.pipeline-tab:hover {
  background-color: #f8fafc;
  color: #0f172a;
}

.pipeline-tab.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: none;
  box-shadow: none;
  z-index: 1;
}

.pipeline-tab-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}

.pipeline-tab-close {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.1);
  color: #475569;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 16px;
  transition: all 0.2s;
  padding: 0;
  font-family: Arial, sans-serif;
}

.pipeline-tab.active .pipeline-tab-close {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.pipeline-tab-close:hover {
  background: #ef4444 !important;
  color: white !important;
}

.pipeline-tabs-content {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-top: none;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pipeline-tab-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.pipeline-tab-panel.active {
  display: flex;
}

.pipeline-output-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.pipeline-console-container {
  width: 400px;
  min-width: 300px;
  max-width: 600px;
  border-left: 2px solid #dee2e6;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
  resize: horizontal;
  overflow: hidden;
}

.pipeline-console-container.hidden {
  display: none;
}

.pipeline-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid #dee2e6;
}

.pipeline-console {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.pipeline-no-output {
  padding: 40px;
  text-align: center;
  color: #6c757d;
  font-size: 16px;
}

/* Pipeline Header Bar (Fixed) */
.pipeline-header-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  background-color: #f8fafc;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  box-shadow: none;
  z-index: 10;
}

.pipeline-name-input {
  flex: 1;
  max-width: 300px;
  padding: 8px 12px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  background-color: #ffffff;
}

.pipeline-name-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 38, 50, 0.1);
}

.pipeline-name-input::placeholder {
  color: #adb5bd;
  font-style: italic;
}

.pipeline-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  text-shadow: none;
  box-shadow: none;
}

.pipeline-btn:hover {
  box-shadow: none;
}

.pipeline-btn:active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.pipeline-save-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.pipeline-save-btn:hover {
  background: linear-gradient(135deg, #218838 0%, #1ab386 100%);
}

.pipeline-delete-btn {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
}

.pipeline-delete-btn:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.pipeline-execute-btn {
  background: #28a745;
  color: white;
  margin-left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  border: 1px solid #1e7e34;
}

.pipeline-execute-btn:hover {
  background: #218838;
  box-shadow: none;
}

.pipeline-execute-btn.running {
  background: #dc3545;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.pipeline-execute-btn.running:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.pipeline-status-btn {
  background: #e9ecef;
  color: #6c757d;
  border: 2px solid #dee2e6;
  margin-left: auto;
}

.pipeline-status-btn:hover {
  background: #dee2e6;
  color: #495057;
  border-color: #ced4da;
}

.pipeline-status-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pipeline-status-btn.active:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-active) 100%);
  border-color: var(--primary-hover);
}

.pipeline-view-switch {
  display: flex;
  border-radius: 5px;
  overflow: hidden;
}

.pipeline-view-switch {
  display: flex;
  background: #eef2f7;
  padding: 2px;
  gap: 2px;
  border: 1px solid #dbe4ee;
}

.pipeline-view-btn {
  background: transparent;
  color: #333;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  transition: all 0.2s ease;
}

.pipeline-view-btn img {
  filter: none; /* Use original icons, no more inverting to white */
  opacity: 1;
  width: 24px !important;
  height: 24px !important;
}

.pipeline-view-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.75);
  border-color: transparent;
  box-shadow: none;
}

.pipeline-view-btn.active {
  background-color: #ffffff;
  border-color: #dbe4ee;
  border-width: 1px;
  padding: 3px 7px;
  box-shadow: inset -1px -2px 0 #a6acb1;
}

.pipeline-view-btn.active img {
  opacity: 1;
}

.pipeline-view-btn::after {
  display: none !important; /* Remove the old separators */
}

/* Pipeline Content Area */
.pipeline-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #f8f9fa; /* Light grey background for the whole content area */
  padding: 1rem;
}

.pipeline-table-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pipeline-tabulator-container {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: auto;
  user-select: none;
  border-radius: 2px;
  border: 1px solid var(--primary-color);
}

.pipeline-editor-view {
  flex: 1;
  display: flex;
  overflow: hidden;
  /*outline: 4px;*/
  border: 1px solid var(--primary-color);
}

.pipeline-output-view {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.pipeline-log-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
}

.pipeline-log-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.pipeline-log {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  background: #ffffff;
  color: #212529;
}

.pipeline-editor-view > canvas {
  width: 100%;
  height: 100%;
  background: #fafafa;
}

.pipeline-tab-add {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 24px;
  font-weight: 400;
  transition: all 0.2s ease;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0 2px 1px 1px;
  font-family: Arial, sans-serif;
}

.pipeline-tab-add:hover {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.08);
}

.pipeline-tab-add:active {
  box-shadow: none;
  background: rgba(15, 23, 42, 0.14);
}

/* =============================================================================
   Pipeline Settings View
   ============================================================================= */
.pipeline-settings-view {
  padding: 24px;
  overflow-y: auto;
  background: #f5f7fa;
}

.pipeline-settings-content {
  max-width: 800px;
  margin: 0 auto;
}

.pipeline-settings-content h2 {
  margin: 0 0 24px 0;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.settings-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  overflow: hidden;
}

.settings-card-danger {
  border: 1px solid #f8d7da;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.settings-card-danger .settings-card-header {
  background: #fff5f5;
  border-bottom-color: #f8d7da;
}

.settings-card-icon {
  width: 20px;
  height: 20px;
  color: var(--primary-color);
  flex-shrink: 0;
}

.settings-card-danger .settings-card-icon {
  color: var(--danger-color);
}

.settings-card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.settings-card-body {
  padding: 20px;
}

.settings-card .form-group {
  margin-bottom: 16px;
}

.settings-card .form-group:last-child {
  margin-bottom: 0;
}

.settings-card .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.settings-card .form-group input[type="text"],
.settings-card .form-group input[type="number"],
.settings-card .form-group input[type="time"],
.settings-card .form-group textarea,
.settings-card .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-card .form-group input:focus,
.settings-card .form-group textarea:focus,
.settings-card .form-group select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 38, 50, 0.15);
}

.settings-card .form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Toggle switch styling */
.toggle-label {
  display: inline-grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.3;
  max-width: 100%;
}

.toggle-checkbox {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  transition: background 0.3s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked + .toggle-switch {
  background: var(--primary-color);
}

.toggle-checkbox:checked + .toggle-switch::after {
  transform: translateX(20px);
}

/* Schedule options */
.schedule-config {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
}

.schedule-options .form-row {
  display: flex;
  gap: 16px;
}

.schedule-options .form-row .form-group {
  flex: 1;
}

.schedule-type-select {
  max-width: 200px;
}

.interval-value {
  max-width: 100px;
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekday-picker label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.weekday-picker label:hover {
  border-color: var(--primary-color);
}

.weekday-picker input:checked + label,
.weekday-picker label:has(input:checked) {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #888;
}

.cron-preview {
  margin-top: 12px;
  padding: 12px;
  background: #e8f4f8;
  border-radius: 4px;
  font-size: 13px;
}

.cron-preview-label {
  font-weight: 500;
  color: #555;
}

.cron-preview-text {
  color: var(--primary-color);
}

/* Execution history */
.execution-history {
  min-height: 100px;
}

.history-placeholder {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
}

.history-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.history-item:last-child {
  border-bottom: none;
}

.history-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 12px;
}

.history-status.success {
  background: var(--success-color);
}

.history-status.error {
  background: var(--danger-color);
}

.history-status.running {
  background: var(--warning-color);
}

.history-info {
  flex: 1;
}

.history-time {
  font-size: 13px;
  color: #666;
}

.history-duration {
  font-size: 12px;
  color: #999;
}

/* Export/Import buttons */
.export-import-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pipeline-export-btn,
.pipeline-import-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.pipeline-export-btn:hover,
.pipeline-import-btn:hover {
  background: #e9ecef;
  border-color: #ccc;
}

.pipeline-export-btn svg,
.pipeline-import-btn svg {
  flex-shrink: 0;
}

/* Settings actions */
.settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-actions .pipeline-duplicate-btn,
.settings-actions .pipeline-delete-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
}

.settings-actions .pipeline-duplicate-btn {
  background: #f8f9fa;
  border: 1px solid #ddd;
  color: #333;
}

.settings-actions .pipeline-duplicate-btn:hover {
  background: #e9ecef;
}

.settings-actions .pipeline-delete-btn {
  background: var(--danger-color);
  border: 1px solid var(--danger-color);
  color: white;
}

.settings-actions .pipeline-delete-btn:hover {
  background: #c82333;
}

/* Sandwich Menu - Fixed position button aligned with pipeline tabs */
.sandwich-menu-btn {
  position: fixed;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  background: transparent;
  color: var(--primary-color);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  transition: all 0.2s ease;
  box-shadow: none;
  z-index: 1001;
}

.sandwich-menu-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

.sandwich-menu-btn:active {
  background: rgba(15, 23, 42, 0.1);
}

.sandwich-menu-btn .bar {
  width: 21px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 1px;
  transition: all 0.2s ease;
}

.sandwich-menu-dropdown {
  position: fixed;
  top: 42px;
  left: 10px;
  background: var(--theme-color);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 220px;
  display: none;
}

.sandwich-menu-btn {
  right: 10px;
  left: auto;
}

.sandwich-menu-dropdown {
  right: 10px;
  left: auto;
}

@media (orientation: portrait), (max-width: 768px) {
  body:not(.sidebar-visible) > nav#navbar {
    display: none;
  }
}

.sandwich-menu-dropdown.show {
  display: block;
}

.sandwich-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sandwich-menu-item:first-child {
  border-radius: 8px 8px 0 0;
}

.sandwich-menu-item:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}

.sandwich-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.sandwich-menu-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1); /* Icons white on dark menu */
}

.sandwich-menu-item .menu-icon {
  width: 24px;
  height: 24px;
  color: #ecf0f1;
  flex-shrink: 0;
}

.sandwich-menu-item span {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #ecf0f1;
}

.sidebar-toggle-item {
  user-select: none;
}

.sidebar-toggle-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--theme-accent);
}

@media (orientation: landscape) and (min-width: 769px) {
  .sidebar-toggle-item {
    display: none;
  }
}

.sensor-quickview-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.sensor-quickview-modal {
  position: relative;
  width: min(980px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  padding: 22px;
  box-sizing: border-box;
}

.sensor-quickview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: #eef2f7;
  color: #243447;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.sensor-quickview-close:hover {
  background: #dbe4ee;
}

.sensor-quickview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-right: 42px;
  margin-bottom: 18px;
}

.sensor-quickview-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: #17212d;
}

.sensor-quickview-header p {
  margin: 0;
  color: #64748b;
  overflow-wrap: anywhere;
}

.sensor-quickview-badge {
  flex: 0 0 auto;
  background: var(--theme-color);
  color: var(--theme-contrast);
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
}

.sensor-quickview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.sensor-quickview-grid > div {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  min-width: 0;
}

.sensor-quickview-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 4px;
}

.sensor-quickview-grid strong {
  display: block;
  color: #17212d;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.sensor-quickview-plot {
  min-height: 380px;
  width: 100%;
}

.sensor-quickview-empty,
.sensor-quickview-loading {
  padding: 42px;
  text-align: center;
  color: #64748b;
}

@media (max-width: 900px) {
  .sensor-quickview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .sensor-quickview-overlay {
    padding: 10px;
  }

  .sensor-quickview-modal {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .sensor-quickview-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   User Edit Modal
   ============================================================================= */
.user-edit-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.user-edit-modal {
  background: white;
  border-radius: 8px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.user-edit-modal h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 18px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

.user-edit-modal .form-group {
  margin-bottom: 16px;
}

.user-edit-modal .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.user-edit-modal .form-group input[type="email"],
.user-edit-modal .form-group input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.user-edit-modal .form-group input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 38, 50, 0.2);
}

.user-edit-modal .checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.user-edit-modal .checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.user-edit-modal .modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.user-edit-modal .modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.user-edit-modal .modal-buttons .btn-primary {
  background: var(--primary-color);
  color: white;
}

.user-edit-modal .modal-buttons .btn-primary:hover {
  background: var(--primary-hover);
}

.user-edit-modal .modal-buttons .btn-secondary {
  background: #6c757d;
  color: white;
}

.user-edit-modal .modal-buttons .btn-secondary:hover {
  background: #5a6268;
}

/* User list item styling */
.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 8px;
}

.user-item:hover {
  background: #e9ecef;
}

.user-info h5 {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: #333;
}

.user-info p {
  margin: 0;
  font-size: 13px;
  color: #666;
}

.user-actions {
  display: flex;
  gap: 8px;
}

.btn-small {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-small.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-small.btn-secondary:hover {
  background: #5a6268;
}

.btn-small.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-small.btn-danger:hover {
  background: #c82333;
}

/* =============================================================================
   Reports Page
   ============================================================================= */
.reports-container {
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.reports-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.reports-header h2 {
  margin: 0;
  color: #333;
  font-size: 24px;
}

.reports-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reports-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  flex: 1;
  overflow: hidden;
}

.reports-sidebar {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.reports-sidebar h3 {
  margin: 0;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.reports-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.reports-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: #999;
}

.reports-empty-state svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.reports-empty-state p {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #666;
}

.reports-empty-state small {
  font-size: 12px;
  color: #999;
}

.report-list-item {
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 4px;
}

.report-list-item:hover {
  background: #f0f4f8;
}

.report-list-item.active {
  background: var(--primary-color);
  color: white;
}

.report-list-item-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
}

.report-list-item-date {
  font-size: 12px;
  opacity: 0.7;
}

.reports-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-editor-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-editor-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  text-align: center;
}

.report-editor-empty svg {
  margin-bottom: 16px;
  opacity: 0.4;
}

.report-editor-empty h3 {
  margin: 0 0 8px 0;
  color: #666;
  font-weight: 500;
}

.report-editor-empty p {
  margin: 0;
  color: #999;
}

.report-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-editor-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e9ecef;
  gap: 16px;
}

.report-title-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
}

.report-title-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 38, 50, 0.15);
}

.report-editor-actions {
  display: flex;
  gap: 8px;
}

.report-editor-actions button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-export {
  background: #17a2b8;
  color: white;
}

.btn-export:hover {
  background: #138496;
}

.report-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.report-content-area {
  min-height: 400px;
}

.report-content-area:empty::before {
  content: 'Report-Inhalt wird hier angezeigt...';
  color: #999;
  font-style: italic;
}
