:root {
  --dashboard-sidebar-width: 64px;
  --dashboard-bg: #f3f5f7;
  --dashboard-card: #ffffff;
  --dashboard-text: #182230;
  --dashboard-muted: #667085;
  --dashboard-border: #e4e7ec;
  --dashboard-primary: #2563eb;
  --dashboard-success: #12b76a;
  --dashboard-warning: #f79009;
  --dashboard-danger: #f04438;
  --dashboard-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

body.theme-dark {
  --dashboard-bg: #0f172a;
  --dashboard-card: #172033;
  --dashboard-text: #f8fafc;
  --dashboard-muted: #9aa8bc;
  --dashboard-border: #2a3850;
  --dashboard-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

body[data-authenticated="false"] .app-sidebar,
body[data-authenticated="false"] .dashboard-page,
body[data-authenticated="false"] .dashboard-mobile-menu,
body.hide-schedule-until-auth .app-sidebar,
body.hide-schedule-until-auth .dashboard-page,
body.hide-schedule-until-auth .dashboard-mobile-menu,
body.auth-modal-open .app-sidebar,
body.auth-modal-open .dashboard-page,
body.auth-modal-open .dashboard-mobile-menu {
  display: none !important;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1100;
  width: var(--dashboard-sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 16px 8px;
  box-sizing: border-box;
  background: #111827;
  color: #d1d5db;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.app-sidebar-brand {
  min-height: 48px;
  display: grid;
  grid-template-columns: 32px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 0 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.app-sidebar button {
  font: inherit;
}

.app-sidebar-account > button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #9ca3af;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.app-sidebar-account > button:hover,
.app-sidebar-account > button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.app-sidebar svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.app-sidebar-nav {
  display: grid;
  gap: 4px;
  padding: 20px 0;
}

.app-sidebar-nav button {
  position: relative;
  min-height: 40px;
  display: grid;
  grid-template-columns: 24px;
  justify-content: center;
  align-items: center;
  padding: 0;
  color: #b8c0cd;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.app-sidebar-nav button:hover,
.app-sidebar-nav button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.app-sidebar-nav button.is-active {
  color: #fff;
  background: #253147;
  border-color: rgba(255, 255, 255, 0.07);
}

.app-sidebar-nav button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 1200;
  padding: 6px 8px;
  color: #f9fafb;
  background: #273244;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity 120ms ease, transform 120ms ease;
}

.app-sidebar-nav button:hover::after,
.app-sidebar-nav button:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.app-sidebar-account {
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar-avatar,
.dashboard-profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: #2563eb;
  border-radius: 8px;
  font-weight: 750;
}

.app-sidebar-avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.app-sidebar-account > button {
  grid-column: 1;
}

.dashboard-page {
  min-height: 100vh;
  margin-left: var(--dashboard-sidebar-width);
  padding: 28px 32px 40px;
  box-sizing: border-box;
  color: var(--dashboard-text);
  background: var(--dashboard-bg);
  transition: margin-left 160ms ease;
}

body[data-app-view="schedule"] .dashboard-page {
  display: none;
}

body[data-app-view="dashboard"] .header,
body[data-app-view="dashboard"] .filter-panel,
body[data-app-view="dashboard"] .grid-wrapper,
body[data-app-view="dashboard"] .mobile-agenda,
body[data-app-view="dashboard"] .dashboard-schedule-filter,
body[data-app-view="settings"] .header,
body[data-app-view="settings"] .filter-panel,
body[data-app-view="settings"] .grid-wrapper,
body[data-app-view="settings"] .mobile-agenda,
body[data-app-view="settings"] .dashboard-schedule-filter {
  display: none !important;
}

body[data-app-view="post-production"] .header,
body[data-app-view="post-production"] .filter-panel,
body[data-app-view="post-production"] .grid-wrapper,
body[data-app-view="post-production"] .mobile-agenda,
body[data-app-view="post-production"] .dashboard-schedule-filter {
  display: none !important;
}

body[data-app-view="schedule"] .header,
body[data-app-view="schedule"] .filter-panel,
body[data-app-view="schedule"] .grid-wrapper,
body[data-app-view="schedule"] .mobile-agenda,
body[data-app-view="schedule"] .dashboard-schedule-filter {
  margin-left: var(--dashboard-sidebar-width);
  width: calc(100% - var(--dashboard-sidebar-width));
  box-sizing: border-box;
  transition: margin-left 160ms ease, width 160ms ease;
}

.dashboard-view,
.dashboard-settings-view,
.post-production-view {
  width: min(100%, 1480px);
  margin: 0 auto;
}

body[data-app-view="dashboard"] [data-dashboard-section="settings"],
body[data-app-view="settings"] [data-dashboard-section="dashboard"],
body:not([data-app-view="post-production"]) [data-dashboard-section="post-production"],
body[data-app-view="post-production"] [data-dashboard-section="dashboard"],
body[data-app-view="post-production"] [data-dashboard-section="settings"],
body[data-app-view="post-production"] [data-dashboard-section="callsheet"] {
  display: none !important;
}

.dashboard-topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-brand-panel {
  display: none;
}

.dashboard-greeting-panel {
  min-width: 0;
}

.dashboard-eyebrow {
  margin: 0 0 6px;
  color: var(--dashboard-primary) !important;
  font-size: 12px !important;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-topbar h1 {
  margin: 0;
  color: var(--dashboard-text);
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.dashboard-topbar p:last-child {
  margin: 7px 0 0;
  color: var(--dashboard-muted);
  font-size: 14px;
}

.dashboard-heading-tools {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.dashboard-live-datetime {
  height: auto;
  display: none;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  color: var(--dashboard-text);
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-border);
  border-radius: 9px;
  box-shadow: var(--dashboard-shadow);
  box-sizing: border-box;
}

.dashboard-live-date,
.dashboard-live-time {
  min-width: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 5px 8px;
  text-align: center;
}

.dashboard-live-time {
  border-left: 1px solid var(--dashboard-border);
}

.dashboard-live-datetime span {
  color: var(--dashboard-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.dashboard-live-date strong {
  color: var(--dashboard-text);
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.dashboard-live-time strong {
  color: var(--dashboard-text);
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.dashboard-topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-icon-button,
.dashboard-profile-button {
  height: 40px;
  color: var(--dashboard-text);
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-border);
  border-radius: 8px;
  box-shadow: var(--dashboard-shadow);
  cursor: pointer;
}

.dashboard-icon-button {
  position: relative;
  width: 40px;
  display: grid;
  place-items: center;
  padding: 0;
}

.dashboard-icon-button svg {
  width: 18px;
  height: 18px;
}

.dashboard-icon-button:hover,
.dashboard-icon-button:focus-visible,
.dashboard-profile-button:hover,
.dashboard-profile-button:focus-visible {
  border-color: #9db7ea;
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.dashboard-notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background: var(--dashboard-danger);
  border: 2px solid var(--dashboard-card);
  border-radius: 50%;
}

.dashboard-profile-button {
  min-width: 176px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  padding: 4px 10px;
  text-align: left;
}

.dashboard-profile-avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.dashboard-profile-button > span:first-child {
  min-width: 0;
  display: grid;
}

.dashboard-profile-button strong,
.dashboard-profile-button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-profile-button strong {
  color: var(--dashboard-text);
  font-size: 12px;
}

.dashboard-profile-button small {
  color: var(--dashboard-muted);
  font-size: 10px;
}

.dashboard-profile-menu {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 20;
  width: 180px;
  padding: 6px;
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12);
}

.dashboard-profile-menu button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  color: var(--dashboard-text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.dashboard-profile-menu button:hover,
.dashboard-profile-menu button:focus-visible {
  background: var(--dashboard-bg);
  outline: none;
}

.dashboard-profile-menu svg {
  width: 16px;
  height: 16px;
}

.dashboard-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-metric-card,
.dashboard-card {
  color: var(--dashboard-text);
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-border);
  border-radius: 9px;
  box-shadow: var(--dashboard-shadow);
}

.dashboard-metric-card {
  min-height: 152px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "value value"
    "note note";
  align-items: center;
  gap: 4px 12px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
}

.dashboard-metric-card:hover,
.dashboard-metric-card:focus-visible {
  transform: translateY(-1px);
  border-color: #a9bce0;
  box-shadow: 0 5px 14px rgba(16, 24, 40, 0.07);
  outline: none;
}

.dashboard-metric-icon {
  grid-area: icon;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--dashboard-primary);
  background: rgba(37, 99, 235, 0.09);
  border-radius: 8px;
}

.dashboard-metric-icon.success {
  color: var(--dashboard-success);
  background: rgba(18, 183, 106, 0.09);
}

.dashboard-metric-icon.warning {
  color: var(--dashboard-warning);
  background: rgba(247, 144, 9, 0.1);
}

.dashboard-metric-icon.option {
  color: #7f56d9;
  background: rgba(127, 86, 217, 0.09);
}

.dashboard-metric-icon.confirmed {
  color: #0e7490;
  background: rgba(14, 116, 144, 0.09);
}

.dashboard-metric-icon.danger {
  color: var(--dashboard-danger);
  background: rgba(240, 68, 56, 0.09);
}

.dashboard-metric-icon svg {
  width: 19px;
  height: 19px;
}

.dashboard-metric-label {
  grid-area: label;
  color: var(--dashboard-muted);
  font-size: 13px;
  font-weight: 650;
}

.dashboard-metric-card > strong {
  grid-area: value;
  margin-top: 6px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.dashboard-metric-card > small {
  grid-area: note;
  color: var(--dashboard-muted);
  font-size: 11px;
}

.dashboard-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.7fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(240px, 0.7fr);
  gap: 16px;
}

.dashboard-card {
  min-width: 0;
  padding: 18px;
}

.dashboard-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--dashboard-border);
}

.dashboard-card-head span {
  color: var(--dashboard-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-card-head h2 {
  margin: 0;
  color: var(--dashboard-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.dashboard-card-period {
  padding: 5px 8px;
  color: var(--dashboard-muted) !important;
  background: var(--dashboard-bg);
  border-radius: 6px;
  font-size: 10px !important;
}

.dashboard-text-button {
  padding: 4px 0;
  color: var(--dashboard-primary);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-line-chart {
  min-height: 230px;
}

.dashboard-line-chart svg {
  width: 100%;
  height: 230px;
  display: block;
  overflow: visible;
}

.dashboard-chart-grid-line {
  stroke: var(--dashboard-border);
  stroke-width: 1;
}

.dashboard-chart-area {
  fill: rgba(37, 99, 235, 0.08);
}

.dashboard-chart-line {
  fill: none;
  stroke: var(--dashboard-primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-chart-point {
  fill: var(--dashboard-card);
  stroke: var(--dashboard-primary);
  stroke-width: 2;
}

.dashboard-chart-label {
  fill: var(--dashboard-muted);
  font-size: 11px;
}

.dashboard-chart-value {
  fill: var(--dashboard-text);
  font-size: 10px;
  font-weight: 700;
}

.dashboard-month-color-segment {
  cursor: pointer;
  stroke: var(--dashboard-card);
  stroke-width: 0.65;
  opacity: 0.92;
  transform-box: fill-box;
  transform-origin: center;
  transition: filter 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.dashboard-month-color-segment:hover,
.dashboard-month-color-segment:focus-visible {
  filter: brightness(0.96) saturate(1.08);
  opacity: 1;
  outline: none !important;
  stroke: var(--dashboard-card);
  stroke-width: 1;
  transform: scaleX(1.14);
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-month-color-segment {
    transition: none;
  }
}

.dashboard-donut-layout {
  min-height: 230px;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.dashboard-donut {
  position: relative;
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
}

.dashboard-donut svg {
  width: 138px;
  height: 138px;
  transform: rotate(-90deg);
}

.dashboard-donut-center {
  position: absolute;
  display: grid;
  text-align: center;
}

.dashboard-donut-center strong {
  font-size: 24px;
}

.dashboard-donut-center span {
  color: var(--dashboard-muted);
  font-size: 10px;
}

.dashboard-status-legend {
  display: grid;
  gap: 10px;
}

.dashboard-status-legend button {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 4px;
  color: var(--dashboard-muted);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}

.dashboard-status-legend button:hover,
.dashboard-status-legend button:focus-visible {
  background: var(--dashboard-bg);
  border-color: var(--dashboard-border);
  outline: 2px solid rgba(37, 99, 235, 0.18);
}

.dashboard-status-legend i {
  width: 8px;
  height: 8px;
  background: var(--legend-color);
  border-radius: 50%;
}

.dashboard-status-legend b {
  color: var(--dashboard-text);
  font-size: 12px;
}

.dashboard-list {
  min-height: 218px;
  display: grid;
  align-content: start;
}

.dashboard-list-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  color: var(--dashboard-text);
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--dashboard-border);
  cursor: pointer;
}

.dashboard-list-row:first-child {
  border-top: 0;
  padding-top: 2px;
}

.dashboard-list-row:hover strong,
.dashboard-list-row:focus-visible strong {
  color: var(--dashboard-project-title-color, var(--dashboard-primary));
}

.dashboard-list-row:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.dashboard-list-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.dashboard-list-main strong,
.dashboard-list-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-list-main strong {
  color: var(--dashboard-project-title-color, var(--dashboard-text));
  font-size: 12px;
}

.dashboard-list-main span {
  color: var(--dashboard-muted);
  font-size: 10px;
}

.dashboard-task-preview-card small span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.45;
}

.dashboard-task-preview-card > em {
  margin: 2px 0 0;
  color: var(--dashboard-primary);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.dashboard-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  color: var(--dashboard-muted);
  background: var(--dashboard-bg);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.dashboard-status-badge.completed { color: var(--dashboard-success); }
.dashboard-status-badge.confirmed { color: var(--dashboard-primary); }
.dashboard-status-badge.pending { color: var(--dashboard-warning); }
.dashboard-status-badge.optional_pending { color: #7f56d9; }

.dashboard-color-projects-modal {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

.dashboard-color-projects-modal.hidden {
  display: none !important;
}

body.dashboard-color-projects-open {
  overflow: hidden;
}

.dashboard-color-projects-dialog {
  width: min(720px, 100%);
  max-height: min(78vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--dashboard-text);
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-border);
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
}

.dashboard-color-projects-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--dashboard-border);
}

.dashboard-color-projects-head h2 {
  margin: 3px 0 4px;
  font-size: 20px;
  line-height: 1.25;
}

.dashboard-color-projects-head p,
.dashboard-color-projects-kicker {
  margin: 0;
  color: var(--dashboard-muted);
  font-size: 12px;
}

.dashboard-color-projects-kicker {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-color-projects-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--dashboard-muted);
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-border);
  border-radius: 8px;
  cursor: pointer;
}

.dashboard-color-projects-close:hover,
.dashboard-color-projects-close:focus-visible {
  color: var(--dashboard-text);
  background: var(--dashboard-bg);
  outline: 2px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.dashboard-color-projects-close svg {
  width: 18px;
  height: 18px;
}

.dashboard-color-projects-list {
  min-height: 120px;
  overflow-y: auto;
  padding: 8px 24px 18px;
}

.dashboard-color-project-link {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  color: var(--dashboard-text);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--dashboard-border);
  cursor: pointer;
}

.dashboard-color-project-link:last-child {
  border-bottom: 0;
}

.dashboard-color-project-link:hover strong,
.dashboard-color-project-link:focus-visible strong {
  color: var(--dashboard-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dashboard-color-project-link:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: -2px;
}

.dashboard-color-project-link > svg {
  width: 16px;
  height: 16px;
  color: var(--dashboard-muted);
}

.dashboard-color-project-dot {
  width: 9px;
  height: 9px;
  background: var(--project-color);
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 50%;
}

.dashboard-color-project-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.dashboard-color-project-copy strong,
.dashboard-color-project-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-color-project-copy strong {
  font-size: 13px;
}

.dashboard-color-project-copy span {
  color: var(--dashboard-muted);
  font-size: 11px;
}

.dashboard-empty,
.dashboard-error {
  min-height: 190px;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--dashboard-muted);
  text-align: center;
  font-size: 12px;
}

.dashboard-error {
  color: var(--dashboard-danger);
}

.dashboard-quick-actions {
  display: grid;
  gap: 9px;
}

.dashboard-quick-actions button,
.dashboard-theme-options button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: var(--dashboard-text);
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-quick-actions button.primary {
  color: #fff;
  background: var(--dashboard-primary);
  border-color: var(--dashboard-primary);
}

.dashboard-quick-actions button:hover,
.dashboard-quick-actions button:focus-visible,
.dashboard-theme-options button:hover,
.dashboard-theme-options button:focus-visible {
  border-color: #9db7ea;
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.dashboard-quick-actions svg,
.dashboard-theme-options svg {
  width: 16px;
  height: 16px;
}

.dashboard-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-theme-options button.is-active {
  color: var(--dashboard-primary);
  border-color: var(--dashboard-primary);
  background: rgba(37, 99, 235, 0.06);
}

.dashboard-schedule-filter {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 16px;
  color: #1e3a8a;
  background: #eff6ff;
  border-top: 1px solid #bfdbfe;
  border-bottom: 1px solid #bfdbfe;
  font-size: 12px;
  font-weight: 650;
}

body.theme-dark .dashboard-schedule-filter {
  color: #bfdbfe;
  background: #172554;
  border-color: #1e3a8a;
}

.dashboard-schedule-filter button {
  color: inherit;
  background: transparent;
  border: 0;
  font-weight: 750;
  cursor: pointer;
}

.dashboard-mobile-menu,
.dashboard-sidebar-backdrop {
  display: none;
}

.dashboard-desktop-only {
  display: none;
}

.dashboard-quick-actions .dashboard-mobile-only {
  display: none;
}

@media (min-width: 901px) {
  body[data-app-view="dashboard"] .dashboard-page {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  body[data-app-view="dashboard"] .dashboard-view[data-dashboard-section="dashboard"] {
    width: min(100%, 1480px);
    margin: auto;
  }

  .dashboard-status-card .dashboard-card-head h2 {
    margin-top: 0;
  }

  /* Desktop uses the icon rail as the single application navigation surface. */
  .controls > #reportBtn,
  .controls > #jobCodeBtn,
  .controls > #yonetimBtn,
  .controls > #changePasswordBtn,
  .controls > #logoutBtn {
    display: none !important;
  }

  .dashboard-desktop-only {
    display: block;
  }

  .dashboard-mobile-period {
    display: none;
  }

  .dashboard-period-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
  }

  .dashboard-heading-tools {
    margin-bottom: 8px;
  }

  .dashboard-view[data-dashboard-section="dashboard"] > .dashboard-topbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
    margin-bottom: 16px;
  }

  .dashboard-brand-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 100%;
    padding: 14px;
    overflow: hidden;
    background: var(--dashboard-card);
    border: 1px solid var(--dashboard-border);
    border-radius: 9px;
    box-shadow: var(--dashboard-shadow);
    box-sizing: border-box;
  }

  .dashboard-greeting-panel {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: var(--dashboard-card);
    border: 1px solid var(--dashboard-border);
    border-radius: 9px;
    box-shadow: var(--dashboard-shadow);
    box-sizing: border-box;
  }

  .dashboard-greeting-panel .dashboard-heading-tools {
    width: 100%;
    justify-content: center;
    margin-bottom: 0;
  }

  .dashboard-brand-panel img {
    width: min(92%, 310px);
    height: auto;
    max-height: 72px;
    object-fit: contain;
  }

  body.theme-dark .dashboard-brand-panel img {
    filter: brightness(0) invert(1);
  }

  #dashboardLiveDateTime {
    position: static;
    width: 100%;
    height: 100%;
    display: grid !important;
  }

  .dashboard-view[data-dashboard-section="dashboard"] > .dashboard-topbar > .dashboard-topbar-actions {
    width: 100%;
    height: 100%;
    justify-self: stretch;
    align-self: stretch;
    justify-content: center;
    padding: 14px;
    background: var(--dashboard-card);
    border: 1px solid var(--dashboard-border);
    border-radius: 9px;
    box-shadow: var(--dashboard-shadow);
    box-sizing: border-box;
  }

  .dashboard-view[data-dashboard-section="dashboard"] > .dashboard-topbar > .dashboard-topbar-actions .dashboard-profile-button {
    min-width: 0;
    flex: 1;
  }

  .dashboard-view[data-dashboard-section="dashboard"] > .dashboard-topbar > .dashboard-topbar-actions .dashboard-profile-menu {
    top: calc(100% + 8px);
  }

  .dashboard-heading-tools .dashboard-period-selector {
    margin-bottom: 0;
  }

  .dashboard-period-selector button,
  .dashboard-period-selector select {
    height: 34px;
    color: var(--dashboard-text);
    background: var(--dashboard-card);
    border: 1px solid var(--dashboard-border);
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 750;
  }

  .dashboard-period-selector button {
    width: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
  }

  .dashboard-period-selector button svg {
    width: 16px;
    height: 16px;
  }

  .dashboard-period-selector select {
    min-width: 112px;
    padding: 0 30px 0 10px;
  }

  .dashboard-period-selector #dashboardYearSelect {
    min-width: 86px;
  }

  .dashboard-period-selector button:hover,
  .dashboard-period-selector button:focus-visible,
  .dashboard-period-selector select:focus-visible {
    border-color: var(--dashboard-primary);
    outline: 3px solid rgba(37, 99, 235, 0.14);
  }

  body .dashboard-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #yonetimYetki .row-user {
    display: grid !important;
    width: 100%;
    min-width: 1100px;
    min-height: 54px;
    grid-template-columns: minmax(140px, 0.8fr) minmax(260px, 2fr) minmax(150px, 0.9fr) 132px 102px 88px 88px 64px !important;
    grid-template-rows: 38px !important;
    grid-auto-flow: column !important;
    align-items: center;
    gap: 8px;
    padding: 8px;
    box-sizing: border-box;
    overflow: visible !important;
  }

  #yonetimYetki .add-new-box {
    width: 100%;
    min-width: 1100px;
    grid-template-columns: minmax(140px, 0.8fr) minmax(260px, 2fr) minmax(150px, 0.9fr) 132px 102px 88px 88px 64px !important;
    grid-template-rows: 38px !important;
    grid-auto-flow: column !important;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
  }

  #yonetimYetki .row-user input,
  #yonetimYetki .row-user select,
  #yonetimYetki .row-user button,
  #yonetimYetki .add-new-box input,
  #yonetimYetki .add-new-box select,
  #yonetimYetki .add-new-box button {
    min-width: 0 !important;
    height: 38px;
    min-height: 38px;
    margin: 0;
    white-space: nowrap;
  }

  #yonetimYetki .row-user .mini-check,
  #yonetimYetki .add-new-box .mini-check {
    min-width: 0;
    height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
    white-space: nowrap;
  }

  #yonetimYetki .row-user .mini-check input,
  #yonetimYetki .add-new-box .mini-check input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    flex: 0 0 18px;
  }

  #yonetimYetki .btn-del-small,
  #yonetimYetki .btn-add-small {
    width: 64px;
    min-width: 64px !important;
    padding: 0 8px;
    justify-self: stretch;
  }

  #yonetimYetki .row-user > .username-input { grid-column: 1; }
  #yonetimYetki .row-user > .email-input { grid-column: 2; }
  #yonetimYetki .row-user > .phone-input { grid-column: 3; }
  #yonetimYetki .row-user > .role-select { grid-column: 4; }
  #yonetimYetki .row-user > .mini-check:nth-of-type(1) { grid-column: 5; }
  #yonetimYetki .row-user > .mini-check:nth-of-type(2) { grid-column: 6; }
  #yonetimYetki .row-user > .mini-check:nth-of-type(3) { grid-column: 7; }
  #yonetimYetki .row-user > [data-action="delete-app-user"] {
    grid-column: 8;
    grid-row: 1;
    white-space: nowrap;
  }

  #yonetimYetki {
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-inline: contain;
  }

  body.dashboard-new-task-entry #taskModal {
    inset: 0 0 0 var(--dashboard-sidebar-width) !important;
    width: calc(100% - var(--dashboard-sidebar-width)) !important;
    height: 100vh !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    background: var(--dashboard-card) !important;
    backdrop-filter: none !important;
    overflow: hidden !important;
  }

  body.dashboard-new-task-entry #taskModal .task-modal-content {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 24px clamp(24px, 3vw, 48px) 0 !important;
    color: var(--dashboard-text) !important;
    background: var(--dashboard-card) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    resize: none !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    animation: none !important;
  }

  body.dashboard-new-task-entry #taskModal .task-modal-content > * {
    width: min(100%, 1240px);
    margin-right: auto;
    margin-left: auto;
    box-sizing: border-box;
  }

  body.dashboard-new-task-entry #taskModal #modalTitle {
    position: sticky;
    top: -24px;
    z-index: 15;
    padding: 20px 0 14px;
    background: var(--dashboard-card);
    border-bottom: 1px solid var(--dashboard-border);
  }

  body.dashboard-new-task-entry #taskModal .btn-row {
    position: sticky;
    bottom: 0;
    z-index: 15;
    justify-content: flex-end;
    margin-top: 18px;
    padding: 12px 0 18px;
    background: var(--dashboard-card);
    border-top: 1px solid var(--dashboard-border);
  }

  .dashboard-settings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-setting-copy {
    margin: -5px 0 14px;
    color: var(--dashboard-muted);
    font-size: 12px;
    line-height: 1.5;
  }

  .dashboard-passkey-mount {
    display: grid;
  }

  .dashboard-passkey-mount #settingsPasskeyBtn {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    color: #fff;
    background: var(--dashboard-primary);
    border: 1px solid var(--dashboard-primary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .dashboard-passkey-mount #settingsPasskeyBtn:hover,
  .dashboard-passkey-mount #settingsPasskeyBtn:focus-visible {
    background: #1d4ed8;
    outline: 3px solid rgba(37, 99, 235, 0.16);
  }

  .dashboard-passkey-mount #settingsPasskeyBtn:disabled {
    cursor: not-allowed;
    opacity: 0.58;
  }

  .dashboard-passkey-card:has(#settingsPasskeyBtn.hidden) {
    display: none;
  }

  /* Keep the existing mobile filter-reset row, but replace it with one compact desktop control. */
  body[data-app-view="schedule"] .dashboard-schedule-filter {
    display: none !important;
  }

  .filter-panel #desktopShowAllBtn:not(.hidden) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    grid-column: 5;
    justify-self: end;
    margin-left: auto;
    padding-inline: 12px;
    color: #1e3a8a;
    background: #eff6ff;
    border-color: #bfdbfe;
    font-weight: 750;
    white-space: nowrap;
  }

  .filter-panel #desktopShowAllBtn svg {
    width: 16px;
    height: 16px;
  }

  .filter-panel #desktopShowAllBtn:hover,
  .filter-panel #desktopShowAllBtn:focus-visible {
    color: #1d4ed8;
    background: #e0ecff;
    border-color: #93b4ea;
    outline: 3px solid rgba(37, 99, 235, 0.12);
  }

  body.theme-dark .filter-panel #desktopShowAllBtn:not(.hidden) {
    color: #bfdbfe;
    background: #172554;
    border-color: #1e3a8a;
  }

  /* Report, management and job-code reuse their existing DOM and behavior in an opaque page shell. */
  #reportModal,
  #yonetimModal,
  #jobCodeModal {
    inset: 0 0 0 var(--dashboard-sidebar-width) !important;
    width: calc(100% - var(--dashboard-sidebar-width)) !important;
    height: 100vh !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    background: var(--dashboard-bg) !important;
    backdrop-filter: none !important;
    overflow: hidden !important;
  }

  #reportModal .modal-content,
  #yonetimModal .modal-content,
  #jobCodeModal .modal-content {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 24px clamp(24px, 3vw, 48px) 0 !important;
    display: flex !important;
    flex-direction: column !important;
    color: var(--dashboard-text) !important;
    background: var(--dashboard-card) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    resize: none !important;
    overflow: hidden !important;
    animation: none !important;
  }

  #reportModal .modal-resize-handle,
  #yonetimModal .modal-resize-handle,
  #jobCodeModal .modal-resize-handle {
    display: none !important;
    pointer-events: none !important;
  }

  #reportModal .modal-heading,
  #yonetimModal .modal-heading,
  #jobCodeModal .modal-heading,
  #reportModal #reportContent,
  #yonetimModal .yonetim-tabs,
  #yonetimModal .yonetim-content,
  #jobCodeModal .job-code-toolbar,
  #jobCodeModal .inline-status,
  #jobCodeModal .job-code-section-heading,
  #jobCodeModal .job-code-table-wrap,
  #reportModal .btn-row,
  #yonetimModal .btn-row,
  #jobCodeModal .btn-row {
    width: min(100%, 1600px);
    margin-inline: auto;
    box-sizing: border-box;
  }

  #reportModal #reportContent {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  #reportModal .report-toolbar {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  #reportModal .report-table-wrap {
    max-height: calc(100vh - 345px);
  }

  #yonetimModal .yonetim-tabs {
    flex: 0 0 auto;
  }

  #yonetimModal .yonetim-content.active {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
  }

  #jobCodeModal .job-code-toolbar {
    flex: 0 0 auto;
  }

  #jobCodeModal .job-code-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }

  #reportModal .btn-row,
  #yonetimModal .btn-row,
  #jobCodeModal .btn-row {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 12;
    justify-content: flex-end;
    margin-top: 14px;
    padding: 12px 0 18px;
    background: var(--dashboard-card);
    border-top: 1px solid var(--dashboard-border);
    backdrop-filter: none;
  }

  #yonetimModal .yonetim-modal-content > .btn-row {
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
  }
}

