/* ZCC Fleet Registry — uses parent ZCC variables from index.html */

/* === Fleet Page === */
.fleet-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.fleet-header {
  padding: 24px 28px 16px;
}

.fleet-header h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.fleet-header p {
  margin: 0;
  font-size: 13px;
  color: var(--text-3);
  max-width: 700px;
  line-height: 1.5;
}

/* === Toolbar row: cards + actions === */
.fleet-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.fleet-toolbar-group {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

/* === Summary Cards === */
.fleet-card-grid {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.fleet-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  text-align: center;
  min-width: 90px;
  transition: border-color 0.15s;
}

.fleet-card:hover { border-color: var(--gold-line); }

.fleet-card-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.fleet-card-title {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-top: 2px;
}

.fleet-card-success .fleet-card-value { color: var(--green); }
.fleet-card-warning .fleet-card-value { color: var(--gold); }
.fleet-card-danger .fleet-card-value { color: var(--hot); }

/* === Filter Bar === */
.fleet-filter-bar {
  display: flex;
  gap: 10px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  flex-wrap: wrap;
}

.fleet-filter-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.fleet-filter-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
}

.fleet-filter-input,
.fleet-filter-select {
  padding: 6px 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 12.5px;
  font-family: var(--sans);
  transition: border-color 0.15s;
}

.fleet-filter-input { min-width: 200px; }
.fleet-filter-select { min-width: 120px; }

.fleet-filter-input:focus,
.fleet-filter-select:focus {
  outline: none;
  border-color: var(--gold-line);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.fleet-filter-input::placeholder { color: var(--text-3); }

/* === Agent Table === */
.fleet-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.fleet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fleet-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--panel-2);
}

.fleet-table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-3);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.fleet-table tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.1s;
  cursor: pointer;
}

.fleet-table tbody tr:hover { background: var(--panel-2); }
.fleet-table tbody tr:active { background: var(--bg-2); }

.fleet-table td { padding: 9px 16px; }

.fleet-cell-id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
  font-weight: 500;
}

.fleet-cell-name {
  font-weight: 550;
  color: var(--text);
}

.fleet-cell-team {
  color: var(--text-2);
  font-size: 12px;
}

/* Status dot + label */
.fleet-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.fleet-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fleet-dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.fleet-dot.warn { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.fleet-dot.err { background: var(--hot); box-shadow: 0 0 0 3px var(--hot-soft); }
.fleet-dot.off { background: var(--text-3); }

/* === Buttons === */
.fleet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  color: var(--text);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  font-family: var(--sans);
}

.fleet-btn:hover { background: var(--bg-2); border-color: var(--gold-line); }
.fleet-btn:active { transform: translateY(1px); }
.fleet-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.fleet-btn-primary {
  background: var(--gold);
  color: #1a1407;
  border-color: var(--gold);
}
.fleet-btn-primary:hover { background: #d4a22a; border-color: #d4a22a; }

.fleet-btn-success {
  background: var(--green-soft);
  color: var(--green);
  border-color: var(--green);
}

.fleet-btn-danger {
  background: var(--hot-soft);
  color: var(--hot);
  border-color: var(--hot);
}

.fleet-btn-sm {
  padding: 4px 10px;
  font-size: 11.5px;
  border-radius: 6px;
}

/* === Drawer (detail panel) === */
.fleet-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 90;
  animation: fleetFadeIn 0.15s ease;
}

.fleet-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 520px;
  max-width: 92vw;
  background: var(--panel);
  border-left: 1px solid var(--line);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: fleetSlideIn 0.25s ease;
}

.fleet-drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-2);
}

.fleet-drawer-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.fleet-drawer-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 8px;
  font-size: 18px;
  transition: all 0.12s;
}
.fleet-drawer-close:hover { background: var(--bg-2); color: var(--text); }

.fleet-drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  overflow-x: auto;
  background: var(--panel);
  flex-shrink: 0;
}

.fleet-drawer-tab {
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.12s;
  font-family: var(--sans);
}
.fleet-drawer-tab:hover { color: var(--text); }
.fleet-drawer-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.fleet-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}

.fleet-drawer-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  display: flex;
  gap: 8px;
}

/* === Modal (edit / rollback) === */
.fleet-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  animation: fleetFadeIn 0.15s ease;
}

.fleet-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: 95%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 210;
  animation: fleetPopIn 0.25s ease;
}

.fleet-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fleet-modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.fleet-modal-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.fleet-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 0 0 16px 16px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* === Edit Form === */
.fleet-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.fleet-form-group.full { grid-column: 1 / -1; }

.fleet-form-label {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.fleet-form-input,
.fleet-form-select,
.fleet-form-textarea {
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--sans);
  transition: border-color 0.15s;
}

.fleet-form-input:focus,
.fleet-form-select:focus,
.fleet-form-textarea:focus {
  outline: none;
  border-color: var(--gold-line);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.fleet-form-textarea {
  resize: vertical;
  min-height: 60px;
  font-family: var(--mono);
  font-size: 12px;
}

.fleet-form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 13px;
}

