/* ============================================
   SHAPE PROJECTS - PROFESSIONAL DESIGN SYSTEM
   ============================================ */

:root {
  /* Chrome (Header + Sidebar) - ALWAYS DARK */
  --chrome-bg: #1a1a1a;
  --chrome-bg-hover: #252525;
  --chrome-border: rgba(255, 255, 255, 0.08);
  --chrome-text: #e5e7eb;
  --chrome-text-muted: rgba(255, 255, 255, 0.5);
  --chrome-active: rgba(59, 130, 246, 0.15);
  --chrome-active-border: #3b82f6;
  
  /* Content Area - Clean & Professional */
  --content-bg: #fafbfc;
  --content-text: #111827;
  --content-muted: #6b7280;
  --content-border: #e5e7eb;
  --content-card: #ffffff;
  --content-hover: #f3f4f6;
  
  /* Sizes */
  --header-height: 48px;
  --sidebar-collapsed: 64px;
  --sidebar-expanded: 220px;
    --lr-toggle-width: 28px;    /* slim pill width */
  --lr-toggle-height: 56px;   /* pill height, centers nicely */

}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--content-text);
  background: var(--content-bg);
  overflow-x: hidden;
}

body, .app-frame, .left-rail { overflow-x: hidden; }

/* ============================================
   MODERN HEADER - SLIM & PROFESSIONAL
   ============================================ */

.modern-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--chrome-border);
}

.modern-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--chrome-text);
  font-weight: 700;
  font-size: 15px;
}

.modern-logo-mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.modern-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

.modern-nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--chrome-text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.modern-nav-link:hover {
  background: var(--chrome-bg-hover);
  color: var(--chrome-text);
}

.modern-nav-link.active {
  background: var(--chrome-active-border);
  color: #fff;
}

.modern-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Notifications (modern header) ===== */
.modern-notifs { position: relative; display: flex; align-items: center; margin-right: 10px; }

