/* MutualOS v43: visual hierarchy for HOY and Dashboard.
   Mobile-first refinement only. No data, permissions or backend changes. */

.ops-commandbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 14px;
  padding:10px 12px;
  background:#fff;
  border:1px solid #e3e8ef;
  border-radius:12px;
  box-shadow:0 1px 2px rgba(15,23,42,.04)
}
.ops-commandbar-copy{min-width:0}
.ops-commandbar-copy strong{display:block;color:#0f172a;font-size:.9rem}
.ops-commandbar-copy span{display:block;color:#64748b;font-size:.76rem;margin-top:2px}
.ops-commandbar-actions{display:flex;gap:7px;flex:0 0 auto}

.today-summary.ops-focus-strip{
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:9px;
  margin-bottom:10px
}
.today-summary.ops-focus-strip .hoy-metric{
  min-height:82px;
  padding:11px 12px;
  text-align:left;
  transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease
}
.today-summary.ops-focus-strip .hoy-metric:hover{
  transform:translateY(-1px);
  box-shadow:0 5px 14px rgba(15,23,42,.08)
}
.today-summary.ops-focus-strip .label{
  font-size:.76rem;
  line-height:1.15;
  font-weight:750;
  color:#64748b
}
.today-summary.ops-focus-strip .value{
  margin-top:4px;
  font-size:1.55rem;
  line-height:1;
  font-weight:850;
  color:#0f172a
}
.today-summary.ops-focus-strip .danger-card{background:#fff7f6;border-color:#f0c7c4;border-left:4px solid #b42318}
.today-summary.ops-focus-strip .warning-card{background:#fffbf2;border-color:#ecd6a4;border-left:4px solid #b7791f}
.today-summary.ops-focus-strip .priority-card{background:#faf7ff;border-color:#ddd0f6;border-left:4px solid #7c3aed}
.today-summary.ops-focus-strip .immediate-card{border-left:4px solid #0f3e7a}

.hoy-briefbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  margin:0 0 14px;
  padding:9px 11px;
  background:#f8fafc;
  border:1px solid #e5eaf0;
  border-radius:10px;
  color:#475569;
  font-size:.78rem
}
.hoy-contextline.ops-briefline{
  margin:0 0 12px;
  padding:8px 10px;
  background:#f8fafc;
  border:1px solid #e5eaf0;
  border-radius:9px;
  color:#475569;
  font-size:.75rem
}
.hoy-contextline.ops-briefline strong{color:#1e293b}
.hoy-briefbar strong{color:#1e293b}
.hoy-briefbar .hoy-brief-urgent{
  color:#991b1b;
  font-weight:800;
  white-space:nowrap
}
.operational-callout.ops-overdue-callout{
  margin-bottom:12px;
  padding:10px 12px;
  font-size:.82rem
}

.hoy-section{
  margin-top:14px;
  padding:0;
  border-radius:12px
}
.hoy-section .section-title-row{
  margin-bottom:6px;
  padding:0 2px
}
.hoy-section .section-title-row h2{
  font-size:1rem;
  letter-spacing:.01em
}
.hoy-section .count-pill{
  min-width:24px;
  height:24px;
  font-size:.72rem
}
.hoy-section[data-hoy-section="VENCIDO"] .count-pill{background:#fee2e2;color:#991b1b}
.hoy-section[data-hoy-section="HOY"] .count-pill{background:#dbeafe;color:#1d4ed8}
.hoy-section[data-hoy-section="FECHA_CRITICA"] .count-pill{background:#fef3c7;color:#92400e}
.hoy-section[data-hoy-section="DOCUMENTOS"] .count-pill{background:#ede9fe;color:#6d28d9}
.hoy-section[data-hoy-section="CITA"] .count-pill{background:#dcfce7;color:#166534}

.dashboard-priority-metrics{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px
}
.dashboard-priority-metrics .dashboard-primary-metric{
  min-height:96px;
  padding:12px;
  border-radius:12px;
  border:1px solid #e3e8ef;
  background:#fff;
  box-shadow:0 1px 2px rgba(15,23,42,.04)
}
.dashboard-primary-metric .label{
  color:#64748b;
  font-size:.75rem;
  font-weight:750;
  line-height:1.15
}
.dashboard-primary-metric .value{
  margin-top:5px;
  font-size:1.65rem;
  line-height:1;
  font-weight:850;
  color:#0f172a
}
.dashboard-primary-metric .subtle{margin-top:5px;font-size:.72rem}
.dashboard-primary-metric.metric-danger{background:#fff7f6;border-color:#f0c7c4;border-left:4px solid #b42318}
.dashboard-primary-metric.metric-warning{background:#fffbf2;border-color:#ecd6a4;border-left:4px solid #b7791f}
.dashboard-primary-metric.metric-alert{background:#faf7ff;border-color:#ddd0f6;border-left:4px solid #7c3aed}
.dashboard-primary-metric.metric-info{border-left:4px solid #0f3e7a}

.dashboard-health-wrap{
  margin:0 0 18px;
  padding:11px 12px 12px;
  background:#f8fafc;
  border:1px solid #e5eaf0;
  border-radius:12px
}
.dashboard-health-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px
}
.dashboard-health-title strong{font-size:.85rem;color:#334155}
.dashboard-health-title span{font-size:.72rem;color:#64748b}
.dashboard-health-strip{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:7px
}
.dashboard-health-metric{
  min-width:0;
  min-height:0!important;
  padding:8px 9px;
  background:#fff;
  border:1px solid #e4e9ef;
  border-radius:9px
}
.dashboard-health-metric .label{
  color:#64748b;
  font-size:.68rem;
  line-height:1.18;
  font-weight:700
}
.dashboard-health-metric .value{
  margin-top:3px;
  font-size:1.05rem;
  line-height:1;
  font-weight:850;
  color:#1e293b
}
.dashboard-health-metric .subtle{margin-top:3px;font-size:.65rem}

.dashboard-grid.ops-dashboard-grid{gap:12px;margin-bottom:16px}
.dashboard-grid.ops-dashboard-grid .dashboard-panel{padding:13px 14px}
.dashboard-grid.ops-dashboard-grid .dashboard-panel h2{font-size:1rem;margin-bottom:6px}
.dashboard-grid.ops-dashboard-grid .statrow{padding:7px 0;font-size:.82rem}
.dashboard-grid.ops-dashboard-grid .statrow strong{
  display:inline-flex;
  min-width:28px;
  justify-content:center;
  padding:2px 7px;
  border-radius:999px;
  background:#eef3f8;
  color:#0f3e7a
}

@media(max-width:1100px){
  .dashboard-priority-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
  .dashboard-health-strip{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(max-width:700px){
  .ops-commandbar{
    padding:9px 10px;
    align-items:flex-start
  }
  .ops-commandbar-copy span{display:none}
  .ops-commandbar-actions .btn{min-height:34px;padding:6px 9px;font-size:.73rem}

  .today-summary.ops-focus-strip{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px
  }
  .today-summary.ops-focus-strip .hoy-metric{
    min-height:72px;
    padding:9px 10px
  }
  .today-summary.ops-focus-strip .hoy-metric:nth-child(5){grid-column:1/-1}
  .today-summary.ops-focus-strip .value{font-size:1.4rem}
  .today-summary.ops-focus-strip .label{font-size:.71rem}

  .hoy-briefbar{
    grid-template-columns:1fr;
    gap:4px;
    padding:8px 9px;
    font-size:.73rem
  }
  .hoy-briefbar .hoy-brief-urgent{white-space:normal}

  .hoy-section .tablewrap{overflow:visible}
  .hoy-section .table tbody{display:grid;gap:7px}
  .hoy-section .table tr{
    border-radius:11px;
    padding:9px 10px;
    box-shadow:0 1px 2px rgba(15,23,42,.04)
  }
  .hoy-section[data-hoy-section="VENCIDO"] .table tr{border-left:4px solid #b42318}
  .hoy-section[data-hoy-section="HOY"] .table tr{border-left:4px solid #2563eb}
  .hoy-section[data-hoy-section="FECHA_CRITICA"] .table tr{border-left:4px solid #b7791f}
  .hoy-section[data-hoy-section="DOCUMENTOS"] .table tr{border-left:4px solid #7c3aed}
  .hoy-section .table td{
    padding:4px 0!important;
    gap:10px;
    font-size:.78rem
  }
  .hoy-section .table td::before{
    font-size:.67rem;
    min-width:86px;
    color:#64748b
  }
  .hoy-section .table td.actions-cell{
    padding-top:7px!important;
    margin-top:3px;
    border-top:1px solid #eef2f6
  }
  .hoy-section .table td.actions-cell::before{display:none}
  .hoy-section .table td.actions-cell .btn{width:100%;min-height:34px}
  .hoy-section .linkbtn{min-height:0!important}

  .dashboard-priority-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px
  }
  .dashboard-priority-metrics .dashboard-primary-metric{
    min-height:80px;
    padding:9px 10px
  }
  .dashboard-priority-metrics .dashboard-primary-metric:nth-child(5){grid-column:1/-1}
  .dashboard-primary-metric .value{font-size:1.4rem}

  .dashboard-health-wrap{padding:9px}
  .dashboard-health-title span{display:none}
  .dashboard-health-strip{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .dashboard-health-metric{padding:7px 8px}
  .dashboard-health-metric .label{font-size:.65rem}
  .dashboard-health-metric .value{font-size:1rem}
  .dashboard-grid.ops-dashboard-grid{grid-template-columns:1fr;gap:8px}
}

@media(max-width:390px){
  .ops-commandbar-actions .btn:last-child{display:none}
  .today-summary.ops-focus-strip .hoy-metric,
  .dashboard-priority-metrics .dashboard-primary-metric{min-height:68px}
  .dashboard-health-strip{grid-template-columns:1fr 1fr}
}


/* v44 hotfix */
.hoy-section.critical-section{
  border-top:0!important;
  padding-top:0!important;
}


/* v45 dashboard drill-down */
.dashboard-primary-metric[data-drill-ready="1"],
.dashboard-health-metric[data-drill-ready="1"],
.dashboard-panel .statrow[data-drill-ready="1"]{
  cursor:pointer;
  transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease,background .12s ease
}
.dashboard-primary-metric[data-drill-ready="1"]:hover,
.dashboard-health-metric[data-drill-ready="1"]:hover{
  transform:translateY(-1px);
  box-shadow:0 5px 14px rgba(15,23,42,.08);
  border-color:#b9c8da
}
.dashboard-primary-metric[data-drill-ready="1"]:focus-visible,
.dashboard-health-metric[data-drill-ready="1"]:focus-visible,
.dashboard-panel .statrow[data-drill-ready="1"]:focus-visible{
  outline:3px solid rgba(54,125,240,.28);
  outline-offset:2px
}
.dashboard-panel .statrow[data-drill-ready="1"]:hover{background:#f8fafc}
.drill-loading{opacity:.58;pointer-events:none}


/* HOY: six compact summary cards on one desktop row. Preserve mobile readability. */
@media (min-width: 1000px) {
  .today-summary.ops-focus-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }
  .today-summary.ops-focus-strip .hoy-metric {
    min-width: 0;
    min-height: 68px;
    padding: 9px 10px;
  }
  .today-summary.ops-focus-strip .hoy-metric .label {
    font-size: clamp(.66rem, .75vw, .73rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .today-summary.ops-focus-strip .hoy-metric .value {
    font-size: 1.42rem;
    margin-top: 3px;
  }
}
@media (min-width: 700px) and (max-width: 999px) {
  .today-summary.ops-focus-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .today-summary.ops-focus-strip .hoy-metric {
    min-height: 72px;
    padding: 10px;
  }
}
@media (max-width: 699px) {
  .today-summary.ops-focus-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .today-summary.ops-focus-strip .hoy-metric:nth-child(5) {
    grid-column: auto;
  }
}
