/* ════════════════════════════════════════════════════════════════
   DeployPro — Enterprise Premium CSS
   ════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --bg:           #080d1a;
  --bg-2:         #0d1426;
  --bg-3:         #111b30;
  --card:         #0f1629;
  --card-border:  #1e2d4a;
  --card2:        #162038;
  --sidebar-w:    240px;
  --topbar-h:     60px;

  --accent:       #4f46e5;
  --accent-2:     #6d28d9;
  --accent-glow:  rgba(79, 70, 229, 0.25);
  --blue:         #3b82f6;
  --green:        #10b981;
  --yellow:       #f59e0b;
  --red:          #ef4444;
  --purple:       #8b5cf6;
  --cyan:         #06b6d4;

  --text-1:       #e2e8f0;
  --text-2:       #94a3b8;
  --text-3:       #475569;

  --radius:       0px;
  --radius-lg:    0px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 48px rgba(0,0,0,0.6);

  --transition:   0.2s ease;
  --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:    'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}
a { color: inherit; text-decoration: none; }
input, textarea, select, button { font: inherit; }
select { appearance: none; }

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--card-border); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ════════════════════════ APP LAYOUT ═══════════════════════════ */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  height: 100vh;
  transition: grid-template-columns var(--transition);
}
#app.sidebar-collapsed {
  grid-template-columns: 60px 1fr;
  --sidebar-w: 60px;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
#sidebar {
  grid-area: sidebar;
  background: var(--bg-2);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}
.brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.brand-name { font-size: 15px; font-weight: 700; color: var(--text-1); }
.brand-sub  { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.nav-section-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 14px 20px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  font-size: 13.5px;
  color: var(--text-2);
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
  white-space: nowrap;
}
.nav-item i { width: 18px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-3); color: var(--text-1); }
.nav-item.active {
  background: linear-gradient(90deg, var(--accent-glow), transparent);
  color: var(--text-1);
  border-right: 3px solid var(--accent);
}
.nav-item.active i { color: var(--accent); }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 0;
  display: none;
}
.nav-badge.visible { display: flex; }

#app.sidebar-collapsed .nav-item span,
#app.sidebar-collapsed .nav-section-label,
#app.sidebar-collapsed .brand-text { display: none; }
#app.sidebar-collapsed .nav-item { justify-content: center; padding: 11px 0; }
#app.sidebar-collapsed .nav-item i { width: auto; }
#app.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.ws-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-dot.connected    { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse-green 2s infinite; }
.ws-dot.disconnected { background: var(--red); }
@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Top Bar ───────────────────────────────────────────────────── */
#topbar {
  grid-area: topbar;
  background: var(--bg-2);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 90;
}
#sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 16px;
  padding: 6px 8px;
  border-radius: 0;
  transition: background var(--transition);
}
#sidebar-toggle:hover { background: var(--bg-3); color: var(--text-1); }
.topbar-title { font-size: 16px; font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--card-border);
}
.topbar-user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2, #7c3aed));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; flex-shrink: 0;
}
.topbar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Main Content ──────────────────────────────────────────────── */
#content {
  grid-area: content;
  overflow-y: auto;
  padding: 28px;
  background: var(--bg);
}

/* ── Pages ─────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }
.fade-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }

/* ════════════════════════ CARDS ════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
}
.card-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header h2 i { color: var(--accent); }
.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ════════════════════════ STATS GRID ═══════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.purple { background: rgba(139,92,246,.15); color: var(--purple); }
.stat-icon.blue   { background: rgba(59,130,246,.15);  color: var(--blue); }
.stat-icon.green  { background: rgba(16,185,129,.15);  color: var(--green); }
.stat-icon.red    { background: rgba(239,68,68,.15);   color: var(--red); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ════════════════════════ LAYOUT HELPERS ═══════════════════════ */
.row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.row-deploy {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  align-items: start;
}
.mt-12 { margin-top: 12px; }