.modern-notif-btn{
  position: relative;
  border: 1px solid var(--content-border);
  background: var(--content-surface, #fff);
  color: var(--content-text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modern-notif-btn:hover{ background: var(--content-bg); }

.modern-notif-badge{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #b42318;
  color: #fff;
  border: 2px solid var(--content-surface, #fff);
}

.modern-notif-menu{
  position: absolute;
  right: 0;
  top: 44px;
  width: 360px;
  max-width: 85vw;
  background: var(--content-surface, #fff);
  border: 1px solid var(--content-border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 50;
}

.modern-notif-head{
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--content-border);
}

.modern-notif-title{ font-size: 13px; font-weight: 800; }

.modern-notif-action{
  background: transparent;
  border: none;
  color: var(--content-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.modern-notif-action:hover{ color: var(--content-text); }

.modern-notif-list{ max-height: 360px; overflow: auto; }

.modern-notif-empty{ padding: 14px 12px; }

.modern-notif-item{
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.modern-notif-item:hover{ background: var(--content-bg); }

.modern-notif-item.unread{
  background: rgba(59, 130, 246, 0.08);
}

.modern-notif-item-title{ font-size: 12px; font-weight: 800; margin-bottom: 2px; }
.modern-notif-item-body{ font-size: 12px; color: var(--content-muted); }
.modern-notif-item-time{ font-size: 11px; color: var(--content-muted); margin-top: 6px; }

.modern-notif-foot{
  padding: 10px 12px;
  border-top: 1px solid var(--content-border);
}
.modern-notif-link{ font-size: 12px; color: var(--content-text); text-decoration: none; }
.modern-notif-link:hover{ text-decoration: underline; }

/* Default: matches dark header */
.modern-notif-btn{
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: rgba(255,255,255,0.9);
}

.modern-notif-btn:hover{
  background: rgba(255,255,255,0.08);
}

/* The icon uses currentColor */
.modern-notif-icon{
  display: block;
}

/* Unread: bell turns red + subtle glow */
.modern-notif-btn.has-unread{
  color: #ef4444;                 /* red */
  border-color: rgba(239,68,68,0.55);
  background: rgba(239,68,68,0.10);
  box-shadow: 0 0 0 2px rgba(239,68,68,0.12);
}

.modern-notif-btn.has-unread:hover{
  background: rgba(239,68,68,0.16);
}

@keyframes bell-shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-10deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(6deg); }
}

.modern-notif-btn.has-unread .modern-notif-icon{
  animation: bell-shake 0.6s ease-in-out;
}

.modern-account-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--chrome-border);
  border-radius: 6px;
  color: var(--chrome-text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.modern-account-btn:hover {
  background: var(--chrome-bg-hover);
  border-color: var(--chrome-active-border);
}

.modern-account-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 20px;
  margin-top: 4px;
  min-width: 200px;
  background: var(--chrome-bg);
  border: 1px solid var(--chrome-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.modern-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--chrome-text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.modern-menu-item:hover {
  background: var(--chrome-bg-hover);
}

.modern-menu-item.danger {
  color: #ef4444;
}

.modern-menu-divider {
  height: 1px;
  background: var(--chrome-border);
  margin: 4px 0;
}

/* ============================================
   SLEEK SIDEBAR - DEFAULTS TO COLLAPSED
   ============================================ */

.app-frame {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* Default collapsed state */
.app-frame:not(.expanded) .left-rail {
  width: var(--sidebar-collapsed);
  position: relative;              /* anchor .lr-toggle (absolute) */
}


.app-frame.expanded .left-rail {
  width: var(--sidebar-expanded);
}

.left-rail {
  position: fixed;
  left: 0;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  width: var(--sidebar-collapsed);
  background: var(--chrome-bg);
  border-right: 1px solid var(--chrome-border);
  display: flex;
  flex-direction: column;
  z-index: 90;
  transition: width 0.2s ease;
  overflow-x: hidden;   /* prevent left-right scrollbar */
  overflow-y: visible;  /* allow the toggle to sit visually outside if needed */
}

.app-frame.expanded .left-rail {
  width: var(--sidebar-expanded);
}

/* First group (top icons) scrolls from the top and reserves right space for the pill */
.left-rail .nav-group:first-child {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

/* Subsequent groups (Socials/Account) do NOT scroll */
.left-rail .lr-foot .nav-group {
  flex: 0 0 auto;
  overflow: visible;
  padding: 8px 0;
}

.nav-label {
  padding: 12px 16px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--chrome-text-muted);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.app-frame.expanded .nav-label {
  opacity: 1;
  visibility: visible;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  color: var(--chrome-text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
  white-space: nowrap;
  position: relative;
  width: 100%;

}

/* Make hover/active backgrounds fill the rail width */
.nav-item { width: 100%; }

/* When collapsed, remove label from layout to avoid sideways overflow */
.app-frame:not(.expanded) .nav-text { display: none; }

.nav-item:hover {
  background: var(--chrome-bg-hover);
  color: var(--chrome-text);
}

.nav-item.active {
  background: var(--chrome-active);
  color: var(--chrome-active-border);
  border-left: 3px solid var(--chrome-active-border);
  padding-left: 13px;
}

.nav-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-text {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  white-space: nowrap;
}

.app-frame.expanded .nav-text {
  opacity: 1;
  visibility: visible;
}

/* When collapsed, fully remove label from layout to avoid horizontal scroll */
.app-frame:not(.expanded) .nav-text {
  display: none;
}

.lr-foot {
  margin-top: auto;
  padding: 8px 0;
  border-top: 1px solid var(--chrome-border);
}

/* Slim vertical pill centered on the divider line */
/* Floating collapse/expand pill — overlays both rail and content */
.lr-toggle {
  position: fixed; /* ← key change: fixed, not absolute in the rail */
  top: 50%;
  transform: translateY(-50%);
  /* collapsed position: straddle the collapsed rail edge */
  left: calc(var(--sidebar-collapsed) - var(--lr-toggle-width) / 2);
  width: var(--lr-toggle-width);
  height: var(--lr-toggle-height);
  border-radius: calc(var(--lr-toggle-width) / 2);
  background: var(--chrome-bg);
  border: 1px solid var(--chrome-border);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 9999; /* ← stays above content */
}
.app-frame.expanded .lr-toggle {
  /* expanded position: straddle the expanded rail edge */
  left: calc(var(--sidebar-expanded) - var(--lr-toggle-width) / 2);
}
/* chevron rotation you already had is fine to keep */


.lr-toggle:hover {
  background: var(--chrome-bg-hover);
  border-color: var(--chrome-active-border);
}

/* Rotate chevron when expanded to point the other way */
.app-frame.expanded .lr-toggle .chev {
  transform: rotate(135deg);           /* » when expanded */
}

.lr-toggle:hover {
  background: var(--chrome-bg-hover);
  border-color: var(--chrome-active-border);
}

.lr-toggle .chev {
  display: block;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--chrome-text);
  border-bottom: 2px solid var(--chrome-text);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}

.app-frame.expanded .lr-toggle .chev {
  transform: rotate(135deg);
}

/* Scrollbar */
.nav-group::-webkit-scrollbar {
  width: 4px;
}

.nav-group::-webkit-scrollbar-track {
  background: transparent;
}

.nav-group::-webkit-scrollbar-thumb {
  background: var(--chrome-border);
  border-radius: 2px;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

main {
  flex: 1;
  margin-left: var(--sidebar-collapsed);
  transition: margin-left 0.2s ease;
  background: var(--content-bg);
}

.app-frame.expanded main {
  margin-left: var(--sidebar-expanded);
}

.content {
  padding: 20px;
  max-width: 1800px;
  margin: 0 auto;
}

/* ============================================
   COMPACT PAGE HEADERS
   ============================================ */

.page-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--content-card);
  border: 1px solid var(--content-border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.page-subheader h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--content-text);
  margin: 0;
}

.page-subheader p {
  font-size: 12px;
  color: var(--content-muted);
  margin: 2px 0 0;
}

.page-subheader .actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ============================================
   CARDS & PANELS
   ============================================ */

.card, .panel {
  background: var(--content-card);
  border: 1px solid var(--content-border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.p-12 { padding: 12px; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.mt-16 { margin-top: 16px; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--content-border);
  border-radius: 6px;
  background: var(--content-card);
  color: var(--content-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--content-hover);
  border-color: var(--chrome-active-border);
}

.btn.tiny {
  padding: 6px 12px;
  font-size: 12px;
}

.btn.primary {
  background: var(--chrome-active-border);
  color: #fff;
  border-color: var(--chrome-active-border);
}

.btn.primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.btn.secondary {
  background: transparent;
}

.btn.danger {
  color: var(--chrome-active-border);
  border-color: var(--chrome-active-border);
}

.btn.danger:hover {
  background: var(--chrome-active-border);
  color: #fff;
  border-color: var(--chrome-active-border);
}

/* ============================================
   TABLES - PROFESSIONAL & DENSE
   ============================================ */

.table-wrap {
  overflow: auto;
  border-radius: 8px;
}

.project-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.project-table thead th {
  position: sticky;
  top: 0;
  background: var(--content-hover);
  border-bottom: 2px solid var(--content-border);
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--content-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}

.project-table tbody tr {
  transition: all 0.15s;
}

.project-table tbody tr:hover {
  background: var(--content-hover);
}

.project-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--content-border);
  vertical-align: middle;
}

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

/* Column widths */
.col-task { width: auto; min-width: 200px; }
.col-res { width: 140px; }
.col-start { width: 120px; }
.col-end { width: 120px; }
.col-status { width: 120px; }
.col-act { width: 140px; text-align: left; }
.col-date { width: 120px; }
.col-actions { width: 180px; }

/* Actions column header alignment */
.project-table thead th.th-actions {
  text-align: left;
  padding: 8px 12px;
}

/* Task cell */
.td-task {
  font-weight: 600;
  color: var(--content-text);
}

.td-task a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.td-task a:hover {
  color: var(--chrome-active-border);
}

/* Row actions */
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
}

/* Inputs & Selects */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--content-border);
  border-radius: 6px;
  background: var(--content-card);
  color: var(--content-text);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--chrome-active-border);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.dense-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.dense-table thead th{
  position: sticky;
  top: 0;
  background: var(--content-hover);
  border-bottom: 1px solid var(--content-border);
  padding: 8px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--content-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dense-table td{
  padding: 8px 12px;
  border-bottom: 1px solid var(--content-border);
  vertical-align: middle;
}

.dense-table tbody tr:hover{
  background: var(--content-hover);
}

.empty-state{
  color: var(--content-muted);
  padding: 14px 12px;
}

/* ============================================
   PROJECT WORK PAGE - MAXIMUM WORKSPACE
   ============================================ */

.project-work .content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - var(--header-height) - 32px);
}

.project-work .page-subheader {
  padding: 10px 14px;
  margin-bottom: 0;
}

/* KPI Row - Ultra Compact */
#kpiContainer {
  padding: 10px 12px;
  margin-bottom: 0;
}

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

.proj-kpi-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  flex: 1;
}

.kpi-card {
  background: var(--content-hover);
  border: 1px solid var(--content-border);
  border-radius: 6px;
  padding: 8px 10px;
}

.kpi-card .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--content-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.kpi-card .value {
  font-size: 13px;
  font-weight: 700;
  color: var(--content-text);
}

.kpi-card input,
.kpi-card select {
  font-size: 12px;
  padding: 4px 6px;
  height: 26px;
}

.proj-kpi-actions {
  display: flex;
  gap: 6px;
}

/* Task Table - Maximum Space */
.project-work .panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.project-work .table-wrap {
  flex: 1;
  overflow: auto;
}

.project-work .project-table {
  font-size: 12px;
}

.project-work .project-table thead th {
  padding: 6px 10px;
  font-size: 10px;
}

.project-work .project-table td {
  padding: 6px 10px;
  height: 32px;
}

.project-work input[type="text"],
.project-work input[type="date"],
.project-work select {
  font-size: 12px;
  padding: 4px 8px;
  height: 26px;
}

/* Milestone groups */
.ms-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--content-hover);
  border: 1px solid var(--content-border);
  border-radius: 6px;
  padding: 4px 10px;
  margin: 2px 0;
}

