header {
  background: linear-gradient(120deg, #101c35 0%, #172b4d 52%, #203d67 100%);
  box-shadow: 0 8px 24px rgba(10, 24, 48, 0.24);
}

main {
  width: 100%;
  max-width: none;
}

.journal-dashboard {
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(69, 32, 113, 0.12);
  border-radius: 12px;
  background:
    radial-gradient(circle at 94% 5%, rgba(200, 108, 155, 0.12), transparent 30%),
    #fff;
  box-shadow: 0 7px 24px rgba(63, 35, 78, 0.07);
}

.dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.dashboard-tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid rgba(84, 38, 129, 0.13);
}

.dashboard-tab {
  position: relative;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px 7px 0 0;
  color: var(--uralsib-muted);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  transition: color 0.15s ease;
}

.dashboard-tab:hover {
  color: var(--uralsib-deep);
}

.dashboard-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #573879 0%, #75488f 58%, #9a6598 100%);
  font-weight: 700;
}

.dashboard-tab.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 0;
}

.dashboard-heading p,
.dashboard-updated,
.dashboard-empty {
  margin: 0;
  color: var(--uralsib-muted);
  font-size: 13px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.dashboard-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-left: 4px solid var(--uralsib-violet);
  border-radius: 8px;
  background: #f8f4fa;
}

.dashboard-kpi span {
  color: var(--uralsib-muted);
  font-size: 13px;
}

.dashboard-kpi strong {
  color: var(--uralsib-deep);
  font-size: 24px;
  white-space: nowrap;
}

.dashboard-kpi-statuses {
  display: grid;
  width: 100%;
  gap: 10px;
  justify-content: stretch;
  justify-items: stretch;
}

.dashboard-kpi-centered {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  align-content: center;
  justify-content: stretch;
  justify-items: stretch;
}

.dashboard-kpi-centered > span {
  align-self: start;
}

.dashboard-kpi-centered > strong {
  width: 100%;
  font-size: 60px;
  text-align: center;
}

.dashboard-kpi-link {
  color: inherit;
  text-decoration: none;
}

.dashboard-kpi-link:hover,
.dashboard-status-legend a:hover {
  color: var(--uralsib-purple);
}

.dashboard-kpi-total,
.dashboard-status-legend {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-kpi-total {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  gap: 2px;
}

.dashboard-kpi-total strong {
  width: 100%;
  font-size: 60px;
  text-align: center;
}

.dashboard-status-legend {
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.dashboard-status-legend > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--uralsib-muted);
  font-size: 13px;
  text-decoration: none;
}

