/* Root CSS Custom Variables (Dark Theme - Clean Dark Slate) */
:root {
  --bg-primary: #0b0e14;
  --bg-secondary: #121620;
  --bg-panel: #151a24;
  --border-color: #212837;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  
  --color-primary: #3498db;
  --color-primary-glow: rgba(52, 152, 219, 0.2);
  --color-accent: #3498db;
  --color-accent-glow: rgba(52, 152, 219, 0.2);
  
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  
  --sidebar-width: 260px;
  --font-main: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  --font-logo: 'Outfit', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --blur-amount: 20px;
}

/* Reset and Globals */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
  flex-shrink: 0;
  z-index: 10;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  touch-action: pan-y !important;
  overscroll-behavior-x: none !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch;
}

.logo-area {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  cursor: pointer;
  user-select: none;
}

.logo-glow {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 50px;
  height: 50px;
  background: var(--color-primary);
  filter: blur(25px);
  opacity: 0.4;
  z-index: -1;
}

.logo-icon {
  font-size: 24px;
  color: var(--color-primary);
  filter: drop-shadow(0 0 8px var(--color-primary-glow));
}

.logo-text {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.5px;
}

.logo-text span {
  color: var(--color-primary);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 14px 16px;
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-smooth);
}

.nav-item i {
  font-size: 16px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.45);
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.2);
  font-weight: 600;
}
.nav-item.active i {
  color: #3498db;
}

.nav-item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Cloud Download & Upload Icon Colors */
i.fa-cloud-arrow-down {
  color: #3498db !important;
}
i.fa-cloud-arrow-up {
  color: #2ecc71 !important;
}

/* Tooltip wrapper */
.tooltip-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* Tooltip text */
.tooltip-wrapper .tooltip-text {
  visibility: hidden;
  width: 220px;
  background-color: #12121c;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 8px 12px;
  position: absolute;
  z-index: 100;
  left: 105%; /* Position to the right of the sidebar item */
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Tooltip arrow pointing left */
.tooltip-wrapper .tooltip-text::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent #12121c transparent transparent;
}

/* Show tooltip only when button inside is disabled */
.tooltip-wrapper:hover button:disabled ~ .tooltip-text,
.tooltip-wrapper:hover button[disabled] ~ .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateY(-50%) translateX(5px);
}

.sidebar-footer {
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.server-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-online {
  background-color: var(--color-success);
  box-shadow: 0 0 10px var(--color-success);
}

.status-online::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 50%;
  background-color: var(--color-success);
  animation: pulse 1.8s infinite ease-in-out;
}

.status-pingable {
  background-color: var(--color-warning);
  box-shadow: 0 0 10px var(--color-warning);
}

.status-pingable::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 50%;
  background-color: var(--color-warning);
  animation: pulse-yellow 1.8s infinite ease-in-out;
}

