
/* Jopholo Control · UX operativa */

.task-summary-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:16px;
}
.task-summary-card {
  position:relative;
  overflow:hidden;
  min-height:96px;
  padding:15px 16px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.94);
  box-shadow:var(--shadow-sm);
}
.task-summary-card::before {
  content:"";
  position:absolute;
  left:0;
  top:12px;
  bottom:12px;
  width:3px;
  border-radius:0 4px 4px 0;
  background:var(--primary);
}
.task-summary-card.success::before { background:var(--success); }
.task-summary-card.warning::before { background:var(--warning); }
.task-summary-card.alert::before { background:var(--danger); }
.task-summary-card > span {
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  letter-spacing:.03em;
  text-transform:uppercase;
}
.task-summary-card > strong {
  display:block;
  margin-top:10px;
  color:var(--text-strong);
  font-size:25px;
  line-height:1;
}
.task-summary-card > small {
  display:block;
  margin-top:7px;
  color:var(--muted-2);
  font-size:9px;
}
.task-workspace .task-toolbar { align-items:stretch; }
.task-table td:first-child { min-width:240px; }
.task-row-overdue td { background:rgba(195,61,61,.018); }
.task-date-overdue { color:var(--danger); font-weight:800; }
.task-progress-inline {
  display:flex;
  align-items:center;
  gap:7px;
  min-width:92px;
}
.task-progress-inline > div {
  width:58px;
  height:6px;
  overflow:hidden;
  border-radius:99px;
  background:#e6edf5;
}
.task-progress-inline i {
  display:block;
  height:100%;
  border-radius:inherit;
  background:var(--primary);
}
.task-progress-inline span {
  min-width:28px;
  color:var(--muted);
  font-size:9px;
  font-weight:800;
}
.task-detail-state {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
  padding:12px 13px;
  border:1px solid var(--border);
  border-radius:11px;
  background:#f8fafc;
}
.task-detail-state > div:first-child { display:flex; gap:6px; flex-wrap:wrap; }
.task-detail-progress {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:150px;
}
.task-detail-progress > span {
  color:var(--text-strong);
  font-size:11px;
  font-weight:850;
}
.task-detail-progress > div {
  flex:1;
  height:7px;
  overflow:hidden;
  border-radius:99px;
  background:#e5ebf2;
}
.task-detail-progress i {
  display:block;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--primary),var(--system));
}
.task-detail-section {
  margin-top:14px;
  padding:15px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
}
.task-detail-section:first-of-type { margin-top:0; }
.task-section-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.task-section-head h3 {
  margin:0;
  color:var(--text-strong);
  font-size:14px;
}
.task-detail-meta {
  display:flex;
  gap:8px 16px;
  flex-wrap:wrap;
  margin-top:12px;
  padding-top:11px;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:9px;
}
.task-detail-meta strong { color:var(--text); }
.task-comment-form {
  display:grid;
  grid-template-columns:130px minmax(0,1fr) auto;
  align-items:start;
  gap:8px;
  margin-bottom:12px;
}
.task-comment-form textarea { min-height:74px; }
.task-comment-list { display:grid; gap:8px; }
.task-comment {
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
}
.task-comment-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  color:var(--muted-2);
  font-size:9px;
}
.task-comment p {
  margin:8px 0 0;
  color:var(--text);
  font-size:11px;
  line-height:1.55;
  white-space:pre-wrap;
}
.task-history-section .timeline-list { max-height:280px; overflow:auto; padding-right:4px; }

