:root {
  --indigo: #1e40af;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --emerald: #047857;
  --emerald-soft: #ecfdf5;
  --emerald-border: #a7f3d0;
  --bg: #f8f9fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.hidden { display: none !important; }
code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.wordmark-img { height: 38px; width: auto; mix-blend-mode: multiply; object-fit: contain; margin: -5px -3px; }
.pill-drop {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}
.topbar-sub { font-size: 12.5px; color: var(--muted); }
.mode-tabs { display: inline-flex; background: #f1f5f9; padding: 3px; border-radius: 9px; gap: 4px; }
.mode-tab {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mode-tab.active { background: #fff; color: var(--indigo); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); }
.tab-pill { font-size: 11px; background: #e5e7eb; color: #374151; padding: 1px 7px; border-radius: 999px; }

.container { max-width: 1060px; margin: 28px auto 56px; padding: 0 24px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.span-2 { grid-column: 1 / -1; }
label span { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; }
input, select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
.btn-primary {
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: #1d3a9c; }
.btn-primary:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 500;
  cursor: pointer;
}

.receipt-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 10px;
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  color: #064e3b;
  font-size: 13px;
}
.receipt-box.err {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.windows-tip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.drop-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}
.drop-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.badge-wait { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-done { background: var(--emerald-soft); color: var(--emerald); border: 1px solid var(--emerald-border); }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 14px;
  font-size: 12.5px;
  color: #374151;
  margin-bottom: 10px;
}
.file-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.file-chip {
  font-size: 11.5px;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}
.path-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 12px;
}

/* ===== MULTI-FIRM FTP / SFTP EXPLORER STYLES ===== */
.ftp-conn-bar {
  background: #0f172a;
  color: #cbd5e1;
  font-size: 12px;
  padding: 7px 28px;
}
.ftp-conn-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
}
.ftp-conn-bar code { background: #1e293b; color: #38bdf8; padding: 1px 6px; }
.conn-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #10b981;
  margin-right: 4px;
}
.container { max-width: 1280px !important; }
.ftp-workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.ftp-pane-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 10px;
}
.ftp-path-preview {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: #0f172a;
  color: #38bdf8;
  padding: 8px 10px;
  border-radius: 8px;
  word-break: break-all;
  margin-bottom: 12px;
}
.folder-tree { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.tree-node { padding: 5px 8px; border-radius: 6px; color: #334155; }
.tree-node.active { background: #eff6ff; color: var(--indigo); font-weight: 600; }
.tree-node.lvl-1 { padding-left: 16px; }
.tree-node.lvl-2 { padding-left: 28px; }
.tree-node.lvl-3 { padding-left: 40px; }
.tree-node.lvl-4 { padding-left: 52px; font-size: 12px; }
.tree-node small { color: var(--muted); font-size: 10.5px; margin-left: 4px; }
.isolation-box {
  margin-top: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12px;
}
.isolation-box p { margin: 4px 0 0; line-height: 1.45; }

.ftp-dropzone {
  position: relative;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  background: #f8fafc;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ftp-dropzone:hover, .ftp-dropzone.drag-over { border-color: var(--indigo); background: #eff6ff; }
.ftp-dropzone-icon { font-size: 24px; margin-bottom: 4px; }
.ftp-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.staged-files-list {
  margin-top: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

/* Staff Multi-Firm FTP Explorer */
.ftp-explorer-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.staff-tree-scroll { max-height: 620px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.ftree-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 7px;
  font: inherit;
  font-size: 12.5px;
  color: #334155;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.ftree-btn:hover { background: #f1f5f9; }
.ftree-btn.active { background: #eff6ff; color: var(--indigo); font-weight: 600; }
.ftree-firm { font-weight: 700; color: #0f172a; margin-top: 4px; }
.ftree-matter { padding-left: 18px; }
.ftree-drop { padding-left: 32px; font-size: 12px; }
.ftree-sub { padding-left: 46px; font-size: 11.5px; color: #475569; }
.ftp-address-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ftp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ftp-table th {
  text-align: left;
  padding: 9px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}
.ftp-table td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.ftp-table tbody tr { cursor: pointer; }
.ftp-table tbody tr:hover { background: #f5f7ff; }

.ui-ico { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; object-fit: contain; }
.ui-ico-lg { width: 26px; height: 26px; object-fit: contain; }
