/* ZTPrototypes Portal — shared styles */

:root {
  --brand-color: #23637A;
  --brand-color-hover: #1a4a5b;
  --brand-color-tint: rgba(35, 99, 122, 0.08);
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg-page: #f9fafb;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  --border-color-light: #f3f4f6;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Header ---------- */

.app-header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}

.app-header .brand-logo {
  font-size: 20px;
  font-weight: 800;
}

.app-header .brand-name {
  font-weight: 600;
  font-size: 16px;
}

.app-header nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-header .user-email {
  font-size: 13px;
  color: var(--text-secondary);
}

.app-header .icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.app-header .icon-btn:hover {
  background: var(--border-color-light);
  color: var(--text-primary);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-color-hover);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--brand-color);
  border-color: var(--brand-color);
}

.btn-outline:hover {
  background: var(--brand-color);
  color: #fff;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--border-color-light);
  color: var(--text-primary);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
}

/* ---------- Layout: Sidebar + Content ---------- */

.app-shell {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0 12px 16px;
  border-bottom: 1px solid var(--border-color-light);
  margin-bottom: 16px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
}

.sidebar-nav-item:hover {
  background: var(--border-color-light);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: var(--brand-color);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---------- Homepage ---------- */

.homepage {
  min-height: 100vh;
  background: #fff;
}

.hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 96px 24px 64px;
  text-align: center;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ---------- Login ---------- */

.auth-container {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  text-align: center;
}

.auth-card .auth-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color 0.15s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-tint);
}

.form-error {
  background: var(--danger-bg);
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid #fecaca;
}

.form-submit {
  width: 100%;
  margin-top: 8px;
}

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
}

.empty-state h3 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* ---------- Utilities ---------- */

.hidden {
  display: none !important;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ---------- Page header with action button ---------- */

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header-row .page-title,
.page-header-row .page-subtitle {
  margin-bottom: 0;
}

.page-header-row .page-subtitle {
  margin-top: 4px;
}

.section-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* ---------- Search input ---------- */

.search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-card);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-tint);
}

/* ---------- Data table ---------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead tr {
  background: #f9fafb;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color-light);
  color: var(--text-primary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr.row-clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.data-table tr.row-clickable:hover {
  background: #f9fafb;
}

.data-table .font-medium {
  font-weight: 500;
}

.data-table .text-muted {
  color: var(--text-secondary);
}

.btn-link-danger {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.btn-link-danger:hover {
  background: var(--danger-bg);
}

/* ---------- Toast ---------- */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: #1f2937;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  max-width: 380px;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: #065f46;
}

.toast-danger {
  background: #991b1b;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.modal-overlay.modal-visible {
  opacity: 1;
}

.modal-panel {
  background: #fff;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  transform: scale(0.96);
  transition: transform 0.15s ease;
}

.modal-overlay.modal-visible .modal-panel {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border-color-light);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #f9fafb;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* ---------- Form ---------- */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  resize: vertical;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-tint);
}

.required {
  color: var(--danger);
}

.helper-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #c82333;
  text-decoration: none;
}

/* ---------- Detail list ---------- */

.detail-list {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 16px;
  font-size: 14px;
}

.detail-list dt {
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-list dd {
  color: var(--text-primary);
}

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

.item-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid var(--border-color-light);
  border-radius: 6px;
  font-size: 14px;
}

/* ---------- Badge ---------- */

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  text-transform: capitalize;
  border: 1px solid transparent;
}

