/* ==========================================================================
   Pttrn Studio — Design System
   Dark Academia meets Modern Creative Studio
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'BTC Trojan';
  src: url('../assets/fonts/BTCMalwareTrojan.woff2') format('woff2'),
       url('../assets/fonts/BTCMalwareTrojan.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Adobe reference palette */
  --ink:        #1c1b19;   /* near-black, warmed from #000000 */
  --paper:      #FFFFFF;
  --lime:       #B0FF50;
  --chartreuse: #F7FC00;
  --coral:      #FF6931;
  --charcoal:   #333332;
  --stone:      #878785;
  --mist:       #D1D1CF;

  /* Derived surfaces */
  --bg-app:     #F3F1EA;   /* warm off-white studio wall */
  --bg-card:    #FFFFFF;
  --bg-sidebar: #17130F;   /* dark academia oak-panel */
  --bg-sidebar-hover: #262019;
  --border-soft: #E4E1D6;
  --border-sidebar: #332B22;

  --text-primary:   var(--ink);
  --text-secondary: #6B685F;
  --text-inverse:   #F3F1EA;
  --text-muted-inverse: #A39C8D;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(28,27,25,0.04), 0 8px 24px rgba(28,27,25,0.06);
  --shadow-card-hover: 0 4px 10px rgba(28,27,25,0.06), 0 16px 32px rgba(28,27,25,0.10);
  --shadow-pop: 0 12px 40px rgba(0,0,0,0.18);

  --font-display: 'BTC Trojan', 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --sidebar-w: 248px;
  --topbar-h: 64px;
  --bottomnav-h: 64px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-primary);
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }
input, textarea, select {
  font-family: var(--font-body);
  font-size: 14px;
}
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--mist); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- App shell ---------- */
#app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 28px;
}
.sidebar-brand .mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--lime), var(--chartreuse));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--on-accent, var(--ink));
  font-size: 17px;
}
.sidebar-brand .name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-inverse);
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted-inverse);
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-link:hover { background: var(--bg-sidebar-hover); color: var(--text-inverse); }
.sidebar-link.active { background: var(--bg-sidebar-hover); color: var(--lime); }
.sidebar-link .ico { width: 18px; text-align: center; opacity: .9; }

.sidebar-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted-inverse);
  padding: 18px 12px 6px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-sidebar);
}
.role-switch {
  display: flex;
  gap: 6px;
  background: var(--bg-sidebar-hover);
  padding: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.role-switch button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted-inverse);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 6px;
  border-radius: var(--radius-pill);
  transition: all .15s;
}
.role-switch button.active {
  background: var(--lime);
  color: var(--ink);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--ink);
  flex-shrink: 0;
}
.user-chip .who { min-width: 0; }
.user-chip .who .n { font-size: 13px; font-weight: 600; color: var(--text-inverse); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who .r { font-size: 11px; color: var(--text-muted-inverse); }

/* ---------- Main column ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: none;
}
.content {
  padding: 36px 40px 80px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--stone);
  margin-bottom: 6px;
}
.page-title {
  font-size: 34px;
}
.page-sub {
  color: var(--text-secondary);
  font-size: 14.5px;
  margin-top: 8px;
  max-width: 60ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform .1s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: var(--text-inverse); }
.btn-primary:hover { background: #000; box-shadow: var(--shadow-card-hover); }
.btn-accent { background: var(--lime); color: var(--on-accent, var(--ink)); }
.btn-accent:hover { background: #9EEF3E; }
.btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--border-soft); }
.btn-ghost:hover { background: var(--bg-card); border-color: var(--stone); }
.btn-danger { background: transparent; color: var(--coral); border-color: rgba(255,105,49,.35); }
.btn-danger:hover { background: rgba(255,105,49,.08); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
}
.icon-btn:hover { border-color: var(--stone); color: var(--text-primary); }

/* ---------- Cards / surfaces ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
}

/* ---------- Dashboard: project cards ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  margin-bottom: 8px;
}
.project-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s, box-shadow .18s;
  cursor: pointer;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}
.project-cover {
  height: 152px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px;
}
.project-cover::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.32) 100%);
}
.type-chip {
  position: relative; z-index: 1;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.88);
  color: var(--ink);
}
.draft-chip {
  position: relative; z-index: 1;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--coral);
  color: white;
}
.project-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-name { font-size: 19px; line-height: 1.25; }
.project-meta { font-size: 12.5px; color: var(--text-secondary); display: flex; gap: 8px; align-items: center; }
.project-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--stone); }
.progress-row { margin-top: auto; }
.progress-track {
  height: 6px; border-radius: 4px; background: var(--mist); overflow: hidden; margin-bottom: 6px;
}
.progress-fill { height: 100%; border-radius: 4px; background: var(--lime); }
.progress-fill.warn { background: var(--coral); }
.progress-label { font-size: 11.5px; color: var(--text-secondary); display: flex; justify-content: space-between; }

/* ---------- Dashboard: side widgets ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 30px;
}
.widget-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.widget { padding: 22px; }
.widget h3 { font-size: 15px; margin-bottom: 4px; }
.widget .widget-sub { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 14px; }
.deadline-item, .overdue-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}
.deadline-item:first-of-type, .overdue-item:first-of-type { border-top: none; }
.dl-date {
  width: 44px; text-align: center; flex-shrink: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  background: var(--bg-app); border-radius: 8px; padding: 5px 0;
}
.dl-date .mo { display:block; font-family: var(--font-body); font-size: 9px; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; letter-spacing: .05em; }
.overdue-item .dl-date { background: rgba(255,105,49,.12); color: var(--coral); }
.dl-info { min-width: 0; flex: 1; }
.dl-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-proj { font-size: 12px; color: var(--text-secondary); }
.empty-note { font-size: 13px; color: var(--text-secondary); padding: 6px 0; }

/* ---------- Tabs ---------- */
.tab-row {
  display: flex; gap: 6px;
  background: var(--mist);
  padding: 4px;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin-bottom: 24px;
}
.tab-row button {
  border: none; background: transparent;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
}
.tab-row button.active { background: var(--ink); color: var(--text-inverse); }

/* ---------- Project header ---------- */
.project-hero {
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  background-size: cover;
  background-position: center;
  color: white;
  position: relative;
  margin-bottom: 24px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.project-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(23,19,15,0.15) 0%, rgba(23,19,15,0.78) 100%);
  border-radius: var(--radius-lg);
}
.project-hero > * { position: relative; z-index: 1; }
.project-hero-top { display: flex; justify-content: space-between; align-items: flex-start; }
.project-hero h1 { color: white; font-size: 30px; }
.project-hero .project-meta { color: rgba(255,255,255,0.78); }
.project-hero .project-meta .dot { background: rgba(255,255,255,0.5); }

