
    body {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      margin: 0;
      padding: 0;
      background: #f4f5f7;
      color: #222;
    }

    .app-shell {
      display: flex;
      min-height: 100vh;
    }
    .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-backdrop.hidden { display: none; }

.modal {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e6e6e6;
}

.modal-meta {
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
  opacity: 0.9;
}

.modal-body { padding: 12px 16px; max-height: 60vh; overflow: auto; }

.modal-close {
  font-size: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.modal-list { list-style: none; padding: 0; margin: 0; }
.modal-list li { padding: 10px 8px; border-bottom: 1px solid #f3f3f3; }
.modal-list li:last-child { border-bottom: none; }

.modal-link {
  text-decoration: none;
  font-weight: 600;
}

.modal-sub {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 2px;
}


    /* Sidebar */
    .sidebar {
      width: 220px;
      background: #002b4f;
      color: #fff;
      padding: 16px 12px;
      box-sizing: border-box;
      position: sticky;
      top: 0;
      align-self: flex-start;
      height: 100vh;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .sidebar-header {
      font-size: 1rem;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .sidebar-subtitle {
      font-size: 0.8rem;
      opacity: 0.8;
      margin-bottom: 12px;
    }

    .nav-section-title {
      font-size: 0.75rem;
      text-transform: uppercase;
      opacity: 0.7;
      margin: 8px 6px 4px;
    }

    .nav-list {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .nav-button {
      width: 100%;
      text-align: left;
      padding: 8px 10px;
      border-radius: 6px;
      border: none;
      font-size: 0.9rem;
      cursor: pointer;
      background: transparent;
      color: #f0f4f8;
    }

    .nav-button:hover {
      background: rgba(255, 255, 255, 0.08);
    }

    .nav-button.active {
      background: #0f78d1;
      color: #fff;
      font-weight: 600;
    }

    .sidebar-footer {
      margin-top: auto;
      font-size: 0.75rem;
      opacity: 0.7;
    }

    /* Main area */
    .main-area {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    header {
      background: #004578;
      color: white;
      padding: 12px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }

    header h1 {
      margin: 0;
      font-size: 1.25rem;
    }

    header p {
      margin: 2px 0 0;
      font-size: 0.85rem;
      opacity: 0.9;
    }

    main {
  max-width: none;
  width: 100%;
  padding: 0 24px;
}


    .card {
      background: white;
      border-radius: 8px;
      padding: 20px 24px;
      margin-bottom: 20px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }

    h2 {
      margin-top: 0;
      font-size: 1.2rem;
      color: #004578;
    }

    h3 {
      margin-top: 0;
      font-size: 1rem;
      color: #333;
    }

    .section-description {
      font-size: 0.9rem;
      color: #555;
      margin-bottom: 12px;
    }

    .grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 16px 24px;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 4px;
      font-size: 0.9rem;
    }

    label {
      font-weight: 600;
    }

    select,
    input[type="number"],
    input[type="text"],
    input[type="date"],
    textarea {
      padding: 6px 8px;
      border-radius: 4px;
      border: 1px solid #ccc;
      font-size: 0.9rem;
    }

    select:focus,
    input:focus,
    textarea:focus {
      outline: 2px solid #004578;
      outline-offset: 1px;
      border-color: #004578;
    }

    textarea {
      min-height: 80px;
      resize: vertical;
    }

    .checkbox-group {
      display: flex;
      flex-direction: column;
      gap: 4px;
      font-size: 0.9rem;
    }

    .checkbox-group label {
      font-weight: 400;
    }

    .inline {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .inline input[type="number"] {
      max-width: 120px;
    }

    .footer-actions {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-top: 16px;
      flex-wrap: wrap;
      align-items: center;
    }

    .footer-actions-right {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
    }

    button {
      padding: 8px 16px;
      border-radius: 4px;
      border: none;
      font-size: 0.9rem;
      cursor: pointer;
    }

    button.primary {
      background: #004578;
      color: white;
    }

    button.secondary {
      background: #e1e1e1;
      color: #333;
    }

    button.small {
      padding: 4px 8px;
      font-size: 0.75rem;
    }

    small {
      font-size: 0.8rem;
      color: #777;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 12px;
      font-size: 0.8rem;
    }

    th,
    td {
      border: 1px solid #ddd;
      padding: 6px 8px;
      text-align: left;
      vertical-align: top;
    }

    th {
      background: #f0f0f0;
      font-weight: 600;
    }

    .metrics-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
      font-size: 0.85rem;
    }

    .metric-pill {
      background: #f0f4f8;
      border-radius: 999px;
      padding: 6px 12px;
    }

    .badge {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 0.75rem;
      background: #e5f1ff;
      color: #004578;
      margin-left: 8px;
    }

    .subtle {
      opacity: 0.8;
    }

    .pill-counter {
      padding: 4px 8px;
      border-radius: 999px;
      background: #f0f0f0;
      font-size: 0.8rem;
    }

    .editing-indicator {
      color: #c00;
      font-size: 0.85rem;
      margin-left: 8px;
    }

    .note-box {
      background: #fff8e5;
      border-left: 4px solid #f0a500;
      padding: 8px 10px;
      font-size: 0.85rem;
      margin-top: 8px;
    }

    /* Option F: highlight projects with overdue PM tasks */
    tr.pm-overdue-row td {
      background: #fff4f4;
    }

    .view {
      display: none;
    }
    .view.active {
      display: block;
    }

    .summary-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 16px 24px;
    }

    .summary-tile {
      background: #f8fafc;
      border-radius: 8px;
      padding: 12px 14px;
      border: 1px solid #dde3ea;
    }

    .summary-number {
      font-size: 1.4rem;
      font-weight: 600;
      color: #004578;
      margin: 4px 0;
    }

    .month-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 4px;
      font-size: 0.85rem;
    }

    .month-bar .bar {
      height: 8px;
      border-radius: 999px;
      background: #0f78d1;
      min-width: 4px;
    }

    .status-flag-heading {
      margin-top: 0;
      margin-bottom: 6px;
      font-size: 0.95rem;
    }

    .status-tag {
      display: inline-block;
      padding: 2px 6px;
      border-radius: 999px;
      font-size: 0.7rem;
      background: #ffe5e5;
      color: #b30000;
      margin-left: 4px;
    }

    .status-tag-warning {
      background: #fff3cd;
      color: #664d03;
    }

    /* Completion Calendar styles */
    .calendar-container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 16px;
      margin-top: 8px;
    }

    .calendar-month {
      background: #f8fafc;
      border-radius: 8px;
      border: 1px solid #dde3ea;
      padding: 8px 10px;
    }

    .calendar-month-title {
      font-weight: 600;
      font-size: 0.9rem;
      margin-bottom: 4px;
    }

    .calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 2px;
      font-size: 0.7rem;
    }

    .calendar-cell {
      min-height: 40px;
      background: #ffffff;
      border-radius: 4px;
      border: 1px solid #edf2f7;
      padding: 2px 3px;
      box-sizing: border-box;
      overflow: hidden;
    }

    .calendar-header {
      background: #eef2f7;
      font-weight: 600;
      text-align: center;
    }

    .calendar-day-number {
      font-weight: 600;
      margin-bottom: 1px;
    }

    .calendar-project {
      margin-top: 1px;
      line-height: 1.2;
      word-wrap: break-word;
    }

    @media (max-width: 800px) {
      .app-shell {
        flex-direction: column;
      }
      .sidebar {
        position: static;
        height: auto;
        width: 100%;
        flex-direction: row;
        align-items: center;
      }
      .nav-section-title, .sidebar-footer, .sidebar-subtitle {
        display: none;
      }
      .nav-list {
        flex-direction: row;
        gap: 4px;
      }
      .nav-button {
        font-size: 0.8rem;
      }
    }
  /* DASHBOARD LAYOUT */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* KPI cards grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

/* Each KPI card spans 3 columns on desktop (4 cards per row) */
.kpi-card {
  grid-column: span 3;
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #eef2f7;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.10);
}

.kpi-label {
  font-size: 0.85rem;
  color: #556;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #004578;
  margin-top: 6px;
}

.kpi-sub {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #667;
  opacity: 0.9;
}

/* Dashboard “sections” under KPIs: use two columns on desktop */
.dashboard-sections {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 16px;
}

/* Responsive breakpoints */
@media (max-width: 1100px) {
  .kpi-card { grid-column: span 4; } /* 3 per row */
  .dashboard-sections { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  main { padding: 0 14px; }
  .kpi-card { grid-column: span 6; } /* 2 per row */
}

@media (max-width: 520px) {
  .kpi-card { grid-column: span 12; } /* 1 per row */
}
.kpi-card {
  opacity: 0;
  transform: translateY(6px);
}

.kpi-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 180ms ease;
}
/* Constrained content (forms like Add Project) */
.narrow-content {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}


/* RAID status pills */
.pm-pill{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  line-height:1.4;
  border:1px solid rgba(0,0,0,0.12);
}
.pm-pill--ok{ background: rgba(0, 128, 0, 0.08); }
.pm-pill--warn{ background: rgba(255, 165, 0, 0.10); }



/* ------------------------------
   PM Modal System (PM Dashboard)
   ------------------------------ */
.pm-hidden { display: none !important; }

.pm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.pm-modal__content {
  width: 100%;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.pm-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.pm-modal__body {
  padding: 16px;
  overflow: auto;
  max-height: calc(100vh - 140px);
}

.pm-muted { opacity: 0.85; }

.pm-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pm-btn {
  border: 1px solid rgba(0,0,0,0.18);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.pm-btn:hover { background: rgba(0,0,0,0.03); }