.status-offline {
  background-color: var(--color-danger);
  box-shadow: 0 0 10px var(--color-danger);
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes pulse-yellow {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

.status-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
  background-color: var(--bg-primary);
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title h1 {
  font-family: var(--font-logo);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

/* General Panels and Elements */
.panel {
  background: var(--bg-panel, #151a24);
  background-color: #151a24 !important;
  border: 1px solid var(--border-color, #212837);
  border-radius: 16px;
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-title i,
.panel-header h2 i,
.panel-header h3 i,
.panel-header h1 i,
dialog h2 i,
dialog h3 i,
.modal-header h2 i,
.modal-header h3 i,
.header-title i {
  color: var(--text-primary) !important;
}

/* CPU and RAM metric icons stay colorful in both light and dark themes */
i.fa-microchip {
  color: #3b82f6 !important;
}

i.fa-memory {
  color: #8b5cf6 !important;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-pulse {
  background-color: rgba(231, 76, 60, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
  position: relative;
  overflow: hidden;
}

.badge-pulse::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-danger);
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 0 6px var(--color-danger);
}

/* Dashboard Grid/Rows */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.icon-blue { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.icon-purple { background: rgba(108, 92, 231, 0.15); color: var(--color-primary); }
.icon-green { background: rgba(46, 204, 113, 0.15); color: var(--color-success); }
.icon-orange { background: rgba(230, 126, 34, 0.15); color: #e67e22; }

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-logo);
}

.dashboard-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.flex-1 { flex: 1; min-width: 300px; }
.flex-2 { flex: 2; min-width: 400px; }

/* Buttons */
.btn {
  font-family: var(--font-main);
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: rgba(108, 92, 231, 0.18);
  color: #a29bfe;
  border: 1px solid rgba(108, 92, 231, 0.4);
  box-shadow: none;
}

.btn-primary i {
  color: #a29bfe;
}

.btn-primary:hover {
  background: rgba(108, 92, 231, 0.28);
  color: #ffffff;
  border-color: rgba(108, 92, 231, 0.65);
  transform: translateY(-1px);
}

.btn-primary:hover i {
  color: #ffffff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Tailored Badge-Style Colors for Action Buttons (Matching Tag Badges) */
.btn-secondary:has(i.fa-circle-info) {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.35);
}
.btn-secondary:has(i.fa-circle-info) i {
  color: #3498db;
}
.btn-secondary:hover:has(i.fa-circle-info) {
  background: rgba(52, 152, 219, 0.25);
  border-color: rgba(52, 152, 219, 0.55);
}

.btn-secondary:has(i.fa-broom) {
  background: rgba(230, 126, 34, 0.15);
  color: #f39c12;
  border: 1px solid rgba(230, 126, 34, 0.35);
}
.btn-secondary:has(i.fa-broom) i {
  color: #f39c12;
}
.btn-secondary:hover:has(i.fa-broom) {
  background: rgba(230, 126, 34, 0.25);
  border-color: rgba(230, 126, 34, 0.55);
}

.btn-secondary:has(i.fa-trash-can),
.btn-secondary:has(i.fa-trash) {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-secondary:has(i.fa-trash-can) i,
.btn-secondary:has(i.fa-trash) i {
  color: #ef4444;
}
.btn-secondary:hover:has(i.fa-trash-can),
.btn-secondary:hover:has(i.fa-trash) {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.55);
}

.btn-secondary:has(i.fa-share-nodes) {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.35);
}
.btn-secondary:has(i.fa-share-nodes) i {
  color: #2ecc71;
}
.btn-secondary:hover:has(i.fa-share-nodes) {
  background: rgba(46, 204, 113, 0.25);
  border-color: rgba(46, 204, 113, 0.55);
}

.btn-secondary:has(i.fa-robot) {
  background: rgba(155, 89, 182, 0.15);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.35);
}
.btn-secondary:has(i.fa-robot) i {
  color: #9b59b6;
}
.btn-secondary:hover:has(i.fa-robot) {
  background: rgba(155, 89, 182, 0.25);
  border-color: rgba(155, 89, 182, 0.55);
}

.btn-secondary:has(i.fa-pen-to-square),
.btn-secondary:has(i.fa-pen) {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.35);
}
.btn-secondary:has(i.fa-pen-to-square) i,
.btn-secondary:has(i.fa-pen) i {
  color: #3498db;
}
.btn-secondary:hover:has(i.fa-pen-to-square),
.btn-secondary:hover:has(i.fa-pen) {
  background: rgba(52, 152, 219, 0.25);
  border-color: rgba(52, 152, 219, 0.55);
}

.btn-secondary:has(i.fa-key) {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.35);
}
.btn-secondary:has(i.fa-key) i {
  color: #f1c40f;
}
.btn-secondary:hover:has(i.fa-key) {
  background: rgba(241, 196, 15, 0.25);
  border-color: rgba(241, 196, 15, 0.55);
}

.btn-secondary:has(i.fa-folder-open) {
  background: rgba(155, 89, 182, 0.15);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.35);
}
.btn-secondary:has(i.fa-folder-open) i {
  color: #9b59b6;
}
.btn-secondary:hover:has(i.fa-folder-open) {
  background: rgba(155, 89, 182, 0.25);
  border-color: rgba(155, 89, 182, 0.55);
}

.btn-secondary:has(i.fa-terminal) {
  background: rgba(26, 188, 156, 0.15);
  color: #1abc9c;
  border: 1px solid rgba(26, 188, 156, 0.35);
}
.btn-secondary:has(i.fa-terminal) i {
  color: #1abc9c;
}
.btn-secondary:hover:has(i.fa-terminal) {
  background: rgba(26, 188, 156, 0.25);
  border-color: rgba(26, 188, 156, 0.55);
}

.btn-secondary:has(i.fa-arrow-up-wide-short) {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.35);
}
.btn-secondary:has(i.fa-arrow-up-wide-short) i {
  color: #f1c40f;
}
.btn-secondary:hover:has(i.fa-arrow-up-wide-short) {
  background: rgba(241, 196, 15, 0.25);
  border-color: rgba(241, 196, 15, 0.55);
}