/* ════════════════════════ TABLE ════════════════════════════════ */
.dp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dp-table thead th {
  background: var(--bg-3);
  color: var(--text-2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}
.dp-table tbody tr {
  border-bottom: 1px solid var(--card-border);
  transition: background var(--transition);
}
.dp-table tbody tr:last-child { border-bottom: none; }
.dp-table tbody tr:hover { background: var(--bg-3); }
.dp-table tbody td {
  padding: 10px 16px;
  color: var(--text-1);
  vertical-align: middle;
}
.dp-table .actions-cell { display: flex; gap: 6px; align-items: center; }
.empty-row { text-align: center; color: var(--text-3); padding: 32px !important; }

/* ════════════════════════ BADGES ═══════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-success    { background: rgba(16,185,129,.15); color: var(--green); }
.badge-failed     { background: rgba(239,68,68,.15);  color: var(--red); }
.badge-inprogress { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-rollback   { background: rgba(139,92,246,.15); color: var(--purple); }
.badge-running    { background: rgba(16,185,129,.15); color: var(--green); }
.badge-stopped    { background: rgba(239,68,68,.15);  color: var(--red); }
.badge-started    { background: rgba(16,185,129,.15); color: var(--green); }
.badge-info       { background: rgba(59,130,246,.15); color: var(--blue); }

/* Pulsing badge for in-progress */
.badge-inprogress::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--yellow);
  border-radius: 50%;
  display: inline-block;
  animation: blink 1s infinite;
}
@keyframes blink { 0%,100%{opacity:1}50%{opacity:0.3} }

/* ════════════════════════ BUTTONS ══════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #4338ca; box-shadow: 0 0 16px var(--accent-glow); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-warning { background: var(--yellow); color: #111; }
.btn-warning:hover:not(:disabled) { background: #d97706; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--card-border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-3); color: var(--text-1); }

.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-xs  { padding: 3px 10px; font-size: 11px; }
.btn-lg  { padding: 11px 28px; font-size: 15px; }

.btn-deploy {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-deploy:hover:not(:disabled) {
  box-shadow: 0 6px 28px rgba(79,70,229,0.5);
  transform: translateY(-1px);
}

.btn-iis-reset {
  background: linear-gradient(135deg, var(--red), #b91c1c);
  box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}
.btn-iis-reset:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(239,68,68,0.5);
  transform: translateY(-1px);
}
.btn-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 16px;
  padding: 4px;
  border-radius: 0;
  transition: color var(--transition);
}
.btn-close:hover { color: var(--text-1); }

/* ════════════════════════ FORMS ════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-group > label,
.form-group > .dep-retain-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 7px;
}
/* Reset: don't let the form-group label rule bleed into toggle rows */
.form-group .toggle {
  display: flex;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}
.required { color: var(--red); }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select,
.select-inline {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--card-border);
  color: var(--text-1);
  border-radius: 0;
  padding: 9px 12px;
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.select-inline {
  width: auto;
  min-width: 180px;
  cursor: pointer;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.form-group select {
  cursor: pointer;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.select-inline:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group textarea { resize: vertical; min-height: 70px; }

/* Toggle switch */
.toggle-group { display: flex; flex-direction: column; gap: 10px; }
.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.toggle input { display: none; }
.toggle-track {
  width: 40px; height: 22px;
  background: var(--bg-3);
  border: 1px solid var(--card-border);
  border-radius: 0;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: var(--text-3);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform var(--transition), background var(--transition);
}
.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle input:checked + .toggle-track::after {
  background: #fff;
  transform: translateX(18px);
}
.toggle-label { font-size: 13px; color: var(--text-2); }

/* ── Drop Zone ─────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-2);
  background: var(--bg-3);
}
.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--accent);
  background: rgba(79,70,229,.06);
  color: var(--text-1);
}
.drop-zone p { margin-top: 10px; font-size: 13px; }
.drop-selected {
  margin-top: 12px;
  background: rgba(16,185,129,.1);
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 0;
  padding: 6px 12px;
  font-size: 12px;
}
.drop-selected.hidden { display: none; }

/* ── Deploy Source Tabs ────────────────────────────────────────── */
.dep-source-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.dep-src-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-3);
  border: 1px solid var(--card-border);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}
.dep-src-tab:hover { border-color: var(--accent); color: var(--text-1); }
.dep-src-tab.active {
  background: rgba(79,70,229,.15);
  border-color: var(--accent);
  color: var(--accent-light);
}
.dep-src-panel { animation: fadeIn .15s ease; }
.dep-retain-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.form-hint {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
}