.dashboard-status-legend b {
  color: var(--uralsib-deep);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.progress-dot {
  background: var(--uralsib-glow);
}

.revision-dot {
  background: #e4a64d;
}

.dashboard-breakdowns {
  display: grid;
  grid-template-columns: minmax(290px, 1.15fr) repeat(3, minmax(205px, 1fr));
  gap: 18px;
}

.dashboard-breakdowns-done {
  grid-template-columns: repeat(4, minmax(205px, 1fr));
}

.dashboard-period-filter {
  display: grid;
  align-content: center;
  gap: 9px;
  height: 150px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #573879 0%, #75488f 56%, #9a6598 100%);
  box-shadow: 0 8px 18px rgba(69, 32, 113, 0.2);
}

.dashboard-period-filter > strong {
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.dashboard-period-filter label {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.dashboard-period-filter select,
.dashboard-period-filter input[type="date"] {
  min-width: 0;
  height: 34px;
  padding: 5px 8px;
  border-color: rgba(84, 38, 129, 0.17);
  border-radius: 7px;
  font-size: 13px;
}

.dashboard-period-filter button {
  justify-self: center;
  width: auto;
  min-width: 96px;
  padding-right: 16px;
  padding-left: 16px;
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.dashboard-period-filter button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dashboard-done-total-card {
  min-height: 150px;
}

.dashboard-period-filter button {
  padding: 7px 10px;
  border-color: rgba(84, 38, 129, 0.2);
  color: var(--uralsib-deep);
  font-size: 13px;
}

.dashboard-summary {
  display: grid;
  align-content: center;
  padding: 12px 14px;
  border-left: 4px solid var(--uralsib-violet);
  border-radius: 8px;
  background: #f8f4fa;
}

.dashboard-summary-head,
.dashboard-summary-row {
  display: grid;
  grid-template-columns: minmax(142px, 1fr) 58px 72px 92px;
  align-items: center;
  border-bottom: 1px solid rgba(84, 38, 129, 0.09);
}

.dashboard-summary-head {
  color: var(--uralsib-muted);
  font-size: 11px;
  text-align: center;
}

.dashboard-summary-head strong {
  color: var(--uralsib-deep);
  font-size: 12px;
}

.dashboard-summary-head > *,
.dashboard-summary-row > * {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
}

.dashboard-summary-head > * + *,
.dashboard-summary-row > * + * {
  border-left: 1px solid rgba(84, 38, 129, 0.07);
}

.dashboard-summary-row:last-child {
  border-bottom: 0;
}

.dashboard-summary-row strong {
  justify-content: flex-start;
  color: var(--uralsib-deep);
  font-size: 13px;
}

.dashboard-summary-row a {
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

.summary-total {
  background: rgba(84, 38, 129, 0.045);
  color: var(--uralsib-deep);
  font-size: 20px !important;
  font-weight: 700 !important;
}

.summary-progress {
  color: #756a7d;
}

.summary-revision {
  color: #8b7a68;
}

.dashboard-summary-row a:hover {
  text-decoration: underline;
}

.dashboard-total-card {
  width: 100%;
  height: 100%;
  min-height: 150px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background:
    radial-gradient(circle at 78% 12%, rgba(220, 164, 201, 0.22), transparent 43%),
    linear-gradient(145deg, #573879 0%, #75488f 55%, #9a6598 100%);
  box-shadow: 0 9px 20px rgba(75, 31, 111, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  text-align: center;
}

.dashboard-summary-total {
  padding: 0;
  border-left: 0;
  background: transparent;
}

.dashboard-total-label {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 600;
}

.dashboard-total-number {
  color: #fff;
  font-size: 52px;
  font-weight: 800;
  line-height: 1.05;
  text-decoration: none;
}

.dashboard-total-number:hover {
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.42);
}

.dashboard-total-components {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 7px;
}

.dashboard-total-components a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  text-decoration: none;
}

.dashboard-total-components a:hover {
  color: #fff;
}

.dashboard-total-components b {
  color: #fff;
  font-size: 15px;
}

.dashboard-total-components .progress-dot {
  background: #eab0db;
}

.dashboard-total-components .revision-dot {
  background: #ffd17a;
}

.dashboard-done-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: stretch;
  border: 1px solid rgba(84, 38, 129, 0.09);
  border-radius: 6px;
  overflow: hidden;
}

.dashboard-done-summary span,
.dashboard-done-summary a {
  min-height: 72px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
}

.dashboard-done-summary span {
  color: var(--uralsib-deep);
  font-size: 14px;
  font-weight: 700;
}

.dashboard-done-summary a {
  justify-content: center;
  border-left: 1px solid rgba(84, 38, 129, 0.07);
  background: rgba(84, 38, 129, 0.045);
  color: var(--uralsib-deep);
  font-size: 28px;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-done-summary a:hover {
  text-decoration: underline;
}

.dashboard-chart {
  display: grid;
  align-content: center;
  padding: 12px 14px;
  border-left: 4px solid var(--uralsib-violet);
  border-radius: 8px;
  background: #f8f4fa;
}

.dashboard-chart h2 {
  margin: 0;
  min-height: 31px;
  display: flex;
  align-items: center;
  padding: 5px 7px;
  border-bottom: 1px solid rgba(84, 38, 129, 0.09);
  color: var(--uralsib-deep);
  font-size: 15px;
}

.dashboard-gradient-list {
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
  height: 150px;
  padding: 8px 14px;
  border-left: 0;
  color: #fff;
  background: linear-gradient(135deg, #573879 0%, #75488f 56%, #9a6598 100%);
  box-shadow: 0 8px 18px rgba(69, 32, 113, 0.2);
}

.dashboard-kpi-list {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.1);
}

.dashboard-gradient-list .dashboard-bar-row {
  grid-template-columns: minmax(0, 1fr) 72px;
  border-bottom-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.dashboard-gradient-list .dashboard-bar-row strong {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 15px;
}

.dashboard-gradient-list h2 {
  justify-content: center;
  min-height: 27px;
  padding: 2px 7px;
  border-bottom-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.dashboard-gradient-list .dashboard-bar-row,
.dashboard-gradient-list .dashboard-bar-label {
  min-height: 31px;
}

.dashboard-gradient-list .dashboard-bar-label {
  padding-top: 3px;
  padding-bottom: 3px;
}

.dashboard-gradient-list .dashboard-bar-row:hover .dashboard-bar-label {
  color: #fff;
  text-decoration: underline;
}

.dashboard-gradient-list .dashboard-empty {
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
}

/* Outline KPI theme */
.dashboard-total-card,
.dashboard-period-filter,
.dashboard-gradient-list {
  border: 1px solid rgba(84, 38, 129, 0.24);
  color: var(--uralsib-deep);
  background: #fff;
  box-shadow: 0 6px 16px rgba(75, 31, 111, 0.08);
}

.dashboard-total-label,
.dashboard-total-components a,
.dashboard-period-filter label,
.dashboard-gradient-list .dashboard-bar-row {
  color: var(--uralsib-purple);
}

.dashboard-total-number,
.dashboard-total-number:hover,
.dashboard-period-filter > strong,
.dashboard-gradient-list h2,
.dashboard-gradient-list .dashboard-bar-row strong {
  color: var(--uralsib-deep);
}

.dashboard-total-number:hover {
  text-shadow: 0 0 14px rgba(84, 38, 129, 0.16);
}

.dashboard-period-filter button {
  border-color: rgba(84, 38, 129, 0.28);
  color: var(--uralsib-deep);
  background: #fff;
}

.dashboard-period-filter button:hover {
  background: #f4edf8;
}

.dashboard-gradient-list h2,
.dashboard-gradient-list .dashboard-bar-row {
  border-bottom-color: rgba(84, 38, 129, 0.14);
}

.dashboard-gradient-list .dashboard-bar-row strong {
  border-left-color: rgba(84, 38, 129, 0.12);
}

.dashboard-gradient-list .dashboard-bar-row:hover .dashboard-bar-label {
  color: var(--uralsib-deep);
}

.dashboard-gradient-list .dashboard-empty {
  color: var(--uralsib-muted);
}

.dashboard-kpi-list {
  scrollbar-color: rgba(84, 38, 129, 0.45) rgba(84, 38, 129, 0.08);
}

.dashboard-period-filter > strong,
.dashboard-gradient-list h2,
.dashboard-total-label {
  color: var(--uralsib-purple);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
}

.dashboard-period-filter button {
  justify-self: end;
  margin-right: 12px;
  transform: translateY(-3px);
}

.dashboard-total-components a,
.dashboard-total-components a:hover,
.dashboard-total-components b {
  color: var(--uralsib-purple);
}

.dashboard-total-components a {
  padding: 3px 7px;
  border-radius: 7px;
}

.dashboard-total-components a:hover,
.dashboard-total-components a.selected {
  background: #f2ebf5;
}

.dashboard-total-components a.selected {
  box-shadow: inset 0 0 0 1px rgba(84, 38, 129, 0.2);
}

.dashboard-gradient-list .dashboard-bar-row.selected {
  color: var(--uralsib-deep);
  background: #f2ebf5;
  box-shadow: inset 3px 0 0 var(--uralsib-violet);
}

.dashboard-gradient-list .dashboard-bar-row.selected strong {
  background: rgba(84, 38, 129, 0.06);
}

.dashboard-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  min-height: 31px;
  border-bottom: 1px solid rgba(84, 38, 129, 0.09);
  color: var(--uralsib-text);
  text-decoration: none;
}

.dashboard-bar-row:last-of-type {
  border-bottom: 0;
}

.dashboard-bar-row:hover .dashboard-bar-label {
  color: var(--uralsib-purple);
}

.dashboard-bar-label {
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 7px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar-track {
  display: none;
}

.dashboard-bar-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--uralsib-glow);
}

.dashboard-bar-row strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 5px 7px;
  border-left: 1px solid rgba(84, 38, 129, 0.07);
  background: rgba(84, 38, 129, 0.045);
  color: var(--uralsib-deep);
  font-size: 16px;
  text-align: center;
}

.dashboard-rail {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.dashboard-rail-total {
  min-height: 168px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 5px;
  padding: 18px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--uralsib-deep), var(--uralsib-glow));
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 18px rgba(84, 38, 129, 0.18);
}

.dashboard-rail-total span {
  font-size: 14px;
}

.dashboard-rail-total a {
  color: #fff;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.dashboard-rail-total a:hover {
  text-decoration: underline;
}

.dashboard-rail-content {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.dashboard-rail-statuses {
  display: grid;
  grid-template-columns: 1.65fr 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(84, 38, 129, 0.12);
  border-radius: 10px;
  background: #faf7fb;
}

.dashboard-rail-statuses > * {
  min-height: 68px;
  padding: 11px 14px;
  border-right: 1px solid rgba(84, 38, 129, 0.1);
}

.dashboard-rail-statuses > *:last-child {
  border-right: 0;
}

.dashboard-rail-status-main {
  display: grid;
  align-content: center;
  gap: 8px;
}

.dashboard-rail-status-main > span:first-child,
.dashboard-rail-statuses > a > span {
  color: var(--uralsib-muted);
  font-size: 12px;
}

.dashboard-rail-status-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
}

.dashboard-rail-status-links a {
  color: var(--uralsib-text);
  font-size: 13px;
  text-decoration: none;
}

.dashboard-rail-status-links b {
  margin-left: 4px;
  color: var(--uralsib-deep);
  font-size: 17px;
}

.dashboard-rail-statuses > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  align-items: center;
  gap: 2px 8px;
  color: var(--uralsib-text);
  text-decoration: none;
}

.dashboard-rail-statuses > a strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--uralsib-deep);
  font-size: 26px;
}

