/* ShiftFlow v0.9 – lebendiges Dashboard */

.dashboard-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 18px auto 18px 18px;
  z-index: 50;
  width: 230px;
  padding: 22px;
  border: 1px solid var(--app-border);
  border-radius: 28px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  backdrop-filter: blur(22px);
}

.app-sidebar nav {
  display: grid;
  gap: 7px;
  margin-top: 34px;
}

.app-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding-inline: 14px;
  border-radius: 14px;
  color: var(--app-text-soft);
  font-size: 13px;
  font-weight: 700;
}

.app-sidebar nav a.active,
.app-sidebar nav a:hover {
  color: var(--app-text);
  background: var(--app-surface-2);
}

.app-sidebar nav span {
  width: 22px;
  text-align: center;
}

.sidebar-logout {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  min-height: 44px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  cursor: pointer;
  color: var(--app-text-soft);
  background: var(--app-surface-2);
  font-weight: 700;
}

.app-main {
  width: calc(100% - 266px);
  margin-left: 266px;
  padding: 34px 34px 80px;
}

.app-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.app-topbar h1 {
  margin: 8px 0 6px;
  font-size: clamp(42px, 5vw, 66px);
  letter-spacing: -.06em;
}

.app-topbar p {
  margin: 0;
  color: var(--app-text-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-shortcut {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.dashboard-widget {
  padding: 24px;
  border: 1px solid var(--app-border);
  border-radius: 28px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  backdrop-filter: blur(20px);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.45fr repeat(2, .72fr);
  gap: 14px;
  margin-top: 32px;
}

.next-shift-widget {
  grid-row: span 2;
  display: flex;
  min-height: 330px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--accent-b) 24%, transparent), transparent 35%),
    var(--app-surface) !important;
}

.next-shift-main h2 {
  margin: 18px 0 8px;
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: -.06em;
}

.next-shift-main > p {
  margin: 0;
  color: var(--app-text-soft);
}

.countdown-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  padding: 13px 16px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-surface-2);
}

.countdown-box small {
  color: var(--app-text-faint);
  text-transform: uppercase;
}

.countdown-box strong {
  font-size: 18px;
}

.next-shift-circle {
  display: grid;
  width: 150px;
  height: 150px;
  flex: 0 0 auto;
  place-content: center;
  text-align: center;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-2);
  box-shadow: inset 0 0 45px color-mix(in srgb, var(--accent-b) 12%, transparent);
}

.next-shift-circle strong,
.next-shift-circle span {
  display: block;
}

.next-shift-circle strong {
  font-size: 29px;
}

.next-shift-circle span {
  margin-top: 5px;
  color: var(--app-text-faint);
}

.overview-metric {
  min-height: 156px;
}

.overview-metric small,
.overview-metric strong {
  display: block;
}

.overview-metric small {
  color: var(--app-text-faint);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-metric > strong {
  margin-top: 12px;
  font-size: 29px;
  letter-spacing: -.04em;
}

.overview-metric p {
  margin: 10px 0 0;
  color: var(--app-text-soft);
  font-size: 11px;
  line-height: 1.45;
}

.metric-progress {
  height: 7px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--app-surface-2);
}

.metric-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  transition: width 850ms var(--ease-soft);
}