.badge-active {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.badge-completed {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.badge-on_hold {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.badge-cancelled {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

/* ---------- Project grid ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.project-card:hover {
  box-shadow: var(--shadow-md);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.project-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.project-card-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}

.project-card-footer {
  border-top: 1px solid var(--border-color-light);
  padding-top: 12px;
  display: flex;
  justify-content: center;
}

.btn-link-brand {
  background: none;
  border: none;
  color: var(--brand-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.btn-link-brand:hover {
  background: var(--brand-color-tint);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 50%;
  color: var(--text-muted);
}

/* ---------- Client checkbox list (in project modal) ---------- */

.client-search-wrap {
  margin-bottom: 8px;
}

.client-search-wrap input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

.client-search-wrap input:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 2px var(--brand-color-tint);
}

.client-checkbox-list {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  max-height: 180px;
  overflow-y: auto;
  background: #f9fafb;
  padding: 4px;
}

.client-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.client-checkbox-row:hover {
  background: #fff;
}

.client-checkbox-row input[type=checkbox] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand-color);
}

.client-checkbox-info {
  flex: 1;
  min-width: 0;
}

.client-checkbox-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.client-checkbox-email {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Project page ---------- */

.project-page {
  min-height: calc(100vh - 64px);
  background: var(--bg-page);
}

.project-page-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.back-link:hover {
  background: var(--border-color-light);
  color: var(--text-primary);
  text-decoration: none;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.project-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.project-description {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 720px;
}

.project-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.project-tab {
  background: none;
  border: none;
  padding: 12px 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.project-tab:hover {
  color: var(--text-primary);
}

.project-tab.active {
  color: var(--brand-color);
  border-bottom-color: var(--brand-color);
}

/* ---------- Overview tab ---------- */

.overview-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.tab-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-tile-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-tile-icon {
  color: var(--text-muted);
}

.stat-tile-orange .stat-tile-icon { color: #f59e0b; }
.stat-tile-blue .stat-tile-icon { color: #3b82f6; }
.stat-tile-green .stat-tile-icon { color: #10b981; }

.stat-tile-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.1;
}

.stat-tile-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.progress-bar {
  height: 8px;
  background: var(--border-color-light);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--brand-color);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.overview-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color-light);
}

.overview-card-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-color-tint);
  color: var(--brand-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overview-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.overview-card-body {
  padding: 16px 20px;
}

.dashed-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 14px;
  background: #fcfcfd;
  border: 2px dashed var(--border-color-light);
  border-radius: 8px;
}

.upcoming-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f9fafb;
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  margin-bottom: 10px;
}

.upcoming-row:last-child {
  margin-bottom: 0;
}

.upcoming-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-color);
  flex-shrink: 0;
}

.upcoming-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.upcoming-row-date {
  font-size: 12px;
  color: var(--text-secondary);
  background: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* ---------- Project Plan tab ---------- */

.plan-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.count-badge {
  display: inline-block;
  background: var(--border-color-light);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.milestone-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.milestone-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.milestone-card-header:hover {
  background: #f9fafb;
}

.milestone-card-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-color-tint);
  color: var(--brand-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.milestone-card-main {
  flex: 1;
  min-width: 0;
}

.milestone-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.milestone-card-dates {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.date-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
  background: #f3f4f6;
  color: var(--text-secondary);
  border: 1px solid var(--border-color-light);
}

.date-pill-start {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.date-pill-due {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.milestone-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.milestone-card-actions .icon-btn {
  width: 28px;
  height: 28px;
  padding: 4px;
}

.chevron {
  color: var(--text-muted);
  font-size: 14px;
  margin-left: 4px;
  width: 14px;
  text-align: center;
}

.milestone-card-body {
  border-top: 1px solid var(--border-color-light);
  padding: 16px 20px;
  background: #fcfcfd;
}

.milestone-section {
  margin-bottom: 16px;
}

.milestone-section:last-child {
  margin-bottom: 0;
}

.milestone-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.milestone-description {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.deliverables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
}

.deliverable-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  font-size: 13px;
}

.deliverable-row-name {
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}

.deliverable-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.deliverable-row-actions .icon-btn {
  width: 24px;
  height: 24px;
  padding: 3px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
}

.task-row-icon {
  width: 28px;
  height: 28px;
  background: #f3f4f6;
  color: var(--text-secondary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-row-main {
  flex: 1;
  min-width: 0;
}

.task-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.task-row-dates {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.task-row-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.task-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.task-row-actions .icon-btn {
  width: 26px;
  height: 26px;
  padding: 4px;
}

/* ---------- Form: select & range ---------- */

.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.form-group select:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-tint);
}

.form-group input[type=range] {
  width: 100%;
  accent-color: var(--brand-color);
}

.form-group input[type=date] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input[type=date]:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-tint);
}

/* ---------- Project plan tab ---------- */

.plan-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.milestones-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  background: var(--brand-color-tint);
  color: var(--brand-color);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

/* ---------- Milestone card ---------- */

.milestone-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.milestone-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.milestone-card-header:hover {
  background: #f9fafb;
}

.milestone-card-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-color-tint);
  color: var(--brand-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.milestone-card-info {
  flex: 1;
  min-width: 0;
}

.milestone-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.milestone-card-dates {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.date-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid transparent;
}

.date-pill-start {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.date-pill-due {
  background: #f3f4f6;
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.milestone-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.chevron.rotated {
  transform: rotate(180deg);
}

.milestone-card-body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border-color-light);
  padding-top: 16px;
}

.milestone-section {
  margin-bottom: 18px;
}

.milestone-section:last-child {
  margin-bottom: 0;
}

.milestone-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.milestone-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.milestone-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color-light);
}