.dashboard-rail-statuses > a small {
  color: var(--uralsib-muted);
  font-size: 11px;
}

.dashboard-rail-statuses a:hover,
.dashboard-rail-status-links a:hover {
  color: var(--uralsib-purple);
}

.dashboard-rail-breakdowns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-rail-breakdowns .dashboard-chart {
  align-content: start;
  padding: 0 0 7px;
  border: 0;
  border-bottom: 2px solid rgba(151, 71, 159, 0.45);
  border-radius: 0;
  background: transparent;
}

.dashboard-rail-breakdowns .dashboard-chart h2 {
  min-height: auto;
  margin-bottom: 3px;
  padding: 0 0 6px;
  border: 0;
  font-size: 14px;
}

.dashboard-rail-breakdowns .dashboard-bar-row {
  grid-template-columns: minmax(0, 1fr) 38px;
  min-height: 27px;
  border-bottom-color: rgba(84, 38, 129, 0.07);
}

.dashboard-rail-breakdowns .dashboard-bar-label,
.dashboard-rail-breakdowns .dashboard-bar-row strong {
  min-height: 27px;
  padding-top: 3px;
  padding-bottom: 3px;
}

.dashboard-period-filter-horizontal {
  grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) minmax(190px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(84, 38, 129, 0.12);
  border-radius: 10px;
  background: #faf7fb;
}

