/* CSS Reset & Variable Tokens */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

:root {
  --bg-app: #0b0f19;
  --bg-sidebar: #0f172a;
  --bg-panel: rgba(22, 30, 47, 0.7);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: #8b5cf6;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --color-violet: #8b5cf6;
  --color-indigo: #6366f1;
  --color-cyan: #06b6d4;
  --color-green: #10b981;
  --color-red: #ef4444;
  --color-warning: #f59e0b;
  
  --gradient-brand: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --gradient-violet: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  --gradient-green: linear-gradient(135deg, #34d399 0%, #059669 100%);
  --gradient-blue: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
}

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

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-left: 8px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  color: var(--color-violet);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--color-violet);
}

.brand-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
}

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

.menu-item.active {
  background: var(--gradient-brand);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.menu-icon {
  width: 20px;
  height: 20px;
}

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

.master-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

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

.status-indicator.online {
  background-color: var(--color-green);
  box-shadow: 0 0 8px var(--color-green);
}

.status-indicator.offline {
  background-color: var(--color-red);
  box-shadow: 0 0 8px var(--color-red);
}

.status-indicator.unknown {
  background-color: var(--text-muted);
}

.status-indicator.online::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  border: 1px solid var(--color-green);
  animation: pulse 1.8s infinite ease-out;
}

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

.node-name {
  font-size: 13px;
  font-weight: 600;
}

.webserver-badge {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--color-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
  font-weight: 700;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-header {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.quick-stats-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.quick-stat-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--gradient-brand);
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.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);
}

.btn-danger {
  background: var(--color-red);
  color: var(--text-primary);
}

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

/* Tab Panels */
.content-body {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Panel / Cards Container */
.panel {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.panel h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Dashboard Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

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

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.purple { background: var(--gradient-violet); }
.stat-icon.green { background: var(--gradient-green); }
.stat-icon.blue { background: var(--gradient-blue); }

.stat-details {
  display: flex;
  flex-direction: column;
}

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

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

/* Charts container */
.chart-container {
  height: 260px;
  position: relative;
  width: 100%;
}

/* Layout Split */
.split-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.max-w-lg { max-width: 550px; }

/* Tables */
.table-container {
  overflow: visible;
  margin-top: 12px;
}

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

.data-table th {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

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

.data-table tbody tr:hover td {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.01);
}

/* Forms */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-help {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.2);
}

.form-group textarea {
  font-family: 'Courier New', Courier, monospace;
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-group label {
  cursor: pointer;
}

.slave-checkboxes {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 130px;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.1);
}

/* Installer Code Block */
.installer-box {
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
  border: 1px dashed var(--color-violet);
  background: rgba(139, 92, 246, 0.05);
}

.installer-box h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--color-violet);
}

.code-command {
  display: flex;
  align-items: center;
  background-color: #05070c;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  gap: 12px;
  justify-content: space-between;
}

.code-command code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  color: var(--color-cyan);
  word-break: break-all;
}

.btn-copy {
  background: var(--color-violet);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

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

.installer-warning {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* File Manager Custom Styles */
.filemanager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.breadcrumbs {
  font-size: 14px;
  color: var(--text-secondary);
}

.breadcrumbs span {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumbs a {
  color: var(--color-violet);
  text-decoration: none;
  cursor: pointer;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.filemanager-actions {
  display: flex;
  gap: 12px;
}

.file-upload-label {
  display: inline-block;
  margin-bottom: 0;
}

/* Editor Modal Window */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(5, 7, 12, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: #161e2f;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 80%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h4 {
  font-size: 15px;
  font-weight: 600;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

#editor-textarea {
  width: 100%;
  height: 450px;
  background-color: #090d16;
  color: #e2e8f0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
}

#editor-textarea:focus {
  border-color: var(--border-focus);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Helpers */
.hidden { display: none !important; }
.mr-2 { margin-right: 8px; }
.text-right { text-align: right; }
.bold { font-weight: 600; }

/* Progress bar inside table */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-bar.green { background: var(--color-green); }
.progress-bar.yellow { background: var(--color-warning); }
.progress-bar.red { background: var(--color-red); }

/* Quick indicators */
.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--color-green); }
.badge-gray { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: var(--color-red); }
.badge-yellow { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }


.file-item-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 8px;
  color: var(--color-violet);
}

.folder-link {
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
}

.folder-link:hover {
  color: var(--color-violet);
  text-decoration: underline;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  background-color: #121926;
}

.modal-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 14px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.modal-tab-btn:hover {
  color: var(--text-primary);
}

.modal-tab-btn.active {
  color: var(--color-violet);
  border-bottom: 2px solid var(--color-violet);
}

.modal-tab-content {
  display: none;
  padding: 24px;
}

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

.cert-detail-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 16px;
  font-size: 13px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 15px;
}

.cert-detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

.cert-detail-val {
  color: var(--text-primary);
  font-family: monospace;
  word-break: break-all;
}

/* Deployment Progress Styles */
.progress-bar.cyan {
  background: var(--color-cyan);
}

.status-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  border-top-color: var(--color-cyan);
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

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

/* Dropdown Menu System */
.dropdown {
  position: relative;
  display: inline-block;
  text-align: left;
}

.dropdown-toggle {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dropdown-toggle:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: rgba(13, 9, 21, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  min-width: 150px;
  padding: 4px 0;
}

.dropdown.active .dropdown-menu {
  display: block;
}

.dropdown.open-up .dropdown-menu {
  top: auto;
  bottom: calc(100% + 4px);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.dropdown-item.text-danger {
  color: var(--color-red);
}

.dropdown-item.text-danger:hover {
  background-color: rgba(239, 68, 68, 0.08);
  color: var(--color-red);
}

/* File manager additional styles */
#filemanager-table th, #filemanager-table td {
  vertical-align: middle;
}

.filemanager-batch-actions {
  transition: opacity 0.2s ease;
}

.filemanager-batch-actions.hidden {
  display: none !important;
}

.filemanager-actions.hidden {
  display: none !important;
}



 / *   F i l e   M a n a g e r   M u l t i - S e l e c t   * / 
 . f i l e - c h e c k b o x - c e l l   {   w i d t h :   4 0 p x ;   t e x t - a l i g n :   c e n t e r ;   } 
 . f i l e - c h e c k b o x   {   w i d t h :   1 6 p x ;   h e i g h t :   1 6 p x ;   c u r s o r :   p o i n t e r ;   a c c e n t - c o l o r :   v a r ( - - c o l o r - c y a n ) ;   } 
  
 