.fleet-form-checkbox input { cursor: pointer; }

.fleet-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.fleet-section-title:first-child { margin-top: 0; }

/* === Pills === */
.fleet-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.fleet-pill-ok { background: var(--green-soft); color: var(--green); }
.fleet-pill-warn { background: var(--gold-soft); color: var(--gold); }
.fleet-pill-error { background: var(--hot-soft); color: var(--hot); }
.fleet-pill-unknown { background: var(--bg-2); color: var(--text-3); }

/* === Validation === */
.fleet-validation-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.fleet-validation-item:last-child { border-bottom: none; }
.fleet-validation-item.error { background: var(--hot-soft); }
.fleet-validation-item.warning { background: var(--gold-soft); }
.fleet-validation-item.success { background: var(--green-soft); }

.fleet-validation-icon { font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.fleet-validation-message { flex: 1; color: var(--text); }

/* === Detail rows === */
.fleet-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  gap: 12px;
}

.fleet-detail-row:last-child { border-bottom: none; }

.fleet-detail-label {
  color: var(--text-2);
  flex-shrink: 0;
  min-width: 120px;
}

.fleet-detail-value {
  font-weight: 550;
  text-align: right;
  max-width: 60%;
  word-break: break-all;
}

.fleet-detail-value code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* === Evidence note === */
.fleet-evidence-note {
  padding: 10px 14px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* === Table mono/dim cells === */
.fleet-cell-mono {
  font-family: var(--mono);
  font-size: 11.5px;
}

.fleet-cell-dim {
  color: var(--text-3);
  font-size: 11px;
}

/* === Status inline === */
.fleet-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

/* === JSON View === */
.fleet-json-view {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  overflow: auto;
  max-height: 400px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* === Empty / Loading === */
.fleet-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 20px;
  color: var(--text-3);
  text-align: center;
}

.fleet-empty-icon { font-size: 36px; opacity: 0.4; }
.fleet-empty-title { font-size: 15px; font-weight: 600; color: var(--text-2); }

.fleet-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  color: var(--text-3);
  font-size: 13px;
}

.fleet-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* === Animations === */
@keyframes fleetFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fleetSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes fleetPopIn { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* === Responsive === */
@media (max-width: 900px) {
  .fleet-header { padding: 18px 20px 12px; }
  .fleet-toolbar { padding: 10px 20px; flex-wrap: wrap; }
  .fleet-filter-bar { padding: 8px 20px; }
  .fleet-table td, .fleet-table th { padding: 8px 10px; }
  .fleet-drawer { width: 100%; }
  .fleet-form-grid { grid-template-columns: 1fr; }
  .fleet-modal { max-width: 96vw; }
}

/* === Graph tab v2 (relationship intelligence) === */
.fleet-pill-hot { background: var(--hot-soft); color: var(--hot); }

.fleet-graph-badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 0 4px;
}
.fleet-graph-warning {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--hot);
  background: var(--hot-soft);
  color: var(--hot);
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}
.fleet-graph-filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 10px 0 4px;
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-1, transparent);
  padding: 6px 0;
}
.fleet-graph-filter {
  border: 1px solid var(--border, rgba(128,128,128,.35));
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.fleet-graph-filter.active {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: var(--gold);
}
.fleet-graph-section { margin-bottom: 4px; }
.fleet-graph-json {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  background: var(--bg-2);
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  max-height: 380px;
  color: var(--text-2);
  white-space: pre;
}

/* Dependency map — pure DOM/CSS, no external graph library */
.fleet-depmap {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  padding: 12px 8px;
  background: var(--bg-2);
  border-radius: 10px;
  margin-bottom: 8px;
}
.fleet-dep-self {
  font-size: 12.5px; font-weight: 600;
  color: var(--gold);
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 8px;
  padding: 6px 14px;
}
.fleet-dep-tier { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; }
.fleet-dep-arrow { font-size: 10.5px; color: var(--text-3); font-family: var(--mono); }
.fleet-dep-nodes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fleet-dep-chip {
  font-size: 11px;
  font-family: var(--mono);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(128,128,128,.35));
  background: var(--bg-1, transparent);
  color: var(--text-2);
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fleet-dep-chip-dep { border-color: var(--gold); color: var(--gold); }
.fleet-dep-chip-io { border-color: var(--green); color: var(--green); }
.fleet-dep-chip-mgr { border-color: var(--text-3); }
.fleet-dep-chip-ok { border-color: var(--green); color: var(--green); }
.fleet-dep-chip-hot { border-color: var(--hot); color: var(--hot); }
.fleet-dep-siderow {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  padding: 5px 2px;
}
.fleet-dep-sidelabel {
  font-size: 10.5px; color: var(--text-3); font-family: var(--mono);
  min-width: 92px;
}
