/* Panel - pulpit, gorny pasek, projekty */

.topbar-project {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: min(280px, 36vw);
  line-height: 1.2;
}

.topbar-project-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.topbar-project-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-project-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.topbar-project-currency {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 14%, transparent);
  color: var(--brand-primary-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
}

.topbar-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  font-size: 1.05rem;
  cursor: pointer;
}

.topbar-icon-glyph {
  line-height: 1;
}

.topbar-icon-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.topbar-icon-badge[hidden] {
  display: none;
}

.topbar-icon-badge.is-alert {
  background: #dc2626;
  min-width: 18px;
  padding: 0;
  font-size: 12px;
  font-weight: 900;
}

.topbar-notifications {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-notifications-wrap {
  position: relative;
}

.topbar-notifications-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(320px, calc(100vw - 24px));
  max-height: min(420px, 70vh);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.topbar-notifications-title {
  margin: 0 0 8px;
  padding: 0 4px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topbar-notifications-list {
  display: grid;
  gap: 8px;
}

.topbar-notifications-empty {
  margin: 0;
  padding: 10px 6px;
  font-size: 0.88rem;
}

.topbar-notification-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: inherit;
  text-decoration: none;
  text-align: left;
}

.topbar-notification-item:not(.is-pinned) {
  cursor: pointer;
}

.topbar-notification-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.topbar-notification-item strong {
  font-size: 0.9rem;
  color: var(--text);
  min-width: 0;
}

.topbar-notification-time {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.35;
}

.topbar-notification-item span {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.topbar-notification-item small {
  font-size: 0.74rem;
  color: #ea580c;
  font-weight: 700;
}

.topbar-notification-item.is-unread {
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--panel));
}

.topbar-notification-item.is-read {
  opacity: 0.72;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
}

.topbar-notification-item.is-read strong {
  color: var(--muted);
}