.btn-secondary:has(i.fa-pause) {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
  border: 1px solid rgba(243, 156, 18, 0.35);
}
.btn-secondary:has(i.fa-pause) i {
  color: #f39c12;
}
.btn-secondary:hover:has(i.fa-pause) {
  background: rgba(243, 156, 18, 0.25);
  border-color: rgba(243, 156, 18, 0.55);
}

.btn-secondary:has(i.fa-play) {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.35);
}
.btn-secondary:has(i.fa-play) i {
  color: #2ecc71;
}
.btn-secondary:hover:has(i.fa-play) {
  background: rgba(46, 204, 113, 0.25);
  border-color: rgba(46, 204, 113, 0.55);
}

.btn-secondary:has(i.fa-stop) {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-secondary:has(i.fa-stop) i {
  color: #ef4444;
}
.btn-secondary:hover:has(i.fa-stop) {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.55);
}

.btn-secondary:has(i.fa-arrow-rotate-right),
.btn-secondary:has(i.fa-rotate-right) {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.35);
}
.btn-secondary:has(i.fa-arrow-rotate-right) i,
.btn-secondary:has(i.fa-rotate-right) i {
  color: #3498db;
}
.btn-secondary:hover:has(i.fa-arrow-rotate-right),
.btn-secondary:hover:has(i.fa-rotate-right) {
  background: rgba(52, 152, 219, 0.25);
  border-color: rgba(52, 152, 219, 0.55);
}

.btn-secondary:has(i.fa-copy),
.btn-secondary:has(i.fa-clone) {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.35);
}
.btn-secondary:has(i.fa-copy) i,
.btn-secondary:has(i.fa-clone) i {
  color: #f1c40f;
}
.btn-secondary:hover:has(i.fa-copy),
.btn-secondary:hover:has(i.fa-clone) {
  background: rgba(241, 196, 15, 0.25);
  border-color: rgba(241, 196, 15, 0.55);
}

.btn-secondary:has(i.fa-download) {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.35);
}
.btn-secondary:has(i.fa-download) i {
  color: #2ecc71;
}
.btn-secondary:hover:has(i.fa-download) {
  background: rgba(46, 204, 113, 0.25);
  border-color: rgba(46, 204, 113, 0.55);
}

.btn-secondary:has(i.fa-plug) {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.35);
}
.btn-secondary:has(i.fa-plug) i {
  color: #f1c40f;
}
.btn-secondary:hover:has(i.fa-plug) {
  background: rgba(241, 196, 15, 0.25);
  border-color: rgba(241, 196, 15, 0.55);
}

.btn-secondary:has(i.fa-rotate),
.btn-secondary:has(i.fa-arrows-rotate),
.btn-secondary:has(i.fa-sync) {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.35);
}
.btn-secondary:has(i.fa-rotate) i,
.btn-secondary:has(i.fa-arrows-rotate) i,
.btn-secondary:has(i.fa-sync) i {
  color: #2ecc71;
}
.btn-secondary:hover:has(i.fa-rotate),
.btn-secondary:hover:has(i.fa-arrows-rotate),
.btn-secondary:hover:has(i.fa-sync) {
  background: rgba(46, 204, 113, 0.25);
  border-color: rgba(46, 204, 113, 0.55);
}

.btn-secondary:has(i.fa-right-from-bracket),
.btn-secondary:has(i.fa-sign-out-alt),
.btn-secondary:has(i.fa-sign-out) {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-secondary:has(i.fa-right-from-bracket) i,
.btn-secondary:has(i.fa-sign-out-alt) i,
.btn-secondary:has(i.fa-sign-out) i {
  color: #ef4444;
}
.btn-secondary:hover:has(i.fa-right-from-bracket),
.btn-secondary:hover:has(i.fa-sign-out-alt),
.btn-secondary:hover:has(i.fa-sign-out) {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.55);
}

