/* Dani — office glance + CRM drill-down navigation */

/* ── CRM subnav (hub → list → record) ── */
.dani-crm-subnav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 12px 24px;
  background: #f4f6f9;
  border-bottom: 1px solid #e8ecf0;
  flex-shrink: 0;
}

.dani-crm-subnav--detail {
  background: var(--white);
}

.dani-crm-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin: 0;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dani-crm-back:hover {
  border-color: var(--teal);
  background: #f0fafa;
}

.dani-crm-back-icon {
  color: var(--teal);
  font-size: 14px;
  line-height: 1;
}

.dani-crm-bc-sep {
  color: #c5cdd6;
  font-size: 13px;
  user-select: none;
}

.dani-crm-bc-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
}

.dani-crm-bc-link:hover {
  color: var(--teal);
  text-decoration: underline;
}

.dani-crm-bc-current {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#viewClients.dani-crm-active .view-header,
#viewAttract.dani-crm-active .view-header {
  border-top: none;
}

/* Dani office — full-width pipeline hub (visibility: css/views.css) */

.dani-office-v2 .office-body-row.dani-office-body-full {
  position: relative;
  flex-direction: column;
}

/* Full-width pipeline — override legacy 55% .office-body-row .office-workspace split */
.dani-office-v2 .office-body-row.dani-office-body-full .office-workspace {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  border-right: none;
  padding: 0;
  background: #eef2f6;
}

.dani-workspace-inner {
  width: 100%;
  max-width: none;
  padding: 24px 28px 40px;
  box-sizing: border-box;
}

.dani-pipeline-workspace {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
}

.dani-pipeline-search-row {
  margin-bottom: 14px;
}

.dani-pipeline-search {
  width: 100%;
  max-width: 480px;
  padding: 11px 14px 11px 38px;
  border: 1px solid #d0d7e2;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.106a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 12px center;
}

.dani-pipeline-search:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(42, 191, 191, 0.2);
}

.dani-pipeline-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.dani-pipeline-tab {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid #d0d7e2;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  font-family: inherit;
}

.dani-pipeline-tab.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.dani-pipeline-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dani-pipeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.dani-pipeline-subtitle {
  font-size: 13px;
  color: var(--gray);
  font-weight: 600;
}

.dani-pipeline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dani-pipeline-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--teal);
  color: var(--white);
  cursor: pointer;
  font-family: inherit;
}

.dani-pipeline-btn.secondary {
  background: var(--white);
  color: var(--navy);
  border: 1px solid #d0d7e2;
}

.dani-pipeline-scroll {
  flex: 1;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid #e8ecf0;
  border-radius: 12px;
  padding: 0;
  min-height: 280px;
}

.dani-pipeline-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--light-gray);
  font-size: 14px;
}

.dani-vendor-add-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  align-items: center;
}

.dani-vendor-field {
  flex: 2;
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  box-sizing: border-box;
  font-family: inherit;
}

.dani-vendor-field--phone {
  flex: 1;
  min-width: 100px;
}

.dani-vendor-remove {
  font-size: 12px;
  color: #c0392b;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.dani-vendors-table {
  width: 100%;
}