/* ---------- Kanban ---------- */
.kanban-board {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}
.kanban-col {
  background: rgba(209,209,207,0.35);
  border: 1px dashed var(--mist);
  border-radius: var(--radius-lg);
  width: 300px;
  flex-shrink: 0;
  padding: 14px;
  min-height: 200px;
}
.kanban-col.dragover { background: rgba(176,255,80,0.18); border-color: var(--lime); }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; }
.kanban-col-head .name { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.kanban-col-head .count { font-size: 11px; background: var(--bg-card); border-radius: var(--radius-pill); padding: 2px 8px; color: var(--text-secondary); font-weight: 600; }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.task-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-card);
  cursor: grab;
  border: 1px solid var(--border-soft);
  border-top: 3px solid var(--mist);
  transition: box-shadow .15s, transform .15s;
}
.task-card:hover { box-shadow: var(--shadow-card-hover); }
.task-card.dragging { opacity: 0.4; }
.task-card.priority-High { border-top-color: var(--coral); }
.task-card.priority-Medium { border-top-color: var(--chartreuse); }
.task-card.priority-Low { border-top-color: var(--lime); }
.task-card.overdue { background: rgba(255,105,49,.06); }
.task-card .t-title { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.task-card .t-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.t-due { font-size: 11.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.t-due.overdue-txt { color: var(--coral); font-weight: 700; }
.priority-pill { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: var(--radius-pill); }
.priority-pill.priority-High { background: rgba(255,105,49,.15); color: #B94E1F; }
.priority-pill.priority-Medium { background: rgba(247,252,0,.28); color: #6B6B00; }
.priority-pill.priority-Low { background: rgba(176,255,80,.28); color: #4C7A17; }
.add-task-btn {
  width: 100%; border: 1px dashed var(--stone); background: transparent;
  border-radius: var(--radius-md); padding: 10px; margin-top: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
}
.add-task-btn:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Timeline ---------- */
.timeline-wrap { overflow-x: auto; padding-bottom: 12px; }
.timeline-grid {
  position: relative;
  display: flex;
  flex-direction: column;
  width: fit-content;
  min-width: 100%;
}
.timeline-label-col { width: 150px; flex-shrink: 0; }
.timeline-header-row { display: flex; border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; background: var(--bg-app); z-index: 3; }
.timeline-track { position: relative; display: flex; }
.timeline-day { width: 56px; flex-shrink: 0; text-align: center; padding: 6px 0; font-size: 11px; color: var(--text-secondary); border-left: 1px solid var(--border-soft); }
.timeline-day.today { color: var(--coral); font-weight: 700; }
.timeline-day .dow { display: block; font-size: 9px; text-transform: uppercase; opacity: .7; }
.timeline-lane-label {
  font-size: 12.5px; font-weight: 600; padding: 10px 12px; display: flex; align-items: center;
}
.timeline-lanes { display: flex; flex-direction: column; }
.timeline-lane { display: flex; position: relative; min-height: 54px; border-bottom: 1px solid var(--border-soft); }
.timeline-bg { position: absolute; top: 0; bottom: 0; left: 150px; right: 0; display: flex; pointer-events: none; }
.timeline-bg div { width: 56px; flex-shrink: 0; border-left: 1px solid var(--border-soft); opacity: .6; }
.timeline-bar {
  position: absolute; top: 10px; height: 34px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; padding: 0 12px;
  font-size: 11.5px; font-weight: 600; color: var(--ink);
  background: var(--lime);
  box-shadow: var(--shadow-card);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
}
.timeline-bar.overdue { background: var(--coral); color: white; }
.timeline-bar.done { background: var(--mist); color: var(--text-secondary); text-decoration: line-through; }
.timeline-bar.milestone {
  border-radius: 8px;
  background: var(--ink); color: white;
  font-family: var(--font-display);
  cursor: default;
}
.timeline-today-line {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--coral); z-index: 2; pointer-events: none;
}

/* ---------- Moodboard ---------- */
.moodboard-grid {
  columns: 4 240px;
  column-gap: 16px;
}
.moodboard-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
}
.moodboard-item img { width: 100%; display: block; }
.moodboard-caption {
  padding: 9px 12px; font-size: 11.5px; color: var(--text-secondary);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.moodboard-item .delete-x {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(23,19,15,0.7); color: white; border: none;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  opacity: 0; transition: opacity .15s;
}
.moodboard-item:hover .delete-x { opacity: 1; }
.upload-tile {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--stone);
  min-height: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-secondary); font-size: 12.5px; font-weight: 600;
  cursor: pointer;
}
.upload-tile:hover { border-color: var(--ink); color: var(--ink); background: rgba(0,0,0,0.02); }
.upload-tile .plus { font-size: 22px; }

/* ---------- My tasks (team member) ---------- */
.task-list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.task-list-row:last-child { border-bottom: none; }
.task-list-row:hover { background: var(--bg-app); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot.To-Do { background: var(--mist); }
.status-dot.In-Progress { background: var(--chartreuse); }
.status-dot.Done { background: var(--lime); }
.task-list-row .tl-main { flex: 1; min-width: 0; }
.task-list-row .tl-title { font-size: 14px; font-weight: 600; }
.task-list-row .tl-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ---------- Modal / drawer ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(23,19,15,0.45);
  display: flex; align-items: stretch; justify-content: flex-end;
  z-index: 50;
}
.modal-overlay.center { align-items: center; justify-content: center; padding: 20px; }
.drawer {
  width: 480px; max-width: 92vw; background: var(--bg-card);
  height: 100%; overflow-y: auto; box-shadow: var(--shadow-pop);
  padding: 28px 26px 40px;
  animation: slidein .22s ease-out;
}
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.modal-card {
  width: 560px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 28px 26px 30px; box-shadow: var(--shadow-pop);
  animation: popin .16s ease-out;
}
@keyframes popin { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 10px; }
.modal-head h2 { font-size: 22px; }
.close-x { border: none; background: var(--bg-app); width: 30px; height: 30px; border-radius: 50%; font-size: 15px; color: var(--text-secondary); flex-shrink: 0; }
.close-x:hover { color: var(--text-primary); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); margin-bottom: 6px; }
.field input[type=text], .field input[type=date], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft); background: var(--bg-app);
  color: var(--text-primary);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ink); }
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.seg-row { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; border: 1px solid var(--border-soft); background: var(--bg-app);
  padding: 9px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text-secondary);
}
.seg-btn.active { background: var(--ink); color: var(--text-inverse); border-color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.cover-picker { display: grid; grid-template-columns: repeat(6,1fr); gap: 8px; }
.cover-swatch { aspect-ratio: 1; border-radius: 8px; background-size: cover; background-position: center; border: 2px solid transparent; }
.cover-swatch.active { border-color: var(--lime); }
.file-drop {
  border: 1.5px dashed var(--stone); border-radius: var(--radius-sm); padding: 16px;
  text-align: center; font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
}
.file-drop:hover { border-color: var(--ink); }

.stage-editor { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.stage-row { display: flex; gap: 8px; align-items: center; }
.stage-row input { flex: 1; }

/* ---------- Task detail ---------- */
.detail-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.detail-meta-item { background: var(--bg-app); border-radius: var(--radius-sm); padding: 10px 12px; }
.detail-meta-item .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); font-weight: 700; margin-bottom: 3px; }
.detail-meta-item .v { font-size: 13.5px; font-weight: 600; }
.status-seg { margin: 18px 0; }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .avatar { width: 28px; height: 28px; font-size: 10px; }
.comment-body { background: var(--bg-app); border-radius: var(--radius-sm); padding: 8px 12px; flex: 1; }
.comment-body .c-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); margin-bottom: 3px; }
.comment-body .c-name { font-weight: 700; color: var(--text-primary); }
.comment-input-row { display: flex; gap: 8px; margin-top: 10px; }
.comment-input-row input { flex: 1; }
.attachment-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-app); border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 6px; }
.attachment-chip img { width: 30px; height: 30px; object-fit: cover; border-radius: 6px; }
.section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); margin: 20px 0 8px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--text-inverse);
  padding: 12px 20px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-pop);
  z-index: 100; animation: toastin .2s ease-out;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%,0); } }