/* Translucent Badge-Style Primary Actions (Matching Odśwież dane & App Theme) */
.btn-success,
.btn-save,
button.btn-success,
button.btn-save {
  background: rgba(46, 204, 113, 0.18) !important;
  color: #2ecc71 !important;
  border: 1px solid rgba(46, 204, 113, 0.4) !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

.btn-success i,
.btn-save i {
  color: #2ecc71 !important;
}

.btn-success:hover,
.btn-save:hover {
  background: rgba(46, 204, 113, 0.28) !important;
  color: #ffffff !important;
  border-color: rgba(46, 204, 113, 0.65) !important;
  transform: translateY(-1px);
}

.btn-success:hover i,
.btn-save:hover i {
  color: #ffffff !important;
}

.btn-danger,
button.btn-danger {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

.btn-danger i {
  color: #ef4444 !important;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.65) !important;
  transform: translateY(-1px);
}

.btn-danger:hover i {
  color: #ffffff !important;
}



/* Translucent Badge Buttons for Action Rows */
.btn-secondary:has(i.fa-paper-plane),
.btn-primary:has(i.fa-paper-plane),
.btn-secondary:has(i.fa-file-pdf),
.btn-primary:has(i.fa-file-pdf),
.btn-secondary:has(i.fa-plus),
.btn-primary:has(i.fa-plus),
.btn-secondary:has(i.fa-circle-plus),
.btn-primary:has(i.fa-circle-plus),
.btn-secondary:has(i.fa-plus-circle),
.btn-primary:has(i.fa-plus-circle),
.btn-secondary:has(i.fa-building-user),
.btn-primary:has(i.fa-building-user),
.btn-secondary:has(i.fa-circle-arrow-right),
.btn-primary:has(i.fa-circle-arrow-right) {
  background: rgba(46, 204, 113, 0.18) !important;
  color: #2ecc71 !important;
  border: 1px solid rgba(46, 204, 113, 0.4) !important;
  box-shadow: none !important;
}

.btn-secondary:has(i.fa-paper-plane) i,
.btn-primary:has(i.fa-paper-plane) i,
.btn-secondary:has(i.fa-file-pdf) i,
.btn-primary:has(i.fa-file-pdf) i,
.btn-secondary:has(i.fa-plus) i,
.btn-primary:has(i.fa-plus) i,
.btn-secondary:has(i.fa-circle-plus) i,
.btn-primary:has(i.fa-circle-plus) i,
.btn-secondary:has(i.fa-plus-circle) i,
.btn-primary:has(i.fa-plus-circle) i,
.btn-secondary:has(i.fa-building-user) i,
.btn-primary:has(i.fa-building-user) i,
.btn-secondary:has(i.fa-circle-arrow-right) i,
.btn-primary:has(i.fa-circle-arrow-right) i {
  color: #2ecc71 !important;
}

.btn-secondary:hover:has(i.fa-paper-plane),
.btn-primary:hover:has(i.fa-paper-plane),
.btn-secondary:hover:has(i.fa-file-pdf),
.btn-primary:hover:has(i.fa-file-pdf),
.btn-secondary:hover:has(i.fa-plus),
.btn-primary:hover:has(i.fa-plus),
.btn-secondary:hover:has(i.fa-circle-plus),
.btn-primary:hover:has(i.fa-circle-plus),
.btn-secondary:hover:has(i.fa-plus-circle),
.btn-primary:hover:has(i.fa-plus-circle),
.btn-secondary:hover:has(i.fa-building-user),
.btn-primary:hover:has(i.fa-building-user),
.btn-secondary:hover:has(i.fa-circle-arrow-right),
.btn-primary:hover:has(i.fa-circle-arrow-right) {
  background: rgba(46, 204, 113, 0.28) !important;
  color: #ffffff !important;
  border-color: rgba(46, 204, 113, 0.65) !important;
  transform: translateY(-1px);
}

.btn-success:hover i,
.btn-save:hover i,
.btn-secondary:hover:has(i.fa-paper-plane) i,
.btn-primary:hover:has(i.fa-paper-plane) i,
.btn-secondary:hover:has(i.fa-file-pdf) i,
.btn-primary:hover:has(i.fa-file-pdf) i,
.btn-secondary:hover:has(i.fa-plus) i,
.btn-primary:hover:has(i.fa-plus) i,
.btn-secondary:hover:has(i.fa-circle-plus) i,
.btn-primary:hover:has(i.fa-circle-plus) i,
.btn-secondary:hover:has(i.fa-plus-circle) i,
.btn-primary:hover:has(i.fa-plus-circle) i,
.btn-secondary:hover:has(i.fa-building-user) i,
.btn-primary:hover:has(i.fa-building-user) i,
.btn-secondary:hover:has(i.fa-circle-arrow-right) i,
.btn-primary:hover:has(i.fa-circle-arrow-right) i {
  color: #ffffff !important;
}

.btn-full {
  width: 100%;
  padding: 14px;
}

.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
  background: rgba(255, 255, 255, 0.04) !important;
  color: rgba(255, 255, 255, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
  pointer-events: none;
}

/* Tabs Toggle */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.tab-content.active {
  display: flex;
}

.dcp-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 6px;
}

.dcp-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  transition: var(--transition-smooth);
}

