/* ==========================================================================
   141 HQ — Simplified Intel Tree & Dossier Command Center Stylesheet
   Clean, simple, professional, no glazing, zero clutter.
   ========================================================================== */

/* Main 2-Column Layout */
.intel-workspace-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: flex-start;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .intel-workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Panel: Tree Directory & Search */
.intel-trees-panel {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 120px);
  position: sticky;
  top: 16px;
}

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

.trees-panel-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trees-search-box {
  position: relative;
}

.trees-search-box input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 34px;
  color: #ffffff;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.15s ease;
}

.trees-search-box input:focus {
  border-color: var(--brand-500);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

.trees-search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--zinc-500);
  pointer-events: none;
}

.trees-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 270px);
  padding-right: 4px;
}

/* Individual Tree Card Item */
.tree-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tree-item-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.tree-item-card.active {
  background: rgba(20, 184, 166, 0.14);
  border-color: var(--brand-500);
}

.tree-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tree-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--zinc-300);
  flex-shrink: 0;
}

.tree-item-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  display: block;
}

.tree-item-card.active .tree-item-icon {
  background: rgba(20, 184, 166, 0.2);
  border-color: var(--brand-500);
  color: var(--brand-400);
}

.tree-item-card.active .tree-item-icon svg {
  stroke: var(--brand-400);
}

.tree-item-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-item-sub {
  font-size: 0.7rem;
  color: var(--zinc-400);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Right Panel: Active Tree Content */
.intel-main-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   HEAD OF BLOCK: The Master Card that Wraps All Tree Data
   ========================================================================== */
.head-of-block-card {
  background: #111217;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: none;
  position: relative;
}

.head-block-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.head-block-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.badge-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-person {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-thing {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-status {
  background: rgba(20, 184, 166, 0.15);
  color: var(--brand-400);
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.head-block-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.head-block-codename {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-400);
  margin-top: 2px;
}

.head-block-description {
  font-size: 0.85rem;
  color: var(--zinc-300);
  line-height: 1.5;
  margin-top: 8px;
  max-width: 800px;
}

.head-block-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   WRAPPED COLLECTED DATA SECTION (Under the Head of Block)
   ========================================================================== */
.wrapped-data-section {
  background: rgba(18, 19, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.wrapped-data-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.in-tree-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.in-tree-search-box input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 34px;
  color: #ffffff;
  font-size: 0.825rem;
  outline: none;
  transition: all 0.15s ease;
}

.in-tree-search-box input:focus {
  border-color: var(--brand-500);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

.in-tree-search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--zinc-500);
  pointer-events: none;
}

/* Quick Add Form Row */
.inline-quick-add {
  display: grid;
  grid-template-columns: 180px 1fr 140px auto;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .inline-quick-add {
    grid-template-columns: 1fr;
  }
}

.inline-input, .inline-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #ffffff;
  padding: 7px 10px;
  font-size: 0.8rem;
  outline: none;
}

.inline-input:focus, .inline-select:focus {
  border-color: var(--brand-500);
}

/* Data Table */
.intel-table {
  width: 100%;
  border-collapse: collapse;
}

.intel-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--zinc-400);
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.intel-table td {
  padding: 10px 12px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.intel-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.intel-data-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  word-break: break-all;
  cursor: pointer;
}
.intel-data-val:hover {
  color: var(--brand-400);
}

.status-chip {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
}
.status-verified {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-alert {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #14151b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--zinc-400);
  cursor: pointer;
  padding: 4px;
}
.modal-close-btn:hover {
  color: #ffffff;
}

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

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--zinc-400);
  margin-bottom: 5px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 8px 12px;
  font-size: 0.85rem;
  outline: none;
  font-family: var(--font-sans);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--brand-500);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Search Highlighting & Refinements */
.search-highlight {
  background: rgba(20, 184, 166, 0.35);
  color: #5eead4;
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 700;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--zinc-400);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.search-clear-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.copy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--zinc-300);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
}

.copy-badge:hover {
  background: rgba(20, 184, 166, 0.15);
  border-color: var(--brand-500);
  color: var(--brand-400);
}

