.role-dashboard {
  --role-blue: #112262;
  --role-blue-soft: #eef1fb;
  --role-yellow: #ffcc05;
  --role-line: #e3e8f2;
  --role-line-strong: #d4dbea;
  --role-muted: #667085;
  --role-surface: #fff;
  --role-success: #21875f;
  --role-danger: #c13b38;
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 16px;
  color: #17203a;
  background: transparent;
}

.role-dashboard *,
.role-dashboard *::before,
.role-dashboard *::after {
  box-sizing: border-box;
}

.role-dashboard[aria-busy='true'] {
  min-height: 240px;
}

.role-dashboard-heading {
  min-width: 0;
  padding: 1px 2px 0;
}

.role-dashboard-heading h1 {
  margin: 0;
  color: #202a49;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.role-dashboard-state {
  display: flex;
  min-height: 240px;
  padding: 24px;
  border: 1px solid var(--role-line);
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--role-surface);
  box-shadow: 0 9px 24px rgb(17 34 98 / 6%);
  color: var(--role-muted);
}

.role-dashboard-state--error {
  flex-direction: column;
  text-align: center;
}

.role-dashboard-state--error p {
  margin: 0;
}

.role-dashboard-state__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #dfe3ef;
  border-top-color: var(--role-blue);
  border-radius: 50%;
  animation: role-dashboard-spin .75s linear infinite;
}

@keyframes role-dashboard-spin {
  to { transform: rotate(360deg); }
}

.role-dashboard-alert {
  display: flex;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #f0cfcc;
  border-radius: 12px;
  align-items: center;
  gap: 11px;
  background: #fff5f4;
  box-shadow: 0 7px 20px rgb(185 58 56 / 8%);
  color: #a83230;
  font-size: .78rem;
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.role-dashboard-alert:hover {
  border-color: #e9b9b5;
  box-shadow: 0 10px 25px rgb(185 58 56 / 12%);
  transform: translateY(-1px);
}

.role-dashboard-alert:focus-visible {
  outline: 3px solid rgb(185 58 56 / 20%);
  outline-offset: 2px;
}

.role-dashboard-alert__mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  place-items: center;
  background: #f8d8d5;
  font-size: .72rem;
  font-weight: 800;
}

.role-dashboard-alert__arrow {
  margin-left: auto;
  color: #8d2927;
  font-size: 17px;
  font-weight: 800;
}

.role-dashboard-panel {
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgb(226 231 241 / 88%);
  border-radius: 14px;
  background: var(--role-surface);
  box-shadow: 0 9px 24px rgb(17 34 98 / 6%);
}

.role-dashboard-panel__heading {
  display: flex;
  min-width: 0;
  min-height: 38px;
  margin-bottom: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.role-dashboard-panel__heading h2 {
  min-width: 0;
  margin: 0;
  color: #202a49;
  font-size: .86rem;
  font-weight: 750;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.role-dashboard-panel__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.role-dashboard-panel__actions .table-excel-button {
  min-width: 38px;
  min-height: 36px;
}

.role-dashboard-workload-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr);
  align-items: start;
  gap: 14px;
}

.role-dashboard-workload-grid .role-dashboard-panel--summary .role-dashboard-counts {
  grid-template-columns: 1fr;
}

.role-dashboard-workload-grid .role-dashboard-panel--couriers .role-dashboard-couriers {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.role-dashboard-counts,
.role-dashboard-couriers {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 9px;
}

.role-dashboard-count,
.role-dashboard-courier {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 56px;
  padding: 10px 12px 10px 30px;
  border: 1px solid var(--role-line);
  border-radius: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
}

.role-dashboard-count::before,
.role-dashboard-courier::before {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--role-yellow);
  content: '';
  transform: translateY(-50%);
}