.ms-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
}

.caret {
  width: 16px;
  text-align: center;
  cursor: pointer;
}

/* Drag handle */
.drag-handle {
  cursor: grab;
  opacity: 0.4;
  font-size: 12px;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
  opacity: 0.8;
}

/* View switcher */
.view-switcher {
  display: flex;
  gap: 6px;
  align-items: center;
}

.chip {
  padding: 6px 12px;
  border: 1px solid var(--content-border);
  border-radius: 16px;
  background: var(--content-card);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  background: var(--content-hover);
}

.chip.active {
  background: var(--chrome-active-border);
  color: #fff;
  border-color: var(--chrome-active-border);
}

/* ============================================
   ASHLEY AI CARD - PROFESSIONAL BLUE
   ============================================ */

.ashley-card {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.ashley-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.ashley-card p {
  margin: 0 0 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
}

.ashley-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.ashley-row textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  resize: vertical;
}

.ashley-row textarea::placeholder {
  color: #6b7280;
}

.ashley-actions {
  display: grid;
  gap: 8px;
  width: 180px;
}

.ashley-actions .btn {
  background: #fff;
  color: #3b82f6;
  border: none;
  font-weight: 600;
}

.ashley-actions .btn:hover {
  background: #f1f5f9;
}

.ashley-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ashley-example-chip {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.ashley-example-chip:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   TEMPLATES PAGE
   ============================================ */

.tpl-searchbar {
  padding: 14px 16px;
  margin-bottom: 16px;
}

.tpl-searchbar-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tpl-searchbar .search {
  width: 100%;
  max-width: none;
}

.tpl-cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tpl-cat {
  padding: 7px 12px;
  border: 1px solid var(--content-border);
  border-radius: 999px;
  background: #fff;
  color: var(--content-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tpl-cat:hover {
  background: var(--content-hover);
  border-color: var(--chrome-active-border);
}

.tpl-cat.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.tpl-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.tpl-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tpl-column-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  margin-bottom: 2px;
}

.tpl-column-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--content-text);
}

.tpl-column-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--content-muted);
}

.tpl-grid {
  display: grid;
  gap: 16px;
}

.tpl-grid-public {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tpl-grid-mine {
  grid-template-columns: 1fr;
}

.tpl-card {
  background: var(--content-card);
  border: 1px solid var(--content-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.18s ease;
  min-height: 260px;
}

.tpl-card:hover {
  border-color: var(--chrome-active-border);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.tpl-card-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tpl-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--content-text);
}

.tpl-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tpl-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid #bfdbfe;
}

.tpl-badge-soft {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.tpl-desc {
  margin: 0;
  color: var(--content-muted);
  font-size: 13px;
  line-height: 1.6;
  min-height: 42px;
}

.tpl-stats-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--content-muted);
  font-weight: 600;
}

.tpl-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
  border-top: 1px solid var(--content-border);
}

.tpl-meta-line {
  font-size: 12px;
  color: var(--content-muted);
  line-height: 1.4;
}

.tpl-meta-line strong {
  color: var(--content-text);
  font-weight: 700;
}

.tpl-empty {
  padding: 22px 18px;
  text-align: center;
  border-radius: 14px;
}

.tpl-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.tpl-actions .btn {
  flex: 0 0 auto;
}

/* Narrow personal column cards should still feel balanced */
.tpl-column-mine .tpl-card {
  min-height: 220px;
}

