.instruction-list {
  display: grid;
  gap: 12px;
}

.instruction-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
}

.instruction-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #252b44;
  color: #ffd34e;
  font-size: 20px;
  font-weight: 700;
}

.instruction-card h2 {
  margin: 7px 0 9px;
  font-size: 18px;
}

.instruction-card p {
  margin: 8px 0;
  line-height: 1.45;
}

.instruction-card ol,
.instruction-card ul {
  margin: 7px 0;
  padding-left: 21px;
  color: #d9dceb;
  line-height: 1.5;
}

.instruction-card li + li {
  margin-top: 5px;
}

.sla-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.sla {
  padding: 6px 9px;
  border-radius: 14px;
  font-size: 11px;
}

.sla.normal { background: #173c31; color: #58dda5; }
.sla.high { background: #41391c; color: #ffd75a; }
.sla.urgent { background: #47212b; color: #ff7182; }
.help-card { border-color: #4c5270; }

.team-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 13px;
}

.team-stats > button {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid #343a52;
  border-radius: 16px;
  background: linear-gradient(145deg, #191c2c, #151827);
  color: #f7f8ff;
  text-align: left;
  cursor: pointer;
}

.team-stats b { font-size: 25px; }
.team-stats span { color: #aeb4c8; font-size: 11px; }
.team-stats .pending { border-color: #695633; }
.team-stats > button.active { border-color: #5897ff; box-shadow: inset 0 0 0 1px #5897ff,0 8px 24px #294d872e; transform: translateY(-1px); }
.team-stats > button:active { transform: translateY(0); }
.team-list { display: grid; gap: 9px; }

.team-member {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #343a52;
  border-radius: 17px;
  background: #171a2a;
}

.team-member.is-pending { opacity: .78; border-color: #665634; }
.team-avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #293451; color: #bcd0ff; font-size: 19px; font-weight: 800; }
.team-person,.team-access { display: flex; flex-direction: column; gap: 5px; }
.team-person small,.team-access small { color: #969caf; font-size: 11px; }
.team-access { align-items: flex-end; text-align: right; }
.team-access em { color: #54d796; font-size: 10px; font-style: normal; }
.is-pending .team-access em { color: #ffd36b; }
.team-role { padding: 5px 8px; border-radius: 12px; background: #27314b; color: #b9cbff; font-size: 10px; font-weight: 700; }
.team-role.role-leader { background: #3b3150; color: #dcc3ff; }
.team-role.role-responsible { background: #173c31; color: #65e0ac; }
.team-role.role-manager { background: #263759; color: #a9c7ff; }
.team-approval { grid-column: 2 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 4px; }
.team-approval select,.team-approval button { min-height: 44px; }
.team-approval button:disabled { opacity: .65; cursor: wait; }

@media (max-width: 560px) {
  .team-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-member { grid-template-columns: 42px minmax(0, 1fr); }
  .team-avatar { width: 42px; height: 42px; }
  .team-access { grid-column: 2; align-items: flex-start; text-align: left; }
  .team-approval { grid-column: 1 / -1; grid-template-columns: 1fr; }
}

.control .section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(120px, auto));
  align-items: center;
  gap: 10px;
}

.control .section-head > div:first-child {
  min-width: 0;
}

.control .section-head > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  white-space: nowrap;
  font-weight: 600;
}

#export-leads {
  border-color: #3e62a8;
  background: #202b47;
  color: #c7d7ff;
}

#toggle-overdue {
  border-color: #654536;
  background: #32241f;
  color: #ffc09a;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics-period {
  display: block;
  margin: 2px 2px 9px;
  color: #858da7;
  font-size: 11px;
  text-align: right;
}

.daily-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 12px;
  padding: 14px 16px;
  border: 1px solid #35548b;
  border-radius: 16px;
  background: linear-gradient(135deg, #182640, #1a2035);
  box-shadow: inset 4px 0 #5897ff;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 14px;
}

.summary-row .daily-summary,
.summary-row .hero-card {
  min-height: 150px;
  margin: 0;
}

.summary-row .daily-summary {
  align-items: flex-start;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.summary-row #daily-details {
  text-align: left;
}

.summary-row .hero-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

.summary-row .hero-card > span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.summary-row .hero-card > b {
  margin: 6px 0;
  font-size: 38px;
}

.summary-row .hero-card > small {
  font-size: 11px;
}

.daily-summary > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.daily-summary span {
  color: #9db9ed;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.daily-summary b {
  font-size: 23px;
}

#daily-details {
  color: #bdc8dd;
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.daily-summary.has-alert {
  border-color: #6c3f4a;
  box-shadow: inset 4px 0 #e5586c;
}

.kpi-grid article {
  position: relative;
  min-height: 116px;
  padding: 13px 15px;
  overflow: hidden;
  border-color: #343a52;
  background: linear-gradient(145deg, #191c2c, #151827);
}

.kpi-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #5897ff;
}

.kpi-grid .kpi-time::before { background: #54d796; }
.kpi-grid .kpi-overdue::before { background: #e5586c; }
.kpi-grid .kpi-conversion::before { background: #b28cff; }

.kpi-grid article > span {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}

.kpi-grid article > b {
  margin: 10px 0 7px;
  font-size: 29px;
  line-height: 1;
}

.kpi-grid article > small {
  color: #aeb4c8;
  line-height: 1.35;
}

.hero-card {
  background: linear-gradient(135deg, #d96831, #ed9656);
  box-shadow: 0 12px 32px #d9683126;
}

.hero-card.quality-warning {
  background: linear-gradient(135deg, #b94055, #e36a68);
}

.hero-card .progress {
  height: 9px;
  margin: 4px 0 8px;
}

.hero-card .progress i {
  transition: width .35s ease;
}

@media (max-width: 560px) {
  .daily-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  #daily-details {
    text-align: left;
  }

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

  .kpi-grid article,
  .kpi-grid article:last-child {
    grid-column: auto;
    min-height: 112px;
  }

  .control .section-head {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control .section-head > div:first-child {
    grid-column: 1 / -1;
  }

  .control .section-head > button {
    width: 100%;
    min-height: 50px;
    padding: 10px 8px;
  }

  #bottom-nav button {
    min-width: 16.666%;
    padding: 8px 2px;
  }

  #bottom-nav button span {
    font-size: 10px;
  }
}

@media (max-width: 410px) {
  .summary-row {
    grid-template-columns: 1fr;
  }

  .summary-row .daily-summary,
  .summary-row .hero-card {
    min-height: 132px;
  }
}