.dcp-card:hover {
  transform: translateY(-1px);
  border-color: rgba(108, 92, 231, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dcp-info-main {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 1200px) {
  .dcp-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
  }
  .dcp-card-actions {
    width: 100%;
    justify-content: space-between;
  }
}

.dcp-tag {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  margin-bottom: 0;
}

.dcp-tag.tag-trailer,
.dcp-tag.tag-feature {
  background: rgba(230, 126, 34, 0.18) !important;
  color: #f39c12 !important;
  border: 1px solid rgba(230, 126, 34, 0.35) !important;
}

.dcp-tag-loading {
  background: rgba(255, 255, 255, 0.15) !important;
  color: var(--text-primary) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  animation: dcp-tag-pulse 1.8s infinite ease-in-out;
}

@keyframes dcp-tag-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(162, 155, 254, 0.4);
    opacity: 0.85;
  }
  50% {
    box-shadow: 0 0 8px 2px rgba(162, 155, 254, 0.6);
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(162, 155, 254, 0);
    opacity: 0.85;
  }
}

.dcp-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
}

.dcp-meta-bytes {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.dcp-card-actions {
  display: flex;
  gap: 10px;
}

.dcp-card-actions button {
  flex: 1;
}

/* Data Tables */
.nodes-table-container, .transfers-table-container {
  width: 100%;
  overflow-x: auto;
  padding-right: 6px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.data-table tbody tr {
  transition: var(--transition-smooth);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

.table-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px !important;
}

/* Progress and Status indicators in Tables/Lists */
.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.progress-track {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--color-text-secondary);
  width: 0%;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 12px;
  font-weight: 700;
  width: 35px;
  text-align: right;
}

/* Badges for status */
.badge-status {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-status.status-completed { background: rgba(46, 204, 113, 0.12); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.25); }
.badge-status.status-downloading { background: rgba(52, 152, 219, 0.12); color: #3498db; border: 1px solid rgba(52, 152, 219, 0.25); }
.badge-status.status-verifying { background: rgba(155, 89, 182, 0.12); color: #9b59b6; border: 1px solid rgba(155, 89, 182, 0.25); }
.badge-status.status-failed { background: rgba(231, 76, 60, 0.12); color: #e74c3c; border: 1px solid rgba(231, 76, 60, 0.25); }
.badge-status.status-pending { background: rgba(241, 196, 15, 0.12); color: #f1c40f; border: 1px solid rgba(241, 196, 15, 0.25); }
.badge-status.status-queued { background: rgba(241, 196, 15, 0.15); color: #f39c12; border: 1px solid rgba(241, 196, 15, 0.3); }
.badge-status.status-paused { background: rgba(230, 126, 34, 0.15); color: #e67e22; border: 1px solid rgba(230, 126, 34, 0.3); }
.badge-status.status-waiting_for_robot { background: rgba(155, 89, 182, 0.12); color: #9b59b6; border: 1px dashed rgba(155, 89, 182, 0.35); }

/* Dialog Modal styling */
.sleek-dialog {
  margin: auto;
  border: 1px solid var(--border-color);
  background: var(--bg-panel);
  color: var(--text-primary);
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(15px);
  z-index: 100;
}

#dcp-details-dialog {
  max-width: 780px;
}

.sleek-dialog::backdrop {
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(6px);
}

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

.dialog-header h3 {
  font-family: var(--font-logo);
  font-size: 20px;
  font-weight: 600;
}

.dialog-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialog-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--color-primary);
  transform: scale(1.05);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.form-group select,
.premium-select {
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  height: 44px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

.form-group select option {
  background-color: #0f0f18;
  color: var(--text-primary);
}

.form-group select:hover,
.premium-select:hover {
  border-color: rgba(108, 92, 231, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.form-group select:focus,
.premium-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(108, 92, 231, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.premium-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.premium-input:hover {
  border-color: rgba(108, 92, 231, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.premium-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(108, 92, 231, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.node-checkbox-list {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-placeholder {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.checkbox-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.checkbox-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
}

/* Details list inside modal */
.dcp-details-meta {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dcp-files-list-container {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
}

.dcp-files-list {
  list-style: none;
}

.dcp-files-list li {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

.dcp-files-list li:last-child {
  border-bottom: none;
}

.file-name {
  word-break: break-all;
  margin-right: 15px;
}

.file-size {
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state i {
  font-size: 32px;
  opacity: 0.3;
}

/* Active transfer progress blocks on dashboard */
.active-transfers-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.active-transfer-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
}

.transfer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.transfer-title-group h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.transfer-node-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.transfer-speed-badge {
  background: rgba(0, 206, 201, 0.1);
  color: var(--color-accent);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.transfer-card-metrics {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
}

/* Quick instructions box */
.quick-info-box {
  background: rgba(108, 92, 231, 0.05);
  border: 1px dashed rgba(108, 92, 231, 0.2);
  border-radius: 10px;
  padding: 16px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-info-box h4 {
  font-weight: 600;
  color: #a29bfe;
}

.quick-info-box p {
  color: var(--text-secondary);
  line-height: 1.4;
}

.quick-info-box code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--color-accent);
  font-family: monospace;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Upload Dropzone styling */
.upload-dropzone {
  border: 2px dashed rgba(108, 92, 231, 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.01);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: var(--transition-smooth);
  margin-top: 10px;
}

.upload-dropzone:hover {
  background: rgba(108, 92, 231, 0.04);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(108, 92, 231, 0.15);
}

.dropzone-icon {
  font-size: 40px;
  color: var(--color-primary);
  filter: drop-shadow(0 0 8px var(--color-primary-glow));
}

.dropzone-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.selected-files-summary {
  background: rgba(0, 206, 201, 0.08);
  border: 1px solid rgba(0, 206, 201, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-progress-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
}



/* Toast Notifications Styling */
.toast-notification {
  pointer-events: auto;
  background: rgba(15, 15, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.toast-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-notification.hide {
  transform: translateX(50px) scale(0.9);
  opacity: 0;
  margin-top: -60px; /* pull sibling toasts up */
  pointer-events: none;
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-success {
  border-left: 4px solid var(--color-success);
  box-shadow: 0 10px 30px rgba(46, 204, 113, 0.15);
}
.toast-success .toast-icon {
  color: var(--color-success);
}

.toast-error {
  border-left: 4px solid var(--color-danger);
  box-shadow: 0 10px 30px rgba(231, 76, 60, 0.15);
}
.toast-error .toast-icon {
  color: var(--color-danger);
}

.toast-info {
  border-left: 4px solid var(--color-primary);
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.15);
}
.toast-info .toast-icon {
  color: var(--color-primary);
}

.toast-message {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

#system-console-content,
#rsync-console-content {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  font-family: var(--font-main) !important;
  border-radius: 8px;
  padding: 8px !important;
}

#system-console-content div,
#rsync-console-content div {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
}

/* Network selection buttons styling */
.network-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: var(--color-text) !important;
}

.network-btn.active {
  background: var(--color-primary-light) !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 12px rgba(108, 92, 231, 0.25);
  color: var(--color-text) !important;
}

/* Custom Scrollbar for Send DCP target grids */
#send-dcp-cinemas-list::-webkit-scrollbar,
#add-cinema-servers-container::-webkit-scrollbar {
  width: 6px;
}

#send-dcp-cinemas-list::-webkit-scrollbar-track,
#add-cinema-servers-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
  border-radius: 4px;
}

#send-dcp-cinemas-list::-webkit-scrollbar-thumb,
#add-cinema-servers-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

#send-dcp-cinemas-list::-webkit-scrollbar-thumb:hover,
#add-cinema-servers-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Premium Combobox Dropdown Custom Styling */
.combobox-item {
  color: var(--text-primary);
}
.combobox-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff;
}
.premium-dropdown-list::-webkit-scrollbar {
  width: 6px;
}
.premium-dropdown-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}
.premium-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.premium-dropdown-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Transfers Table Layout Fixes */
#transfers-table td {
  padding: 16px;
  height: 72px; /* Enforce premium height to prevent jumping */
  white-space: nowrap; /* Prevent wrapping which triggers height resizing */
  vertical-align: middle;
}
#transfers-table th {
  white-space: nowrap;
}
/* Reserve fixed widths for columns prone to shifting */
#transfers-table th:nth-child(1), #transfers-table td:nth-child(1) { width: 100px; min-width: 100px; } /* ID */
#transfers-table th:nth-child(2), #transfers-table td:nth-child(2) { min-width: 250px; } /* DCP Name */
#transfers-table th:nth-child(3), #transfers-table td:nth-child(3) { min-width: 180px; } /* Target Node */
#transfers-table th:nth-child(4), #transfers-table td:nth-child(4) { width: 90px; min-width: 90px; } /* Size */
#transfers-table th:nth-child(5), #transfers-table td:nth-child(5) { min-width: 160px; } /* Progress */
#transfers-table th:nth-child(6), #transfers-table td:nth-child(6) { width: 110px; min-width: 110px; } /* Speed */
#transfers-table th:nth-child(7), #transfers-table td:nth-child(7) { width: 110px; min-width: 110px; } /* Avg Speed */
#transfers-table th:nth-child(8), #transfers-table td:nth-child(8) { width: 140px; min-width: 140px; } /* Start Time */
#transfers-table th:nth-child(9), #transfers-table td:nth-child(9) { width: 140px; min-width: 140px; } /* End Time */
#transfers-table th:nth-child(10), #transfers-table td:nth-child(10) { width: 150px; min-width: 150px; } /* Status */
#transfers-table th:nth-child(11), #transfers-table td:nth-child(11) { width: 120px; min-width: 120px; text-align: center; } /* Actions */

/* Flashing animation for new packages row */
@keyframes flash-orange {
  0%, 100% { background-color: transparent; box-shadow: none; border-bottom-color: rgba(255, 255, 255, 0.05); }
  50% { background-color: rgba(230, 126, 34, 0.18); box-shadow: 0 0 0 1px rgba(230, 126, 34, 0.35), inset 0 0 12px rgba(230, 126, 34, 0.12); border-bottom-color: transparent; }
}
.flashing-stat-row {
  animation: flash-orange 2s infinite ease-in-out;
  border-radius: 8px !important;
}

/* Flashing animation for transfer error row */
@keyframes flash-red {
  0%, 100% { background-color: transparent; box-shadow: none; border-bottom-color: rgba(255, 255, 255, 0.05); }
  50% { background-color: rgba(231, 76, 60, 0.22); box-shadow: 0 0 0 1px rgba(231, 76, 60, 0.45), inset 0 0 12px rgba(231, 76, 60, 0.18); border-bottom-color: transparent; }
}
.flashing-stat-row-error {
  animation: flash-red 1.8s infinite ease-in-out;
  border-radius: 8px !important;
}



/* Ensure login inputs and container font styling matches KDM system exactly */
#login-container input {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 14px !important;
}
#login-container button,
#login-container label,
#login-container p,
#login-container h2 {
  font-family: 'Outfit', sans-serif !important;
}

#login-container input:focus {
  border-color: #d1008c !important;
  box-shadow: 0 0 12px rgba(209, 0, 140, 0.25) !important;
  background: rgba(0, 0, 0, 0.8) !important;
}

body.light-theme #login-container input {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

body.light-theme #login-container input:focus {
  background: #ffffff !important;
  border-color: #d1008c !important;
  color: #0f172a !important;
  box-shadow: 0 0 12px rgba(209, 0, 140, 0.15) !important;
}

/* Robots Dashboard styling */
.robots-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.robots-stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition-smooth);
}

.robots-stat-card:hover {
  border-color: rgba(155, 89, 182, 0.25);
  background: rgba(255, 255, 255, 0.03);
}

.robots-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.robots-stat-info {
  display: flex;
  flex-direction: column;
}

.robots-stat-info span {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.robots-stat-info strong {
  font-size: 20px;
  color: var(--color-text-primary);
  font-weight: 700;
}

/* Robot Cards Grid */
.robots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.premium-robot-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-robot-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(155, 89, 182, 0.05), transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.premium-robot-card:hover {
  transform: translateY(-4px);
  border-color: rgba(155, 89, 182, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.premium-robot-card.offline:hover {
  border-color: rgba(231, 76, 60, 0.3);
}

.premium-robot-card.pending {
  border: 1px dashed rgba(230, 126, 34, 0.4);
  background: rgba(230, 126, 34, 0.02);
}

.premium-robot-card.pending:hover {
  border-color: #e67e22;
  box-shadow: 0 8px 30px rgba(230, 126, 34, 0.15);
}

.robot-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1;
  position: relative;
}

.robot-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(155, 89, 182, 0.15);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.3);
  transition: var(--transition-smooth);
}

.premium-robot-card.offline .robot-card-avatar {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border-color: rgba(231, 76, 60, 0.2);
}

.premium-robot-card.pending .robot-card-avatar {
  background: rgba(230, 126, 34, 0.1);
  color: #e67e22;
  border-color: rgba(230, 126, 34, 0.2);
}

.robot-card-title-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.robot-card-title-group h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.robot-card-title-group span {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
  font-family: monospace;
}

.robot-card-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.robot-card-status-badge.online {
  background: rgba(46, 204, 113, 0.12);
  color: #2e7d32;
  border: 1px solid rgba(46, 204, 113, 0.2);
}

body.dark-theme .robot-card-status-badge.online {
  color: #2ecc71;
}

.robot-card-status-badge.offline {
  background: rgba(231, 76, 60, 0.12);
  color: #c62828;
  border: 1px solid rgba(231, 76, 60, 0.2);
}

body.dark-theme .robot-card-status-badge.offline {
  color: #e74c3c;
}

.robot-card-status-badge.pending {
  background: rgba(230, 126, 34, 0.12);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.2);
}

.robot-card-meta-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding: 10px 0;
  z-index: 1;
}

.robot-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
}

.robot-meta-item i {
  font-size: 12px;
  color: var(--color-primary);
  width: 14px;
  text-align: center;
}

.robot-meta-item code {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 4px;
  border-radius: 4px;
}

/* Metric Progress bars inside Robot Cards */
.robot-card-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
}

.robot-metric-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.robot-metric-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
}

.robot-metric-label strong {
  color: var(--color-text-primary);
}

.robot-metric-track {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.robot-metric-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.robot-metric-fill.cpu {
  background: #3b82f6;
}

.robot-metric-fill.ram {
  background: #8b5cf6;
}

.robot-metric-fill.storage {
  background: #10b981;
}

.robot-card-network {
  display: flex;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-family: monospace;
  z-index: 1;
}

.robot-network-speed {
  display: flex;
  align-items: center;
  gap: 6px;
}

.robot-network-speed.dl {
  color: var(--color-text-secondary);
}

.robot-network-speed.ul {
  color: var(--color-text-secondary);
}

.robot-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 14px;
  z-index: 1;
}

/* Responsive sidebar collapsed mode for iPad/Tablets */
@media (max-width: 1200px) {
  .sidebar-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition-smooth);
    margin-right: 15px;
    flex-shrink: 0;
  }
  
  body.light-theme .sidebar-toggle-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  body.sidebar-open {
    overflow: hidden !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    z-index: 99999;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    touch-action: pan-y !important;
    overscroll-behavior-x: none !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px !important;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    padding: 24px !important;
    width: 100% !important;
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  .dcp-card-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-start !important;
  }
  
  .dcp-card-actions button {
    flex: 1 1 auto !important;
    min-width: 130px !important;
    max-width: 100% !important;
  }
}