/* Responsive */
@media (max-width: 1100px) {
  .tpl-layout {
    grid-template-columns: 1fr;
  }

  .tpl-grid-public {
    grid-template-columns: 1fr 1fr;
  }

  .tpl-grid-mine {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .tpl-grid-public,
  .tpl-grid-mine {
    grid-template-columns: 1fr;
  }

  .tpl-card {
    min-height: 0;
  }

  .tpl-actions {
    flex-direction: column;
  }

  .tpl-actions .btn {
    width: 100%;
  }
}

/* ============================================
   HOME PAGE KPIs
   ============================================ */

.ns-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.ns-kpi {
  background: var(--content-card);
  border: 1px solid var(--content-border);
  border-radius: 8px;
  padding: 14px;
  transition: all 0.15s;
}

.ns-kpi:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: var(--chrome-active-border);
  transform: translateY(-2px);
}

.ns-kpi .lab {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--content-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.ns-kpi .val {
  font-size: 28px;
  font-weight: 800;
  color: var(--content-text);
  line-height: 1;
  margin-bottom: 6px;
}

.ns-kpi .chg {
  font-size: 11px;
  color: #10b981;
  font-weight: 600;
}

.ns-kpi .chg.down {
  color: #ef4444;
}

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

.ns-card {
  background: var(--content-card);
  border: 1px solid var(--content-border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.15s;
}

.ns-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ns-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--content-border);
  margin-bottom: 12px;
}

.ns-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.ns-link {
  font-size: 12px;
  color: var(--chrome-active-border);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s;
}

.ns-link:hover {
  color: #2563eb;
}

.ns-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.ns-table thead th {
  text-align: left;
  padding: 6px 8px;
  background: var(--content-hover);
  border-bottom: 1px solid var(--content-border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--content-muted);
  font-weight: 600;
}

.ns-table td {
  padding: 8px;
  border-bottom: 1px solid var(--content-border);
}

.ns-table tbody tr:hover {
  background: var(--content-hover);
}

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

.ns-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ns-li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--content-border);
  font-size: 12px;
}

.ns-li:last-child {
  border-bottom: none;
}

.ns-li .lbl {
  font-weight: 600;
  color: var(--content-text);
}

.ns-li .val {
  color: var(--content-muted);
  font-size: 11px;
}

.ns-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: capitalize;
}

.ns-badge.active {
  background: #dcfce7;
  color: #166534;
}

.ns-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.ns-badge.complete {
  background: #dbeafe;
  color: #1e40af;
}

.ns-progress {
  width: 60px;
  height: 6px;
  background: var(--content-border);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
}

.ns-progress > span {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  display: block;
  transition: width 0.3s;
}

/* ============================================
   UTILITIES
   ============================================ */

.muted {
  color: var(--content-muted);
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  main,
  .app-frame.expanded main {
    margin-left: 0;
  }

  .work-tabs {
    left: 0;
  }

  .content {
    padding: 12px;
  }
}
/* Keep handle + title on one line */
.task-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;       /* prevents title wrapping to next line */
}

/* Handle should not force a new line */
.move-handle {
  display: inline-flex;      /* was block or inline-block in some pages */
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  line-height: 1;            /* avoids tall line box */
}

/* Let the input shrink and ellipsize instead of wrapping */
.task-title {
  flex: 1 1 auto;
  min-width: 0;              /* important so flex item can shrink */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Task title input polish */
.project-work input.task-title {
  border: 1px solid var(--content-border) !important;
  background: var(--content-card);
  color: var(--content-text);
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-work input.task-title:focus {
  border-color: var(--chrome-active-border);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
  outline: none;
}
/* --- Keep "Add …" input + button inline --- */
.add-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;           /* never wrap to the next line */
}

/* override the global width:100% applied to inputs */
.add-inline input[type="text"],
.add-inline input[type="date"],
.add-inline select,
.add-inline textarea {
  width: auto;                 /* override global */
  flex: 1 1 auto;              /* grow/shrink with available space */
  min-width: 0;                /* allow shrinking in flex row */
}

/* button stays compact and never wraps */
.add-inline .btn,
.add-inline button {
  white-space: nowrap;
  flex: 0 0 auto;
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--content-card);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--content-border);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--content-text);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--content-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--content-hover);
  color: var(--content-text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--content-border);
  background: var(--content-bg);
}

/* Form styles for modal */
.form-group {
  margin-bottom: 20px;
}

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

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--content-border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--content-text);
  background: var(--content-card);
  transition: all 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--chrome-active-border);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Make sure icon buttons with danger class also use blue */
.icon-btn.danger {
  color: var(--chrome-active-border);
}

.icon-btn.danger:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--chrome-active-border);
}

/* ============================================
   CLICKABLE ROW STYLES
   ============================================ */

.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s;
}

.clickable-row:hover {
  background: var(--content-hover);
}

.task-title-display {
  font-weight: 500;
  color: var(--content-text);
}

/* Ensure action buttons don't interfere with row click and have proper alignment */
.row-actions .btn {
  pointer-events: auto;
  flex-shrink: 0;
}

/* Ensure actions column cells use standard padding */
.project-table td.row-actions {
  padding: 10px 12px;
  vertical-align: middle;
}

/* ============================================
   ADD FORM STYLES (for expandable forms)
   ============================================ */