/* KPI strip (legacy hub — unused) */
.dani-hub-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.dani-hub-kpis--alert .dani-kpi--alert {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.dani-kpi {
  border-radius: 12px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 88px;
  justify-content: center;
}

.dani-kpi-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.dani-kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.dani-kpi--alert {
  background: linear-gradient(145deg, #fef2f2 0%, #fff 100%);
  color: #b42318;
  border: 1px solid #fecaca;
}

.dani-kpi--teal {
  background: linear-gradient(145deg, #e6f7f7 0%, #fff 100%);
  color: #0e7490;
  border: 1px solid #99e5e5;
}

.dani-kpi--navy {
  background: linear-gradient(145deg, #e8edf5 0%, #fff 100%);
  color: var(--navy);
  border: 1px solid #c5d0e0;
}

.dani-kpi--violet {
  background: linear-gradient(145deg, #f3eef9 0%, #fff 100%);
  color: #6b21a8;
  border: 1px solid #ddd0f0;
}

.dani-kpi--muted {
  background: var(--white);
  color: var(--gray);
  border: 1px solid #e8ecf0;
}

/* Toolbar */
.dani-hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 0 4px;
}

.dani-glance-tabs {
  display: flex;
  gap: 6px;
  background: var(--white);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #dde3ea;
  box-shadow: 0 1px 2px rgba(27, 42, 74, 0.04);
}

.dani-glance-tab {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
}

.dani-glance-tab.active {
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 2px 6px rgba(27, 42, 74, 0.15);
}

.dani-glance-tab.active .dani-glance-tab-count {
  color: rgba(255, 255, 255, 0.85);
}

.dani-glance-tab-count {
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

.dani-hub-open-db {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: var(--teal);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.1s;
}

.dani-hub-open-db:hover {
  filter: brightness(1.05);
}

.dani-hub-panel-root {
  display: block;
}

/* Two-column hub */
.dani-hub-split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.35fr);
  gap: 18px;
  align-items: stretch;
}

.dani-hub-col {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid #dde3ea;
  box-shadow: 0 2px 8px rgba(27, 42, 74, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.dani-hub-col-head {
  padding: 14px 18px;
  border-bottom: 1px solid #eef1f4;
}

.dani-hub-col-head--touch {
  background: linear-gradient(90deg, #fff5eb 0%, #fff 40%);
  border-bottom-color: #fde8d4;
}

.dani-hub-col--touch.has-items .dani-hub-col-head--touch {
  background: linear-gradient(90deg, #fee2e2 0%, #fff 45%);
  border-bottom-color: #fecaca;
}

.dani-hub-col--touch.is-clear .dani-hub-col-head--touch {
  background: linear-gradient(90deg, #dcfce7 0%, #fff 45%);
  border-bottom-color: #bbf7d0;
}

.dani-hub-col-head--pipeline {
  background: linear-gradient(90deg, #e6f7f7 0%, #fff 35%);
  border-bottom-color: #b8ecec;
}

.dani-hub-col-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--navy);
}

.dani-hub-col-body {
  padding: 16px 18px 20px;
  flex: 1;
}

.dani-hub-clear {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #15803d;
  padding: 20px 8px;
}

.dani-hub-clear-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.dani-touch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dani-touch-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fafbfc;
  border: 1px solid #e8ecf0;
  border-left: 4px solid #f59e0b;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.dani-hub-col--touch.has-items .dani-touch-card {
  border-left-color: #dc2626;
}

.dani-touch-card:hover {
  background: #f0f7ff;
  border-color: #b8dce8;
}

.dani-touch-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.dani-touch-card-meta {
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  margin-top: 3px;
}

.dani-hub-col--touch.has-items .dani-touch-card-meta {
  color: #b42318;
}

.dani-hub-more {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px dashed #c5d0e0;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
}

.dani-hub-more:hover {
  background: #f0fafa;
}

/* Stage tile grid */
.dani-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.dani-stage-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid #e8ecf0;
  border-top: 4px solid var(--stage-color, #999);
  background: #fafbfc;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}

.dani-stage-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 42, 74, 0.08);
  background: var(--white);
}

.dani-stage-tile-count {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.dani-stage-tile-label {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  line-height: 1.25;
}

.dani-hub-empty {
  font-size: 13px;
  color: var(--gray);
  margin: 0;
  padding: 12px 0;
}

/* Legacy row styles (list views) */
.dani-glance-overdue-list .dani-pipeline-attn-row,
.dani-pipeline-attn-row {
  border-radius: 10px;
  margin-bottom: 8px;
}

/* ── Chat slide-in ── */
.dani-chat-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: var(--white);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}

.dani-chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--navy);
  color: var(--white);
  flex-shrink: 0;
  gap: 10px;
}

.dani-chat-panel-title {
  font-weight: 700;
  font-size: 15px;
}

.dani-chat-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dani-chat-panel-ideas {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.dani-chat-panel-ideas:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dani-chat-panel-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.dani-chat-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.dani-chat-panel-footer {
  padding: 12px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}

.dani-chat-panel-footer .office-chat-input {
  width: 100%;
  box-sizing: border-box;
}

.dani-chat-panel-footer .office-chat-send {
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .dani-hub-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dani-hub-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dani-workspace-inner {
    padding: 16px 14px 28px;
  }

  .dani-pipeline-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dani-pipeline-actions {
    width: 100%;
  }

  .dani-pipeline-btn {
    flex: 1;
    min-height: 44px;
  }

  .dani-pipeline-search {
    max-width: none;
  }

  .dani-chat-panel {
    width: 100vw;
    right: -100vw;
  }

  .dani-hub-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dani-hub-open-db {
    width: 100%;
  }

  .dani-kpi-value {
    font-size: 26px;
  }

  .dani-stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