/* ---------- Deliverable pills ---------- */

.deliverables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.deliverable-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  font-size: 13px;
  color: var(--brand-color);
}

.deliverable-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deliverable-due {
  font-size: 11px;
  color: var(--text-secondary);
  background: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

/* ---------- Task card (in plan) ---------- */

.task-card {
  background: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.task-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  color: var(--text-secondary);
}

.task-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.task-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.task-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  margin-left: 24px;
  font-style: italic;
}

.icon-btn-tiny {
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn-tiny:hover {
  background: var(--border-color-light);
  color: var(--text-primary);
}

.icon-btn-tiny-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Date input + select styling */

.form-group input[type=date],
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
}

.form-group input[type=date]:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-tint);
}

.form-group input[type=range] {
  width: 100%;
  accent-color: var(--brand-color);
}

/* ---------- Gantt chart ---------- */

.gantt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.gantt-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  background: #fafbfc;
}

.gantt-icon {
  color: var(--brand-color);
  display: flex;
}

.gantt-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.gantt-body {
  display: flex;
  max-height: 480px;
  overflow: hidden;
}

.gantt-sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  background: #fff;
  display: flex;
  flex-direction: column;
}

.gantt-sidebar-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  background: #f9fafb;
  border-bottom: 1px solid var(--border-color);
}

.gantt-sidebar-rows {
  flex: 1;
  overflow: hidden;
}

.gantt-sidebar-row {
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 6px;
  border-bottom: 1px solid var(--border-color-light);
  white-space: nowrap;
  overflow: hidden;
}

.gantt-sidebar-row-milestone {
  cursor: pointer;
  background: #fff;
  transition: background 0.15s ease;
}

.gantt-sidebar-row-milestone:hover {
  background: #f9fafb;
}

.gantt-sidebar-row-task {
  background: #f9fafb;
  padding-left: 36px;
}

.gantt-chevron-wrap {
  color: var(--text-muted);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
}

.gantt-spacer {
  display: inline-block;
  width: 14px;
}

.gantt-task-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.gantt-row-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-row-label-task {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 12px;
}

.gantt-timeline-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
}

.gantt-timeline {
  position: relative;
}

.gantt-timeline-header {
  height: 56px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
}

.gantt-months {
  display: flex;
  height: 28px;
  border-bottom: 1px solid var(--border-color-light);
}

.gantt-month {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-color-light);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f3f4f6;
}

.gantt-days {
  display: flex;
  height: 28px;
}

.gantt-day {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-color-light);
  font-size: 10px;
  color: var(--text-muted);
}

.gantt-day-weekend {
  background: #f3f4f6;
}

.gantt-grid {
  position: absolute;
  top: 56px;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  pointer-events: none;
}

.gantt-grid-col {
  border-right: 1px solid #f3f4f6;
}