/* Safe area padding for Full Screen Standalone PWA Mode on iOS */
@media all and (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
  }
}

.machine-id-code {
  font-family: monospace !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border-color) !important;
  padding: 3px 6px !important;
  border-radius: 4px !important;
  display: inline-block !important;
  letter-spacing: 0.5px !important;
  vertical-align: middle;
}

body.light-theme .machine-id-code {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

.suggestion-item {
  transition: background-color 0.15s ease, color 0.15s ease;
  color: var(--text-primary) !important;
}
.suggestion-item span {
  color: inherit !important;
}
.suggestion-item span span {
  color: var(--text-secondary) !important;
}
.suggestion-item:hover {
  background-color: rgba(108, 92, 231, 0.1) !important;
}
.suggestion-item.create-new:hover {
  background-color: rgba(108, 92, 231, 0.15) !important;
}

/* Custom DCP Dropdown & Options */
.custom-dcp-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 8px;
  box-sizing: border-box;
}

.custom-dcp-option {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  background-color: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fix datetime-local inputs for iPad / Mobile touch screens */
input[type="datetime-local"] {
  width: 100%;
  box-sizing: border-box;
  color-scheme: dark;
}

/* All Cancel buttons in dialog footers are styled in translucent red danger badge */
.dialog-footer .btn-secondary,
.dialog-footer button[id*="cancel"] {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.dialog-footer .btn-secondary:hover,
.dialog-footer button[id*="cancel"]:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

.custom-dcp-option:hover {
  background-color: rgba(108, 92, 231, 0.08);
  color: var(--color-accent);
}

.custom-dcp-option.active {
  background-color: rgba(108, 92, 231, 0.15);
  color: var(--color-accent);
  font-weight: 700;
}