.role-dashboard-count span,
.role-dashboard-courier span {
  min-width: 0;
  overflow: hidden;
  color: #505c77;
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-dashboard-courier span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.role-dashboard-count strong,
.role-dashboard-courier strong {
  flex: 0 0 auto;
  color: var(--role-blue);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.role-dashboard-courier {
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease,
    transform 140ms ease;
}

.role-dashboard-courier::before {
  background: var(--role-blue);
}

.role-dashboard-courier:hover {
  border-color: rgb(17 34 98 / 20%);
  background: #fffdf4;
  box-shadow: 0 6px 16px rgb(17 34 98 / 6%);
  transform: translateY(-1px);
}

.role-dashboard-courier:focus-visible {
  outline: 3px solid rgb(17 34 98 / 14%);
  outline-offset: 2px;
}

.role-dashboard-courier--late {
  border-color: #f0cfcc;
  background: #fff7f6;
}

.role-dashboard-courier--late::before {
  background: var(--role-danger);
}

.role-dashboard-courier--late strong {
  color: #a83230;
}

.role-dashboard-empty {
  min-height: 72px;
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--role-line-strong);
  border-radius: 10px;
  align-content: center;
  color: var(--role-muted);
  font-size: .74rem;
  text-align: center;
}

.role-dashboard-counts > .role-dashboard-empty,
.role-dashboard-couriers > .role-dashboard-empty,
.role-dashboard-controller-couriers__list > .role-dashboard-empty {
  grid-column: 1 / -1;
}

.role-dashboard-metrics {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.role-dashboard-metric {
  --role-metric-accent: #c89024;
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 112px;
  padding: 15px 16px 14px;
  overflow: hidden;
  border: 1px solid rgb(226 231 241 / 88%);
  border-radius: 12px;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  background: var(--role-surface);
  box-shadow: 0 9px 24px rgb(17 34 98 / 6%);
}

.role-dashboard-metric::before {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--role-metric-accent);
  content: '';
}

.role-dashboard-metric--te_dorezuara {
  --role-metric-accent: var(--role-success);
}

.role-dashboard-metric--problematike_te_kthyera {
  --role-metric-accent: var(--role-danger);
}

.role-dashboard-metric--te_pa_likujduara {
  --role-metric-accent: var(--role-blue);
}

.role-dashboard-metric__value {
  display: flex;
  min-height: 27px;
  align-items: baseline;
  gap: 4px;
}

.role-dashboard-metric__value strong,
.role-dashboard-metric__amounts strong {
  color: var(--role-blue);
  font-size: 1.42rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1;
}

.role-dashboard-metric__value small,
.role-dashboard-metric > span,
.role-dashboard-metric__copy span {
  color: var(--role-muted);
  font-size: .7rem;
  font-weight: 650;
}

.role-dashboard-metric__copy {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.role-dashboard-metric__copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-dashboard-metric__copy strong {
  flex: 0 0 auto;
  color: #344054;
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.role-dashboard-metric progress {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: #edf0f6;
  accent-color: var(--role-metric-accent);
}

.role-dashboard-metric progress::-webkit-progress-bar {
  border-radius: inherit;
  background: #edf0f6;
}

.role-dashboard-metric progress::-webkit-progress-value {
  border-radius: inherit;
  background: var(--role-metric-accent);
}

.role-dashboard-metric progress::-moz-progress-bar {
  border-radius: inherit;
  background: var(--role-metric-accent);
}

.role-dashboard-metric__amounts {
  display: grid;
  min-height: 56px;
  align-content: center;
  gap: 7px;
}

.role-dashboard-panel--table {
  padding-bottom: 0;
}

.role-dashboard-table-region {
  width: auto;
  max-width: none;
  margin: 0 -16px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--role-line);
  outline: none;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.role-dashboard-table-region:focus-visible {
  box-shadow: inset 0 0 0 2px rgb(17 34 98 / 15%);
}

.role-dashboard-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border-spacing: 0;
  background: var(--role-surface);
  font-size: 12.5px;
}

.role-dashboard-table[data-excel-source='role-controller-agencies'],
.role-dashboard-table[data-excel-source='role-package-controller-agencies'] {
  min-width: 900px;
}

.role-dashboard-table--compact {
  min-width: 520px;
}

.role-dashboard-table th,
.role-dashboard-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--role-line);
}

