/* ── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Brand */
  --blue:        #2F6BD8;
  --blue-dark:   #1E4FA8;
  --blue-light:  #EBF1FD;
  --ink:         #1A1A1F;
  --ink-80:      rgba(26,26,31,0.80);
  --steel:       #9A9AA2;
  --steel-light: #D0D0D5;
  --mist:        #F3F3F5;
  --white:       #FFFFFF;

  /* Semantic */
  --color-success:     #166534;
  --color-success-bg:  #DCFCE7;
  --color-warning:     #92400E;
  --color-warning-bg:  #FEF3C7;
  --color-danger:      #991B1B;
  --color-danger-bg:   #FEE2E2;
  --color-info:        #1E40AF;
  --color-info-bg:     #DBEAFE;

  /* Status colors */
  --status-complete:    #166534;
  --status-complete-bg: #DCFCE7;
  --status-inprocess:   #1E40AF;
  --status-inprocess-bg:#DBEAFE;
  --status-notstarted:  #374151;
  --status-notstarted-bg:#F3F4F6;
  --status-onhold:      #92400E;
  --status-onhold-bg:   #FEF3C7;
  --status-overdue:     #991B1B;
  --status-overdue-bg:  #FEE2E2;

  /* Sidebar */
  --sidebar-w:      220px;
  --sidebar-bg:     #1A1A1F;
  --sidebar-border: rgba(255,255,255,0.08);
  --sidebar-text:   rgba(255,255,255,0.65);
  --sidebar-hover:  rgba(255,255,255,0.07);
  --sidebar-active: rgba(47,107,216,0.25);
  --sidebar-active-text: #FFFFFF;

  /* Layout */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.10);

  /* Typography */
  --font: 'Space Grotesk', Arial, sans-serif;
  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  28px;
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ── APP SHELL ──────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo a {
  display: block;
}
.sidebar-logo svg {
  width: 140px;
  height: auto;
}

.sidebar-section {
  padding: 12px 8px 8px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-section-header {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel);
  padding: 0 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Project filter toggle */
.proj-filter-toggle {
  display: flex;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pft-btn {
  border: none;
  background: transparent;
  color: var(--steel);
  font-size: 10px;
  font-family: var(--font);
  padding: 2px 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.pft-btn.active {
  background: var(--blue);
  color: white;
}

/* Project links */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}
.proj-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: var(--text-sm);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
}
.proj-link:hover {
  background: var(--sidebar-hover);
  color: white;
}
.proj-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 500;
}
.proj-link i { font-size: 14px; flex-shrink: 0; }
.proj-link span { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.proj-closed-tag {
  font-size: 9px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 1px 6px;
  color: var(--steel);
  flex-shrink: 0;
}
.sidebar-empty {
  font-size: var(--text-xs);
  color: var(--steel);
  padding: 6px 8px;
}

/* New project button */
.btn-new-project {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  color: var(--blue);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background 0.15s;
  margin-top: 2px;
}
.btn-new-project:hover { background: var(--sidebar-hover); }
.btn-new-project i { font-size: 14px; }

/* Tab navigation */
.sidebar-nav { border-bottom: 1px solid var(--sidebar-border); }
.tab-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tab-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 8px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: var(--text-sm);
  transition: background 0.15s, color 0.15s;
}
.tab-link:hover {
  background: var(--sidebar-hover);
  color: white;
}
.tab-link.active {
  background: var(--blue);
  color: white;
  font-weight: 500;
}
.tab-link i { font-size: 15px; flex-shrink: 0; }
.tab-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 4px 0;
}

.sidebar-spacer { flex: 1; }

/* User footer */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-top: 1px solid var(--sidebar-border);
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 10px;
  color: var(--steel);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logout-btn {
  color: var(--steel);
  font-size: 16px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  flex-shrink: 0;
}
.logout-btn:hover { color: white; }

/* ── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ── FLASH MESSAGES ─────────────────────────────────────── */
.flash-container {
  padding: 12px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
}
.flash-success { background: var(--color-success-bg); color: var(--color-success); }
.flash-error   { background: var(--color-danger-bg);  color: var(--color-danger); }
.flash-info    { background: var(--color-info-bg);    color: var(--color-info); }
.flash-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  font-size: 14px;
  cursor: pointer;
}

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-left { flex: 1; min-width: 0; }
.page-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-subtitle {
  font-size: var(--text-sm);
  color: var(--steel);
  margin-top: 3px;
}
.page-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── CONTENT AREA ───────────────────────────────────────── */
.page-body {
  padding: 20px 24px 32px;
  flex: 1;
}

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid #E8E8EC;
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid #F0F0F3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: var(--text-base);
  font-weight: 600;
}
.card-body { padding: 16px; }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid #D0D0D5;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--mist); }
.btn i { font-size: 15px; }

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.btn-danger {
  color: var(--color-danger);
  border-color: #FECACA;
}
.btn-danger:hover { background: var(--color-danger-bg); }

.btn-success {
  color: var(--color-success);
  border-color: #BBF7D0;
}
.btn-success:hover { background: var(--color-success-bg); }

.btn-sm {
  padding: 4px 10px;
  font-size: var(--text-xs);
}
.btn-sm i { font-size: 13px; }

.btn-icon {
  padding: 6px;
  border-radius: var(--radius-md);
  background: none;
  border: none;
  color: var(--steel);
  cursor: pointer;
  display: inline-flex;
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: var(--mist); color: var(--ink); }
.btn-icon i { font-size: 16px; }

/* ── FORMS ──────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.form-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--steel);
  letter-spacing: 0.03em;
}
.form-control {
  padding: 8px 11px;
  border: 1px solid #D0D0D5;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.15s;
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,107,216,0.12);
}
.form-control[readonly] {
  background: var(--mist);
  color: var(--steel);
  cursor: not-allowed;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.full   { grid-template-columns: 1fr; }

/* ── TABLES ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.data-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--steel);
  letter-spacing: 0.04em;
  border-bottom: 1px solid #E8E8EC;
  white-space: nowrap;
  background: var(--white);
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #F0F0F3;
  vertical-align: middle;
}
.data-table tr:hover td { background: #FAFAFB; }
.data-table tr:last-child td { border-bottom: none; }

/* Phase row */
.phase-header td {
  background: #F8F8FA !important;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--blue);
  padding: 8px 12px;
}

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.badge-complete    { background: var(--status-complete-bg);    color: var(--status-complete); }
.badge-in-process  { background: var(--status-inprocess-bg);   color: var(--status-inprocess); }
.badge-not-started { background: var(--status-notstarted-bg);  color: var(--status-notstarted); }
.badge-on-hold     { background: var(--status-onhold-bg);      color: var(--status-onhold); }
.badge-overdue     { background: var(--status-overdue-bg);     color: var(--status-overdue); }
.badge-open        { background: var(--color-info-bg);         color: var(--color-info); }
.badge-closed      { background: var(--status-notstarted-bg);  color: var(--status-notstarted); }

/* ── PROGRESS BAR ───────────────────────────────────────── */
.pct-bar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.pct-track {
  width: 64px;
  height: 5px;
  background: #E8E8EC;
  border-radius: 3px;
  overflow: hidden;
}
.pct-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--blue);
  transition: width 0.3s;
}
.pct-label {
  font-size: var(--text-xs);
  color: var(--steel);
  min-width: 28px;
}

/* ── STAT GRID ──────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border: 1px solid #E8E8EC;
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}
.stat-val {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--steel);
  margin-top: 4px;
  font-weight: 500;
}

/* ── SECTION TITLE ──────────────────────────────────────── */
.section-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink);
  margin: 20px 0 10px;
}

/* ── CLOSED BANNER ──────────────────────────────────────── */
.closed-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #F8F8FA;
  border: 1px solid #E8E8EC;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--steel);
  margin-bottom: 16px;
}
.closed-banner i { font-size: 16px; }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--steel);
}
.empty-state i {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}
.empty-state p {
  font-size: var(--text-base);
  margin-bottom: 16px;
}

/* ── DEP TAG ────────────────────────────────────────────── */
.dep-tag {
  display: inline-block;
  background: var(--mist);
  border-radius: 100px;
  padding: 1px 8px;
  font-size: var(--text-xs);
  color: var(--steel);
  margin-right: 3px;
  border: 1px solid #E8E8EC;
}

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 540px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #F0F0F3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: var(--text-md); font-weight: 600; }
.modal-body  { padding: 18px 20px; }
.modal-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid #F0F0F3;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-footer-left { margin-right: auto; }