.topbar-notification-action {
  margin-top: 4px;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.topbar-notification-action:hover {
  text-decoration: underline;
}

.topbar-notification-item.is-warn.is-unread,
.topbar-notification-item.is-pinned.is-unread {
  border-color: color-mix(in srgb, #f97316 45%, var(--line));
  background: color-mix(in srgb, #f97316 10%, var(--panel));
}

.topbar-notification-item:hover {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
}

.topbar-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.action-button,
.small-button,
.secondary-button,
.danger,
.details-button,
.attachment-button,
.topbar-admin-link,
.topbar-public-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    filter 0.2s ease,
    opacity 0.2s ease;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card {
  min-height: 120px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card.blue .stat-icon {
  background: var(--brand-gradient-soft);
}

.stat-card.green .stat-icon {
  background: linear-gradient(135deg, var(--green), #64d28e);
}

.stat-card.orange .stat-icon {
  background: linear-gradient(135deg, var(--orange), #ffbd55);
}

.stat-card.purple .stat-icon {
  background: linear-gradient(135deg, var(--purple), #9f7aea);
}

.stat-card span {
  color: var(--text);
  font-size: 14px;
}

.stat-card strong {
  display: block;
  margin: 4px 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.stat-card small {
  color: var(--muted);
}

.project-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.project-card .project-row-actions {
  margin-top: auto;
  padding-top: 4px;
}

.projects-hub {
  display: grid;
  gap: 22px;
  min-width: 0;
  max-width: 100%;
}

.projects-hub-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.projects-hub-head-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.projects-hub-head-meta {
  min-width: 0;
}

.projects-hub-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 360px;
  margin-left: auto;
}

.projects-hub-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px 0 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
}

.projects-hub-head .muted {
  word-break: break-word;
}

.projects-hub-head h1 {
  margin: 0;
  flex-shrink: 0;
}

.projects-hub-head-meta .muted {
  margin: 0;
}

.projects-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.projects-hub-add-btn,
.projects-hub-actions .action-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.projects-btn-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.projects-hub-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.projects-stat-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-width: 0;
}

.projects-stat-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
}

.projects-stat-icon img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.projects-stat-main {
  min-width: 0;
}

.projects-stat-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 72px;
  height: 36px;
  flex-shrink: 0;
  align-self: flex-end;
  justify-self: end;
}

.projects-stat-sparkline .dash-sparkline-wave {
  width: 100%;
  height: 100%;
  display: block;
}

.projects-stat-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.projects-stat-sparkline span {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: #cbd5e1;
  min-height: 4px;
}

.projects-stat-sparkline.is-green span { background: #86efac; }

.projects-stat-sparkline.is-orange span { background: #fdba74; }

.projects-stat-sparkline.is-purple span { background: #c4b5fd; }

.projects-stat-sparkline.is-blue span { background: color-mix(in srgb, var(--brand-primary-light) 70%, #fff); }

.projects-plan-note {
  margin: 8px 0 0;
  font-size: 0.88rem;
}

.projects-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
  min-width: 0;
}

.projects-list-panel {
  overflow-x: hidden;
  max-width: 100%;
}

.projects-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.projects-toolbar-select select {
  min-width: 170px;
}

.projects-view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.projects-view-toggle button {
  border: 0;
  background: #f8fafc;
  color: #475569;
  width: 40px;
  height: 38px;
  font-size: 1rem;
  cursor: pointer;
}

.projects-view-toggle button.active {
  background: var(--brand-gradient);
  color: #fff;
}

.projects-filter-tabs button {
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.projects-filter-tabs button.active {
  background: var(--brand-gradient);
  color: #fff;
}

.projects-cards-grid.is-list-view {
  grid-template-columns: 1fr;
}

.projects-cards-grid.is-list-view .project-card-v2-main {
  flex-direction: row;
  align-items: flex-start;
  padding: 10px 12px 0;
  min-height: auto;
  gap: 12px;
}

.projects-cards-grid.is-list-view .project-card-v2-cover {
  width: 80px;
  flex: 0 0 80px;
  height: 80px;
  min-height: 80px;
  max-height: 80px;
  align-self: flex-start;
  margin-bottom: 0;
}

.projects-cards-grid.is-list-view .project-card-v2-cover-media {
  border-radius: 12px;
}

.projects-cards-grid.is-list-view .project-card-v2-cover-media img {
  display: none;
}

.projects-cards-grid.is-list-view .project-card-v2-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
  min-height: 0;
  flex: 0;
  margin: 0;
}

.projects-cards-grid.is-list-view .project-card-v2-desc:empty {
  display: none;
}

.projects-cards-grid.is-list-view .project-card-v2-content {
  gap: 6px;
  padding-bottom: 8px;
}

.projects-cards-grid.is-list-view .project-card-v2-metrics {
  margin-top: 4px;
}

.projects-cards-grid.is-list-view .project-card-v2-finance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.projects-cards-grid.is-list-view .project-card-v2-finance div {
  padding: 6px 8px;
}

.projects-cards-grid.is-list-view .project-card-v2-finance strong {
  font-size: 0.8rem;
}

.projects-cards-grid.is-list-view .project-card-v2-main {
  align-items: center;
}

.projects-cards-grid.is-list-view .project-card-v2-footer {
  padding: 8px 12px;
}

.project-card-v2.is-plan-locked {
  opacity: 0.62;
  filter: grayscale(0.35);
}

.project-card-locked-badge {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.68);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.project-card-v2-type {
  margin: -4px 0 0;
  font-size: 0.78rem;
}

.projects-recent-panel {
  margin-top: 28px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.projects-recent-table-wrap {
  overflow-x: auto;
}

.projects-recent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.projects-recent-table th,
.projects-recent-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.projects-recent-table tr.is-plan-locked {
  opacity: 0.55;
}

.projects-recent-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.projects-recent-name img {
  border-radius: 8px;
  object-fit: cover;
}

.projects-recent-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.projects-recent-progress .project-card-v2-progress-bar {
  flex: 1;
}

.projects-stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.projects-stat-card strong {
  font-size: 1.2rem;
  line-height: 1.2;
}

.projects-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.projects-filter-tabs a {
  padding: 9px 14px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.projects-filter-tabs a.active {
  background: var(--brand-gradient);
  color: #fff;
}

.projects-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.projects-list-head h2 {
  margin: 0;
}

.projects-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
  gap: 16px;
}

.projects-cards-grid:not(.is-list-view) .project-card-v2-cover {
  position: relative;
  flex: 0 0 196px;
  width: 196px;
  height: 204px;
  min-height: 204px;
  max-height: 204px;
}

.projects-cards-grid:not(.is-list-view) .project-card-v2-cover-media {
  border-radius: 14px;
  overflow: hidden;
}

.projects-cards-grid.is-filter-empty {
  display: none;
}

.project-card-v2 {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: clip;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}

.project-card-v2-inner {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  height: 100%;
}

.project-card-v2-main {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex: 1;
  min-height: 0;
  padding: 12px 12px 10px;
}

.project-card-v2.is-open {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--line));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--brand-primary) 14%, transparent);
  border-left: 4px solid var(--brand-primary);
}

.project-card-v2-cover {
  position: relative;
  flex: 0 0 196px;
  width: 196px;
  height: 204px;
  min-height: 204px;
  max-height: 204px;
  align-self: flex-start;
  margin-bottom: 10px;
  background: transparent;
}

.project-card-v2-cover-media {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background-color: #e2e8f0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.project-card-v2-cover-media img {
  display: none;
}

.project-card-open-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.project-card-footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.project-card-deadline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  min-width: 0;
}

.project-card-v2-progress.is-muted .project-card-v2-progress-bar span {
  width: 0 !important;
}

.project-card-v2-progress.is-over .project-card-v2-progress-bar span,
.project-card-v2-progress-bar.is-over span {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.project-card-v2-content {
  flex: 1;
  min-width: 0;
  min-height: 204px;
  padding: 2px 4px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card-v2-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 8px 10px;
}

.project-card-v2-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  min-width: 0;
}

.project-card-v2-status {
  white-space: nowrap;
}

.project-card-menu-spacer {
  width: 34px;
  height: 34px;
}

.project-card-v2-headtext {
  min-width: 0;
}

.project-card-v2-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.project-card-v2-title-row h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  flex: 1 1 auto;
}

.project-card-menu {
  position: relative;
  flex-shrink: 0;
}

.project-card-menu-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.project-card-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.project-card-menu-panel > * + * {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 4px;
}

.project-card-menu-panel a,
.project-card-menu-panel .menu-link-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  text-align: left;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.project-card-menu-panel a:hover,
.project-card-menu-panel .menu-link-btn:hover {
  background: #f1f5f9;
}

.project-card-menu-panel .menu-link-btn.is-danger {
  color: #dc2626;
}

.project-card-v2-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  margin-top: auto;
  flex-shrink: 0;
}

.project-card-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-card-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  padding: 0;
}

