:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #13233a;
  --subtle: #58677a;
  --line: #d7e0eb;
  --primary: #0954c6;
  --primary-dark: #06439d;
}

* {
  box-sizing: border-box;
}

body.dashboard-page {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(19, 35, 58, 0.05);
}

.dashboard-topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.dashboard-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.dashboard-logo {
  display: block;
  width: min(220px, 42vw);
  height: auto;
}

.dashboard-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
}

.dashboard-shell {
  width: min(1320px, 96vw);
  margin: 1.5rem auto 2rem;
}

.dashboard-home-layout {
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.dashboard-home-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.dashboard-modules-sidebar {
  position: sticky;
  top: 1rem;
}

.dashboard-modules-intro {
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.dashboard-module-nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dashboard-widgets-column {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.dashboard-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 8px 20px rgba(19, 35, 58, 0.06);
}

.dashboard-intro {
  margin: 0 0 1.25rem;
  color: var(--subtle);
}

.dashboard-access-denied {
  margin: 0 0 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #fff7e6;
  color: #7a5a20;
  border: 1px solid #ecd39a;
  font-size: 0.92rem;
}

.dashboard-admin-link {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.dashboard-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.85rem;
}

.dashboard-module-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  text-align: left;
  line-height: 1.25;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.12s ease,
    background-color 0.12s ease,
    color 0.12s ease;
}

.dashboard-module-link:hover {
  border-color: #b8c9de;
  box-shadow: 0 4px 12px rgba(19, 35, 58, 0.08);
  transform: translateY(-1px);
}

.dashboard-module-link.is-ready {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.dashboard-module-link.is-ready:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.dashboard-module-link.is-planned {
  color: var(--subtle);
  background: #f8fafc;
}

.dashboard-module-link.is-planned:hover {
  color: var(--text);
}

.dashboard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.dashboard-btn-primary {
  background: var(--primary);
  color: #fff;
}

.dashboard-btn-primary:hover {
  background: var(--primary-dark);
}

.dashboard-btn-secondary {
  background: #eff3f8;
  color: var(--text);
  border-color: var(--line);
}

.dashboard-btn-secondary:hover {
  background: #e2e9f3;
}

.dashboard-placeholder {
  max-width: 40rem;
}

.procedures-document-nav {
  margin-bottom: 1.25rem;
}

.procedures-section-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.procedures-document-nav .dashboard-module-link.is-planned.is-unavailable {
  cursor: default;
  pointer-events: none;
}

.strategy-section-nav {
  margin-bottom: 0;
}

.dashboard-placeholder .dashboard-btn-secondary {
  margin-right: 0.65rem;
  margin-bottom: 0.65rem;
}

.dashboard-placeholder h1 {
  margin-top: 0;
}

.dashboard-placeholder p {
  color: var(--subtle);
  line-height: 1.5;
}

.dashboard-back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.65rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.dashboard-back-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .dashboard-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-topbar-right {
    justify-content: flex-end;
  }
}

.dashboard-widgets {
  margin-bottom: 0;
}

.dashboard-widget-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.dashboard-widget-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dashboard-widget-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.dashboard-widget-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.92rem;
}

.dashboard-widget-link:hover {
  text-decoration: underline;
}

.dashboard-widget-subtle {
  color: var(--subtle);
  font-size: 0.88rem;
}

.dashboard-widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.dashboard-widget-item {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.dashboard-widget-item-title {
  display: block;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
}

.dashboard-widget-item-title:hover {
  color: var(--primary);
}

.dashboard-widget-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.whiteboard-shell {
  width: min(1280px, 96vw);
}

.whiteboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.whiteboard-panel h2 {
  margin-top: 0;
}

.whiteboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.task-filter-tabs {
  display: inline-flex;
  gap: 0.35rem;
}

.task-filter-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--subtle);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.task-filter-tab.active,
.task-filter-tab:hover {
  color: var(--text);
  border-color: #b8c9de;
  background: #f7faff;
}

.whiteboard-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.whiteboard-field {
  display: grid;
  gap: 0.35rem;
}

.whiteboard-field span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--subtle);
}

.whiteboard-field textarea,
.whiteboard-field input[type="text"],
.whiteboard-field input[type="date"],
.whiteboard-field select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.whiteboard-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.whiteboard-field-inline {
  flex: 1 1 10rem;
}

.whiteboard-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 0.55rem;
}

.whiteboard-list-wrap,
.whiteboard-thread-list {
  display: grid;
  gap: 0.75rem;
}

.whiteboard-thread-summary-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whiteboard-thread-item.is-done .whiteboard-thread-summary-main strong {
  color: var(--subtle);
  text-decoration: line-through;
}

.whiteboard-thread-item.is-done {
  opacity: 0.82;
}

.whiteboard-task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.whiteboard-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #eef3f9;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.whiteboard-badge-priority {
  background: #ffe8e8;
  color: #9b1c1c;
}

.whiteboard-badge-deadline {
  background: #fff4df;
  color: #8a5a00;
}

.whiteboard-badge-muted {
  background: #eef1f5;
  color: var(--subtle);
}

.whiteboard-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.whiteboard-item-actions form {
  margin: 0;
}

.whiteboard-btn-danger {
  color: #9b1c1c;
}

.whiteboard-thread-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.whiteboard-thread-item.thread-has-new {
  border-color: #f0c36d;
  box-shadow: 0 0 0 1px rgba(240, 195, 109, 0.35);
}

.whiteboard-thread-item.whiteboard-item-has-priority {
  border-color: #e8a0a0;
  box-shadow: 0 0 0 1px rgba(155, 28, 28, 0.22);
}

.whiteboard-thread-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  list-style: none;
}

.whiteboard-thread-summary::-webkit-details-marker {
  display: none;
}

.whiteboard-thread-summary-main {
  display: grid;
  gap: 0.2rem;
}

.whiteboard-thread-summary-main small {
  color: var(--subtle);
}

.whiteboard-thread-summary-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.whiteboard-thread-new-badge,
.whiteboard-priority-badge {
  flex: 0 0 auto;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.whiteboard-thread-new-badge {
  background: #fff4df;
  color: #8a5a00;
}

.whiteboard-priority-badge {
  background: #ffe8e8;
  color: #9b1c1c;
}

.whiteboard-thread-expanded {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--line);
}

.whiteboard-thread-replies {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.whiteboard-thread-replies li {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: #f7faff;
}

.whiteboard-thread-replies small {
  color: var(--subtle);
}

.is-hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .dashboard-home-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-modules-sidebar {
    position: static;
  }

  .dashboard-widget-grid,
  .whiteboard-grid {
    grid-template-columns: 1fr;
  }
}