.gantt-grid-col-weekend {
  background: rgba(243, 244, 246, 0.5);
}

.gantt-rows {
  position: relative;
}

.gantt-row {
  position: relative;
  border-bottom: 1px solid var(--border-color-light);
}

.gantt-row-task {
  background: rgba(249, 250, 251, 0.5);
}

.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 10;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.gantt-bar:hover {
  filter: brightness(1.1);
}

.gantt-bar-milestone {
  height: 28px;
  background: var(--brand-color);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.gantt-bar-task {
  height: 18px;
  background: #d1d5db;
  border-radius: 999px;
  opacity: 0.85;
}

.gantt-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: #1f2937;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  z-index: 50;
}

.gantt-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1f2937;
}

.gantt-tooltip-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.gantt-tooltip-dates {
  color: #d1d5db;
}

.gantt-bar:hover .gantt-tooltip {
  opacity: 1;
}

/* ---------- Progress tab ---------- */

.progress-milestone {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.progress-milestone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.progress-milestone-header:hover {
  background: #f9fafb;
}

.progress-milestone-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-flag-icon {
  color: var(--text-muted);
}

.progress-milestone-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-milestone-name.is-complete {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.progress-milestone-percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.progress-milestone-body {
  padding: 0 20px 18px;
  border-top: 1px solid var(--border-color-light);
  padding-top: 14px;
}

.progress-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.progress-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  gap: 16px;
}

.progress-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.progress-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-row-name.is-complete {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.progress-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 280px;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-fill-orange {
  background: #f59e0b;
}

.progress-fill-yellow {
  background: #eab308;
}

.progress-fill-green {
  background: #10b981;
}

.progress-percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 38px;
  text-align: right;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
}

/* ---------- Documents tab ---------- */

.documents-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.documents-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.breadcrumb-link:hover {
  background: var(--border-color-light);
  color: var(--text-primary);
}

.breadcrumb-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 8px;
}

.breadcrumb-sep {
  color: var(--text-muted);
}

.documents-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-wrap {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  padding: 6px;
  z-index: 100;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--border-color-light);
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 20px;
}

.document-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  border: 1px solid transparent;
}

.document-item:hover {
  background: #f9fafb;
  border-color: var(--border-color-light);
}

.document-item.selected {
  background: var(--brand-color-tint);
  border-color: var(--brand-color);
}

.document-item input[type=checkbox] {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand-color);
}

.document-item-icon {
  margin-bottom: 8px;
}

.document-item-icon.folder {
  color: #f59e0b;
}

.document-item-icon.file {
  color: var(--text-secondary);
}

.document-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.document-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Upload progress modal */

.upload-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color-light);
}

.upload-row:last-child {
  border-bottom: none;
}

.upload-row-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.upload-row-name {
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  margin-right: 12px;
}

.upload-row-size {
  color: var(--text-muted);
  font-size: 12px;
}

.upload-row-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-row-bar {
  flex: 1;
  height: 6px;
  background: var(--border-color-light);
  border-radius: 999px;
  overflow: hidden;
}