/* ── Retain File-Tree Picker ───────────────────────────────────── */
.retain-picker {
  border: 1px solid var(--card-border);
  background: var(--bg-2);
  margin-bottom: 8px;
}
.retain-picker-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--card-border);
  font-size: 12px;
  color: var(--text-2);
  gap: 8px;
}
.retain-picker-hdr strong { color: var(--text-1); }
.retain-tree {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}
.rtree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12.5px;
  cursor: default;
  transition: background var(--transition);
}
.rtree-row:hover { background: var(--bg-3); }
.rtree-row.rtree-checked { background: rgba(79,70,229,.08); }
.rtree-chk { cursor: pointer; flex-shrink: 0; accent-color: var(--accent); }
.rtree-exp-btn {
  background: none; border: none; padding: 0 2px;
  color: var(--text-3); cursor: pointer; flex-shrink: 0;
  width: 16px; text-align: center;
  transition: color var(--transition);
}
.rtree-exp-btn:hover { color: var(--text-1); }
.rtree-chevron { font-size: 10px; }
.rtree-dir-icon  { color: var(--yellow); flex-shrink: 0; }
.rtree-file-icon { color: var(--text-3); flex-shrink: 0; font-size: 12px; }
.rtree-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.rtree-size { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.rtree-children { padding-left: 24px; }
.rtree-loading, .rtree-empty, .rtree-error {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-3);
}
.rtree-error { color: var(--red); }
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ── Console / Log ─────────────────────────────────────────────── */
.console-log {
  background: #050810;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 16px;
  min-height: 320px;
  max-height: 480px;
  overflow-y: auto;
  color: #a8b2c1;
  line-height: 1.7;
}
.console-idle { color: var(--text-3); }
.log-info    { color: #8bb8f8; }
.log-success { color: var(--green); }
.log-warning { color: var(--yellow); }
.log-error   { color: var(--red); }
.log-ts      { color: var(--text-3); font-size: 11px; margin-right: 6px; }

/* ── Progress Bar ──────────────────────────────────────────────── */
.progress-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-3);
  border-radius: 0;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 0;
  transition: width 0.4s ease;
  width: 0%;
}

/* ── Chart ─────────────────────────────────────────────────────── */
.chart-wrap { height: 220px; }

/* ── Live Feed ─────────────────────────────────────────────────── */
#live-feed {
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 12px;
}
.feed-item {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--card-border);
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.feed-item:last-child { border-bottom: none; }
.feed-ts   { color: var(--text-3); flex-shrink: 0; }
.feed-msg  { color: var(--text-2); }
.feed-success .feed-msg { color: var(--green); }
.feed-error   .feed-msg { color: var(--red); }
.feed-warning .feed-msg { color: var(--yellow); }

/* ════════════════════════ FILE MANAGER ════════════════════════ */
.fm-toolbar {
  flex-wrap: wrap;
  gap: 8px;
}
.fm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-2);
  flex: 1;
}
.crumb {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 0;
  transition: background var(--transition);
}
.crumb:hover { background: var(--bg-3); color: var(--text-1); }
.crumb-sep { color: var(--text-3); font-size: 12px; }
.fm-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.fm-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 400px;
}
.fm-tree {
  border-right: 1px solid var(--card-border);
  padding: 12px 0;
  overflow-y: auto;
  font-size: 13px;
}
.fm-placeholder { color: var(--text-3); padding: 24px 16px; font-size: 13px; }
.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  color: var(--text-2);
  transition: background var(--transition);
}
.tree-item:hover { background: var(--bg-3); color: var(--text-1); }
.tree-item.active { background: var(--accent-glow); color: var(--text-1); }
.tree-item i { width: 14px; text-align: center; }

.fm-list { overflow-y: auto; }

/* Checkbox column */
.fm-chk-col { width: 36px; text-align: center; padding: 0 4px !important; }
.fm-chk-col input[type="checkbox"] { cursor: pointer; accent-color: var(--indigo); width: 15px; height: 15px; }

