﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 44px;
}

:root {
  --cnvg-header-bg: #334155;
  --cnvg-header-fg: #f8fafc;
  --cnvg-sticky-col-bg: #e2e8f0;
}

.permission-denied-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid #fecaca;
  border-left: 6px solid #dc2626;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #fff7f7 0%, #ffe4e6 100%);
  box-shadow: 0 10px 24px rgba(127, 29, 29, 0.08);
}

.permission-denied-icon {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background-color: #dc2626;
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.35);
}

.dashboard-table tbody td.hours-zero {
  background-color: #f8fafc;
  color: #94a3b8;
  font-weight: 500;
}

.dashboard-table tbody td.hours-positive {
  background-color: #ecfdf5;
  color: #14532d;
  font-weight: 600;
}

.dashboard-table.table-hover tbody tr:hover td.hours-zero {
  background-color: #f1f5f9;
}

.dashboard-table.table-hover tbody tr:hover td.hours-positive {
  background-color: #dcfce7;
}

.dashboard-table {
  width: max-content;
  min-width: 100%;
}

.dashboard-table.dashboard-assigned-task-compact .assigned-task-parent-title,
.dashboard-table.dashboard-assigned-task-compact .assigned-task-child-title,
.dashboard-table.dashboard-assigned-task-compact .assigned-metric-chip {
  display: none;
}

.dashboard-table .assigned-task-inline-type-pill {
  display: none;
}

.dashboard-table.dashboard-assigned-task-compact .assigned-task-inline-type-pill {
  display: inline-flex;
  margin-left: 0.35rem;
  flex: 0 0 auto;
}

.dashboard-table.dashboard-assigned-task-compact .assigned-task-line--badge-row {
  display: none;
}

.dashboard-table.dashboard-assigned-task-compact .assigned-task-line--parent,
.dashboard-table.dashboard-assigned-task-compact .assigned-task-line--child,
.dashboard-table.dashboard-assigned-task-compact .assigned-task-line {
  gap: 0.25rem;
  flex-wrap: nowrap;
  overflow: hidden;
}

.dashboard-table.dashboard-assigned-task-compact .assigned-task-inline-type-pill,
.dashboard-table.dashboard-assigned-task-compact .assigned-task-link {
  font-size: 0.72rem;
}

.sticky-last {
  position: sticky;
  right: 0;
  z-index: 2;
  background-color: var(--cnvg-sticky-col-bg) !important;
  box-shadow: none;
  border-left: 1px solid rgba(148, 163, 184, 0.75);
  border-top: 1px solid rgba(148, 163, 184, 0.45);
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
  background-clip: padding-box;
}

thead .sticky-last {
  background-color: var(--cnvg-header-bg) !important;
  color: var(--cnvg-header-fg) !important;
}

tfoot .sticky-last {
  background-color: #c7d2fe !important;
}

.dashboard-total-day-row td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background-color: #c7d2fe !important;
  box-shadow: 0 -1px 0 rgba(148, 163, 184, 0.55);
}

.dashboard-total-day-row .sticky-last {
  z-index: 4;
}

.dashboard-assigned-task-header {
  position: relative;
  padding-right: 1.25rem;
}

.dashboard-column-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 0.75rem;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}

.dashboard-column-resize-handle::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  bottom: 0.2rem;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

body.dashboard-column-resizing,
body.dashboard-column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

#loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  transition: none;
}
#loading-overlay.visible {
  display: flex;
}
#loading-overlay .loading-text {
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.meta-pills {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.58rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.status-pill {
  color: #0f172a;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.status-pill.status-in-progress {
  color: #14532d;
  background: #dcfce7;
  border-color: #86efac;
}

.status-pill.status-code-review {
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #93c5fd;
}

.status-pill.status-testing {
  color: #7c2d12;
  background: #ffedd5;
  border-color: #fdba74;
}

.status-pill.status-to-do {
  color: #334155;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.type-pill {
  color: #3f3f46;
  background: #f4f4f5;
  border-color: #d4d4d8;
}

.type-pill.type-subtarea,
.type-pill.type-sub-task {
  color: #312e81;
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.type-pill.type-tarea {
  color: #075985;
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.type-pill.type-historia {
  color: #365314;
  background: #ecfccb;
  border-color: #bef264;
}

.type-pill.type-error,
.type-pill.type-bug {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #fca5a5;
}

.type-pill.type-epic {
  color: #4c1d95;
  background: #ede9fe;
  border-color: #c4b5fd;
}

.type-pill.type-test {
  color: #164e63;
  background: #cffafe;
  border-color: #67e8f9;
}

.type-pill.type-change-request {
  color: #14532d;
  background: #dcfce7;
  border-color: #86efac;
}

.type-pill.type-spike {
  color: #7c2d12;
  background: #ffedd5;
  border-color: #fdba74;
}

.type-pill.type-deploy-to-prd {
  color: #052e16;
  background: #dcfce7;
  border-color: #86efac;
}

.dashboard-filters-card {
  border: 1px solid #d5deea;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.dashboard-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.95rem;
  align-items: start;
}

.dashboard-filter-item {
  min-width: 0;
}

.dashboard-filter-item--stacked {
  display: flex;
  flex-direction: column;
}

.dashboard-filter-item--statuses,
.dashboard-filter-item--users {
  padding-top: 2rem;
}

.dashboard-filter-item--stacked .form-select[multiple] {
  min-height: 138px;
}

.dashboard-filter-item--statuses .form-text,
.dashboard-filter-item--activity .form-text,
.dashboard-filter-item--users .form-text {
  min-height: 2.6em;
}

.dashboard-filter-item .form-label {
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.dashboard-filter-item .form-select,
.dashboard-filter-item .form-control {
  border-radius: 12px;
  border-color: #cbd5e1;
}

.dashboard-filter-item .form-select:disabled,
.dashboard-filter-item .form-control:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
}

.dashboard-filter-item--compact {
  max-width: 320px;
}

.dashboard-actions-panel {
  display: flex;
  align-items: flex-end;
}

.dashboard-actions-panel--row {
  grid-column: 1 / -1;
  justify-content: center;
}

.dashboard-table-scroll {
  max-height: 600px;
  overflow: auto;
}

.app-tabs-header {
  padding: 0.55rem 0.8rem 0;
}

.app-tabs-header .card-header-tabs {
  margin-bottom: -1px;
}

.app-tabs-header .card-header-tabs .nav-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  font-weight: 600;
}

.worklog-chart-tile,
.metrics-chart-tile {
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  padding: 0.85rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
}

.worklog-chart-tile canvas {
  display: block;
  width: 100% !important;
  height: 290px !important;
  min-height: 290px;
  max-height: 290px;
  flex: 0 0 auto;
}

.metrics-chart-tile canvas {
  display: block;
  width: 100% !important;
  height: 240px !important;
  min-height: 240px;
  max-height: 240px;
  flex: 0 0 auto;
}

.worklog-chart-tile--fixed {
  min-height: 340px;
  max-height: 340px;
}

.worklog-chart-tile--top-issues {
  min-height: 340px;
  max-height: 340px;
}

.worklog-chart-tile--top-issues canvas {
  height: 290px !important;
  min-height: 290px;
  max-height: 290px;
}

.worklog-heatmap {
  display: grid;
  gap: 0.3rem;
  box-sizing: border-box;
  width: 100%;
  height: 290px;
  min-height: 290px;
  max-height: 290px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 0;
}

.worklog-heatmap-pager {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.worklog-heatmap-pager .btn {
  min-width: 84px;
}

.worklog-heatmap__row {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(140px, 180px) repeat(var(--worklog-heatmap-columns, 20), minmax(0, 1fr));
  gap: 0.2rem;
  align-items: center;
}

.worklog-heatmap__row--head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.worklog-heatmap__user {
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.worklog-heatmap__cell {
  border-radius: 6px;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.worklog-heatmap__cell--head {
  border: 0;
  background: transparent;
  color: #64748b;
  min-height: auto;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-table {
  --dashboard-capacity-row-height: 0px;
  --dashboard-task-column-width: 420px;
  --dashboard-total-column-width: 120px;
  border-collapse: separate;
  border-spacing: 0;
}

.dashboard-table thead th:first-child,
.dashboard-table tbody td:first-child,
.dashboard-table tfoot td:first-child {
  width: var(--dashboard-task-column-width);
  min-width: var(--dashboard-task-column-width);
  max-width: var(--dashboard-task-column-width);
}

.dashboard-table thead th:first-child,
.dashboard-table tbody td:first-child,
.dashboard-table tfoot td:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  box-shadow: 1px 0 0 rgba(148, 163, 184, 0.55);
}

.dashboard-table tbody td:first-child {
  background-color: #ffffff;
}

.dashboard-table.table-hover tbody tr:hover td:first-child {
  background-color: #f8fafc;
}

.dashboard-table .sticky-last {
  width: var(--dashboard-total-column-width);
  min-width: var(--dashboard-total-column-width);
  max-width: var(--dashboard-total-column-width);
}

.dashboard-table th,
.dashboard-table td {
  background-clip: padding-box;
  border-top: 1px solid rgba(148, 163, 184, 0.45);
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
}

.dashboard-table tbody td {
  border-top: 1px solid rgba(148, 163, 184, 0.45);
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
}

.dashboard-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid rgba(148, 163, 184, 0.75);
}

.dashboard-table thead.table-dark th,
#metrics-table thead.table-dark th {
  background-color: var(--cnvg-header-bg);
  border-color: var(--cnvg-header-bg);
  color: var(--cnvg-header-fg);
}

.dashboard-table thead.table-dark th:first-child {
  z-index: 7;
  background-color: var(--cnvg-header-bg) !important;
  color: var(--cnvg-header-fg) !important;
}

.table > :not(:last-child) > :last-child > * {
  border-bottom-color: rgba(148, 163, 184, 0.75) !important;
}

.dashboard-table thead .sticky-last {
  z-index: 6;
}

.dashboard-table tfoot .dashboard-capacity-row td,
.dashboard-table tfoot .dashboard-total-day-row td {
  position: sticky;
  z-index: 6;
  border-top: 1px solid rgba(148, 163, 184, 0.75);
}

.dashboard-table tfoot .dashboard-capacity-row td {
  bottom: 0;
}

.dashboard-table tfoot .dashboard-total-day-row td {
  bottom: var(--dashboard-capacity-row-height);
}

.dashboard-table tfoot .dashboard-capacity-row .sticky-last,
.dashboard-table tfoot .dashboard-total-day-row .sticky-last {
  z-index: 7;
}

.dashboard-table tfoot .dashboard-total-day-row td {
  background-color: #cfe2ff !important;
}

.dashboard-table tfoot .dashboard-capacity-row td {
  background-color: #fff3cd !important;
}

.dashboard-table tfoot .dashboard-total-day-row td:first-child {
  z-index: 8;
  background-color: #cfe2ff !important;
}

.dashboard-table tfoot .dashboard-capacity-row td:first-child {
  z-index: 8;
  background-color: #fff3cd !important;
}

.dashboard-table tfoot .dashboard-capacity-row .sticky-last {
  background-color: #fff3cd !important;
}

.dashboard-actions {
  width: auto;
  display: flex;
  gap: 0.65rem;
  justify-content: center;
}

.dashboard-btn-primary,
.dashboard-btn-secondary {
  min-height: 42px;
  border-radius: 12px;
  font-weight: 600;
  padding: 0.5rem 1.05rem;
}

.dashboard-btn-primary {
  border: none;
  background: linear-gradient(135deg, #0f766e 0%, #0ea5a3 100%);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.25);
}

.dashboard-btn-primary:hover,
.dashboard-btn-primary:focus {
  background: linear-gradient(135deg, #115e59 0%, #0f766e 100%);
}

.dashboard-btn-secondary {
  border-color: #94a3b8;
  color: #334155;
  background: #ffffff;
}

.dashboard-btn-secondary:hover,
.dashboard-btn-secondary:focus {
  border-color: #64748b;
  color: #0f172a;
  background: #f8fafc;
}

@media (max-width: 991.98px) {
  .dashboard-actions {
    width: 100%;
    justify-content: stretch;
  }

  .dashboard-actions .btn {
    flex: 1 1 auto;
  }

  .dashboard-filter-item--compact {
    max-width: none;
  }
}

@media (min-width: 992px) {
  .dashboard-filters-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
  }

  .dashboard-filter-item--project,
  .dashboard-filter-item--team,
  .dashboard-filter-item--date-from,
  .dashboard-filter-item--date-to {
    grid-column: span 3;
    grid-row: 1;
  }

  .dashboard-filter-item--statuses,
  .dashboard-filter-item--activity {
    grid-column: span 6;
    grid-row: 2;
  }

  .dashboard-filters-grid--with-users .dashboard-filter-item--statuses {
    grid-column: 1 / span 4;
    grid-row: 2;
  }

  .dashboard-filters-grid--with-users .dashboard-filter-item--activity {
    grid-column: 5 / span 4;
    grid-row: 2;
  }

  .dashboard-filters-grid--with-users .dashboard-filter-item--users {
    grid-column: 9 / span 4;
    grid-row: 2;
  }

  .dashboard-actions-panel--row {
    grid-row: 3;
  }
}

.metrics-filters-card {
  border-color: #d5deea;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.metrics-filters-grid .metrics-filter-item {
  min-width: 0;
}

@media (min-width: 992px) {
  .metrics-filters-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .metrics-filters-grid .metrics-filter-item--project,
  .metrics-filters-grid .metrics-filter-item--team,
  .metrics-filters-grid .metrics-filter-item--date-from,
  .metrics-filters-grid .metrics-filter-item--date-to {
    grid-column: span 3;
    grid-row: 1;
  }

  .metrics-filters-grid .metrics-filter-item--status-from,
  .metrics-filters-grid .metrics-filter-item--status-to,
  .metrics-filters-grid .metrics-filter-item--activity-type {
    grid-column: span 4;
    grid-row: 2;
  }

  .metrics-filters-grid .dashboard-actions-panel--row {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