.dashboard-period-filter-horizontal label {
  grid-template-columns: auto minmax(0, 1fr);
}

.dashboard-period-filter-horizontal button {
  white-space: nowrap;
}

.filters.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.toolbar-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 260px;
}

.toolbar-search input {
  width: 100%;
  padding-right: 42px;
}

.toolbar-search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--uralsib-muted);
  font-size: 22px;
  line-height: 1;
  background: transparent;
  transform: translateY(-50%);
}

.toolbar-search-clear:hover {
  color: var(--uralsib-deep);
  background: #f2ebf5;
}

.toolbar-search-clear[hidden] {
  display: none;
}

.toolbar-add {
  flex: 0 0 auto;
  white-space: nowrap;
}

.toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.toolbar .primary {
  white-space: nowrap;
}

.export-button {
  white-space: nowrap;
}

.journal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.filter-sidebar {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.filter-sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.filter-sidebar-heading h2 {
  margin: 0;
  font-size: 18px;
}

.filter-sidebar-heading a {
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-5px);
}

.column-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7f2fa;
  color: #542681;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.journal-table-column {
  min-width: 0;
}

.toolbar-column-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--uralsib-border);
  border-radius: 8px;
  background: #fff;
  color: var(--uralsib-deep);
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
}

.toolbar-column-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.column-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #cfc4d8;
  transition: background .2s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(45, 23, 58, .25);
  transition: transform .2s ease;
}

.column-switch input:checked + .switch-track,
.toolbar-column-switch input:checked + .switch-track {
  background: #65369a;
}

.column-switch input:checked + .switch-track::after,
.toolbar-column-switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

.column-switch input:focus-visible + .switch-track,
.toolbar-column-switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(134, 87, 181, .2);
}

.filter-sidebar details {
  margin-top: 9px;
}