.vacation-progress i {
  background: linear-gradient(90deg, #54d49a, #82e6b9);
}

.salary-progress i {
  background: linear-gradient(90deg, #ff9f55, #ffca6b);
}

.dashboard-content-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 18px;
  margin-top: 18px;
}

.week-widget {
  grid-column: 1 / -1;
}

.widget-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.widget-heading small,
.widget-heading strong {
  display: block;
}

.widget-heading small {
  color: var(--app-text-faint);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.widget-heading strong {
  margin-top: 7px;
  font-size: 23px;
}

.widget-heading a {
  color: var(--accent-a);
  font-size: 12px;
  font-weight: 800;
}

.week-list {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.week-list article {
  min-height: 122px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: 17px;
  background: var(--app-surface-2);
}

.week-list small,
.week-list strong,
.week-list span {
  display: block;
}

.week-list small {
  color: var(--app-text-faint);
  text-transform: uppercase;
}

.week-list strong {
  margin-top: 8px;
  font-size: 23px;
}

.week-list span {
  margin-top: 14px;
  font-size: 11px;
  font-weight: 800;
}

.week-list em {
  display: block;
  margin-top: 6px;
  color: var(--app-text-soft);
  font-size: 9px;
  font-style: normal;
}

.week-list article[data-type="early"] { background: linear-gradient(180deg, color-mix(in srgb, #5da9ff 12%, var(--app-surface-2)), var(--app-surface-2)); }
.week-list article[data-type="late"] { background: linear-gradient(180deg, color-mix(in srgb, #ff9f55 12%, var(--app-surface-2)), var(--app-surface-2)); }
.week-list article[data-type="night"] { background: linear-gradient(180deg, color-mix(in srgb, #9b61ff 14%, var(--app-surface-2)), var(--app-surface-2)); }
.week-list article[data-type="vacation"] { background: linear-gradient(180deg, color-mix(in srgb, #54d49a 12%, var(--app-surface-2)), var(--app-surface-2)); }

.distribution-widget {
  min-height: 390px;
}

.distribution-chart {
  display: grid;
  place-items: center;
  margin-top: 24px;
}

.chart-ring {
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  border-radius: 999px;
  background:
    conic-gradient(
      #5da9ff 0 var(--early-end, 0%),
      #ff9f55 var(--early-end, 0%) var(--late-end, 0%),
      #9b61ff var(--late-end, 0%) var(--night-end, 0%),
      #9aa1ad var(--night-end, 0%) 100%
    );
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}

.chart-center {
  display: grid;
  width: 116px;
  height: 116px;
  place-content: center;
  text-align: center;
  border-radius: 999px;
  background: var(--app-surface);
}

.chart-center strong,
.chart-center small {
  display: block;
}

.chart-center strong {
  font-size: 34px;
}

.chart-center small {
  color: var(--app-text-faint);
}

.chart-legend {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.chart-legend div {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-legend i.early { background: #5da9ff; }
.chart-legend i.late { background: #ff9f55; }
.chart-legend i.night { background: #9b61ff; }
.chart-legend i.off { background: #9aa1ad; }

.chart-legend span {
  color: var(--app-text-soft);
}

.quick-actions {
  min-height: 390px;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.quick-action-grid a {
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: var(--app-surface-2);
  transition: transform var(--motion-fast) var(--ease-apple);
}

.quick-action-grid a:hover {
  transform: translateY(-3px);
}

.quick-action-grid span,
.quick-action-grid strong,
.quick-action-grid small {
  display: block;
}

.quick-action-grid span {
  color: var(--accent-b);
  font-size: 22px;
}

.quick-action-grid strong {
  margin-top: 14px;
}

.quick-action-grid small {
  margin-top: 5px;
  color: var(--app-text-soft);
}

.insight-widget {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.insight-widget strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
}

.insight-widget p {
  margin: 7px 0 0;
  color: var(--app-text-soft);
}

@media (max-width: 1180px) {
  .overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .next-shift-widget {
    grid-column: 1 / -1;
    grid-row: auto;
  }

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

  .week-widget,
  .insight-widget {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .app-sidebar {
    width: 82px;
    padding: 18px 12px;
  }

  .app-sidebar .brand span:last-child,
  .app-sidebar nav a {
    font-size: 0;
  }

  .app-sidebar nav a {
    justify-content: center;
  }

  .sidebar-logout {
    font-size: 0;
  }

  .sidebar-logout::after {
    content: "↪";
    font-size: 18px;
  }

  .app-main {
    width: calc(100% - 118px);
    margin-left: 118px;
  }

  .week-widget {
    overflow-x: auto;
  }

  .week-list {
    min-width: 760px;
  }
}

@media (max-width: 760px) {
  .app-sidebar {
    position: fixed;
    inset: auto 12px 12px 12px;
    width: auto;
    height: 70px;
    padding: 8px;
  }

  .app-sidebar .brand,
  .sidebar-logout {
    display: none;
  }

  .app-sidebar nav {
    grid-template-columns: repeat(7, 1fr);
    margin: 0;
  }

  .app-sidebar nav a {
    min-height: 52px;
  }

  .app-main {
    width: 100%;
    margin-left: 0;
    padding: 24px 16px 110px;
  }

  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .button {
    flex: 1;
  }

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

  .next-shift-widget {
    align-items: flex-start;
  }

  .next-shift-circle {
    width: 105px;
    height: 105px;
  }
}
