/* ============================================================
   PARTNERS PAGE — partners.css
   Tree view, table view, contact drawer
   ============================================================ */

/* ---- Partner list page ---- */
.partners-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.partner-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 20px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.partner-card:hover {
  border-color: #1b708b;
  box-shadow: 0 2px 10px rgba(27,112,139,0.12);
}

.partner-card-name {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.partner-card-type {
  font-size: 12px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.partner-card-cta {
  font-size: 13px;
  color: #1b708b;
  font-weight: 500;
  margin-top: 8px;
}

/* ---- Toolbar ---- */
.partners-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.partners-view-toggle {
  display: flex;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.partners-view-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.partners-view-btn.active {
  background: #1b708b;
  color: #fff;
}

.partners-search {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  width: 220px;
  outline: none;
}

.partners-search:focus {
  border-color: #1b708b;
  box-shadow: 0 0 0 2px rgba(27,112,139,0.12);
}

.partners-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 4px;
  background: #fff;
}

.partners-zoom-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #475569;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.partners-zoom-btn:hover { background: #f1f5f9; color: #1b708b; }

.partners-zoom-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  min-width: 36px;
  text-align: center;
}

.partners-zoom-fit {
  padding: 3px 8px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  border-radius: 4px;
  border-left: 1px solid #e2e8f0;
  margin-left: 2px;
}

.partners-zoom-fit:hover { background: #f1f5f9; color: #1b708b; }

/* ---- Tree view ---- */
.org-tree {
  overflow: auto;
  min-height: calc(100vh - 320px);
  padding-bottom: 48px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

/* Inner wrapper so the scroll container knows the full width (fixes left-clip) */
.org-tree-inner {
  width: max-content;
  min-width: 100%;
  padding: 32px 48px;
}

/* A branch = one node + its children below it */
.org-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* The connector stem from parent node down to the children row */
.org-branch-connector {
  width: 2px;
  height: 20px;
  background: #cbd5e1;
  flex-shrink: 0;
}

/* Children sit in a row, each child is its own branch */
.org-children {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

/* Each child column has a top border that forms the horizontal connector bar,
   and a vertical stem via ::before. Together they draw a T-junction. */
.org-child-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px;
  border-top: 2px solid #cbd5e1;
  position: relative;
}

/* Vertical stem down from the horizontal bar to the child node */
.org-child-col::before {
  content: '';
  width: 2px;
  height: 20px;
  background: #cbd5e1;
  display: block;
  flex-shrink: 0;
}

/* For a single child, hide the horizontal bar (no siblings to connect) */
.org-children:has(> .org-child-col:only-child) > .org-child-col {
  border-top: none;
}
.org-children:has(> .org-child-col:only-child) > .org-child-col::before {
  /* stem only, no top bar */
}

/* ---- Node cards ---- */
.org-node {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
}

.org-node-root {
  background: #0f2d3d;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
}

.org-node-geo {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

.org-node-dept {
  background: #f8fafc;
  color: #64748b;
  font-weight: 500;
  border: 1px solid #f1f5f9;
  font-size: 12px;
}

.org-node-person {
  background: #fff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 140px;
}

.org-node-person:hover {
  border-color: #1b708b;
  box-shadow: 0 1px 6px rgba(27,112,139,0.15);
}

.org-node-person .org-node-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 13px;
}

.org-node-person .org-node-role {
  color: #64748b;
  font-size: 11px;
  margin-top: 2px;
  white-space: normal;
  max-width: 160px;
}

/* ---- Table view ---- */
.partners-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.partners-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #e2e8f0;
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
}

.partners-table th:hover { color: #1b708b; }

.partners-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.partners-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

.partners-table tbody tr:hover { background: #f8fafc; }

.partners-table .cell-name { font-weight: 600; color: #1b708b; }

.partners-table .cell-phone a,
.partners-table .cell-email a {
  color: #334155;
  text-decoration: none;
}

.partners-table .cell-phone a:hover,
.partners-table .cell-email a:hover { color: #1b708b; }

/* ---- Contact drawer ---- */
.partners-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,45,61,0.25);
  z-index: 299;
}

.partners-backdrop.active { display: block; }

.partners-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  max-width: 95vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(15,45,61,0.12);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
  overflow: hidden;
}

.partners-drawer.active { right: 0; }

.partners-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #f1f5f9;
  gap: 12px;
}

.partners-drawer-name {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.partners-drawer-role {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

.partners-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  margin-top: 2px;
}

.partners-drawer-close:hover { color: #334155; }

.partners-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.drawer-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.drawer-field-value {
  font-size: 14px;
  color: #334155;
}

.drawer-field-value a {
  color: #1b708b;
  text-decoration: none;
}

.drawer-field-value a:hover { text-decoration: underline; }

.drawer-crm-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 14px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  transition: background 0.15s;
}

.drawer-crm-link:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.partners-loading {
  color: #94a3b8;
  font-size: 14px;
  padding: 40px 0;
  text-align: center;
}