.add-form {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE MODAL
   ============================================ */

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-footer {
    padding: 12px 20px;
    flex-wrap: wrap;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Bottom work dock states and toggle */
.work-tabs {
  max-height: 320px;
}

.work-tabs.min {
  max-height: 40px;
}

.work-tabs.max {
  max-height: 70vh;
}

.work-tabs,
.tabpanel {
  transition: max-height 0.2s ease;
}

.work-tabs.min .tabpanel {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.work-tabs.max .tabpanel {
  max-height: calc(70vh - 46px);
  overflow-y: auto;
}

.work-tabs .tabbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.work-tabs .dock-toggle {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--content-border);
  border-radius: 6px;
  background: var(--content-card);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.work-tabs .dock-toggle:hover {
  background: var(--content-hover);
  border-color: var(--chrome-active-border);
}

/* Hide legacy meeting sub-pills for MVP (Agenda/Minutes/Notes) */
#tab-meetings [data-sub="agenda"],
#tab-meetings [data-sub="minutes"],
#tab-meetings [data-sub="notes"] {
  display: none !important;
}
/* View switcher styling (Gantt / Calendar / Kanban / List) */
.view-switcher { display: flex; align-items: center; gap: 6px; }

.view-switcher .btn.tiny.edit {
  background: #fff;
  color: var(--content-text);
  border: 1px solid var(--content-border);
  border-radius: 20px;
  padding: 6px 12px;
  font-weight: 600;            /* consistent weight for both <a> and <button> */
  text-decoration: none;       /* remove underline on anchors */
  line-height: 1;
}

.view-switcher .btn.tiny.edit:hover {
  background: var(--content-hover);
  border-color: var(--chrome-active-border);
}

.view-switcher .btn.tiny.edit.active {
  background: #111827;         /* filled look for active */
  color: #fff;
  border-color: #111827;
}
/* Neutralize Edit buttons to white background */
.btn.edit,
.btn[title="Edit"],
.btn[aria-label="Edit"] {
  background: #fff !important;
  color: var(--content-text) !important;
  border-color: var(--content-border) !important;
}

.btn.edit:hover,
.btn[title="Edit"]:hover,
.btn[aria-label="Edit"]:hover {
  background: var(--content-hover) !important;
  border-color: var(--chrome-active-border) !important;
}

/* ============================================
   PROJECT TOP TABS (Edge-style)
   ============================================ */

.edge-tabs{
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--content-border);
  background: var(--content-card);
  position: sticky;
  top: 0;
  z-index: 5;
}
.edge-tab{
  appearance: none;
  border: 1px solid var(--content-border);
  background: #fff;
  color: var(--content-text);
  padding: 6px 12px;
  border-radius: 999px;   /* pill */
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

.edge-tab:hover{
  background: var(--content-hover);
  border-color: var(--chrome-active-border);
}

.edge-tab.active{
  background: #111827;
  color: #fff;
  border-color: #111827;
}


.ptab-body{
  padding: 12px;
}

.ptab-panel{
  padding: 12px 0;
}

.panel-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--content-border);
}

.panel-toolbar .muted{
  line-height: 1.4;
}

.ptab-panel .table-wrap{
  border: 1px solid var(--content-border);
  border-radius: 8px;
}

/* === Completed styling === */

/* Tasks */
.task-row.done .task-title {
  text-decoration: line-through;
  opacity: 0.75;
}

/* Milestone header (we add .done on the header row and title container) */
.ms-header-row.done .ms-title span,
.ms-title.done span {
  text-decoration: line-through;
  opacity: 0.75;
}
/* Team Member Cards */
.team-member-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--content-border);
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--content-card);
  transition: all 0.2s;
}

.team-member-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.team-member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
}

.team-member-info {
  flex: 1;
}

.team-member-name {
  font-weight: 600;
  margin: 0 0 4px;
  font-size: 1rem;
}

.team-member-email {
  color: var(--content-muted);
  font-size: 0.85rem;
  margin: 0;
}

.access-badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.access-badge.owner {
  background: #dbeafe;
  color: #3b82f6;
}

.access-badge.member {
  background: #d1fae5;
  color: #059669;
}

.access-badge.assignee {
  background: #f3f4f6;
  color: #6b7280;
}