.dashboard-skeleton {
  position: relative;
  overflow: hidden;
}

.dashboard-skeleton::after,
.dashboard-metric-card.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.11), transparent);
  transform: translateX(-100%);
  animation: dashboard-skeleton 1.25s infinite;
}

@keyframes dashboard-skeleton {
  to { transform: translateX(100%); }
}

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

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

  .dashboard-quick-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  :root {
    --dashboard-sidebar-width: 0px;
  }

  .dashboard-quick-actions .dashboard-mobile-only {
    display: flex;
  }

  .app-sidebar {
    width: 64px;
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .app-sidebar [data-dashboard-action="job-code"] {
    display: none !important;
  }

  body.dashboard-mobile-nav-open .app-sidebar {
    transform: translateX(0);
  }

  body.dashboard-mobile-nav-open .dashboard-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: block;
    background: rgba(15, 23, 42, 0.45);
    border: 0;
  }

  .dashboard-mobile-menu {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    z-index: 1040;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--dashboard-text);
    background: var(--dashboard-card);
    border: 1px solid var(--dashboard-border);
    border-radius: 8px;
    box-shadow: var(--dashboard-shadow);
  }

  .dashboard-mobile-menu svg {
    width: 19px;
    height: 19px;
  }

  .dashboard-desktop-phone {
    display: none !important;
  }

  .dashboard-page {
    margin-left: 0;
    padding: 70px 16px 28px;
  }

  body[data-app-view="schedule"] .header,
  body[data-app-view="schedule"] .filter-panel,
  body[data-app-view="schedule"] .grid-wrapper,
  body[data-app-view="schedule"] .mobile-agenda,
  body[data-app-view="schedule"] .dashboard-schedule-filter {
    width: 100%;
    margin-left: 0;
  }

  .dashboard-analysis-grid,
  .dashboard-detail-grid,
  .dashboard-settings-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-card {
    grid-column: auto;
  }
}