.date-range {
  max-height: none;
}

.filter-options.date-range label {
  display: grid;
  gap: 5px;
  font-weight: 600;
}

.date-range input[type="date"] {
  width: 100%;
  height: 34px;
  padding: 5px 8px;
}

.filter-sidebar summary {
  padding: 10px 12px;
  border: 1px solid #ded5e7;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.filter-sidebar details[open] summary,
.filter-sidebar details.has-selection summary {
  border-color: #8657b5;
  color: #542681;
}

.filter-options {
  display: grid;
  max-height: 170px;
  gap: 8px;
  overflow-y: auto;
  margin-top: 5px;
  padding: 10px;
  border: 1px solid #e8e0ec;
  border-radius: 8px;
  background: #faf8fb;
}

.filter-search {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 34px;
  padding: 6px 9px;
  background: #fff;
}

.filter-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.25;
  cursor: pointer;
}

.filter-options label[hidden] {
  display: none;
}

.filter-options input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: #65369a;
}

.filter-options small {
  color: #746b7c;
}

.filter-apply {
  width: 100%;
  margin-top: 16px;
}

.underwriting-table {
  overflow-x: auto;
}

.underwriting-table .extended-column {
  display: none;
}

.underwriting-table.show-all-columns .extended-column {
  display: table-cell;
}

.underwriting-table table {
  width: max-content;
  min-width: 100%;
}

.underwriting-table th {
  max-width: 220px;
  white-space: normal;
}

.underwriting-table td {
  max-width: 280px;
  white-space: nowrap;
}

.underwriting-table .actions-cell {
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -8px 0 12px rgba(16, 28, 53, 0.06);
}

.form-card {
  max-width: 1100px;
}

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.form-heading p {
  margin: 0;
  color: #667085;
}

.form-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 10px;
  background: #eef2f7;
}

.form-tab {
  flex: 1 0 auto;
  border: 0;
  padding: 11px 16px;
  background: transparent;
  color: #526078;
  font-weight: 600;
}

.form-tab.active {
  background: #fff;
  color: #172b4d;
  box-shadow: 0 2px 8px rgba(16, 28, 53, 0.1);
}

.tab-panel {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

.tab-panel.active {
  display: grid;
}

.tab-panel label {
  display: grid;
  gap: 7px;
  align-content: start;
  font-weight: 600;
}

.tab-panel .wide-field,
.single-panel label {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #e3e7ef;
}

.application-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.application-form .errorlist,
.application-form .actions,
.application-form > p {
  grid-column: 1 / -1;
}

.application-form label:has(textarea) {
  grid-column: 1 / -1;
}

@media (max-width: 800px) {
  .dashboard-rail {
    grid-template-columns: 1fr;
  }

  .dashboard-rail-total {
    min-height: 125px;
  }

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

  .dashboard-period-filter-horizontal {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-breakdowns {
    grid-template-columns: 1fr;
  }

  .filters.toolbar {
    flex-wrap: wrap;
  }

  .toolbar-search {
    flex: 1 1 100%;
    max-width: none;
  }

  .toolbar-actions {
    flex: 1 1 100%;
  }

  .toolbar-column-switch {
    width: 100%;
  }

  .toolbar select,
  .toolbar button {
    width: 100%;
  }

  .journal-layout {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: static;
  }

  .application-form {
    grid-template-columns: 1fr;
  }

  .form-heading {
    flex-direction: column;
  }

  .tab-panel {
    grid-template-columns: 1fr;
  }

  .tab-panel .wide-field,
  .single-panel label {
    grid-column: auto;
  }

  .application-form label:has(textarea) {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .dashboard-rail-statuses,
  .dashboard-rail-breakdowns,
  .dashboard-period-filter-horizontal {
    grid-template-columns: 1fr;
  }

  .dashboard-rail-statuses > * {
    border-right: 0;
    border-bottom: 1px solid rgba(84, 38, 129, 0.1);
  }

  .dashboard-rail-statuses > *:last-child {
    border-bottom: 0;
  }

  .journal-dashboard {
    padding: 18px;
  }

  .dashboard-heading {
    display: block;
  }

  .dashboard-updated {
    display: block;
    margin-top: 6px;
  }

  .dashboard-kpis {
    grid-template-columns: 1fr;
  }

  .filters.toolbar {
    display: grid;
  }

  .toolbar-search,
  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar-add {
    width: 100%;
    text-align: center;
  }
}