/* Upload progress queue */
.uq-row {
  display: grid;
  grid-template-columns: 20px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px;
}
.uq-row:last-child { border-bottom: none; }
.uq-icon { font-size: 14px; flex-shrink: 0; }
.uq-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uq-size { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.uq-status { font-size: 12px; white-space: nowrap; color: var(--text-3); }

.code-editor {
  width: 100%;
  min-height: 420px;
  background: #050810;
  color: #a8b2c1;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 16px;
  border: none;
  outline: none;
  resize: vertical;
  line-height: 1.6;
  tab-size: 2;
}

/* ── FM: search, sort, status bar, context menu, icons, drop ── */
.fm-main { display: flex; flex-direction: column; overflow: hidden; }
.fm-search-wrap { position: relative; display: flex; align-items: center; }
.fm-search-icon { position: absolute; left: 8px; color: var(--text-3); font-size: 12px; pointer-events: none; }
.fm-search-input {
  background: var(--bg-3); border: 1px solid var(--card-border); color: var(--text-1);
  border-radius: 0; padding: 4px 8px 4px 26px; font-size: 12px; width: 150px;
  outline: none; transition: border-color var(--transition);
}
.fm-search-input:focus { border-color: var(--accent); }
.fm-sort-col { cursor: pointer; user-select: none; white-space: nowrap; }
.fm-sort-col:hover { color: var(--text-1); }
.sort-arrow { font-size: 10px; color: var(--accent); margin-left: 2px; }
.fm-row { cursor: pointer; }
.fm-row:hover { background: var(--bg-3); }
.fm-row.fm-selected { background: var(--accent-glow); }
.fm-name-cell { display: flex; align-items: center; gap: 8px; }
.fm-name { font-weight: 500; }
.fm-dir-link { color: var(--blue); cursor: pointer; }
.fm-dir-link:hover { text-decoration: underline; }
.fm-meta-cell { font-size: 12px; color: var(--text-2); }
/* File type icon colours */
.fmi-dir    { color: var(--yellow); }
.fmi-js     { color: #f7df1e; }
.fmi-ts     { color: #3178c6; }
.fmi-html   { color: #e34c26; }
.fmi-css    { color: #1572b6; }
.fmi-json, .fmi-xml { color: #5bc0de; }
.fmi-md, .fmi-txt   { color: #94a3b8; }
.fmi-img    { color: #e91e63; }
.fmi-pdf    { color: #ef4444; }
.fmi-zip    { color: var(--yellow); }
.fmi-db     { color: #8b5cf6; }
.fmi-py     { color: #3572a5; }
.fmi-php    { color: #4f5d95; }
.fmi-dll, .fmi-exe  { color: #3b82f6; }
.fmi-bat, .fmi-sh, .fmi-ps { color: #89e051; }
.fmi-cfg    { color: #94a3b8; }
.fmi-default { color: var(--text-3); }
.fm-statusbar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 16px; font-size: 11px; color: var(--text-3);
  border-top: 1px solid var(--card-border); background: var(--bg-3);
  flex-shrink: 0;
}
.fm-statusbar strong { color: var(--text-2); }
.fm-drop-overlay {
  position: absolute; inset: 0;
  background: rgba(79,70,229,0.18);
  border: 2px dashed var(--accent);
  display: none; align-items: center; justify-content: center;
  z-index: 50; pointer-events: none;
}
.fm-drop-message {
  background: var(--card); padding: 28px 40px; text-align: center;
  color: var(--text-1); font-size: 16px; font-weight: 600;
  border: 1px solid var(--card-border);
}
/* Context menu */
.fm-ctx-menu {
  position: fixed; z-index: 3000; display: none;
  background: var(--card); border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg); min-width: 180px; padding: 4px 0;
}
.ctx-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; font-size: 13px; cursor: pointer;
  color: var(--text-2); transition: background var(--transition);
}
.ctx-item:hover { background: var(--bg-3); color: var(--text-1); }
.ctx-item i { width: 14px; text-align: center; flex-shrink: 0; }
.ctx-danger { color: var(--red) !important; }
.ctx-danger:hover { background: rgba(239,68,68,.1) !important; }
.ctx-sep { height: 1px; background: var(--card-border); margin: 4px 0; }
.ctx-key {
  margin-left: auto; font-size: 10px; color: var(--text-3);
  background: var(--bg-3); padding: 1px 5px; border: 1px solid var(--card-border);
}

/* ════════════════════════ MODALS ════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: calc(100vw - 40px);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--card-border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; flex: 1; }
.modal-icon { font-size: 20px; color: var(--yellow); }
.modal-icon.warning { color: var(--yellow); }
.modal-icon.danger  { color: var(--red); }
.modal-body { padding: 20px; color: var(--text-2); font-size: 14px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--card-border);
}

/* ════════════════════════ TOASTS ════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-width: 280px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--yellow); }
.toast-info    { border-left: 3px solid var(--blue); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: var(--green); }
.toast-error   .toast-icon { color: var(--red); }
.toast-warning .toast-icon { color: var(--yellow); }
.toast-info    .toast-icon { color: var(--blue); }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 13px; color: var(--text-1); }
.toast-msg   { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ════════════════════════ RESPONSIVE ═══════════════════════════ */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .row-2col   { grid-template-columns: 1fr; }
  .row-deploy { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  #content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .fm-layout  { grid-template-columns: 1fr; }
  .fm-tree    { border-right: none; border-bottom: 1px solid var(--card-border); max-height: 180px; }
}