/* ── GANTT ──────────────────────────────────────────────── */
.gantt-wrap { overflow-x: auto; }
.gantt-table {
  border-collapse: collapse;
  font-size: var(--text-xs);
  width: max-content;   /* size to the days shown; the Task column is fixed at 220px */
}
.gantt-table th,
.gantt-table td {
  border: 1px solid #E8E8EC;
  padding: 4px 6px;
  white-space: nowrap;
}
.gantt-table th {
  background: #F8F8FA;
  font-weight: 600;
  text-align: center;
}
.gantt-bar-cell {
  position: relative;
  padding: 0 !important;
  min-width: 20px;
  height: 28px;
}
/* Planned = wide soft grey-blue band. Prints cleanly as a light grey fill. */
.gantt-bar-planned {
  height: 18px;
  border-radius: 3px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #E4E9F2;
  border: 1px solid #B9C3D6;
  box-sizing: border-box;
  z-index: 1;
}
/* Actual = thinner band nested in the middle of the planned band. The full
   band outlines the estimated duration measured from actual_start; the solid
   fill inside represents pct_complete progress against that duration. */
.gantt-bar-actual {
  height: 8px;
  border-radius: 2px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid var(--blue-dark);
  box-sizing: border-box;
  z-index: 2;
}
.gantt-bar-actual-fill {
  height: 8px;
  border-radius: 2px 0 0 2px;
  position: absolute;
  top: 0;
  left: 0;
  background: var(--blue-dark);
  z-index: 2;
}
/* Ghost bar for tasks with no planned dates yet */
.gantt-bar-ghost {
  height: 18px;
  border-radius: 3px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #F4F4F6;
  border: 1px dashed var(--steel-light);
  box-sizing: border-box;
  z-index: 1;
}
/* Aggregate band on phase summary rows */
.gantt-bar-phase {
  height: 12px;
  border-radius: 3px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #B9C3D6;
  opacity: 0.55;
}
.gantt-bar-planned.critical,
.gantt-bar-ghost.critical {
  box-shadow: 0 0 0 1.5px #EF4444;
}
.gantt-phase-row td {
  background: #F0F4FF !important;
  font-weight: 600;
  color: var(--blue);
}
.gantt-wknd {
  background: #F8F8FA !important;
  opacity: 0.6;
}
.gantt-today {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
}
.gantt-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: var(--text-xs);
  color: var(--steel);
  flex-wrap: wrap;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