@media (hover: none) and (pointer: coarse), (max-width: 720px) {
  .app-sidebar,
  .dashboard-mobile-menu,
  .dashboard-sidebar-backdrop,
  .dashboard-page {
    display: none !important;
  }

  body[data-app-view="schedule"] .header,
  body[data-app-view="schedule"] .filter-panel,
  body[data-app-view="schedule"] .grid-wrapper,
  body[data-app-view="schedule"] .mobile-agenda,
  body[data-app-view="schedule"] .dashboard-schedule-filter {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .dashboard-color-projects-modal {
    align-items: end;
    padding: 12px;
  }

  .dashboard-color-projects-dialog {
    max-height: 82vh;
  }

  .dashboard-color-projects-head,
  .dashboard-color-projects-list {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dashboard-color-project-link {
    grid-template-columns: 10px minmax(0, 1fr) 18px;
  }

  .dashboard-color-project-link .dashboard-status-badge {
    display: none;
  }

  .dashboard-topbar {
    display: grid;
  }

  .dashboard-topbar-actions {
    width: 100%;
  }

  .dashboard-profile-button {
    min-width: 0;
    flex: 1;
  }

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

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

  .dashboard-donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .dashboard-status-legend {
    width: 100%;
  }

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

@media (prefers-reduced-motion: reduce) {
  .app-sidebar,
  .dashboard-page,
  .dashboard-metric-card,
  body[data-app-view="schedule"] .header,
  body[data-app-view="schedule"] .filter-panel,
  body[data-app-view="schedule"] .grid-wrapper,
  body[data-app-view="schedule"] .mobile-agenda {
    transition: none !important;
  }

  .dashboard-skeleton::after,
  .dashboard-metric-card.is-loading::after {
    animation: none;
  }
}
body:not([data-app-role="admin"]) [data-admin-only] { display: none !important; }