.project-card-inline-icon {
  display: block;
  opacity: 0.72;
}

.project-card-v2-finance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.project-card-open-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.project-card-v2-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 12px;
}

.project-card-v2-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  min-height: calc(0.82rem * 1.4 * 2);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-shrink: 0;
}

.project-card-v2-desc.is-empty {
  visibility: hidden;
}

.project-card-v2-budget .project-card-v2-progress-bar span {
  background: linear-gradient(90deg, var(--brand-primary-dark), var(--brand-primary-light));
}

.project-card-v2-budget.is-over .project-card-v2-progress-bar span,
.project-card-v2-budget .project-card-v2-progress-bar.is-over span {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.project-card-v2-metrics {
  display: grid;
  gap: 10px;
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
}

.projects-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.projects-pagination.hidden {
  display: none !important;
}

.projects-pagination-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.projects-pagination-btn:hover:not(:disabled) {
  background: #f1f5f9;
}

.projects-pagination-btn.active {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #fff;
}

.projects-pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.projects-pagination-info {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 4px;
}

.project-card-v2-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.project-card-v2-finance div {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.project-card-v2-finance span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  margin-bottom: 4px;
}

.project-card-v2-finance strong {
  font-size: 0.88rem;
  word-break: break-word;
}

.project-card-v2-progress .project-card-v2-progress-bar span {
  background: linear-gradient(90deg, var(--brand-primary-dark), var(--brand-primary-light));
}

.project-card-v2-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.project-card-v2-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-light));
}

.project-card-v2-progress-bar.is-over span {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.project-card-v2-progress.is-muted .project-card-v2-progress-bar span {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

.project-card-v2-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 280px;
    height: 100dvh;
    max-height: 100dvh;
    transform: translateX(-105%);
    transition: 0.22s ease;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    z-index: 40;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .sidebar {
    width: 280px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-hub-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.topbar-admin-link,
.topbar-public-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1f2937, #111827);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.18);
}

.topbar-admin-link:hover,
.topbar-public-link:hover {
  filter: brightness(1.04);
}

.topbar-public-link {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand-primary) 28%, transparent);
  text-decoration: none;
  color: #fff;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-self: start;
}