.upload-row-bar-fill {
  height: 100%;
  background: var(--brand-color);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.upload-row-bar-fill.upload-success {
  background: #10b981;
}

.upload-row-bar-fill.upload-failed {
  background: var(--danger);
}

.upload-row-percent {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 36px;
  text-align: right;
}

.comms-header-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.comms-subtabs { display: flex; gap: 8px; margin-top: 16px; border-bottom: 1px solid var(--border-color); }
.comms-subtab { background: none; border: none; padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.comms-subtab.active { color: var(--brand-color); border-bottom-color: var(--brand-color); }
.comms-actions-row { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.comms-timeline { position: relative; padding-left: 28px; }
.comms-timeline-line { position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border-color); }
.comms-timeline-item { position: relative; margin-bottom: 16px; }
.comms-timeline-dot { position: absolute; left: -22px; top: 16px; width: 12px; height: 12px; background: var(--brand-color); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--brand-color); }
.comms-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px; box-shadow: var(--shadow-sm); }
.comms-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 12px; }
.comms-card-meta { display: flex; align-items: center; gap: 10px; }
.comms-card-date { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.comms-card-actions { display: flex; gap: 4px; }
.comms-card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.comms-card-body { font-size: 14px; color: var(--text-secondary); line-height: 1.6; white-space: pre-wrap; }

/* ============ Issues sub-tab (task 9) — append to styles.css ============ */

.issue-severity-low      { background: #e0f2fe; color: #075985; }
.issue-severity-medium   { background: #fef3c7; color: #92400e; }
.issue-severity-high     { background: #ffedd5; color: #9a3412; }
.issue-severity-critical { background: #fee2e2; color: #991b1b; }

.issue-status-open        { background: #dbeafe; color: #1e40af; }
.issue-status-in_progress { background: #fef3c7; color: #92400e; }
.issue-status-resolved    { background: #dcfce7; color: #166534; }
.issue-status-closed      { background: #e5e7eb; color: #374151; }

.issue-dot-low      { background: #38bdf8 !important; }
.issue-dot-medium   { background: #f59e0b !important; }
.issue-dot-high     { background: #f97316 !important; }
.issue-dot-critical { background: #dc2626 !important; }

.issue-filter-group { display: flex; gap: 6px; }
.issue-filter-group .is-active-filter {
  background: var(--brand-color, #23637A);
  color: #fff;
}

.comms-card-resolved {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
}

/* ============ Project Settings tab (task 11) — append to styles.css ============ */

.settings-section { margin-bottom: 24px; padding: 24px; }
.settings-section-title { margin: 0 0 16px; font-size: 16px; font-weight: 600; }

.danger-zone { border: 1px solid #fecaca; background: #fef2f2; }
.danger-title { color: #991b1b; }

.danger-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding: 16px 0; border-top: 1px solid #fecaca;
}
.danger-row:first-of-type { border-top: none; padding-top: 8px; }
.danger-row-title { font-weight: 600; margin-bottom: 4px; }

.btn-danger { background: #dc2626; color: #fff; border: 1px solid #dc2626; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ Notifications bell + popover (task 13) — append to styles.css ============ */

#notifications-bell-wrap { position: relative; display: inline-flex; }

.notifications-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: #dc2626; color: #fff;
  border-radius: 8px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.notifications-popover {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; max-height: 480px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  z-index: 1000; display: flex; flex-direction: column;
}

.notifications-popover-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid #e5e7eb;
}
.notifications-popover-title { font-weight: 600; font-size: 14px; }

.notifications-popover-body { overflow-y: auto; flex: 1; }

.notifications-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #6b7280;
  padding: 10px 16px 6px;
}

.notifications-row {
  display: flex; gap: 10px; padding: 10px 16px;
  cursor: pointer; border-bottom: 1px solid #f3f4f6;
}
.notifications-row:hover { background: #f9fafb; }
.notifications-row-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: transparent; margin-top: 6px; flex-shrink: 0;
}
.notifications-row.is-unread .notifications-row-dot { background: var(--brand-color, #23637A); }
.notifications-row.is-unread .notifications-row-message { font-weight: 600; }

.notifications-row-content { flex: 1; min-width: 0; }
.notifications-row-message {
  font-size: 13px; color: #111827; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
}
.notifications-row-meta {
  font-size: 11px; color: #6b7280; margin-top: 2px;
}

/* ============ Logo (post-build polish) — append to styles.css ============ */

.brand-logo-img {
  height: 36px;
  width: 36px;
  display: block;
}

.brand-logo-hero {
  height: 96px;
  width: 96px;
  display: block;
  margin: 0 auto 24px;
}

/* ============ Hero title restyling + brand color variable ============ */
/* Append to styles.css. The :root rule properly declares --brand-color
   so future var() references pick it up instead of relying on the fallback. */

:root {
  --brand-color: #23637A;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--brand-color);
  letter-spacing: normal;
  margin-bottom: 16px;
}