/* Inicio · lectura inmediata de cómo estamos */
.dashboard-pulse-strip {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
  margin-bottom:13px;
}
.dashboard-pulse-summary {
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  padding:10px 11px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
}
.dashboard-pulse-summary > div { min-width:0; }
.dashboard-pulse-summary strong {
  display:block;
  color:var(--text-strong);
  font-size:11px;
}
.dashboard-pulse-summary span {
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:9px;
  line-height:1.35;
}
.dashboard-pulse-summary .health-dot { flex:0 0 auto; }
.dashboard-pulse-host {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  min-height:58px;
  margin-top:8px;
  padding:9px 10px;
  border:1px solid var(--border);
  border-radius:11px;
  background:#f8fafc;
}
.dashboard-pulse-host strong {
  display:block;
  color:var(--text-strong);
  font-size:11px;
}
.dashboard-pulse-host small {
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:9px;
}
.dashboard-pulse-host .dashboard-host-metrics {
  text-align:right;
  color:var(--muted);
  font-size:9px;
  line-height:1.45;
}
.dashboard-panel-action {
  border:0;
  background:transparent;
  color:var(--primary);
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.dashboard-panel-action:hover { text-decoration:underline; }

/* Cliente 360 · actividad */
.activity-toolbar {
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin-bottom:13px;
}
.activity-filter {
  min-height:30px;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#f8fafc;
  color:var(--muted);
  font-size:9px;
  font-weight:850;
  cursor:pointer;
}
.activity-filter.active {
  border-color:#b9d2fb;
  background:var(--primary-soft);
  color:var(--primary);
}
.client-activity-list { display:grid; gap:0; }
.client-activity-item {
  position:relative;
  display:grid;
  grid-template-columns:32px minmax(0,1fr);
  gap:10px;
  padding:10px 0;
}
.client-activity-item:not(:last-child)::after {
  content:"";
  position:absolute;
  left:15px;
  top:42px;
  bottom:-2px;
  width:1px;
  background:var(--border);
}
.client-activity-icon {
  position:relative;
  z-index:1;
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border:1px solid #d9e5f6;
  border-radius:10px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:10px;
  font-weight:900;
}
.client-activity-icon.finance { border-color:#d4e9df; background:var(--success-soft); color:var(--success); }
.client-activity-icon.pulse { border-color:#d2eaf0; background:var(--system-soft); color:#087b91; }
.client-activity-icon.task { border-color:#f0dfbc; background:var(--warning-soft); color:var(--warning); }
.client-activity-icon.crm { border-color:#ddd1f8; background:var(--ai-soft); color:var(--ai); }
.client-activity-title { color:var(--text-strong); font-size:11px; font-weight:800; }
.client-activity-meta { margin-top:3px; color:var(--muted-2); font-size:9px; }
.client-activity-detail { margin-top:5px; color:var(--muted); font-size:10px; line-height:1.5; }

/* Pulse VPS · semántica visual sin convertirlo en un dashboard ruidoso */
.pulse-host-card {
  position:relative;
  overflow:hidden;
  transition:border-color var(--transition),box-shadow var(--transition),background var(--transition);
}
.pulse-host-card::before {
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:4px;
  background:#aeb8c5;
}
.pulse-host-card.host-ok {
  border-color:#cfe8dc;
  background:linear-gradient(110deg,rgba(234,248,241,.58),rgba(255,255,255,.98) 32%);
}
.pulse-host-card.host-ok::before { background:var(--success); }
.pulse-host-card.host-warning {
  border-color:#efd8a8;
  background:linear-gradient(110deg,rgba(255,245,223,.68),rgba(255,255,255,.98) 32%);
}
.pulse-host-card.host-warning::before { background:var(--warning); }
.pulse-host-card.host-error {
  border-color:#efc8c4;
  background:linear-gradient(110deg,rgba(255,240,239,.72),rgba(255,255,255,.98) 32%);
}
.pulse-host-card.host-error::before { background:var(--danger); }
.pulse-host-card.host-nodata::before { background:#98a2b3; }
.pulse-host-metric.metric-ok { background:rgba(234,248,241,.55); }
.pulse-host-metric.metric-warning { background:rgba(255,245,223,.72); }
.pulse-host-metric.metric-error { background:rgba(255,240,239,.76); }
.pulse-host-metric.metric-ok strong { color:var(--success); }
.pulse-host-metric.metric-warning strong { color:var(--warning); }
.pulse-host-metric.metric-error strong { color:var(--danger); }

@media(max-width:1000px) {
  .task-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-pulse-strip { grid-template-columns:1fr; }
}
@media(max-width:700px) {
  .task-comment-form { grid-template-columns:1fr; }
  .task-detail-state { align-items:flex-start; flex-direction:column; }
  .task-detail-progress { width:100%; }
}
@media(max-width:520px) {
  .task-summary-grid { grid-template-columns:1fr; }
}

/* Inicio · jerarquía ejecutiva: salud, finanzas, operación y comercial */
.dashboard-primary-grid,
.dashboard-operations-grid,
.dashboard-commercial-grid {
  align-items: stretch;
}
.dashboard-primary-grid > .panel + .panel,
.dashboard-operations-grid > .panel + .panel,
.dashboard-commercial-grid > .panel + .panel {
  margin-top: 0;
}
.dashboard-priority-panel {
  min-height: 100%;
}
.finance-overview-panel {
  position: relative;
  overflow: hidden;
}
.finance-overview-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--primary);
  opacity: .82;
}
.finance-overview-metrics {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px;
  margin-bottom: 15px;
}
.finance-overview-metric {
  position: relative;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #f8fafc;
}
.finance-overview-metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #a8b4c2;
}
.finance-overview-metric.positive::before { background: var(--success); }
.finance-overview-metric.warning::before { background: var(--warning); }
.finance-overview-metric.negative::before { background: var(--danger); }
.finance-overview-metric > span,
.finance-overview-metric > small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}
.finance-overview-metric > span {
  font-weight: 800;
  letter-spacing: .015em;
}
.finance-overview-metric > strong {
  display: block;
  margin: 7px 0 5px;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 19px;
  line-height: 1;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finance-overview-metric.positive > strong { color: var(--success); }
.finance-overview-metric.negative > strong { color: var(--danger); }
.dashboard-subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 8px;
  padding-top: 2px;
}
.dashboard-subsection-head strong {
  color: var(--text-strong);
  font-size: 11px;
}
.dashboard-subsection-head span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 750;
}
.workload-summary-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 8px;
  margin-bottom: 13px;
}
.workload-stat {
  position: relative;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.workload-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #9ca8b7;
}
.workload-stat.ok::before { background: var(--success); }
.workload-stat.warning::before { background: var(--warning); }
.workload-stat.error::before { background: var(--danger); }
.workload-stat span,
.workload-stat small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workload-stat span { font-weight: 800; }
.workload-stat strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--text-strong);
  font-size: 19px;
  line-height: 1;
}
.workload-list { display: grid; gap: 7px; }
.workload-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 92px 24px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #f8fafc;
}
.workload-row.attention { border-color: #efd8a8; background: #fffbf3; }
.workload-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.workload-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #d5e2f5;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9px;
  font-weight: 900;
}
.workload-person > div { min-width: 0; }
.workload-person strong,
.workload-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workload-person strong { color: var(--text-strong); font-size: 10px; }
.workload-person small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.workload-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5ebf2;
}
.workload-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg,var(--primary),var(--system));
}
.workload-row.attention .workload-bar i { background: var(--warning); }
.workload-count {
  color: var(--text-strong);
  font-size: 11px;
  text-align: right;
}

@media(max-width:1200px) {
  .workload-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:700px) {
  .finance-overview-metrics { grid-template-columns: 1fr; }
  .workload-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workload-row { grid-template-columns: minmax(0,1fr) 70px 22px; }
}
