:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #eef8ff;
  background: transparent;
  font-synthesis: none;
  --panel: #102f4a;
  --panel-2: #0b2942;
  --panel-top: #123955;
  --line: rgba(255, 255, 255, 0.55);
  --line-soft: rgba(255, 255, 255, 0.1);
  --text: #f4fbff;
  --muted: #b6d0e0;
  --faint: #7fa1b8;
  --green: #00e383;
  --cyan: #35e6c4;
  --red: #ff6075;
  --violet: #8d7cff;
  --blue: #3a9af5;
  --yellow: #ffd85d;
  --shadow: 0 7px 15px rgba(1, 36, 66, 0.45);
}

* { box-sizing: border-box; }
html,
body {
  margin: 0;
  min-height: 100%;
  background: transparent;
}

body {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.dashboard {
  width: 100%;
  min-height: 100vh;
  padding: 8px 10px 10px;
}

.status-message {
  min-height: 22px;
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  line-height: 1.3;
}

.status-message--error {
  color: #ffecf0;
  font-weight: 800;
}

.warnings {
  margin: 0 0 8px;
  border-left: 3px solid var(--yellow);
  border-radius: 6px;
  background: rgba(9, 45, 76, 0.64);
  padding: 8px 10px;
  color: #ffe38a;
  font-size: 12px;
  line-height: 1.35;
}

.amo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  grid-auto-flow: dense;
}

.metric-card,
.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 174px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.metric-card h2,
.panel h2 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.metric-card strong {
  display: block;
  margin-top: 16px;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.metric-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
}

.metric-card i {
  display: none;
}

.metric-card--violet strong {
  color: var(--violet);
}

.metric-card--green strong {
  color: var(--green);
}

.metric-card--completed strong {
  color: var(--cyan);
}

.metric-card--blue strong {
  color: var(--blue);
}

.metric-card--scope strong {
  color: var(--yellow);
  font-size: clamp(32px, 3.6vw, 48px);
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel--tasks {
  grid-column: 1 / -1;
}

.panel--deals {
  grid-column: span 3;
}

.panel--employees {
  grid-column: span 2;
}

.panel--completed {
  grid-column: 1 / -1;
}

.panel__header {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px 12px;
  background: rgba(5, 18, 30, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel__header > * {
  min-width: 0;
}

.panel__header--completed {
  align-items: flex-start;
}

.panel__header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.refresh-button {
  flex: 0 0 auto;
  min-width: 118px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 18px;
  background: rgba(16, 141, 184, 0.22);
  color: #fff;
  font-weight: 850;
}

.refresh-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.table-wrap {
  overflow: auto;
  max-height: 430px;
  min-height: 330px;
}

.table-wrap--tasks {
  max-height: 360px;
  min-height: 260px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0b2942;
  color: #c9d9e8;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.number-cell {
  text-align: right;
  white-space: nowrap;
}

.deal-link {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.deal-link:hover {
  color: var(--yellow);
  text-decoration: underline;
}

.deal-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.badge {
  display: inline-grid;
  min-width: 28px;
  place-items: center;
  border-radius: 4px;
  padding: 4px 7px;
  background: rgba(255, 96, 117, 0.13);
  color: var(--red);
  font-weight: 900;
}

.employees-list {
  max-height: 430px;
  min-height: 330px;
  overflow: auto;
}

.employee-card {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.employee-card:last-child {
  border-bottom: 0;
}

.employee-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.employee-card summary::-webkit-details-marker {
  display: none;
}

.employee-card__identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.employee-card__identity strong,
.employee-card__identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-card__identity small,
.employee-card__result small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.employee-department {
  color: var(--faint);
}

.employee-card__result {
  min-width: 142px;
  text-align: right;
  white-space: nowrap;
}

.employee-card__result strong {
  color: var(--red);
  font-size: 18px;
}

.employee-card__result .employee-completed {
  color: var(--cyan);
  font-weight: 800;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #66d9f4;
  color: #083047;
  font-size: 12px;
  font-weight: 900;
}

.task-list {
  padding: 0 18px 14px 68px;
}

.task-item {
  padding: 9px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  font-size: 12px;
  line-height: 1.3;
}

.task-item a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.task-item a:hover {
  color: var(--yellow);
}

.task-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.task-item--empty {
  color: var(--muted);
}

.completed-summary {
  flex: 0 0 auto;
  min-width: 148px;
  text-align: right;
}

.completed-summary strong,
.completed-summary span {
  display: block;
}

.completed-summary strong {
  color: var(--cyan);
  font-size: clamp(30px, 3vw, 42px);
  line-height: 0.95;
  font-weight: 950;
}

.completed-summary span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.completed-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
}

.completed-card {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid rgba(53, 230, 196, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.completed-card__identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.completed-card__identity strong,
.completed-card__identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completed-card__identity strong {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.completed-card__identity small,
.completed-card__result small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.completed-card__avatar {
  background: rgba(53, 230, 196, 0.92);
}

.completed-card__result {
  flex: 0 0 auto;
  min-width: 58px;
  text-align: right;
}

.completed-card__result strong {
  display: block;
  color: var(--cyan);
  font-size: 28px;
  line-height: 0.95;
  font-weight: 950;
}

.completed-card__result small {
  display: block;
}

.empty-state {
  padding: 40px 18px;
  color: var(--muted);
  text-align: center;
}

.dashboard__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .amo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel--tasks,
  .panel--deals,
  .panel--employees,
  .panel--completed {
    grid-column: span 2;
  }

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

@media (max-width: 760px) {
  .dashboard {
    padding: 8px;
  }

  .amo-grid {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .panel--tasks,
  .panel--deals,
  .panel--employees,
  .panel--completed {
    grid-column: auto;
  }

  .panel__header,
  .dashboard__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-wrap,
  .table-wrap--tasks,
  .employees-list {
    max-height: none;
    min-height: 0;
  }

  .completed-list {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .completed-summary,
  .employee-card__result {
    min-width: 0;
    text-align: left;
    white-space: normal;
  }

  .employee-card summary {
    grid-template-columns: 1fr;
  }

  th:nth-child(3),
  td:nth-child(3),
  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }
}