.topbar-center {
  display: flex;
  justify-content: center;
  min-width: 0;
  width: 100%;
  max-width: 460px;
  justify-self: center;
}

.topbar .topbar-right {
  justify-self: end;
  margin-left: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-no-project {
  grid-template-columns: minmax(0, 1fr) auto;
}

.topbar-no-project .topbar-left {
  justify-self: start;
}

.topbar-no-project .topbar-right {
  grid-column: 2;
  justify-self: end;
}

.topbar-storage {
  display: grid;
  gap: 5px;
  min-width: 168px;
  max-width: 220px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.topbar-storage-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}

.topbar-storage-copy strong {
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
}

.topbar-storage-label {
  grid-column: 1 / -1;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.topbar-storage-warn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f97316;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.topbar-storage-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 55%, transparent);
  overflow: hidden;
}

.topbar-storage-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #22c55e;
  transition: width 0.2s ease;
}

.topbar-storage-bar.is-warn > span {
  background: #f97316;
}

.topbar-storage-bar.is-critical > span {
  background: #ef4444;
}

.topbar-project-switcher {
  position: relative;
  min-width: 0;
  flex: 0 1 280px;
}

.topbar-project-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.topbar-project-thumb {
  width: 44px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
}

.topbar-project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar-project-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.topbar-project-copy .topbar-project-name {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-project-progress-meta {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.topbar-project-progress-bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.topbar-project-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
}

.topbar-project-progress-bar.is-over span {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.topbar-project-chevron {
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
}

.topbar-project-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(320px, 92vw);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.topbar-project-menu-title {
  margin: 0 0 8px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.topbar-project-option button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.topbar-project-option button:hover {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
}

.topbar-project-option.is-active button {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}

.topbar-project-option img {
  width: 40px;
  height: 28px;
  object-fit: cover;
  border-radius: 6px;
}

.topbar-project-option-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.topbar-project-option-copy strong {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-project-option-copy small {
  color: var(--muted);
  font-size: 11px;
}

.topbar-project-active-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--blue);
  text-transform: uppercase;
}

.topbar-project-menu-link {
  display: block;
  margin-top: 6px;
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}

.topbar-search-trigger {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.topbar-search-icon {
  display: grid;
  place-items: center;
  color: #64748b;
}

.topbar-search-placeholder {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-search-mobile {
  display: none;
}

.topbar-search-kbd {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.dash-page {
  position: relative;
}

.dash-json-data {
  display: none !important;
}

.dash-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dash-page-title {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.dash-page-lead {
  margin: 4px 0 0;
  font-size: 14px;
}

.dash-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dash-page-actions .action-button,
.dash-page-actions .secondary-button {
  display: inline-flex;
  align-items: center;
}

.dash-add-menu {
  position: relative;
}

.dash-add-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 6;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
}

.dash-add-panel a,
.dash-add-panel button {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.dash-add-panel a:hover,
.dash-add-panel button:hover {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dash-kpi-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 14px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-height: 118px;
  min-width: 0;
}

.dash-kpi-card-rich {
  min-height: 132px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.dash-kpi-card-budget {
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
}

.dash-sparkline-side {
  width: 92px;
  height: 54px;
  margin-top: 0;
  flex-shrink: 0;
}

.dash-kpi-progress.is-over span {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.dash-donut.is-over::after {
  background: #fef2f2;
}

.dash-kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.dash-kpi-icon img,
.projects-stat-icon img,
.project-card-inline-icon {
  opacity: 0.92;
}

.dash-kpi-icon-budget { background: #dbeafe; }

.dash-kpi-icon-expense { background: #dcfce7; }

.dash-kpi-icon-tasks { background: #ffedd5; }

.dash-kpi-icon-date { background: #ede9fe; }

.dash-kpi-icon-progress { background: #e0e7ff; }

.dash-kpi-icon-journal { background: #fef3c7; }

.dash-kpi-body {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  align-content: start;
}

.dash-sparkline-side,
.dash-sparkline-wave-wrap,
.dash-donut-sm {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
}

.dash-sparkline-wave-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 108px;
}

.dash-sparkline-wave {
  display: block;
}

.dash-kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.dash-kpi-value {
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dash-kpi-value-hero {
  font-size: 26px;
  color: var(--text);
}

.dash-kpi-accent {
  color: #ea580c !important;
  font-weight: 700;
  font-size: 13px !important;
}

.dash-kpi-body small {
  color: var(--muted);
  font-size: 12px;
}

.dash-kpi-progress {
  margin-top: 6px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.dash-kpi-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
}

.dash-kpi-meta {
  margin-top: 2px;
}

.dash-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 34px;
  margin-top: 6px;
}

.dash-sparkline span {
  flex: 1;
  min-width: 5px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #93c5fd 0%, #2563eb 100%);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
  opacity: 0.92;
}

.dash-sparkline span:nth-child(odd) {
  opacity: 0.78;
}

.dash-donut {
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.dash-donut::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: var(--panel);
}

.dash-donut span {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 800;
}

.dash-donut-sm {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.dash-donut-lg {
  width: 148px;
  height: 148px;
}

.dash-donut-lg span {
  font-size: 20px;
}

.dash-donut-ring {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.dash-donut-ring::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--blue) 12%, transparent);
  pointer-events: none;
}

.dash-donut-center {
  display: grid;
  gap: 2px;
  text-align: center;
  line-height: 1.15;
  max-width: 78%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dash-donut-center strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-donut-center small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.dash-main-grid,
.dash-mid-grid,
.dash-bottom-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  min-width: 0;
}

.dash-main-grid {
  grid-template-columns: 1.05fr 1.2fr 0.9fr;
}

.dash-main-grid .dash-table-wrap,
.summary-quad-row .dash-table-wrap {
  max-height: 240px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-main-grid .dash-table,
.summary-quad-row .dash-table {
  min-width: 460px;
}

.dash-main-grid .dash-table td,
.dash-main-grid .dash-table th,
.summary-quad-row .dash-table td,
.summary-quad-row .dash-table th {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .dash-main-grid .dash-table,
  .summary-quad-row .dash-table {
    min-width: 0;
  }

  .dash-main-grid .dash-table td,
  .dash-main-grid .dash-table th,
  .summary-quad-row .dash-table td,
  .summary-quad-row .dash-table th {
    white-space: normal;
  }
}

.dash-mid-grid {
  grid-template-columns: 1.15fr 1.05fr 1.05fr;
  align-items: stretch;
}

.dash-mid-grid > .dash-panel-wide {
  align-self: stretch;
}

.dash-mid-grid .dash-panel-wide,
.dash-mid-grid .dash-panel-journal,
.dash-mid-grid .dash-panel-photos {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 420px;
  max-height: 420px;
  min-height: 420px;
  overflow: hidden;
}

.dash-mid-grid .dash-panel-wide .dash-schedule-widget {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.dash-mid-grid .dash-panel-wide .dash-panel-head,
.dash-mid-grid .dash-panel-journal .dash-panel-head,
.dash-mid-grid .dash-panel-photos .dash-panel-head {
  flex-shrink: 0;
}

.dash-mid-grid .dash-panel-journal .dash-timeline {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.dash-mid-grid .dash-panel-journal .dash-timeline-foot {
  flex-shrink: 0;
  margin-top: auto;
}

.dash-timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dash-timeline-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-timeline-head small {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}

.dash-timeline {
  display: grid;
  gap: 12px;
  position: relative;
  padding-left: 6px;
}

.dash-timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--line);
}

.dash-timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.dash-timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  margin-left: 1px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px color-mix(in srgb, #94a3b8 18%, transparent);
}

.dash-timeline-item.is-today .dash-timeline-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent);
}

.dash-timeline-item.is-past .dash-timeline-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 4px color-mix(in srgb, #94a3b8 16%, transparent);
}

.dash-timeline-item.is-important .dash-timeline-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px color-mix(in srgb, #ef4444 18%, transparent);
}

.dash-timeline-item.is-important .dash-timeline-head strong {
  color: #b91c1c;
}

.dash-timeline-item p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.dash-timeline-head strong {
  font-size: 14px;
}

.dash-timeline-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue) 5%, var(--panel));
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.dash-timeline-foot:hover {
  background: color-mix(in srgb, var(--blue) 10%, var(--panel));
}

.dash-mid-grid .dash-panel-photos .dash-photos-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  grid-auto-rows: auto;
}

.dash-schedule-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.dash-bottom-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.dash-bottom-grid .dash-panel-tasks-widget,
.dash-bottom-grid .dash-panel-notes-widget {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 320px;
  max-height: 320px;
  overflow: hidden;
}

.dash-bottom-grid .dash-panel-tasks-widget .dash-task-list,
.dash-bottom-grid .dash-panel-notes-widget .dash-notes-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.dash-panel-head-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.projects-hub.is-editing .projects-hub-search {
  display: none;
}

@media (max-width: 720px) {
  .projects-hub.is-editing .projects-hub-head-meta {
    display: none;
  }
}

.dash-panel-actions {
  grid-column: 1 / -1;
}

.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.dash-panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.dash-panel-head a,
.dash-panel-head .link-button {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.dash-budget-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px 24px;
  min-width: 0;
}

.dash-donut-wrap {
  padding: 8px;
  border-radius: 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid var(--line);
  min-width: 0;
}

.dash-budget-details {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.dash-budget-legend {
  display: grid;
  gap: 10px;
  font-size: 14px;
}

.dash-budget-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  min-width: 0;
}

.dash-budget-legend-row.is-meta {
  background: transparent;
  border-style: dashed;
}

.dash-budget-legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
  min-width: 0;
}

.dash-budget-legend-row strong {
  font-size: 15px;
  letter-spacing: -0.02em;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dash-budget-legend-row strong small {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.dash-budget-legend-row.is-spent {
  background: #fff7ed;
  border-color: #fed7aa;
}

.dash-budget-legend-row.is-spent strong {
  color: #c2410c;
}

.dash-budget-legend-row.is-remain {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.dash-budget-legend-row.is-remain strong {
  color: #166534;
}

.dash-budget-legend-row.is-remain.is-warn {
  background: #fff7ed;
  border-color: #fdba74;
}

.dash-budget-legend-row.is-remain.is-warn strong {
  color: #c2410c;
}

.dash-budget-legend-row.is-remain.is-over {
  background: #fef2f2;
  border-color: #fecaca;
}

.dash-budget-legend-row.is-remain.is-over strong {
  color: #b91c1c;
}

.dash-budget-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-budget-tip {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue) 6%, #f8fafc);
  font-size: 13px;
  line-height: 1.45;
}

.dash-table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.dash-table-title {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-table th,
.dash-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.dash-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-table tr.js-entry-open {
  cursor: pointer;
}

.dash-table tr.js-entry-open:hover {
  background: color-mix(in srgb, var(--blue) 6%, transparent);
}

.dash-receipts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.dash-receipt-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #f8fafc;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-receipt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.dash-receipt-thumb {
  height: 148px;
  overflow: hidden;
  background: #eef2f7;
}

.dash-receipt-thumb img,
.dash-receipt-thumb object {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.dash-receipt-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.dash-receipt-meta {
  display: grid;
  gap: 1px;
  padding: 6px 6px 8px;
  text-align: center;
}

.dash-receipt-meta strong {
  font-size: 12px;
  line-height: 1.2;
}

.dash-receipt-meta small {
  font-size: 10px;
  color: var(--muted);
}

.dash-schedule-widget {
  display: grid;
  gap: 12px;
}

.dash-schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-schedule-nav-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
}

.dash-schedule-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.dash-schedule-view-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
}

.dash-schedule-view-btn:hover {
  color: var(--text);
}

.dash-schedule-view-btn.is-active {
  background: color-mix(in srgb, var(--blue) 14%, var(--panel));
  color: var(--blue);
}

.dash-schedule-range {
  min-width: 180px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.dash-schedule-nav,
.dash-schedule-today {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.dash-schedule-nav:hover,
.dash-schedule-today:hover {
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  background: color-mix(in srgb, var(--blue) 6%, var(--panel));
}

.dash-gantt-week {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dash-gantt-week-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.dash-gantt-week-head-row {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 96px 82px 92px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  box-shadow: 0 1px 0 var(--line);
}

.dash-gantt-week-row {
  display: grid;
  grid-template-columns: 96px 82px 92px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.dash-gantt-week-table {
  min-width: 480px;
}

.dash-gantt-week-term {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.dash-gantt-week-status {
  min-width: 0;
}

.dash-gantt-week-status .dash-task-status {
  display: inline-block;
  white-space: nowrap;
}

.dash-gantt-week-corner {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-gantt-week-days {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.dash-gantt-day {
  text-align: center;
}

.dash-gantt-day.is-today {
  color: #ea580c;
}

.dash-gantt-today-in-track {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, #f97316 0 4px, transparent 4px 8px);
  pointer-events: none;
  z-index: 2;
}

.dash-gantt-week-body {
  position: relative;
  padding: 10px 12px 12px;
  min-height: 120px;
}

.dash-gantt-week-task {
  min-width: 0;
}

.dash-gantt-week-task strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-gantt-week-task small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-gantt-week-track {
  position: relative;
  height: 28px;
  border-radius: 8px;
  background: #e2e8f0;
  min-width: 140px;
}

.dash-gantt-week-track .dash-gantt-bar {
  top: 6px;
}

.dash-gantt-week-empty {
  margin: 12px 0 4px;
  text-align: center;
}

/* Podgląd harmonogramu - widok miesiąca (siatka kalendarza jak na stronie Kalendarz + paski etapów) */
.dash-month-grid {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.dash-month-dow-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.dash-month-dow {
  padding: 6px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: color-mix(in srgb, var(--line) 30%, var(--panel));
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dash-month-week {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.dash-month-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 3px 4px;
}

.dash-month-cell.is-outside {
  background: color-mix(in srgb, var(--line) 20%, var(--panel));
}

.dash-month-daynum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  border-radius: 50%;
}

.dash-month-cell.is-outside .dash-month-daynum {
  color: var(--muted);
  opacity: 0.6;
}

.dash-month-daynum.is-today {
  color: #fff;
  background: var(--blue);
}

.dash-month-bars {
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  bottom: 0;
  pointer-events: none;
}

.dash-month-bar {
  position: absolute;
  height: 18px;
  line-height: 18px;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
}

.dash-month-bar:hover {
  filter: brightness(1.08);
}

.dash-month-bar.is-planned { background: #94a3b8; }

.dash-month-bar.is-active { background: #2563eb; }

.dash-month-bar.is-done { background: #10b981; }

.dash-schedule-categories {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.dash-schedule-categories li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.dash-schedule-category-name {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dash-schedule-category-count {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.dash-kpi-card-deadline {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.dash-kpi-deadline-date {
  font-size: 24px !important;
}

.dash-kpi-deadline-meta {
  font-weight: 600;
}

.dash-kpi-deadline-source {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.dash-panel-actions .dash-panel-head {
  margin-bottom: 10px;
}

.dash-panel-actions {
  min-height: 0;
}

.dash-gantt-bar {
  position: absolute;
  top: 6px;
  height: 16px;
  border-radius: 999px;
}

.dash-gantt-bar.is-planned { background: #94a3b8; }

.dash-gantt-bar.is-active { background: #2563eb; }

.dash-gantt-bar.is-done { background: #10b981; }

.dash-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dash-photo-tile {
  border: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #e2e8f0;
  display: block;
  aspect-ratio: 1;
  line-height: 0;
}

.dash-photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dash-task-list,
.dash-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dash-task-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  min-width: 0;
}

.dash-task-list li.is-done .dash-task-title {
  text-decoration: line-through;
  color: var(--muted);
}

.dash-task-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
}

.dash-task-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dash-task-check-ui {
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #fff;
}

.dash-task-check input:checked + .dash-task-check-ui {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.dash-task-check input:checked + .dash-task-check-ui::before {
  content: "✓";
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.dash-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-task-status {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-task-status.is-todo { background: #e2e8f0; color: #334155; }

.dash-task-status.is-active { background: #dbeafe; color: #1d4ed8; }

.dash-task-status.is-done { background: #dcfce7; color: #166534; }

.dash-notes-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.dash-notes-item.js-entry-open,
.dash-gantt-week-row.js-entry-open {
  cursor: pointer;
}

.dash-notes-item.js-entry-open:hover,
.dash-gantt-week-row.js-entry-open:hover {
  background: color-mix(in srgb, var(--blue) 6%, transparent);
}

.dash-notes-main {
  min-width: 0;
  flex: 1;
}

.dash-notes-main strong {
  font-size: 13px;
  font-weight: 700;
}

.dash-notes-date {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.dash-notes-list p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dash-bottom-grid .dash-panel {
  padding: 14px 16px;
}

.dash-task-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dash-task-priority {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dash-task-priority.is-high {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.28), 0 0 14px rgba(239, 68, 68, 0.22);
}

.dash-task-priority.is-medium {
  background: #ffedd5;
  color: #c2410c;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.28), 0 0 14px rgba(249, 115, 22, 0.18);
}

.dash-task-priority.is-low { background: #e2e8f0; color: #475569; }

.dash-quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 6px 0 4px;
  max-width: 920px;
  margin-inline: auto;
}

.dash-quick-action {
  flex: 1 1 140px;
  max-width: 170px;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px 10px 14px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  width: 100%;
}

.dash-add-panel button {
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.dash-quick-action-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.dash-quick-action-expense .dash-quick-action-icon { background: #dcfce7; }

.dash-quick-action-receipt .dash-quick-action-icon { background: #ffedd5; }

.dash-quick-action-task .dash-quick-action-icon { background: #dbeafe; }

.dash-quick-action-photo .dash-quick-action-icon { background: #e0e7ff; }

.dash-quick-action-note .dash-quick-action-icon { background: #ede9fe; }

.dash-quick-action:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.dash-fab-wrap,
.page-fab-wrap {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 8;
}

.dash-fab,
.page-fab {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #1d4ed8);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
  cursor: pointer;
}

.dash-fab-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 8px;
}

.dash-fab-menu a,
.dash-fab-menu button.js-dash-open-modal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.dash-fab-menu a span,
.dash-fab-menu button.js-dash-open-modal span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  font-size: 14px;
  flex-shrink: 0;
}

.dash-fab-menu a em,
.dash-fab-menu button.js-dash-open-modal em {
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-main-grid,
  .dash-mid-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-main-grid .dash-panel-budget,
  .dash-mid-grid .dash-panel-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .topbar-search-kbd,
  .topbar-project-currency {
    display: none;
  }

  .dash-kpi-grid,
  .dash-bottom-grid,
  .dash-main-grid,
  .dash-mid-grid {
    grid-template-columns: 1fr;
  }

  .dash-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-receipts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-budget-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .dash-budget-details {
    width: 100%;
  }

  .dash-budget-legend-row {
    flex-wrap: wrap;
  }

  .dash-kpi-value-hero {
    font-size: 22px;
  }

  .dash-donut-lg {
    width: 128px;
    height: 128px;
  }

  .dash-sparkline-wave-wrap {
    min-width: 72px;
  }

  .dash-page-head {
    flex-direction: column;
  }

  .dash-fab-wrap,
  .page-fab-wrap {
    bottom: 78px;
  }

  .dash-mid-grid .dash-panel-photos {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .dash-mid-grid .dash-panel-photos .dash-photos-grid {
    flex: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-items: stretch;
    padding: 8px 12px 10px;
    gap: 8px;
  }

  .topbar-left {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .topbar-right {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .topbar-storage {
    display: none;
  }

  .topbar-center {
    display: none;
  }

  .topbar-search-mobile {
    display: inline-grid;
    flex-shrink: 0;
  }

  .topbar-project-switcher {
    flex: 1;
    max-width: none;
    min-width: 0;
  }

  .topbar-project-trigger {
    padding: 6px 10px 6px 6px;
  }

  .topbar-project-thumb {
    display: block;
    width: 34px;
    height: 28px;
  }

  .topbar-project-progress-bar,
  .topbar-project-progress-meta {
    display: none;
  }

  .topbar-project-copy .topbar-project-name {
    font-size: 14px;
    color: var(--text) !important;
  }

  .topbar-notifications {
    flex-shrink: 0;
  }

  .topbar-notifications-panel {
    left: 0;
    right: auto;
    width: min(320px, calc(100vw - 24px));
  }

  .topbar-project-menu {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
  }

  .topbar-project-trigger {
    color: var(--text);
  }

  .projects-hub-stats {
    grid-template-columns: 1fr;
  }

  .projects-stat-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .user-menu {
    flex-shrink: 1;
    min-width: 0;
  }

  .user-menu-panel {
    min-width: 200px;
    padding: 6px;
  }

  .dash-gantt-week-table {
    min-width: 620px;
  }

  .dash-gantt-week-head-row,
  .dash-gantt-week-row {
    grid-template-columns: 96px 76px 86px minmax(280px, 1fr);
  }

  .dash-schedule-toolbar {
    justify-content: center;
  }

  .dash-month-dow {
    padding: 4px 2px;
    font-size: 10px;
  }

  .dash-month-cell {
    padding: 2px 2px;
  }

  .dash-month-daynum {
    font-size: 10px;
    width: 16px;
    height: 16px;
  }

  .dash-month-bar {
    font-size: 9px;
    padding: 0 4px;
  }
}

.topbar-notification-item span strong {
  color: var(--text);
}