.access-level-select {
  padding: 6px 12px;
  border: 1px solid var(--content-border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.access-level-select:focus {
  outline: none;
  border-color: #3b82f6;
}

.remove-member-btn {
  padding: 6px 12px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.remove-member-btn:hover {
  background: #fecaca;
}

.empty-team-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--content-muted);
}

.empty-team-state svg {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  opacity: 0.3;
}

.empty-team-state h3 {
  margin: 0 0 8px;
  color: var(--content-text);
}
/* Team badges */
.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid var(--content-border); }
.badge.owner    { background:#e0f2fe; color:#0c4a6e; border-color:#93c5fd; }
.badge.member   { background:#dcfce7; color:#065f46; border-color:#86efac; }
.badge.assignee { background:#f3f4f6; color:#374151; border-color:#d1d5db; }

/* Optional: hide helper when we show Team section */
.panel.hide { display:none; }

/* Ensure no layout margin/padding keeps the dock off the bottom */
html, body { height: 100%; }
body { margin: 0; padding-bottom: 0 !important; }

/* The project-work content already squeezes height; no extra bottom gap */
.project-work .content { padding-bottom: 12px; } /* small breathing room above the dock */

.page-subheader.gradient-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ---------- Compact table for My Tasks ---------- */
.tasks-table th, .tasks-table td {
  font-size: 12px;     /* was 0.92rem */
}
.tasks-table thead th {
  font-size: 10px;     /* was 0.8rem */
}

.tasks-table tbody tr:hover {
  background: var(--content-hover);
}
.tasks-table .title {
  font-weight: 600;
  color: var(--content-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 1px; /* enables ellipsis in flex table layouts */
}
.tasks-table .project {
  color: var(--content-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 1px;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.todo         { background:#f3f4f6; color:#6b7280; }
.badge.in-progress  { background:#dbeafe; color:#2563eb; }
.badge.review       { background:#fef3c7; color:#d97706; }
.badge.completed    { background:#d1fae5; color:#059669; }
.badge.overdue      { background:#fee2e2; color:#dc2626; }
.row-actions {
  display:flex; gap:8px; justify-content:flex-end;
}
.row-actions .btn.tiny {
  padding: 6px 10px;
  font-size: 12px;
}

/* Task modal: dependency pickers */
#taskModal #modalTaskPreds,
#taskModal #modalTaskSuccs {
  min-height: 280px;
  line-height: 1.25;
}

#taskModal select optgroup { font-weight: 700; }
#taskModal select option { white-space: normal; } /* allow long titles to wrap */

/* Project table: display titles should look like plain text */
.task-title-display {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Hard reset any input-like styling on display titles in the task table */
.project-work .td-task .task-cell .task-title-display {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  outline: 0 !important;
}

/* Ensure the cell wrapper isn't painting a background behind the text */
.project-work .td-task .task-cell {
  background: transparent !important;
  box-shadow: none !important;
}

/* Milestone header row shouldn't draw a table bottom border */
.project-table .ms-header-row td {
  border-bottom: none;
  padding-top: 6px;
  padding-bottom: 2px;
}

/* Minimal icon buttons in milestone header */
.icon-btn {
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--content-muted);
}
.icon-btn:hover {
  background: var(--content-hover);
  color: var(--content-text);
}
.icon-btn.danger { color: var(--content-muted); }
.icon-btn.danger:hover { color: var(--content-text); }

/* Milestone header is clickable to expand/collapse */
.ms-head { cursor: pointer; user-select: none; }
.ms-head .caret { display: inline-block; width: 1em; text-align: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.pill.active {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.24);
}

.meeting-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.req { color: #ef4444; font-weight: 800; margin-left: 3px; }
.field label { display:block; margin-bottom:6px; color: #e5e7eb; }

/* ===== Inline table dropdowns (Resource + Status) ===== */

/* Remove native select arrow */
select.inline-status,
select.inline-resource {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none !important;
}

/* Base pill style */
.inline-status,
.inline-resource {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: 1px solid var(--content-border);
  background: var(--content-card);
  color: var(--content-text);
  min-width: 120px;
}

/* Resource pill should look like a control on a light table */
.inline-resource {
  min-width: 160px;
}
.inline-resource:hover {
  background: var(--content-hover);
  border-color: var(--chrome-active-border);
}
.inline-resource:focus {
  outline: none;
  border-color: var(--chrome-active-border);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.10);
}

/* Status colours (use data-status set by JS) */
select.inline-status[data-status="Not Started"] {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}
select.inline-status[data-status="In Progress"] {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}
select.inline-status[data-status="Delayed"] {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
select.inline-status[data-status="Complete"] {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.inline-status {
  border: none;
}

/* Pill inputs for tab add-forms (risks/issues/actions/decisions) */
.pill-input{
  border: 1px solid var(--content-border);
  background: var(--content-card);
  color: var(--content-text);
  border-radius: 999px;
  padding: 10px 12px;
  height: 38px;
  line-height: 18px;
  outline: none;
}

.pill-input:focus{
  border-color: rgba(59,130,246,0.7);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* Add-form spacing so text isn’t crushed */
.add-form .row,
.panel-toolbar + .add-form,
.add-form > div{
  gap: 10px;
}

/*.pill-input,
.pill-select {
  height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: inherit;
  outline: none;
}*/

/* remove select arrow 
.pill-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 10px; /* no arrow space */
/*}*/

/* “Pill-like” textarea for longer text fields */
textarea.pill-textarea {
  border-radius: 14px !important;
  padding: 10px 12px !important;
  min-height: 38px;
  resize: vertical;
}
/* Bottom section split: Milestones + Quick Task Add */
.bottom-split{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.bottom-col{
  border:1px solid var(--content-border);
  border-radius:12px;
  padding:10px;              /* was 12px */
  background:var(--content-card);
}
.bottom-col-head{
  font-weight:700;
  font-size:13px;
  margin-bottom:6px;         /* was 10px */
  line-height:1.1;
}

/* --- Fix inline dropdown text clipping (Resource + Status) --- */
.project-work select.inline-resource,
.project-work select.inline-status {
  height: 26px;
  line-height: 1.2;       /* allow descenders like y/g/p */
  padding: 4px 10px;      /* reduce vertical squeeze */
}

/* Resource: slightly less bold so it renders like the rest of the row */
.project-work select.inline-resource {
  font-weight: 600;
}

/* Status can stay strong but don't crush it */
.project-work select.inline-status {
  font-weight: 700;
}
/* --- Slimmer milestone headers in the task table --- */
.project-table .ms-header-row td {
  padding-top: 4px;
  padding-bottom: 0px;
}

.ms-head {
  padding: 2px 10px;   /* was 4px 10px */
  margin: 1px 0;       /* reduce vertical spacing */
}
/* Compact bottom management strip */
#milestoneMgmtCard .add-inline{
  gap: 8px;
}

/* Bottom strip controls: always look like content controls (bordered on white) */
#milestoneMgmtCard .pill-input,
#milestoneMgmtCard select,
#milestoneMgmtCard input[type="text"]{
  border: 1px solid var(--content-border);
  background: var(--content-card);
  color: var(--content-text);
}

#milestoneMgmtCard input,
#milestoneMgmtCard select{
  height: 26px;
  line-height: 1.2;
  padding-top: 4px;
  padding-bottom: 4px;
}

#milestoneMgmtCard .btn.tiny{
  height: 26px;
  padding-top: 4px;
  padding-bottom: 4px;
}

/* Keep reference IDs in first column on one line (Risks/Issues/Actions/Decisions/Journal tables) */
#riskTable th:first-child, #riskTable td:first-child,
#issueTable th:first-child, #issueTable td:first-child,
#actTable th:first-child, #actTable td:first-child,
#decTable th:first-child, #decTable td:first-child,
#noteTable th:first-child, #noteTable td:first-child{
  width: 72px;          /* adjust if your refs are longer */
  min-width: 72px;
  white-space: nowrap;
  text-align: center;
}

/* If the ref is inside a pill/span, also prevent wrapping there */
#riskTable td:first-child *,
#issueTable td:first-child *,
#actionTable td:first-child *,
#decisionTable td:first-child *,
#noteTable td:first-child *{
  white-space: nowrap;
}

/* --- Project tab tables: make title pills match the rest of the row --- */
.dense-table td,
.dense-table th {
  font-size: 12px;
  line-height: 1.2;
}

.dense-table input,
.dense-table select {
  font-size: 12px;
}

.dense-table .pill-input {
  font-size: 12px;
  font-weight: 400;      /* stops “bold” feel */
  height: 28px;
  line-height: 28px;
  padding: 0 10px;
  width: 100%;           /* fill the column without forcing the column wider */
  box-sizing: border-box;
}

/* ===========================
   Project page: allow task table to flow + page scroll
   =========================== */
body.project-page {
  height: auto;
  overflow: auto;
}

body.project-page .app-frame,
body.project-page main,
body.project-page .content,
body.project-page .panel {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

body.project-page .table-wrap {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body.project-page #projectTable {
  overflow: visible !important;
}

/* ===================== Feedback modal styles ===================== */

.fb-float-btn{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

/* Full-screen overlay */
.fb-modal{
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;              /* hidden by default */
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.55);
}

/* When JS adds .open, show it centered */
.fb-modal.open{
  display: flex;
}

/* Center panel */
.fb-panel{
  width: min(720px, 94vw);
  max-height: 85vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
  padding: 16px;
}

.fb-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.fb-panel-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top: 14px;
}

.fb-form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 720px){
  .fb-form-grid{ grid-template-columns: 1fr; }
}

.fb-label{
  display:block;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 6px;
}

.fb-input{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  outline: none;
  font: inherit;
}

.fb-input:focus{
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.fb-muted{
  color:#6b7280;
}

/* Shared public footer */
.footer {
  background: #1a1a1a;
  color: #9ca3af;
  padding: 3rem 2rem 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: #ffffff;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-section ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: #ffffff;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #374151;
  color: #6b7280;
}

/* =========================
   PROJECT GANTT VIEW
========================= */

.project-gantt-page{
  --gantt-left-width: 560px;
  --gantt-cols-left: minmax(230px, 2.8fr) 82px 78px 78px 78px;
  --gantt-min-timeline-width: 900px;
}

.project-gantt-page .gantt-stage{
  overflow:hidden;
}

.project-gantt-page .gantt-table{
  border-top:1px solid var(--content-border);
  width:100%;
  overflow:hidden;
}

.project-gantt-page .gantt-grid-head,
.project-gantt-page .gantt-row{
  display:grid;
  grid-template-columns: var(--gantt-left-width) var(--gantt-min-timeline-width);
  min-width: calc(var(--gantt-left-width) + var(--gantt-min-timeline-width));
}

.project-gantt-page .gantt-grid-head{
  position:sticky;
  top:0;
  z-index:5;
  background:var(--content-card);
  border-bottom:1px solid var(--content-border);
}

.project-gantt-page .gantt-grid-head-left{
  display:grid;
  grid-template-columns: var(--gantt-cols-left);
  gap:0;
  width:var(--gantt-left-width);
  min-width:var(--gantt-left-width);
  max-width:var(--gantt-left-width);
  border-right:1px solid var(--content-border);
  background:var(--content-card);
  position:sticky;
  left:0;
  z-index:8;
  overflow:hidden;
}

.project-gantt-page .gantt-grid-head-left .gantt-head-cell:first-child{
  position:relative;
  left:auto;
  z-index:auto;
  background:transparent;
  border-right:1px solid var(--content-border);
}

.project-gantt-page .gantt-grid-head-right{
  position:relative;
  overflow:hidden;
  background:var(--content-card);
  min-width:0;
}

.project-gantt-page .gantt-head-cell{
  padding:12px 10px;
  font-size:11px;
  font-weight:700;
  color:var(--content-text-muted);
  border-right:1px solid var(--content-border);
  white-space:nowrap;
}

.project-gantt-page .gantt-head-cell:last-child{
  border-right:0;
}

.project-gantt-page .gantt-grid-body{
  overflow:auto;
  max-height: calc(100vh - 360px);
  width:100%;
  position:relative;
}

.project-gantt-page .gantt-row{
  min-height:36px;
  border-bottom:1px solid var(--content-border);
  background:var(--content-card);
}

.project-gantt-page .gantt-row:hover{
  background:var(--content-hover);
}

.project-gantt-page .gantt-row.is-task{
  cursor:pointer;
}

.project-gantt-page .gantt-row-left{
  display:grid;
  grid-template-columns: var(--gantt-cols-left);
  gap:0;
  width:var(--gantt-left-width);
  min-width:var(--gantt-left-width);
  max-width:var(--gantt-left-width);
  border-right:1px solid var(--content-border);
  position:relative;
  z-index:6;
  background:var(--content-card);
  overflow:hidden;
  will-change:transform;
}

.project-gantt-page .gantt-row-left .gantt-cell-task{
  position:relative;
  left:auto;
  z-index:auto;
  background:transparent;
  border-right:1px solid var(--content-border);
}
.project-gantt-page .gantt-milestone-left{
  min-width: 0;
}

.project-gantt-page .gantt-row-right{
  position:relative;
  min-width:0;
  overflow:hidden;
  z-index:1;
}
.project-gantt-page .gantt-row-left::after,
.project-gantt-page .gantt-milestone-left::after{
  content:"";
  position:absolute;
  top:0;
  right:0;
  width:1px;
  height:100%;
  background:var(--content-border);
  pointer-events:none;
}
.project-gantt-page .gantt-cell{
  padding:4px 6px;
  border-right:1px solid var(--content-border);
  display:flex;
  align-items:center;
  min-width:0;
  font-size:12px;
  color:var(--content-text);
  background:transparent;
}

.project-gantt-page .gantt-cell:last-child{
  border-right:0;
}

.project-gantt-page .gantt-cell-task{
  font-weight:600;
  line-height:1.2;
  white-space:normal;
  overflow-wrap:break-word;
}

.project-gantt-page .gantt-cell-muted{
  font-size:10px;
  color:var(--content-text-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.project-gantt-page .gantt-milestone-row{
  background:var(--content-hover);
  min-height:30px;
}

.project-gantt-page .gantt-milestone-row .gantt-row-right{
  background:var(--content-hover);
}

.project-gantt-page .gantt-milestone-left{
  grid-column:1 / 2;
  display:flex;
  align-items:center;
  width:var(--gantt-left-width);
  min-width:var(--gantt-left-width);
  max-width:var(--gantt-left-width);
  padding:10px 12px;
  font-size:13px;
  font-weight:700;
  color:var(--content-text);
  border-right:1px solid var(--content-border);
  position:relative;
  z-index:7;
  background:var(--content-hover);
  overflow:hidden;
  will-change:transform;
}

.project-gantt-page .gantt-milestone-right{
  position:relative;
  background:var(--content-hover);
  isolation:isolate;
}

.project-gantt-page .gantt-timeline-header,
.project-gantt-page .gantt-timeline-row{
  position:relative;
  min-width:0;
}

.project-gantt-page .gantt-milestone-right .gantt-timeline-row,
.project-gantt-page .gantt-milestone-right .gantt-timeline-track{
  background:var(--content-hover);
}

.project-gantt-page .gantt-milestone-band{
  position:absolute;
  inset:0;
  background:var(--content-hover);
  pointer-events:none;
  z-index:0;
}

.project-gantt-page .gantt-timeline-header{
  height:36px;
  overflow:hidden;
}

.project-gantt-page .gantt-timeline-row{
  height:34px;
  overflow:hidden;
}

.project-gantt-page .gantt-timeline-track{
  position:relative;
  height:100%;
  min-width:100%;
}

.project-gantt-page .gantt-day-line{
  position:absolute;
  top:0;
  bottom:0;
  width:1px;
  background:var(--content-border);
  z-index:1;
}

.project-gantt-page .gantt-row-right::after,
.project-gantt-page .gantt-milestone-right::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:1px;
  background:var(--content-border);
  pointer-events:none;
}

.project-gantt-page .gantt-today-line{
  position:absolute;
  top:0;
  bottom:0;
  width:2px;
  background:#dc2626;
  z-index:2;
  pointer-events:none;
}

.project-gantt-page .gantt-day-header{
  position:absolute;
  top:0;
  bottom:0;
  border-right:1px solid var(--content-border);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  color:var(--content-text-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  padding:0 6px;
}

.project-gantt-page .gantt-bar{
  position:absolute;
  top:5px;
  height:22px;
  min-width:14px;
  border-radius:6px;
  border:1px solid rgba(37,99,235,.25);
  background:#dbeafe;
  color:#1e3a8a;
  display:flex;
  align-items:center;
  padding:0 0 0 8px;
  font-size:11px;
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  z-index:3;
  cursor:grab;
  user-select:none;
  touch-action:none;
}

.project-gantt-page .gantt-bar.is-dragging{
  opacity:.9;
  cursor:grabbing;
}

.project-gantt-page .gantt-bar-label{
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding-right:6px;
}

.project-gantt-page .gantt-bar-resize{
  width:10px;
  min-width:10px;
  height:100%;
  cursor:ew-resize;
  border-left:1px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.28);
  flex:0 0 auto;
}

.project-gantt-page .gantt-bar.is-complete{
  background:#dcfce7;
  border-color:rgba(22,163,74,.25);
  color:#166534;
}

.project-gantt-page .gantt-bar.is-delayed{
  background:#fee2e2;
  border-color:rgba(220,38,38,.2);
  color:#991b1b;
}

.project-gantt-page .gantt-row.selected,
.project-gantt-page .gantt-row.selected .gantt-cell,
.project-gantt-page .gantt-row.selected .gantt-row-right{
  background:rgba(37,99,235,.06);
}

.project-gantt-page .gantt-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid var(--content-border);
  background:var(--content-card);
}

.project-gantt-page .gantt-toolbar-right{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.project-gantt-page .gantt-empty{
  padding:24px;
  color:var(--content-text-muted);
  text-align:center;
}
/* Keep Gantt contained inside the panel even though project pages
   elsewhere use overflow: visible for list/table layouts */
body.project-gantt-page .app-frame,
body.project-gantt-page main,
body.project-gantt-page .content,
body.project-gantt-page .panel,
body.project-gantt-page .gantt-stage,
body.project-gantt-page .gantt-table{
  overflow: hidden !important;
  min-width: 0 !important;
}

body.project-gantt-page main,
body.project-gantt-page .content,
body.project-gantt-page .panel,
body.project-gantt-page .gantt-stage{
  width: 100%;
}
@media (max-width: 1400px){
  .project-gantt-page{
    --gantt-left-width: 480px;
    --gantt-cols-left: minmax(190px, 2.2fr) 85px 75px 60px 60px;
    --gantt-min-timeline-width: 680px;
  }
}

@media (max-width: 1200px){
  .project-gantt-page{
    --gantt-left-width: 450px;
    --gantt-cols-left: minmax(175px, 2.1fr) 80px 70px 55px 55px;
    --gantt-min-timeline-width: 620px;
  }
}

@media (max-width: 992px){
  .project-gantt-page{
    --gantt-left-width: 420px;
    --gantt-cols-left: minmax(160px, 2fr) 75px 65px 55px 55px;
    --gantt-min-timeline-width: 560px;
  }

  .project-gantt-page .gantt-head-cell,
  .project-gantt-page .gantt-cell{
    padding-left:8px;
    padding-right:8px;
  }

  .project-gantt-page .gantt-cell{
    font-size:12px;
  }

  .project-gantt-page .gantt-cell-muted{
    font-size:11px;
  }
}
@media (max-width: 900px){
  .project-gantt-page .gantt-toolbar{
    flex-direction:column;
    align-items:flex-start;
  }
}