.role-dashboard-table th {
  color: #55617a;
  background: #f8f9fc;
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.role-dashboard-table td {
  height: 48px;
  color: #344054;
  font-variant-numeric: tabular-nums;
}

.role-dashboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.role-dashboard-table tbody tr {
  transition: background-color 140ms ease;
}

.role-dashboard-table tbody tr:hover {
  background: #fffdf4;
}

.role-dashboard-table tbody tr:focus-visible {
  outline: 2px solid rgb(17 34 98 / 18%);
  outline-offset: -2px;
  background: #fffdf4;
}

.role-dashboard-table[data-excel-source='role-controller-headline'] th:nth-child(2),
.role-dashboard-table[data-excel-source='role-controller-headline'] td:nth-child(2),
.role-dashboard-table[data-excel-source='role-controller-agencies'] th:nth-child(n + 2),
.role-dashboard-table[data-excel-source='role-controller-agencies'] td:nth-child(n + 2),
.role-dashboard-table[data-excel-source='role-package-controller-agencies'] th:nth-child(n + 2),
.role-dashboard-table[data-excel-source='role-package-controller-agencies'] td:nth-child(n + 2) {
  text-align: right;
}

.role-dashboard-table__link {
  color: #26376f;
  font-weight: 700;
  text-decoration: none;
}

.role-dashboard-table__link:hover,
.role-dashboard-table__link:focus-visible {
  color: #08143f;
  text-decoration: underline;
  text-decoration-color: var(--role-yellow);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.role-dashboard-status {
  display: inline-flex;
  min-height: 26px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid var(--role-dashboard-status-color, #65728b);
  border-radius: 6px;
  align-items: center;
  background: var(--role-dashboard-status-color, #65728b);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 16%);
  color: #fff;
  font-size: .67rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.role-dashboard-table__empty {
  height: 84px !important;
  color: var(--role-muted) !important;
  text-align: center !important;
  white-space: normal !important;
}

.role-dashboard-controller-layout {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.role-dashboard-controller-couriers {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.role-dashboard-controller-couriers .role-dashboard-panel__heading {
  margin-bottom: 0;
}

.role-dashboard-controller-couriers__group {
  display: grid;
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--role-line);
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.role-dashboard-controller-couriers__group h3 {
  margin: 11px 0 0;
  color: #344054;
  font-size: .75rem;
  font-weight: 750;
}

.role-dashboard-controller-couriers__list {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 9px;
}

.role-dashboard .table-export-feedback {
  margin: 0 0 12px;
}

@media (max-width: 1100px) {
  .role-dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-dashboard-workload-grid {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (max-width: 760px) {
  .role-dashboard {
    gap: 12px;
  }

  .role-dashboard-panel {
    padding: 14px;
    border-radius: 12px;
  }

  .role-dashboard-panel--table {
    padding-bottom: 0;
  }

  .role-dashboard-table-region {
    margin-right: -14px;
    margin-left: -14px;
  }

  .role-dashboard-counts,
  .role-dashboard-couriers,
  .role-dashboard-controller-couriers__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-dashboard-controller-couriers__group {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .role-dashboard-controller-couriers__group h3 {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .role-dashboard-metrics,
  .role-dashboard-counts,
  .role-dashboard-couriers,
  .role-dashboard-controller-couriers__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-dashboard-panel__heading {
    min-height: 36px;
  }

  .role-dashboard-panel--table {
    padding-bottom: 14px;
  }

  .role-dashboard-table-region {
    margin: 0;
    overflow: visible;
    border-top: 0;
  }

  .role-dashboard-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    background: transparent;
  }

  .role-dashboard-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  .role-dashboard-table tbody {
    display: grid;
    min-width: 0;
    gap: 10px;
  }

  .role-dashboard-table tbody tr {
    display: grid;
    min-width: 0;
    padding: 4px 12px;
    border: 1px solid var(--role-line);
    border-radius: 10px;
    background: var(--role-surface);
  }

  .role-dashboard-table td,
  .role-dashboard-table[data-excel-source='role-controller-headline'] td:nth-child(2),
  .role-dashboard-table[data-excel-source='role-controller-agencies'] td:nth-child(n + 2),
  .role-dashboard-table[data-excel-source='role-package-controller-agencies'] td:nth-child(n + 2) {
    display: grid;
    min-width: 0;
    height: auto;
    padding: 9px 0;
    border-bottom: 1px solid var(--role-line);
    grid-template-columns: minmax(92px, .72fr) minmax(0, 1.28fr);
    align-items: start;
    gap: 12px;
    text-align: right;
    white-space: normal;
  }

  .role-dashboard-table td::before {
    color: var(--role-muted);
    content: attr(data-label);
    font-size: .64rem;
    font-weight: 750;
    letter-spacing: .025em;
    line-height: 1.4;
    text-align: left;
    text-transform: uppercase;
  }

  .role-dashboard-table td:last-child {
    border-bottom: 0;
  }

  .role-dashboard-table td > * {
    min-width: 0;
    justify-self: end;
    overflow-wrap: anywhere;
    text-align: right;
  }

  .role-dashboard-table__empty {
    display: block !important;
    padding: 24px 8px !important;
    border-bottom: 0 !important;
    text-align: center !important;
  }

  .role-dashboard-table__empty::before {
    content: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .role-dashboard *,
  .role-dashboard *::before,
  .role-dashboard *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .role-dashboard-panel,
  .role-dashboard-metric,
  .role-dashboard-state {
    box-shadow: none;
  }

  .role-dashboard-panel__actions,
  .role-dashboard-alert {
    display: none;
  }

  .role-dashboard-table-region {
    overflow: visible;
  }
}

/* Cash-desk and agency dashboards: role-specific enterprise hierarchy. */
.role-dashboard--arka,
.role-dashboard--agjensi {
  --role-surface-raised: #fff;
  --role-soft-blue: #f5f7fc;
  --role-cash-green: #157655;
  gap: 18px;
}

.role-dashboard--arka .role-dashboard-heading,
.role-dashboard--agjensi .role-dashboard-heading {
  position: relative;
  min-height: 44px;
  padding: 7px 4px 8px 17px;
  align-content: center;
}

.role-dashboard--arka .role-dashboard-heading::before,
.role-dashboard--agjensi .role-dashboard-heading::before {
  position: absolute;
  top: 7px;
  bottom: 8px;
  left: 2px;
  width: 4px;
  border-radius: 999px;
  background: var(--role-yellow);
  content: '';
}

.role-dashboard--arka .role-dashboard-heading h1,
.role-dashboard--agjensi .role-dashboard-heading h1 {
  font-size: clamp(1.14rem, 1.6vw, 1.4rem);
  font-weight: 790;
}

.role-dashboard--arka .role-dashboard-metrics {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.role-dashboard--arka .role-dashboard-metric {
  min-height: 126px;
  padding: 17px;
  border-color: #dfe5f0;
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgb(17 34 98 / 5%), transparent 42%),
    var(--role-surface-raised);
  box-shadow: 0 8px 24px rgb(17 34 98 / 7%);
}

.role-dashboard--arka .role-dashboard-metric::after {
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--role-metric-accent);
  content: '';
  opacity: .82;
}

.role-dashboard--arka .role-dashboard-metric__value strong,
.role-dashboard--arka .role-dashboard-metric__amounts strong {
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  letter-spacing: -.03em;
}

.role-dashboard--arka .role-dashboard-workload-grid,
.role-dashboard--agjensi .role-dashboard-workload-grid {
  grid-template-columns: minmax(270px, .76fr) minmax(0, 1.24fr);
  gap: 16px;
}

.role-dashboard--arka .role-dashboard-panel,
.role-dashboard--agjensi .role-dashboard-panel {
  border-color: #dfe5f0;
  background: var(--role-surface-raised);
  box-shadow: 0 8px 24px rgb(17 34 98 / 6%);
}

.role-dashboard--arka .role-dashboard-panel__heading,
.role-dashboard--agjensi .role-dashboard-panel__heading {
  min-height: 42px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--role-line);
}

.role-dashboard--arka .role-dashboard-panel__heading h2,
.role-dashboard--agjensi .role-dashboard-panel__heading h2 {
  font-size: .9rem;
  font-weight: 780;
}

.role-dashboard--arka .role-dashboard-count,
.role-dashboard--arka .role-dashboard-courier,
.role-dashboard--agjensi .role-dashboard-count,
.role-dashboard--agjensi .role-dashboard-courier {
  min-height: 61px;
  border-color: #e1e6ef;
  background: #fbfcfe;
}

.role-dashboard--arka .role-dashboard-table-region,
.role-dashboard--agjensi .role-dashboard-table-region {
  max-height: min(52vh, 520px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.role-dashboard--arka .role-dashboard-table th,
.role-dashboard--agjensi .role-dashboard-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  box-shadow: inset 0 -1px 0 #dce2ed;
}

.role-dashboard--arka .role-dashboard-table tbody tr:nth-child(even),
.role-dashboard--agjensi .role-dashboard-table tbody tr:nth-child(even) {
  background: #fbfcfe;
}

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

  .role-dashboard--arka .role-dashboard-workload-grid,
  .role-dashboard--agjensi .role-dashboard-workload-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .role-dashboard--arka,
  .role-dashboard--agjensi {
    gap: 12px;
  }

  .role-dashboard--arka .role-dashboard-heading,
  .role-dashboard--agjensi .role-dashboard-heading {
    min-height: 38px;
  }

  .role-dashboard--arka .role-dashboard-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-dashboard--arka .role-dashboard-metric {
    min-height: 108px;
  }

  .role-dashboard--arka .role-dashboard-table-region,
  .role-dashboard--agjensi .role-dashboard-table-region {
    max-height: none;
  }

  .role-dashboard--arka .role-dashboard-table th,
  .role-dashboard--agjensi .role-dashboard-table th {
    position: static;
  }
}