/* ── KANBAN ─────────────────────────────────────────────── */
.kanban-owner-section { margin-bottom: 28px; }
.kanban-owner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #E8E8EC;
}
.owner-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.kanban-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.kanban-col {
  background: #F8F8FA;
  border-radius: var(--radius-lg);
  border: 1px solid #E8E8EC;
  padding: 12px;
  min-height: 80px;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.kanban-col-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kanban-col-count {
  font-size: var(--text-xs);
  background: white;
  border: 1px solid #E8E8EC;
  border-radius: 100px;
  padding: 1px 7px;
  color: var(--steel);
}
.kanban-card {
  background: white;
  border: 1px solid #E8E8EC;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kanban-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-sm);
}
.kanban-card:last-child { margin-bottom: 0; }
.kanban-card-name {
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: 3px;
  line-height: 1.4;
}
.kanban-card-meta {
  font-size: var(--text-xs);
  color: var(--steel);
  margin-bottom: 4px;
}
.kanban-card-due { font-size: var(--text-xs); margin-top: 5px; }
.due-overdue { color: var(--color-danger); }
.due-soon    { color: var(--color-warning); }
.due-ok      { color: var(--steel); }
.kanban-empty {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--steel-light);
  padding: 16px 0;
}
.kanban-card.action-card {
  border-style: dashed;
  background: #FAFAFA;
}
.action-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border-radius: 100px;
  padding: 1px 7px;
  margin-bottom: 5px;
}
.pct-bar-kanban {
  height: 4px;
  background: #E8E8EC;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.pct-bar-kanban-fill { height: 100%; border-radius: 2px; }

/* ── NOTES ──────────────────────────────────────────────── */
.notes-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  min-height: 400px;
}
.notes-sidebar {
  border-right: 1px solid #E8E8EC;
  padding-right: 20px;
}
.note-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #D0D0D5;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font);
  margin-bottom: 10px;
  color: var(--ink);
  background: white;
}
.note-search:focus {
  outline: none;
  border-color: var(--blue);
}
.note-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 4px;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.note-item:hover { background: var(--mist); }
.note-item.active {
  background: var(--blue-light);
  border-color: #C3D7F7;
}
.note-item-title {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-item-meta {
  font-size: var(--text-xs);
  color: var(--steel);
  margin-top: 2px;
}
.note-body {
  font-size: var(--text-sm);
  line-height: 1.7;
  white-space: pre-wrap;
  background: var(--mist);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  min-height: 100px;
  color: var(--ink);
}
.action-item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #F0F0F3;
  font-size: var(--text-sm);
}
.action-item-row:last-child { border-bottom: none; }
.action-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── MEETING TYPE BADGES ────────────────────────────────── */
.type-kickoff  { background: #DBEAFE; color: #1E40AF; }
.type-status   { background: #DCFCE7; color: #166534; }
.type-review   { background: #FEF3C7; color: #92400E; }
.type-decision { background: #FEE2E2; color: #991B1B; }
.type-other    { background: #F3F4F6; color: #374151; }

/* ── AUTH PAGES ─────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  padding: 20px;
}
.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  width: 420px;
  max-width: 100%;
  box-shadow: var(--shadow-md);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo svg { width: 160px; height: auto; }
.auth-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  text-align: center;
}
.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--steel);
  text-align: center;
  margin-bottom: 24px;
}
.auth-footer {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--steel);
  margin-top: 20px;
}
.auth-footer a { color: var(--blue); font-weight: 500; }

/* ── PROJECT INDEX ──────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.project-card {
  background: white;
  border: 1px solid #E8E8EC;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: block;
}
.project-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-sm);
}
.project-card-name {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}
.project-card-meta {
  font-size: var(--text-xs);
  color: var(--steel);
  margin-bottom: 12px;
}
.project-card-progress {
  height: 5px;
  background: #E8E8EC;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.project-card-progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
}
.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

/* ── TEAM GRID ──────────────────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.team-card {
  background: white;
  border: 1px solid #E8E8EC;
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.team-card-info { flex: 1; min-width: 0; }
.team-card-name { font-size: var(--text-sm); font-weight: 600; }
.team-card-role { font-size: var(--text-xs); color: var(--steel); margin-top: 2px; }
.team-card-initials {
  font-size: var(--text-xs);
  color: var(--steel);
  margin-top: 2px;
}

/* ── PRINT REPORT PAGES ─────────────────────────────────── */
@media print {
  .sidebar, .page-header-actions, .btn, .flash-container { display: none !important; }
  .app-shell { display: block; }
  .main-content { overflow: visible; }
  body { background: white; }
}

/* ── UTILITIES ──────────────────────────────────────────── */
.text-muted  { color: var(--steel); }
.text-danger { color: var(--color-danger); }
.text-success{ color: var(--color-success); }
.text-warning{ color: var(--color-warning); }
.text-blue   { color: var(--blue); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

/* ── COLLAPSIBLE SIDEBAR ─────────────────────────────────── */
.app-shell.sidebar-collapsed .sidebar {
  width: 52px;
  min-width: 52px;
}
.app-shell.sidebar-collapsed .sidebar-logo { padding: 14px 10px; }
.app-shell.sidebar-collapsed .sidebar-logo svg { display: none; }
.app-shell.sidebar-collapsed .sidebar-logo::after {
  content: '';
  display: block;
  width: 32px; height: 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Crect width='120' height='120' rx='26' fill='%231a1a1f'/%3E%3Ctext x='60' y='60' font-family='Arial' font-size='60' font-weight='600' text-anchor='middle' dominant-baseline='central'%3E%3Ctspan fill='%23ffffff'%3EA%3C/tspan%3E%3Ctspan fill='%232f6bd8'%3EX%3C/tspan%3E%3C/text%3E%3C/svg%3E") center/contain no-repeat;
}
.app-shell.sidebar-collapsed .sidebar-section-header span,
.app-shell.sidebar-collapsed .proj-filter-toggle,
.app-shell.sidebar-collapsed .project-list,
.app-shell.sidebar-collapsed .btn-new-project,
.app-shell.sidebar-collapsed .tab-nav .tab-link span,
.app-shell.sidebar-collapsed .user-info,
.app-shell.sidebar-collapsed .user-name,
.app-shell.sidebar-collapsed .user-email,
.app-shell.sidebar-collapsed .proj-link span,
.app-shell.sidebar-collapsed .proj-closed-tag,
.app-shell.sidebar-collapsed .sidebar-empty { display: none; }
.app-shell.sidebar-collapsed .tab-link,
.app-shell.sidebar-collapsed .proj-link { justify-content: center; padding: 9px 0; }
.app-shell.sidebar-collapsed .tab-link i,
.app-shell.sidebar-collapsed .proj-link i { margin: 0; font-size: 17px; }
.app-shell.sidebar-collapsed .sidebar-user { padding: 10px 6px; justify-content: center; gap: 0; flex-direction: column; }
.app-shell.sidebar-collapsed .user-avatar { width: 28px; height: 28px; font-size: 11px; }
.app-shell.sidebar-collapsed .logout-btn,
.app-shell.sidebar-collapsed .sidebar-user a[href*="admin"] { display: none; }
.app-shell.sidebar-collapsed .sidebar-section { padding: 8px 4px; }
.app-shell.sidebar-collapsed .tab-divider { margin: 4px 4px; }

/* Toggle button */
.sidebar-toggle {
  position: fixed;
  bottom: 80px;
  left: 0;
  z-index: 100;
  width: 20px;
  height: 36px;
  background: var(--blue);
  border: none;
  border-radius: 0 6px 6px 0;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: left 0.2s;
  box-shadow: 2px 0 6px rgba(0,0,0,0.15);
}
.sidebar-toggle:hover { background: var(--blue-dark); }
.app-shell:not(.sidebar-collapsed) .sidebar-toggle { left: var(--sidebar-w); }
.app-shell.sidebar-collapsed .sidebar-toggle { left: 52px; }

/* Smooth transition */
.sidebar { transition: width 0.2s ease, min-width 0.2s ease; overflow: hidden; }

/* ── CRITICAL PATH ───────────────────────────────────────── */

.cp-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600; padding: 1px 6px;
  border-radius: 100px; background: #FEE2E2; color: #991B1B;
}

/* ── RESOURCE CAPACITY ───────────────────────────────────── */
.capacity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.capacity-card {
  background: white;
  border: 1px solid #E8E8EC;
  border-radius: var(--radius-lg);
  padding: 14px;
}
.capacity-bar-wrap {
  height: 6px; background: #E8E8EC; border-radius: 3px;
  margin: 8px 0 4px; overflow: hidden;
}
.capacity-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }

/* ── EV WIDGET ───────────────────────────────────────────── */
.ev-gauge {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.ev-card {
  flex: 1; min-width: 120px;
  background: white; border: 1px solid #E8E8EC;
  border-radius: var(--radius-lg); padding: 14px; text-align: center;
}
.ev-val { font-size: 22px; font-weight: 700; }
.ev-label { font-size: 11px; color: var(--steel); margin-top: 3px; }

/* ── ACTION ITEM CARD — distinct from task cards ─────────── */
.kanban-card.action-card {
  border: 1.5px dashed #D97706;
  border-left: 4px solid #D97706;
  background: #FFFBF2;
  border-radius: var(--radius-md);
}
.kanban-card.action-card:hover {
  border-color: #92400E;
  box-shadow: var(--shadow-sm);
  background: #FFF8E8;
}

/* ── TASK ROW DRAG AND DROP ──────────────────────────────── */
.task-row-draggable { cursor: grab; }
.task-row-draggable:active { cursor: grabbing; }
.task-row-dragging {
  opacity: 0.4;
  background: #EBF1FD !important;
}
.task-row-drag-over td {
  border-top: 2px solid var(--blue) !important;
}
.drag-handle {
  color: var(--steel-light);
  cursor: grab;
  padding: 0 4px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.drag-handle:hover { color: var(--steel); }

/* Meeting list: attendees wrap and stop at two lines (full list in the meeting detail) */
.note-attendees {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* Team tab: what each project role can do */
.role-help { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 13px; }
.role-help dt { font-weight: 600; color: var(--ink); }
.role-help dd { margin: 0; color: var(--steel); }