.empty-state {
  text-align: center; padding: 70px 20px; color: var(--text-secondary);
}
.empty-state h3 { color: var(--text-primary); margin-bottom: 8px; font-size: 19px; }
.empty-state .btn { margin-top: 16px; }

.bottom-nav { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  #app { flex-direction: column; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--topbar-h); padding: 0 18px;
    background: var(--bg-sidebar); color: var(--text-inverse);
    position: sticky; top: 0; z-index: 20;
  }
  .topbar .name { font-family: var(--font-display); font-size: 18px; }
  .content { padding: 20px 16px 90px; }
  .page-title { font-size: 26px; }
  .widget-row { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .drawer { width: 100%; max-width: 100%; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottomnav-h);
    background: var(--bg-sidebar); z-index: 20; border-top: 1px solid var(--border-sidebar);
    padding: 6px 4px;
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--text-muted-inverse); font-size: 10.5px; font-weight: 600;
  }
  .bottom-nav a.active { color: var(--lime); }
  .bottom-nav .ico { font-size: 17px; }
  .moodboard-grid { columns: 2 160px; }
}

/* ==========================================================================
   Auth, Drive & Team additions
   ========================================================================== */

/* ---------- Sign-in screen ---------- */
.signin-wrap {
  min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% -10%, color-mix(in srgb, var(--lime) 16%, transparent), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, color-mix(in srgb, var(--chartreuse) 14%, transparent), transparent 55%),
    var(--bg-sidebar);
}
.signin-card {
  width: 460px; max-width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 38px 36px 30px;
  box-shadow: var(--shadow-pop);
}
.signin-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.signin-brand .mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--lime), var(--chartreuse));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--on-accent, var(--ink)); font-size: 19px;
  overflow: hidden;
}
.signin-brand .name { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.logo-mark {
  display: block; width: 74%; height: 74%;
  background-color: var(--on-accent, #fff);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.brand-tagline {
  font-size: 10px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--brand-accent, var(--lime)); margin: -14px 0 24px; opacity: .9;
}
.signin-title { font-size: 34px; line-height: 1.08; margin-bottom: 12px; }
.signin-sub { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 24px; }
.signin-btn { width: 100%; justify-content: center; padding: 13px; font-size: 14.5px; }
.signin-btn .g-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--lime);
  font-weight: 800; font-size: 12px; margin-right: 2px;
}
.signin-fine { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; margin-top: 10px; }
.signin-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 16px; color: var(--text-secondary); font-size: 12px;
}
.signin-divider::before, .signin-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-soft);
}
.signin-error {
  margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255,105,49,0.1); color: #B94E1F; font-size: 12.5px; font-weight: 500;
}
.setup-notice {
  border: 1px solid var(--border-soft); border-radius: var(--radius-md);
  padding: 16px; background: var(--bg-app);
}
.setup-notice .setup-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.setup-notice p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.setup-notice code { background: var(--mist); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }

/* ---------- Storage badge & sign-out ---------- */
.storage-badge {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; padding: 7px 10px; border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.storage-badge.drive { background: rgba(176,255,80,0.14); color: var(--lime); }
.storage-badge.local { background: var(--bg-sidebar-hover); color: var(--text-muted-inverse); }
.storage-badge .dot-on, .storage-badge .dot-off { width: 7px; height: 7px; border-radius: 50%; }
.storage-badge .dot-on { background: var(--lime); }
.storage-badge .dot-off { background: var(--stone); }
.signout-btn { width: 100%; justify-content: center; margin-top: 12px; color: var(--text-inverse); border-color: var(--border-sidebar); }
.signout-btn:hover { background: var(--bg-sidebar-hover); border-color: var(--stone); }

/* ---------- Drive tags & moodboard states ---------- */
.drive-tag {
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  background: var(--lime); color: var(--ink); padding: 2px 6px; border-radius: 5px;
  vertical-align: middle; margin-left: 6px;
}
.moodboard-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.mb-status {
  break-inside: avoid; margin-bottom: 16px; padding: 22px 16px; text-align: center;
  font-size: 12.5px; color: var(--text-secondary);
  border: 1px dashed var(--border-soft); border-radius: var(--radius-md);
}
.mb-status.error { color: #B94E1F; border-color: rgba(255,105,49,0.4); background: rgba(255,105,49,0.06); }
img.drive-loading { min-height: 120px; background: var(--bg-app); }
img.drive-error { min-height: 80px; background: rgba(255,105,49,0.08); }
.file-tile {
  min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; background: var(--bg-app); color: var(--text-secondary); padding: 16px;
}
.file-tile .file-ico { font-size: 30px; }
.file-tile .file-name { font-size: 11.5px; word-break: break-word; text-align: center; }

/* ---------- Attachment chips ---------- */
.attachment-chip { position: relative; }
.attachment-chip .att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip .att-ico { font-size: 18px; width: 30px; text-align: center; }
.attachment-chip .att-open { color: var(--text-secondary); font-size: 15px; padding: 0 4px; }
.attachment-chip .att-open:hover { color: var(--ink); }
.attachment-chip .att-del {
  border: none; background: transparent; color: var(--stone); font-size: 16px;
  cursor: pointer; padding: 0 2px; line-height: 1;
}
.attachment-chip .att-del:hover { color: var(--coral); }

/* ---------- Team screen ---------- */
.role-badge {
  font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: var(--radius-pill);
}
.role-badge.director { background: rgba(176,255,80,0.28); color: #4C7A17; }
.role-badge.member { background: var(--mist); color: var(--text-secondary); }
.invite-note { padding: 18px 20px; display: flex; gap: 12px; align-items: flex-start; }

@media (max-width: 900px) {
  .signin-card { padding: 30px 22px 26px; }
  .signin-title { font-size: 28px; }
}

/* ==========================================================================
   Brand mark — outlined Trojan "P" + restrained glitch accents
   Goal: the glitch is a nod (chromatic edges, a scanline whisper, a hover
   flicker), never at the cost of readability. Functional surfaces
   (modals, drawers, inputs, tables) stay perfectly clean.
   ========================================================================== */

/* The mark tile holds a hollow, stroked capital P from the Trojan face. */
.sidebar-brand .mark,
.signin-brand .mark {
  position: relative;
  color: transparent;
  -webkit-text-stroke: 1.4px var(--ink);
  overflow: visible;
}
.sidebar-brand .mark { -webkit-text-stroke-width: 1.3px; }
.signin-brand .mark { -webkit-text-stroke-width: 1.5px; }

/* Chromatic ghosts of the P — only visible as faint coloured edges. */
.sidebar-brand .mark::before,
.sidebar-brand .mark::after,
.signin-brand .mark::before,
.signin-brand .mark::after {
  content: attr(data-ghost);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font: inherit; color: transparent;
  -webkit-text-stroke: 1.2px currentColor;
  opacity: 0; pointer-events: none;
}
/* Logo marks (e.g. Spectral Surf) render a real logo — no hollow letter, no glitch ghost. */
.sidebar-brand .mark.has-logo,
.signin-brand .mark.has-logo { color: var(--on-accent, var(--ink)); -webkit-text-stroke: 0; }
.sidebar-brand .mark.has-logo::before, .sidebar-brand .mark.has-logo::after,
.signin-brand .mark.has-logo::before, .signin-brand .mark.has-logo::after { content: none; }
.sidebar-brand .mark::before, .signin-brand .mark::before { color: var(--coral); }
.sidebar-brand .mark::after,  .signin-brand .mark::after  { color: #3aa0ff; }

/* Hover flicker: the ghosts slice apart briefly, then snap back. */
.sidebar-brand:hover .mark::before,
.signin-brand:hover .mark::before { animation: glitch-x 0.42s steps(2,end) 1; opacity: .9; }
.sidebar-brand:hover .mark::after,
.signin-brand:hover .mark::after  { animation: glitch-x-rev 0.42s steps(2,end) 1; opacity: .9; }
@keyframes glitch-x {
  0% { transform: translate(0,0); clip-path: inset(0 0 60% 0); }
  30% { transform: translate(-2px,-1px); clip-path: inset(40% 0 20% 0); }
  60% { transform: translate(2px,1px); clip-path: inset(10% 0 55% 0); }
  100% { transform: translate(0,0); clip-path: inset(0 0 0 0); opacity: 0; }
}
@keyframes glitch-x-rev {
  0% { transform: translate(0,0); clip-path: inset(55% 0 0 0); }
  30% { transform: translate(2px,1px); clip-path: inset(20% 0 40% 0); }
  60% { transform: translate(-2px,-1px); clip-path: inset(50% 0 12% 0); }
  100% { transform: translate(0,0); clip-path: inset(0 0 0 0); opacity: 0; }
}

/* ---------- Glitch nod #2: chromatic edge on the big display headings ----------
   The solid ink/white glyph stays crisp; two 1px coloured ghosts sit just
   behind it, echoing the split-scan posters without hurting legibility. */
.signin-title,
.page-title,
.project-hero h1 {
  text-shadow:
     1px 0 0 rgba(255,105,49,0.22),
    -1px 0 0 rgba(58,160,255,0.20);
}

/* ---------- Glitch nod #3: scanline whisper on the dark surfaces ---------- */
.sidebar::after,
.signin-wrap::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.035) 0px,
    rgba(255,255,255,0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  z-index: 0;
}
.sidebar { position: sticky; } /* already sticky; ensure ::after anchors */
.sidebar > * { position: relative; z-index: 1; }
.signin-card { position: relative; z-index: 1; }

/* ---------- Glitch nod #4: a torn divider under section labels ---------- */
.section-label {
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-brand:hover .mark::before,
  .sidebar-brand:hover .mark::after,
  .signin-brand:hover .mark::before,
  .signin-brand:hover .mark::after { animation: none; opacity: 0; }
}

/* Anchor the sign-in scanline overlay to its own box */
.signin-wrap { position: relative; }
.signin-wrap > * { position: relative; z-index: 1; }

/* ==========================================================================
   Spectral Surf — Project OS components
   ========================================================================== */
:root { --steel:#4AA3C7; --amber:#F7A100; --rose:#E0457B; }

/* ---- roster sign-in ---- */
.signin-card.wide { width: 560px; }
.roster-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:8px 0 4px; }
.roster-card { display:flex; align-items:center; gap:11px; text-align:left; padding:11px 13px;
  border:1px solid var(--border-soft); background:var(--bg-app); border-radius:var(--radius-md); transition:all .14s; }
.roster-card:hover { border-color:var(--ink); transform:translateY(-1px); box-shadow:var(--shadow-card); }
.roster-who .rn { font-size:13.5px; font-weight:700; }
.roster-who .rt { font-size:11.5px; color:var(--text-secondary); }

/* ---- generic bits ---- */
.entity-id { font-family:var(--font-body); font-size:11px; font-weight:800; letter-spacing:.03em; color:var(--stone); }
.entity-id.light { color:rgba(255,255,255,.85); background:rgba(0,0,0,.28); padding:2px 7px; border-radius:6px; }
.muted-note { font-size:12.5px; color:var(--text-secondary); }
.mini-select { border:1px solid var(--border-soft); background:var(--bg-card); border-radius:var(--radius-pill); padding:7px 12px; font-size:12.5px; font-weight:600; }
.sl-count { font-size:11px; color:var(--text-secondary); font-weight:700; }
.opt-tag { font-size:10px; font-weight:800; text-transform:uppercase; background:var(--mist); color:var(--text-secondary); padding:2px 7px; border-radius:6px; letter-spacing:.04em; }

.status-pill { font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; padding:3px 9px; border-radius:var(--radius-pill); background:var(--mist); color:var(--charcoal); }
.status-pill.s-Active, .status-pill.s-InProgress { background:rgba(74,163,199,.18); color:#1f6d8c; }
.status-pill.s-Planned { background:var(--mist); color:var(--charcoal); }
.status-pill.s-Blocked { background:rgba(224,69,123,.16); color:#b12057; }
.status-pill.s-Done { background:rgba(176,255,80,.3); color:#4C7A17; }
.status-pill.s-AtRisk { background:rgba(255,105,49,.18); color:#b94e1f; }

.ms-chip { display:inline-block; font-size:10.5px; font-weight:800; letter-spacing:.03em; padding:2px 8px; border-radius:6px;
  background:rgba(23,19,15,.06); color:var(--text-secondary); }
.ms-chip:hover { background:var(--ink); color:var(--text-inverse); }
.ms-chip.light { background:rgba(255,255,255,.16); color:#fff; }
.ms-chip.light:hover { background:rgba(255,255,255,.32); }
.ms-chip-row, .hero-chips { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:6px; }

.drive-pill { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:var(--steel);
  border:1px solid rgba(74,163,199,.35); padding:3px 10px; border-radius:var(--radius-pill); }
.drive-pill:hover { background:rgba(74,163,199,.1); }
.drive-none { font-size:11.5px; color:var(--stone); }

/* ---- per-user board ---- */
.board-tools { display:flex; align-items:center; gap:8px; }
.board-grid { display:grid; grid-template-columns:repeat(6,minmax(180px,1fr)); gap:12px; overflow-x:auto; padding-bottom:10px; align-items:flex-start; }
.board-col { background:rgba(209,209,207,.24); border-radius:var(--radius-lg); padding:12px 10px; border-top:3px solid var(--stone); min-height:120px; }
.board-col.col-overdue  { border-top-color:var(--coral); }
.board-col.col-today    { border-top-color:var(--amber); }
.board-col.col-progress { border-top-color:var(--steel); }
.board-col.col-next     { border-top-color:var(--lime); }
.board-col.col-blocked  { border-top-color:var(--rose); }
.board-col.col-backlog  { border-top-color:var(--stone); }
.board-col.dragover { background:rgba(176,255,80,.16); outline:2px dashed var(--lime); }
.board-col-head { display:flex; align-items:center; justify-content:space-between; padding:0 4px; }
.bc-name { font-family:var(--font-display); font-size:13.5px; font-weight:600; }
.bc-count { font-size:11px; font-weight:700; background:var(--bg-card); border-radius:var(--radius-pill); padding:1px 8px; color:var(--text-secondary); }
.board-col-hint { font-size:10.5px; color:var(--text-secondary); padding:2px 4px 10px; }
.board-cards { display:flex; flex-direction:column; gap:9px; min-height:30px; }
.board-empty { text-align:center; color:var(--mist); font-size:18px; padding:6px; }

.task-card { background:var(--bg-card); border:1px solid var(--border-soft); border-radius:var(--radius-md); padding:11px 12px;
  box-shadow:var(--shadow-card); cursor:grab; border-left:3px solid var(--mist); }
.task-card:hover { box-shadow:var(--shadow-card-hover); }
.task-card.dragging { opacity:.4; }
.task-card.priority-High { border-left-color:var(--coral); }
.task-card.priority-Medium { border-left-color:var(--amber); }
.task-card.priority-Low { border-left-color:var(--lime); }
.t-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:5px; }
.t-id { font-size:10px; font-weight:800; color:var(--stone); }
.task-card .t-title { font-size:13px; font-weight:600; line-height:1.3; margin-bottom:7px; }
.task-card .t-row { display:flex; align-items:center; justify-content:space-between; }
.proj-tag { font-size:10px; font-weight:800; color:var(--steel); }
.t-due { font-size:11px; color:var(--text-secondary); }
.t-due.muted { color:var(--mist); }
.t-due.overdue-txt, .overdue-txt { color:var(--coral); font-weight:700; }
.priority-pill { font-size:9.5px; font-weight:800; text-transform:uppercase; padding:2px 7px; border-radius:var(--radius-pill); }
.priority-pill.priority-High { background:rgba(255,105,49,.16); color:#b94e1f; }
.priority-pill.priority-Medium { background:rgba(247,161,0,.2); color:#8a5a00; }
.priority-pill.priority-Low { background:rgba(176,255,80,.28); color:#4C7A17; }
.t-blocked { font-size:10.5px; color:var(--rose); font-weight:700; margin-top:7px; }
.t-subs { font-size:10.5px; color:var(--text-secondary); margin-top:6px; }

/* ---- milestone + project cards ---- */
.ms-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:18px; }
.ms-card { padding:18px 20px; cursor:pointer; transition:transform .16s, box-shadow .16s; }
.ms-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-card-hover); }
.ms-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.ms-name { font-family:var(--font-display); font-size:18px; font-weight:600; margin-bottom:5px; }
.ms-desc { font-size:12.5px; color:var(--text-secondary); line-height:1.45; margin-bottom:12px; min-height:34px; }
.ms-meta { display:flex; align-items:center; gap:7px; font-size:11.5px; color:var(--text-secondary); margin-top:10px; }
.ms-meta .avatar { display:inline-flex; vertical-align:middle; }
.ms-foot { margin-top:12px; }
.dot { width:3px; height:3px; border-radius:50%; background:var(--stone); display:inline-block; }

.proj-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
.proj-mini { padding:15px 16px; cursor:pointer; transition:transform .16s, box-shadow .16s; }
.proj-mini:hover { transform:translateY(-2px); box-shadow:var(--shadow-card-hover); }
.pm-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.pm-name { font-family:var(--font-display); font-size:15px; font-weight:600; margin-bottom:9px; }
.pm-meta { font-size:11.5px; color:var(--text-secondary); margin-top:8px; display:flex; align-items:center; gap:5px; }
.pm-supports { font-size:11px; color:var(--text-secondary); margin-top:8px; display:flex; gap:5px; flex-wrap:wrap; align-items:center; }

.project-card { overflow:hidden; cursor:pointer; transition:transform .16s, box-shadow .16s; padding:0; }
.project-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-card-hover); }
.project-cover { height:120px; background-size:cover; background-position:center; position:relative; display:flex; justify-content:space-between; align-items:flex-start; padding:12px; }
.project-body { padding:15px 17px 17px; }
.project-name { font-family:var(--font-display); font-size:17px; font-weight:600; }
.project-meta { display:flex; align-items:center; gap:7px; font-size:11.5px; color:var(--text-secondary); margin-top:7px; }
.progress-row { margin-top:12px; }
.progress-track { height:6px; border-radius:4px; background:var(--mist); overflow:hidden; margin-bottom:5px; }
.progress-fill { height:100%; border-radius:4px; background:var(--steel); }
.progress-fill.warn { background:var(--coral); }
.progress-label { display:flex; justify-content:space-between; font-size:11px; color:var(--text-secondary); }

/* ---- detail hero (milestone/project) ---- */
.detail-hero { background:var(--bg-sidebar); color:var(--text-inverse); border-radius:var(--radius-lg); padding:24px 26px; margin-bottom:22px; position:relative; overflow:hidden; }
.detail-hero::after { content:''; position:absolute; inset:0; background:repeating-linear-gradient(0deg,rgba(255,255,255,.03) 0 1px,transparent 1px 3px); pointer-events:none; }
.detail-hero > * { position:relative; z-index:1; }
.dh-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:10px; }
.detail-hero h1 { color:#fff; font-size:26px; }
.dh-desc { color:var(--text-muted-inverse); font-size:13.5px; line-height:1.5; margin:8px 0; max-width:70ch; }
.dh-meta { display:flex; align-items:center; gap:9px; font-size:12px; color:var(--text-muted-inverse); flex-wrap:wrap; margin-top:10px; }
.project-hero .hero-chips { margin-top:10px; }
.light-btn { background:rgba(255,255,255,.9)!important; }

/* ---- task table ---- */
.tasks-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.task-table { overflow:hidden; margin-bottom:20px; }
.task-row { display:flex; align-items:center; gap:12px; padding:12px 15px; border-bottom:1px solid var(--border-soft); cursor:pointer; }
.task-row:last-child { border-bottom:none; }
.task-row:hover { background:var(--bg-app); }
.status-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; background:var(--mist); }
.status-dot.In-Progress { background:var(--steel); }
.status-dot.To-Do { background:var(--stone); }
.status-dot.Done { background:var(--lime); }
.status-dot.Backlog { background:var(--mist); }
.status-dot.Blocked { background:var(--rose); }
.tr-id { font-size:10.5px; font-weight:800; color:var(--stone); width:58px; flex-shrink:0; }
.tr-main { flex:1; min-width:0; }
.tr-title { font-size:13.5px; font-weight:600; }
.tr-link { color:var(--steel); }
.tr-sub { font-size:11.5px; color:var(--text-secondary); margin-top:2px; }
.tr-due { font-size:11.5px; color:var(--text-secondary); }

/* ---- gantt ---- */
.gantt { padding:14px; }
.gantt-scroll { overflow-x:auto; }
.gantt-inner { min-width:100%; }
.g-header { display:flex; position:sticky; top:0; background:var(--bg-card); z-index:3; border-bottom:1px solid var(--border-soft); }
.g-corner { flex-shrink:0; }
.g-days { display:flex; }
.g-day { flex-shrink:0; text-align:center; font-size:10px; color:var(--text-secondary); padding:5px 0; border-left:1px solid var(--border-soft); }
.g-day.today { color:var(--coral); font-weight:800; }
.g-dow { display:block; font-size:8px; opacity:.6; text-transform:uppercase; }
.g-wk { font-size:9.5px; white-space:nowrap; }
.g-body { position:relative; }
.g-lane { display:flex; min-height:40px; border-bottom:1px solid var(--border-soft); align-items:center; }
.g-lane-label { width:var(--label-w,210px); flex-shrink:0; padding:6px 12px; position:sticky; left:0; background:var(--bg-card); z-index:2; }
.gll-main { font-size:12.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gll-main a:hover { color:var(--steel); }
.gll-sub { font-size:10px; color:var(--text-secondary); }
.g-track { position:relative; flex-shrink:0; min-height:40px; }
.g-bar { position:absolute; top:8px; height:24px; border-radius:6px; display:flex; align-items:center; padding:0 9px; font-size:10.5px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; box-shadow:var(--shadow-card); cursor:pointer; border:1px solid rgba(0,0,0,.06); }
.g-bar.todo { background:var(--lime); }
.g-bar.progress { background:var(--steel); color:#fff; }
.g-bar.overdue { background:var(--coral); color:#fff; }
.g-bar.blocked { background:var(--rose); color:#fff; }
.g-bar.backlog { background:var(--mist); color:var(--text-secondary); }
.g-bar.done { background:#cfd6db; color:var(--text-secondary); text-decoration:line-through; }
.g-today { position:absolute; top:0; bottom:0; width:2px; background:var(--coral); z-index:1; }
.g-marker { position:absolute; top:0; bottom:0; width:0; border-left:2px dotted var(--ink); z-index:1; }
.g-marker.target { border-color:var(--steel); }
.g-marker.start { border-color:var(--stone); }
.g-marker span { position:absolute; top:2px; left:4px; font-size:9px; font-weight:800; color:var(--ink); background:var(--bg-card); padding:0 4px; white-space:nowrap; }

/* ---- drawer additions ---- */
.drawer-actions { display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.detail-meta-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:6px 0 4px; }
.dm { background:var(--bg-app); border-radius:var(--radius-sm); padding:9px 11px; }
.dm .k { font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:var(--text-secondary); font-weight:800; margin-bottom:3px; }
.dm .v { font-size:13px; font-weight:600; }
.perm-note { font-size:11.5px; color:var(--text-secondary); margin:6px 0 0; }
.blocker-list { display:flex; flex-direction:column; gap:6px; }
.blocker-chip { display:block; font-size:12px; padding:7px 10px; border-radius:var(--radius-sm); background:var(--bg-app); font-weight:600; }
.blocker-chip.open { color:var(--rose); }
.blocker-chip.cleared { color:#4C7A17; text-decoration:line-through; }
.drive-row { display:flex; align-items:center; gap:10px; }
.sub-item { display:flex; align-items:center; justify-content:space-between; padding:7px 2px; border-bottom:1px solid var(--border-soft); }
.sub-item label { display:flex; align-items:center; gap:9px; font-size:13px; cursor:pointer; }
.sub-done { color:var(--text-secondary); text-decoration:line-through; }
.sub-right { display:flex; align-items:center; gap:8px; }
.sub-id { font-size:9.5px; font-weight:800; color:var(--mist); }
.sub-del { border:none; background:transparent; color:var(--stone); font-size:15px; cursor:pointer; }
.sub-del:hover { color:var(--coral); }
.sub-add { display:flex; gap:8px; margin-top:10px; }
.sub-add input { flex:1; }
.check-list { display:flex; flex-direction:column; gap:6px; max-height:150px; overflow-y:auto; padding:4px; background:var(--bg-app); border-radius:var(--radius-sm); }
.check-item { display:flex; align-items:center; gap:8px; font-size:12.5px; }

/* ---- dashboard ---- */
.stat-row { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:24px; }
.stat { background:var(--bg-card); border:1px solid var(--border-soft); border-radius:var(--radius-md); padding:15px 16px; box-shadow:var(--shadow-card); }
.stat-n { font-family:var(--font-display); font-size:28px; font-weight:700; line-height:1; }
.stat-l { font-size:11.5px; color:var(--text-secondary); margin-top:5px; font-weight:600; }
.stat.bad .stat-n { color:var(--coral); }
.stat.warn .stat-n { color:var(--rose); }
.stat.progress .stat-n { color:var(--steel); }
.stat.muted .stat-n { color:var(--stone); }
.dash-cols { display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.workload { padding:6px 4px; }
.wl-row { display:flex; align-items:center; gap:12px; padding:11px 14px; border-bottom:1px solid var(--border-soft); cursor:pointer; }
.wl-row:last-child { border-bottom:none; }
.wl-row:hover { background:var(--bg-app); }
.wl-main { flex:1; min-width:0; }
.wl-name { font-size:13px; font-weight:600; }
.wl-title { font-size:11px; color:var(--text-secondary); font-weight:400; }
.wl-bar { height:5px; background:var(--mist); border-radius:3px; margin-top:5px; overflow:hidden; }
.wl-fill { height:100%; background:var(--steel); border-radius:3px; }
.wl-nums { display:flex; flex-direction:column; align-items:flex-end; gap:1px; font-size:10.5px; }
.wl-open { font-weight:700; }
.wl-ip { color:var(--steel); }
.wl-od { color:var(--coral); font-weight:700; }
.init-row { display:flex; align-items:center; gap:12px; padding:11px 15px; border-bottom:1px solid var(--border-soft); cursor:pointer; }
.init-row:last-child { border-bottom:none; }
.init-row:hover { background:var(--bg-app); }
.init-main { flex:1; min-width:0; }
.init-name { font-size:13px; font-weight:600; display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.init-pct { font-family:var(--font-display); font-weight:700; font-size:15px; }
.att-row { display:flex; align-items:center; gap:11px; padding:10px 15px; border-bottom:1px solid var(--border-soft); cursor:pointer; }
.att-row:last-child { border-bottom:none; }
.att-row:hover { background:var(--bg-app); }
.att-flag { font-size:9px; font-weight:800; padding:3px 7px; border-radius:5px; letter-spacing:.04em; flex-shrink:0; }
.att-flag.overdue { background:rgba(255,105,49,.16); color:#b94e1f; }
.att-flag.blocked { background:rgba(224,69,123,.16); color:#b12057; }
.att-title { font-size:12.5px; font-weight:600; }
.att-sub { font-size:11px; color:var(--text-secondary); margin-top:2px; }

/* ---- audit ---- */
.audit-tools { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.audit-list { overflow:hidden; }
.audit-row { display:flex; align-items:center; gap:12px; padding:11px 15px; border-bottom:1px solid var(--border-soft); }
.audit-row:last-child { border-bottom:none; }
.audit-row[data-open] { cursor:pointer; }
.audit-row[data-open]:hover { background:var(--bg-app); }
.au-icon { width:26px; height:26px; border-radius:7px; display:flex; align-items:center; justify-content:center; font-size:12px; flex-shrink:0; background:var(--bg-app); color:var(--text-secondary); }
.au-create { background:rgba(176,255,80,.28); color:#4C7A17; }
.au-delete { background:rgba(255,105,49,.16); color:#b94e1f; }
.au-status { background:rgba(74,163,199,.18); color:#1f6d8c; }
.au-main { flex:1; min-width:0; }
.au-line { font-size:12.5px; }
.au-type { text-transform:capitalize; color:var(--text-secondary); }
.au-sub { font-size:11px; color:var(--text-secondary); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.au-time { font-size:11px; color:var(--stone); white-space:nowrap; }

/* ---- team + settings ---- */
.role-badge { font-size:11px; font-weight:700; padding:5px 12px; border-radius:var(--radius-pill); }
.role-badge.director { background:rgba(176,255,80,.28); color:#4C7A17; }
.role-badge.member { background:var(--mist); color:var(--text-secondary); }
.discord-input { margin-top:6px; width:100%; max-width:320px; padding:6px 10px; border:1px solid var(--border-soft); border-radius:var(--radius-sm); background:var(--bg-app); font-size:12px; }
.settings-card { padding:20px 22px; margin-bottom:16px; max-width:640px; }
.settings-card.danger { border-color:rgba(255,105,49,.3); }

/* ---- responsive ---- */
@media (max-width:900px){
  .board-grid { grid-template-columns:repeat(6,minmax(160px,1fr)); }
  .dash-cols { grid-template-columns:1fr; }
  .stat-row { grid-template-columns:repeat(2,1fr); }
  .roster-grid { grid-template-columns:1fr; }
  .detail-meta-grid { grid-template-columns:1fr 1fr; }
}

/* ==========================================================================
   PM Platform — Hub + multi-tenant bits
   ========================================================================== */
.hub { max-width: 1100px; margin: 0 auto; padding: 40px 28px 80px; }
.hub-head { margin-bottom: 26px; }
.hub-head .sidebar-brand { padding: 0; margin-bottom: 8px; }
.hub-head .sidebar-brand .name { color: var(--ink); }
.hub-head .sidebar-brand .mark { background: linear-gradient(135deg, var(--lime), var(--chartreuse)); }
.hub-sub { font-size: 13.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 12px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.node-card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card); border-top: 4px solid var(--na, var(--lime)); text-align: left; }
.node-card.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed var(--stone); border-top: 1.5px dashed var(--stone); color: var(--text-secondary); font-weight: 600; min-height: 150px; cursor: pointer; }
.node-card.add:hover { border-color: var(--ink); color: var(--ink); }
.node-card.add .plus { font-size: 24px; }
.nc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.nc-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--na, var(--lime)); color: var(--on-accent, var(--ink)); display: flex; align-items: center; justify-content: center; overflow: hidden; font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.nc-id { font-size: 11px; font-weight: 800; color: var(--stone); text-transform: uppercase; letter-spacing: .04em; }
.nc-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.nc-link { font-size: 11.5px; color: var(--steel); word-break: break-all; margin-bottom: 12px; font-weight: 600; }
.nc-members { font-size: 12px; min-height: 20px; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.mem-chip { font-size: 11px; font-weight: 700; background: var(--bg-app); padding: 2px 8px; border-radius: var(--radius-pill); }
.nc-actions { display: flex; gap: 8px; }
.hublink { color: var(--lime) !important; }
.hub-steps { font-size: 13px; color: var(--text-secondary); line-height: 1.6; padding-left: 20px; margin: 6px 0 12px; }
.hub-steps code { background: var(--mist); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.g-mark { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--lime); font-weight: 800; font-size: 12px; margin-right: 4px; }
.signin-btn { width: 100%; justify-content: center; padding: 12px; margin-top: 4px; }
.signin-error { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255,105,49,.1); color: #b94e1f; font-size: 12.5px; }
.signin-fine { font-size: 11.5px; color: var(--text-secondary); margin-top: 12px; line-height: 1.5; }

/* ---- pointer-based board drag ---- */
.task-card.grabbable { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.task-card.dragging { opacity: .35; }
.drag-clone {
  position: fixed; z-index: 2000; pointer-events: none;
  transform: rotate(-2deg); box-shadow: var(--shadow-pop); opacity: .96; margin: 0;
}
body.board-dragging { cursor: grabbing; }
/* while dragging, show which columns can receive the card */
body.board-dragging .board-col[data-drop]:not([data-drop=""]) { outline: 2px dashed var(--mist); outline-offset: -4px; }
body.board-dragging .board-col.dragover { outline: 2px dashed var(--lime); outline-offset: -4px; background: rgba(176,255,80,.12); }
/* the computed columns can't receive drops — dim them so it's obvious */
body.board-dragging .board-col[data-drop=""] { opacity: .5; }
