/* FarmManagerPro Stage 6.6 — final dashboard layout polish. Presentation only. */

/* Weather is a real dashboard row. It must never be covered by quick actions. */
#dashboard #fmp61WeatherStrip.fmp61-weather-strip{
  position:relative!important;
  z-index:2!important;
  margin:12px 0 14px!important;
  min-height:72px!important;
  overflow:visible!important;
}
#dashboard #dashboardQuickActions.dashboard-quick-actions{
  margin:0 0 16px!important;
  position:relative!important;
  z-index:1!important;
}

/* Six business KPIs stay together on normal desktop widths. */
@media (min-width:1100px){
  #dashboard .dashboard-kpi-grid-v561{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:10px!important;
    align-items:stretch!important;
  }
  #dashboard .dashboard-kpi-v561{
    min-width:0!important;
    min-height:108px!important;
    padding:13px 12px!important;
  }
  #dashboard .dashboard-kpi-v561 strong{
    font-size:clamp(16px,1.18vw,20px)!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  #dashboard .dashboard-kpi-v561 em{max-width:100%!important}
  #dashboard .dashboard-sparkline{width:64px!important;right:9px!important;bottom:11px!important}

  /* Fill the third column instead of letting System span two rows. */
  #dashboard .dashboard-core-grid-v561{
    grid-template-columns:minmax(0,1fr) minmax(0,1.06fr) minmax(300px,.92fr)!important;
    grid-template-areas:
      "activity crops system"
      "documents workers customers"!important;
    align-items:stretch!important;
  }
  #dashboard .dashboard-activity-v561{grid-area:activity!important}
  #dashboard .dashboard-crops-v561{grid-area:crops!important}
  #dashboard .dashboard-system-v561{grid-area:system!important;grid-column:auto!important;grid-row:auto!important}
  #dashboard .dashboard-documents-v561{grid-area:documents!important}
  #dashboard .dashboard-workers-v561{grid-area:workers!important}
  #dashboard .dashboard-customers-v566{grid-area:customers!important}
}

/* Customer ranking card uses the same visual language as employee ranking. */
.dashboard-customers-v566{min-width:0}
.fmp66-customer-list{display:flex;flex-direction:column;gap:6px}
.fmp66-customer-row{
  appearance:none;width:100%;display:grid;grid-template-columns:27px 30px minmax(0,1fr) max-content;
  gap:8px;align-items:center;padding:8px 9px;border:1px solid #edf0f5;border-radius:11px;background:#fff;
  color:#1d263a;text-align:left;cursor:pointer
}
.fmp66-customer-row:hover{border-color:#ddd5ff;background:#fcfbff}
.fmp66-customer-no{font-size:10px;font-weight:900;color:#737d92;text-align:center}
.fmp66-customer-row>i{display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:#f1edff;color:#653ee6;font-style:normal;font-size:10px;font-weight:900}
.fmp66-customer-main{display:flex;flex-direction:column;min-width:0}
.fmp66-customer-main b{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fmp66-customer-main small{font-size:8px;color:#8a93a6;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fmp66-customer-main u{height:4px;margin-top:5px;border-radius:999px;background:#eeeef4;text-decoration:none;overflow:hidden}
.fmp66-customer-main u s{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6e45ee,#8b67f4);text-decoration:none}
.fmp66-customer-row>strong{font-size:9px;white-space:nowrap;color:#364056}
.fmp66-customer-row.rank-1{border-color:#ecdba9;background:#fffdf7}

/* The simplified system card should look intentionally compact. */
#dashboard .dashboard-system-v561 .fmp61-system-simple{margin-bottom:0!important}

/* Tablet/phone: two KPI columns and a deliberate content order. */
@media (max-width:1099px){
  #dashboard #fmp61WeatherStrip.fmp61-weather-strip{margin:10px 0 12px!important;min-height:0!important}
  #dashboard #dashboardQuickActions.dashboard-quick-actions{margin:0 0 12px!important}
  #dashboard .dashboard-kpi-grid-v561{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #dashboard .dashboard-core-grid-v561{display:grid!important;grid-template-columns:minmax(0,1fr)!important}
  #dashboard .dashboard-activity-v561{order:1}
  #dashboard .dashboard-crops-v561{order:2}
  #dashboard .dashboard-workers-v561{order:3}
  #dashboard .dashboard-system-v561{order:4;grid-column:auto!important;grid-row:auto!important}
  #dashboard .dashboard-customers-v566{order:5}
  #dashboard .dashboard-documents-v561{order:6}
}

@media (max-width:520px){
  .fmp66-customer-row{grid-template-columns:24px 28px minmax(0,1fr) max-content;padding:8px 7px;gap:6px}
  .fmp66-customer-row>i{width:27px;height:27px}
  .fmp66-customer-main b{font-size:9.5px}
  .fmp66-customer-row>strong{font-size:8.5px}
}
