/* ============================================================
   Agile+ Work Management — Global Styles
   ============================================================ */

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

:root {
  --brand:      #2563eb;
  --brand-dark: #1d4ed8;
  --brand-light:#eff6ff;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-600:   #4b5563;
  --gray-700:   #374151;
  --gray-900:   #111827;
  --red:        #ef4444;
  --green:      #10b981;
  --amber:      #f59e0b;
  --radius:     10px;
  --surface:    #fff;
  --bg:         #f6f8fb;
  --canvas:     #f6f8fb;
  --panel:      #fff;
  --panel-muted:#f8fafc;
  --border:     #e6eaf2;
  --text:       #172033;
  --text-muted: #667085;
  --sidebar-bg: #fbfcff;
  --sidebar-border: #e6eaf2;
  --shadow:     0 8px 24px rgba(15,23,42,.045);
  --shadow-md:  0 14px 34px rgba(15,23,42,.075);
  --shadow-lg:  0 22px 58px rgba(15,23,42,.12);
  --space-1:    .25rem;
  --space-2:    .5rem;
  --space-3:    .75rem;
  --space-4:    1rem;
  --space-5:    1.25rem;
  --space-6:    1.5rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--canvas);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── Auth Layout ─────────────────────────────────────────── */
.auth-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  padding: 1rem;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
  padding: 2rem;
  width: 100%;
  max-width: 380px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-logo .icon {
  width: 52px; height: 52px;
  background: rgba(255,255,255,.2);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
  backdrop-filter: blur(8px);
}
.auth-logo h1 { font-size: 1.4rem; font-weight: 700; color: #fff; }
.auth-logo p  { font-size: .8rem; color: rgba(255,255,255,.7); margin-top: .2rem; }

.auth-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 1.25rem; color: var(--gray-900); }

/* ─── Form ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.form-group label { font-size: .8rem; font-weight: 500; color: var(--gray-700); }

input, select, textarea {
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .55rem .75rem;
  font-size: .875rem;
  background: #fff;
  color: var(--gray-900);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
input::placeholder { color: var(--gray-400); }
textarea { resize: vertical; min-height: 80px; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-size: .875rem; font-weight: 500;
  padding: .6rem 1.1rem;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--gray-700); border: 1.5px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-50); }
.btn-ghost  { background: transparent; color: var(--gray-500); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.25rem; font-size: .95rem; width: 100%; }
.btn-icon { padding: .45rem; border-radius: 8px; }

/* ─── Alert ───────────────────────────────────────────────── */
.alert {
  padding: .65rem .9rem;
  border-radius: var(--radius);
  font-size: .825rem;
  margin-bottom: .75rem;
}
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ─── Dashboard Layout ────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow: hidden;
  transition: width .2s ease;
}
.sidebar-logo {
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--brand); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo .logo-icon svg { color: #fff; }
.sidebar-logo .logo-text p:first-child { font-weight: 700; font-size: .875rem; }
.sidebar-logo .logo-text p:last-child  { font-size: .7rem; color: var(--gray-400); }

.sidebar-nav { flex: 1; padding: .6rem; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-section { margin-top: .75rem; }
.nav-section-label,
.nav-group-label {
  font-size: .65rem; font-weight: 600; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 0 .6rem; margin-bottom: .3rem;
}
.nav-group-label { margin-top: .85rem; }
.nav-group-label:first-child { margin-top: .1rem; }
.nav-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: all .12s;
}
.nav-item:hover    { background: #eef3f9; color: var(--text); }
.nav-item.active   { background: var(--brand-light); color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.nav-item svg      { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item.entity-company { font-size: .78rem; }
.nav-item.entity-bu {
  font-size: .75rem;
  padding-left: 1.75rem;
  color: var(--text-muted);
}
.nav-item.entity-company svg,
.nav-item.entity-bu svg {
  flex-shrink: 0;
  opacity: .68;
}
.nav-item.entity-company svg { width: 11px; height: 11px; }
.nav-item.entity-bu svg { width: 9px; height: 9px; }
.nav-entity-dot {
  width: 7px; height: 7px;
  border-radius: 50%; background: var(--brand);
  flex-shrink: 0;
}

.sidebar-user {
  padding: .6rem;
  border-top: 1px solid var(--gray-100);
}
.user-chip {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .6rem;
  border-radius: 8px;
  cursor: pointer;
}
.user-chip:hover { background: var(--gray-50); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .75rem;
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: .65rem; }
.user-name { font-size: .825rem; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Main content ────────────────────────────────────────── */
.main { margin-left: 220px; flex: 1; min-width: 0; padding-bottom: 4rem; transition: margin-left .2s ease; }
.page { max-width: 900px; margin: 0 auto; padding: 1.5rem; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap; gap: .75rem;
}
.page-header h1 { font-size: 1.25rem; font-weight: 700; }
.page-header p  { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  font-weight: 600; font-size: .875rem;
}
.card-body { padding: 1rem; }

/* ─── Design primitives ───────────────────────────────────── */
.surface {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.surface-muted {
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.panel-pad { padding: var(--space-4); }
.stack-sm { display: grid; gap: var(--space-2); }
.stack-md { display: grid; gap: var(--space-3); }
.cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.cluster-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.eyebrow {
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}
.metric-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1rem;
  box-shadow: var(--shadow);
}
.metric-tile span {
  display: block;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.25;
}
.metric-tile strong {
  display: block;
  margin-top: .3rem;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
}
.work-row {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: inherit;
  text-decoration: none;
  transition: background .12s, border-color .12s;
}
.work-row:hover { background: var(--panel-muted); }
.work-row:last-child { border-bottom: none; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--brand);
}
.section-divider {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .9rem 0 .55rem;
}
.section-divider span:first-child {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.section-divider .count {
  color: var(--text-muted);
  background: var(--gray-100);
  border-radius: 999px;
  padding: .05rem .45rem;
  font-size: .7rem;
}
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.today-command-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}
.today-command-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 8px;
  padding: .45rem .75rem;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.today-command-link.primary {
  background: #fff;
  color: #172033;
}
.today-command-link.secondary {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
}

/* ─── Stats grid ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { border-radius: 10px; padding: 1rem; border: 1px solid rgba(255,255,255,.55); box-shadow: 0 8px 22px rgba(15,23,42,.035); }
.stat-card .stat-val { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-card .stat-lbl { font-size: .72rem; color: var(--gray-500); margin-top: .3rem; }
.stat-blue   { background: #eff6ff; } .stat-blue   .stat-val { color: #1d4ed8; }
.stat-amber  { background: #fffbeb; } .stat-amber  .stat-val { color: #b45309; }
.stat-red    { background: #fef2f2; } .stat-red    .stat-val { color: #b91c1c; }
.stat-purple { background: #f5f3ff; } .stat-purple .stat-val { color: #6d28d9; }

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem;
  border-radius: 99px;
  font-size: .72rem; font-weight: 500;
}
.badge-todo        { background: #f3f4f6; color: #374151; }
.badge-in_progress { background: #dbeafe; color: #1e40af; }
.badge-review      { background: #ede9fe; color: #5b21b6; }
.badge-done        { background: #d1fae5; color: #065f46; }
.badge-blocked     { background: #fee2e2; color: #991b1b; }
.badge-low         { color: #6b7280; }
.badge-medium      { color: #b45309; }
.badge-high        { color: #c2410c; }
.badge-urgent      { color: #b91c1c; font-weight: 700; }
.badge-dot::before { content: "●"; margin-right: .2rem; font-size: .5rem; }

/* ─── Task list ───────────────────────────────────────────── */
.tasks-page {
  max-width: 980px;
}
.task-command {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(260px, .9fr);
  gap: .85rem;
  margin-bottom: 1rem;
}
.task-command-main {
  background: linear-gradient(135deg, #172033 0%, #2563eb 100%);
  border-radius: 10px;
  color: #fff;
  padding: 1rem;
  box-shadow: 0 16px 34px rgba(37,99,235,.16);
}
.task-command-main .eyebrow { color: rgba(255,255,255,.68); }
.task-command-main h2 {
  margin-top: .35rem;
  font-size: 1.12rem;
  line-height: 1.25;
  letter-spacing: 0;
}
.task-command-main p {
  margin-top: .35rem;
  color: rgba(255,255,255,.78);
  font-size: .82rem;
  line-height: 1.45;
}
.task-command-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
.task-command-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .8rem;
  box-shadow: var(--shadow);
}
.task-command-stat strong {
  display: block;
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
}
.task-command-stat span {
  display: block;
  margin-top: .3rem;
  color: var(--text-muted);
  font-size: .72rem;
}
.task-list { display: flex; flex-direction: column; gap: .45rem; }
.task-section {
  display: grid;
  gap: .45rem;
}
.task-item {
  display: flex; align-items: flex-start; gap: .75rem;
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: .75rem 1rem;
  text-decoration: none; color: inherit;
  transition: border-color .12s, box-shadow .12s;
  border-left-width: 3px;
  box-shadow: 0 6px 18px rgba(15,23,42,.035);
}
.task-item:hover { border-color: var(--brand); border-left-color: inherit; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.task-dot { display: none; }
.task-title { font-weight: 500; font-size: .875rem; }
.task-meta  { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; font-size: .75rem; color: var(--gray-400); }
.task-meta .sep::before { content: "·"; }
.task-work-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 700;
  padding: .24rem .55rem;
  text-decoration: none;
  transition: background .12s;
}
.task-work-link:hover { background: #dbeafe; }
.task-chevron {
  flex-shrink: 0;
  color: var(--gray-300);
  margin-top: .2rem;
}
.tasks-archive-toggle {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: .75rem;
  justify-content: center;
  padding: .45rem .75rem;
  transition: border-color .12s, color .12s;
  width: 100%;
}
.tasks-archive-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
}
@media (max-width: 760px) {
  .tasks-page { max-width: none; }
  .task-command { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .task-command-side { grid-template-columns: 1fr; }
}


/* --- Project detail workspace --- */
.page.project-detail-mode {
  max-width: none;
  margin: 0;
  padding: 1.25rem clamp(1rem, 2vw, 2rem) 2rem;
}
.project-detail-view { margin-top: 0; }
.project-detail-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(249,250,251,.92);
  backdrop-filter: blur(10px);
  padding: .35rem 0 .75rem;
}
.project-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.detail-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(17,24,39,.05);
}
.detail-meeting-card { background: #eff6ff; border-color: #bfdbfe; }
.gantt-card { margin-bottom: 1.25rem; overflow-x: auto; }
.project-insights-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.project-insight-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: .85rem 1rem;
  min-height: 92px;
}
.project-insight-label {
  font-size: .68rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .35rem;
}
.project-insight-value {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 750;
  color: var(--gray-900);
}
.project-insight-note {
  margin-top: .35rem;
  font-size: .75rem;
  color: var(--gray-500);
  line-height: 1.35;
}
.project-focus-panel {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: .75rem;
  margin-bottom: 1rem;
}
.focus-coach,
.focus-queue {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: .95rem;
}
.focus-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: .3rem;
}
.focus-subtitle {
  font-size: .76rem;
  color: var(--gray-500);
  line-height: 1.45;
}
.focus-task-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .5rem;
}
.focus-task-card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 9px;
  padding: .7rem .8rem;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.focus-task-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.focus-task-title {
  font-size: .8rem;
  font-weight: 650;
  color: var(--gray-900);
  margin-bottom: .45rem;
}
.focus-chip-row { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.focus-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  padding: .12rem .45rem;
  font-size: .66rem;
  font-weight: 650;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  background: #fff;
}
.focus-chip.hot { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.focus-chip.warn { border-color: #fde68a; color: #92400e; background: #fffbeb; }
.focus-chip.cool { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.focus-chip.good { border-color: #bbf7d0; color: #166534; background: #f0fdf4; }
@media (min-width: 1180px) {
  .project-detail-top.has-meeting { grid-template-columns: minmax(0, 1fr) 320px; }
  .kanban-col { width: calc((100vw - 220px - 5.5rem) / 5); min-width: 230px; max-width: 320px; }
}
@media (max-width: 1080px) {
  .project-insights-row { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .project-focus-panel { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .page.project-detail-mode { padding: 1rem 1rem 5.75rem; }
  .project-detail-header { top: 0; flex-wrap: wrap; }
  .project-insights-row { grid-template-columns: 1fr; }
}

/* ─── Project grid ────────────────────────────────────────── */
.project-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 560px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .project-grid { grid-template-columns: repeat(3, 1fr); } }
.project-card {
  position: relative;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 12px; padding: 1rem;
  text-decoration: none; color: inherit;
  transition: border-color .12s, box-shadow .12s;
  display: block;
}
.project-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.project-card.is-sprint { border-color: #fed7aa; }
.project-bar { height: 3px; border-radius: 99px; margin-bottom: .75rem; }
.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .55rem;
}
.project-title-wrap { min-width: 0; }
.project-title-line {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.project-name {
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}
.project-entity { font-size: .75rem; color: var(--gray-400); margin-top: .2rem; }
.project-description {
  color: var(--gray-500);
  display: -webkit-box;
  font-size: .75rem;
  line-height: 1.45;
  margin-top: .35rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.project-progress { margin-top: .65rem; }
.project-progress .progress-bar-bg { height: 4px; }
.project-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .35rem;
}
.project-progress-copy {
  color: var(--gray-400);
  font-size: .7rem;
  margin: 0;
}
.project-footer {
  display: flex; align-items: center; justify-content: space-between; gap: .45rem; flex-wrap: wrap;
  margin-top: .75rem; padding-top: .6rem;
  border-top: 1px solid var(--gray-100);
}
.project-status-chip,
.project-sprint-chip,
.project-hint-chip,
.project-work-btn,
.project-date-chip,
.project-countdown-chip,
.project-type-chip,
.agenda-type-chip,
.activity-icon,
.task-delay-badge,
.action-review-badge,
.task-mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  border-radius: 99px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.project-status-chip { font-size: .72rem; padding: .15rem .55rem; }
.project-status-chip.active { background:#d1fae5; color:#065f46; }
.project-status-chip.on_hold { background:#fffbeb; color:#b45309; }
.project-status-chip.completed { background:#dbeafe; color:#1e40af; }
.project-status-chip.archived { background:#f3f4f6; color:#374151; }
.project-sprint-chip {
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#c2410c;
  flex-shrink: 0;
  font-size:.62rem;
  padding:.1rem .45rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.project-hint-chip {
  background:#fef9c3;
  border:1px solid #fde047;
  color:#a16207;
  font-size:.63rem;
  padding:.08rem .4rem;
}
.project-date-chip {
  color: var(--gray-400);
  font-size:.72rem;
  font-weight: 600;
}
.project-work-btn {
  border:1px solid #bfdbfe;
  border-radius: 7px;
  color:#2563eb;
  font-size:.7rem;
  margin-left:auto;
  padding:.24rem .6rem;
}
.project-countdown-chip {
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: .78rem;
  padding: .25rem .75rem;
}
.project-countdown-chip.overdue { background:#fee2e2; color:#b91c1c; border-color:#fecaca; }
.project-countdown-chip.today { background:#fef3c7; color:#b45309; border-color:#fde68a; }
.project-countdown-chip.soon { background:#fef3c7; color:#b45309; border-color:#fde68a; }
.project-countdown-chip.medium { background:#fffbeb; color:#92400e; border-color:#fde68a; }
.project-countdown-chip.relaxed { background:#f0fdf4; color:#166534; border-color:#bbf7d0; }
.project-detail-head,
.project-detail-stats,
.project-detail-progress-head {
  display: flex;
  gap: 1rem;
}
.project-detail-head {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .85rem;
}
.project-detail-meta { min-width: 0; }
.project-detail-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .25rem;
}
.project-detail-entity { color: var(--gray-400); font-size: .75rem; }
.project-detail-description {
  color: var(--gray-600);
  font-size: .83rem;
  line-height: 1.55;
  margin-bottom: .6rem;
}
.project-detail-stats { flex-wrap: wrap; margin-bottom: .85rem; }
.project-detail-stat { color: var(--gray-500); font-size: .78rem; }
.project-detail-stat span { color: var(--gray-400); }
.project-detail-stat strong { color: var(--gray-800); display: inline-block; margin-top: .08rem; }
.project-detail-stat strong.info { color: #2563eb; }
.project-detail-stat strong.danger { color: #dc2626; }
.project-detail-progress-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: .25rem;
}
.project-detail-progress-head span { color: var(--gray-600); font-size: .76rem; font-weight: 600; }
.project-detail-progress-head strong { color: var(--gray-800); font-size: .76rem; }
.project-meeting-label {
  color:#2563eb;
  font-size:.67rem;
  font-weight:800;
  letter-spacing:.07em;
  margin-bottom:.35rem;
  text-transform:uppercase;
}
.project-meeting-title {
  color:var(--gray-800);
  font-size:.9rem;
  font-weight:700;
  margin-bottom:.3rem;
}
.project-meeting-time {
  color:#2563eb;
  font-size:.78rem;
  font-weight:700;
  margin-bottom:.25rem;
}
.project-meeting-location { color:var(--gray-500); font-size:.75rem; }
.project-meeting-join { display:inline-flex; font-size:.72rem; margin-top:.6rem; }
.agenda-type-chip {
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color:#2563eb;
  flex-shrink:0;
  font-size:.62rem;
  padding:.1rem .35rem;
}
.agenda-type-chip.due { background:#fef9c3; border-color:#fde047; color:#92400e; }
.agenda-type-chip.meeting { background:#eff6ff; }
.activity-icon {
  border-radius: 50%;
  flex-shrink: 0;
  font-size: .58rem;
  height: 26px;
  letter-spacing: .03em;
  width: 26px;
}
.activity-icon.comment { color:#2563eb; }
.activity-icon.task { color:#15803d; }
.streak-mark {
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 99px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  padding: .12rem .45rem;
  text-transform: uppercase;
}

/* ─── Progress bar ────────────────────────────────────────── */
.progress-wrap { margin-bottom: 1.25rem; }
.progress-bar-bg { height: 8px; background: var(--gray-100); border-radius: 99px; overflow: hidden; margin: .4rem 0; }
.progress-bar-fill { height: 100%; border-radius: 99px; transition: width .4s; }
.progress-meta { display: flex; gap: 1rem; font-size: .75rem; color: var(--gray-400); }

/* ─── Kanban ──────────────────────────────────────────────── */
.kanban { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-col {
  flex-shrink: 0; width: 260px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px; overflow: hidden;
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: .8rem; font-weight: 600;
}
.kanban-col-body { padding: .5rem; display: flex; flex-direction: column; gap: .4rem; min-height: 80px; }
.kanban-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 8px; padding: .65rem .75rem;
  text-decoration: none; color: inherit;
  display: block;
  transition: border-color .12s, box-shadow .12s;
}
.kanban-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.kanban-card-title { font-size: .8rem; font-weight: 500; }
.kanban-card-meta  { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; }

/* ─── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; background: var(--gray-100); border-radius: 10px; padding: .25rem; margin-bottom: 1rem; overflow-x: auto; }
.tab {
  flex-shrink: 0; padding: .4rem .85rem;
  border-radius: 8px; font-size: .8rem; font-weight: 500;
  cursor: pointer; border: none; background: none;
  color: var(--gray-500); transition: all .12s;
  text-decoration: none;
}
.tab.active { background: #fff; color: var(--gray-900); box-shadow: var(--shadow); }
.tab:hover:not(.active) { color: var(--gray-700); }

/* ─── Filter pills ────────────────────────────────────────── */
.filter-pills { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: 1rem; padding-bottom: .25rem; }
.pill {
  flex-shrink: 0; padding: .3rem .75rem;
  border-radius: 99px; border: 1.5px solid var(--gray-200);
  font-size: .78rem; font-weight: 500; cursor: pointer;
  background: #fff; color: var(--gray-600);
  text-decoration: none; transition: all .12s;
}
.pill.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pill:hover:not(.active) { border-color: var(--brand); color: var(--brand); }

/* ─── Color picker ────────────────────────────────────────── */
.color-picker { display: flex; gap: .5rem; flex-wrap: wrap; }
.color-dot {
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform .12s;
}
.color-dot:hover   { transform: scale(1.15); }
.color-dot.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--gray-500); transform: scale(1.15); }

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,.2);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  font-weight: 600;
}
.modal-body    { padding: 1.25rem; }
.modal-footer  {
  display: flex; gap: .75rem; justify-content: flex-end;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--gray-100);
}

/* ─── Mobile bottom nav ───────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--gray-200);
  z-index: 200;
}
.mobile-nav-items { display: flex; }
.mobile-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: .6rem .25rem;
  text-decoration: none;
  color: var(--gray-400); font-size: .65rem; font-weight: 500; gap: .2rem;
  transition: color .12s;
}
.mobile-nav-item.active { color: var(--brand); }
.mobile-nav-item svg { width: 20px; height: 20px; }

/* ─── Empty state ─────────────────────────────────────────── */
.empty,
.empty-state {
  color: var(--gray-400);
  font-size: .875rem;
  padding: 3rem 1rem;
  text-align: center;
}
.empty p { margin-top: .5rem; }
.empty-state {
  background: linear-gradient(180deg, #fff, var(--panel-muted));
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-muted);
}
.empty-state.compact {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  padding: 1.25rem 1rem;
}
.empty-state-title {
  color: var(--text);
  font-size: .9rem;
  font-weight: 760;
  margin: 0 0 .25rem;
}
.empty-state-copy {
  color: var(--text-muted);
  font-size: .8rem;
  line-height: 1.45;
  margin: 0;
}
.empty-state-action {
  display: inline-flex;
  margin-top: .85rem;
}

/* ─── Roles chip ──────────────────────────────────────────── */
.role-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.role-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 99px; padding: .25rem .65rem;
  font-size: .75rem; font-weight: 500; color: var(--gray-700);
}
.role-chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar    { display: none; }
  .main       { margin-left: 0; padding-bottom: 5rem; }
  .mobile-nav { display: block; }
  .grid-2     { grid-template-columns: 1fr !important; }
  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: .75rem;
  }
  .project-grid { grid-template-columns: 1fr; }
  .project-detail-head,
  .project-detail-progress-head { flex-direction: column; align-items: flex-start; }
  .project-footer { align-items: flex-start; }
  .project-work-btn { margin-left: 0; }
  .tabs,
  .filter-pills { scrollbar-width: none; }
  .tabs::-webkit-scrollbar,
  .filter-pills::-webkit-scrollbar { display: none; }
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.page-wide { max-width: none; margin: 0; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Overdue */
.overdue { color: var(--red) !important; font-weight: 600; }
.due-today { color: var(--amber) !important; font-weight: 600; }

.divider { height: 1px; background: var(--gray-100); margin: .5rem 0; }
.text-muted { color: var(--gray-400); }
.text-small { font-size: .78rem; }
.fw-600     { font-weight: 600; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.flex-1 { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Notification bell ───────────────────────────────────────── */
#notif-bell {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 500;
}
#notif-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--brand);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
#notif-btn:hover { transform: scale(1.08); box-shadow: 0 6px 16px rgba(37,99,235,.4); }
#notif-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px;
  background: #ef4444; color: #fff;
  border-radius: 99px; font-size: .65rem; font-weight: 700;
  align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid #fff;
}
#notif-panel {
  position: absolute;
  bottom: calc(100% + .5rem);
  right: 0;
  width: 320px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  overflow: hidden;
}
#notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}
@media (max-width: 768px) {
  #notif-panel { width: calc(100vw - 2rem); right: 0; }
  #notif-bell  { bottom: 5rem; }
}

/* ─── Search filter bar (tasks / projects page) ─────────────── */
.search-filter-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
  align-items: center;
}
.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrap .search-icon {
  position: absolute;
  left: .65rem;
  color: var(--gray-400);
  pointer-events: none;
}
.search-input-wrap input {
  width: 100%;
  padding: .5rem .5rem .5rem 2.1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  font-size: .85rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input-wrap input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.search-input-wrap #search-clear,
.search-input-wrap #proj-search-clear {
  position: absolute;
  right: .5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: .85rem;
  padding: .15rem .3rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.search-input-wrap #search-clear:hover,
.search-input-wrap #proj-search-clear:hover { color: var(--gray-700); background: var(--gray-100); }
.filter-select {
  padding: .5rem .75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  font-size: .8rem;
  color: var(--gray-700);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.filter-select:focus { border-color: var(--brand); }
@media (max-width: 600px) {
  .search-filter-bar { flex-wrap: wrap; }
  .filter-select { font-size: .75rem; padding: .45rem .5rem; }
}

/* ─── Global Search Overlay ──────────────────────────────────── */
#global-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}
#global-search-overlay.gs-open { display: block; }
#gs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}
#gs-box {
  position: absolute;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 2rem));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#gs-input-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}
#gs-icon { color: var(--gray-400); flex-shrink: 0; }
#gs-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--gray-900);
  background: transparent;
}
#gs-input::placeholder { color: var(--gray-400); }
#gs-esc-hint {
  font-size: .7rem;
  background: var(--gray-100);
  color: var(--gray-500);
  padding: .2rem .4rem;
  border-radius: 4px;
  flex-shrink: 0;
  font-family: inherit;
  cursor: pointer;
}
#gs-results {
  max-height: 55vh;
  overflow-y: auto;
}
.gs-section-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  padding: .6rem 1rem .3rem;
}
.gs-result-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: background .1s;
  cursor: pointer;
}
.gs-result-item:hover,
.gs-result-item.gs-result-active { background: var(--brand-light); }
.gs-result-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gs-result-title {
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-result-meta {
  font-size: .72rem;
  color: var(--gray-400);
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#gs-footer {
  display: flex;
  gap: 1rem;
  padding: .5rem 1rem;
  border-top: 1px solid var(--gray-100);
  font-size: .7rem;
  color: var(--gray-400);
}
#gs-footer kbd {
  background: var(--gray-100);
  border-radius: 4px;
  padding: .1rem .35rem;
  font-family: inherit;
  font-size: .65rem;
  color: var(--gray-500);
}

/* ─── Sidebar user dropdown menu ─────────────────────────────── */
#sidebar-user-menu {
  position: absolute;
  bottom: calc(100% + .5rem);
  left: .5rem;
  right: .5rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  overflow: hidden;
  z-index: 200;
}
#sidebar-user-menu a,
#sidebar-user-menu button {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .6rem .85rem;
  font-size: .82rem;
  color: var(--gray-700);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .1s;
}
#sidebar-user-menu a:hover,
#sidebar-user-menu button:hover { background: var(--gray-50); }
#sidebar-user-menu button { color: #b91c1c; }
#sidebar-user-menu a + button,
#sidebar-user-menu button + a {
  border-top: 1px solid var(--gray-100);
}

/* ─── Header inline search ───────────────────────────────────── */
.page-header { flex-wrap: wrap; gap: .5rem; }

.header-search-wrap {
  flex: 1;
  min-width: 160px;
  max-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}
.header-search-wrap .search-icon {
  position: absolute;
  left: .6rem;
  color: var(--gray-400);
  pointer-events: none;
  flex-shrink: 0;
}
.header-search-wrap input {
  width: 100%;
  padding: .45rem .45rem .45rem 2rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
  font-size: .82rem;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.header-search-wrap input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.header-search-wrap input::placeholder { color: var(--gray-400); }
.header-search-wrap button {
  position: absolute;
  right: .4rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: .8rem;
  padding: .1rem .25rem;
  border-radius: 4px;
  line-height: 1;
}
.header-search-wrap button:hover { color: var(--gray-700); background: var(--gray-100); }

/* ─── Tabs + filter in one row ───────────────────────────────── */
.tabs-filter-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
  overflow: hidden;
}
.tabs-filter-row .tabs {
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-filter-row .tabs::-webkit-scrollbar { display: none; }

@media (max-width: 600px) {
  .header-search-wrap { max-width: 100%; order: 3; flex-basis: 100%; }
  .page-header { flex-wrap: wrap; }
}

/* ─── Sidebar search button ──────────────────────────────────── */
#sidebar-search-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: calc(100% - 1rem);
  margin: .5rem .5rem .25rem;
  padding: .45rem .65rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  color: var(--gray-500);
  font-size: .8rem;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
#sidebar-search-btn:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
  color: var(--gray-700);
}
#sidebar-search-btn kbd {
  margin-left: auto;
  font-size: .65rem;
  background: var(--gray-200);
  color: var(--gray-400);
  border-radius: 4px;
  padding: .1rem .3rem;
  font-family: inherit;
}

/* ─── Section eyebrow label ──────────────────────────────────── */
.section-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .6rem;
}

/* ─── Collaborator chips (modal + detail) ────────────────────── */
.collab-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .5rem .2rem .3rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 99px;
  font-size: .78rem;
  color: var(--gray-700);
}

/* ─── File drop zone ─────────────────────────────────────────── */
.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: 1rem;
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.file-drop-zone:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

/* ─── Entity Dashboard ───────────────────────────────────────── */
.entity-page { max-width: 1440px; }
.entity-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.entity-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  font-size: .74rem;
  color: var(--gray-400);
  margin-bottom: .35rem;
}
.entity-breadcrumb a { color: var(--gray-500); text-decoration: none; font-weight: 600; }
.entity-hero h1 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: 0;
  color: var(--gray-900);
}
.entity-hero p {
  margin-top: .35rem;
  color: var(--gray-500);
  font-size: .86rem;
  max-width: 760px;
}
.entity-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .45rem;
}
.entity-command-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}
.entity-metric {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: .78rem .85rem;
  min-width: 0;
}
.entity-metric span {
  display: block;
  font-size: .66rem;
  color: var(--gray-400);
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.entity-metric strong {
  display: block;
  margin-top: .2rem;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--gray-900);
}
.entity-metric small {
  display: block;
  margin-top: .25rem;
  color: var(--gray-500);
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-metric.warning { border-color: #fed7aa; background: #fff7ed; }
.entity-metric.danger { border-color: #fecaca; background: #fff5f5; }
.entity-metric.success { border-color: #bbf7d0; background: #f0fdf4; }
.entity-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: .9rem;
  align-items: start;
}
.entity-panel {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}
.entity-panel + .entity-panel { margin-top: .9rem; }
.entity-panel-header {
  padding: .85rem .95rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}
.entity-panel-title {
  font-size: .8rem;
  font-weight: 800;
  color: var(--gray-800);
  text-transform: uppercase;
  letter-spacing: .055em;
}
.entity-panel-link {
  font-size: .74rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}
.entity-panel-body { padding: .85rem .95rem; }
.entity-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.entity-row {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .7rem;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--gray-25, #fcfcfd);
  min-width: 0;
  transition: background .12s, border-color .12s;
}
.entity-row:hover { background: var(--gray-50); border-color: var(--gray-200); }
.entity-row-main { flex: 1; min-width: 0; }
.entity-row-title {
  font-size: .84rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--gray-900);
  overflow-wrap: anywhere;
}
.entity-row-copy {
  margin-top: .18rem;
  font-size: .73rem;
  line-height: 1.35;
  color: var(--gray-500);
  overflow-wrap: anywhere;
}
.entity-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .45rem;
}
.entity-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
  flex: 0 0 auto;
  margin-top: .28rem;
}
.entity-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  min-height: 20px;
  padding: .12rem .48rem;
  border-radius: 99px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.entity-chip.brand { background: var(--brand-light); color: var(--brand-dark); }
.entity-chip.red { background: #fee2e2; color: #b91c1c; }
.entity-chip.amber { background: #fef3c7; color: #92400e; }
.entity-chip.green { background: #dcfce7; color: #166534; }
.entity-chip.blue { background: #dbeafe; color: #1d4ed8; }
.entity-project-grid,
.entity-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .7rem;
}
.entity-project-card {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.entity-project-accent { height: 4px; background: var(--brand); }
.entity-project-card-inner { padding: .8rem; }
.entity-project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .65rem;
}
.entity-progress {
  height: 6px;
  border-radius: 99px;
  background: var(--gray-100);
  overflow: hidden;
  margin-top: .7rem;
}
.entity-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}
.entity-team-card {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: .8rem;
  background: #fff;
  min-width: 0;
}
.entity-team-head {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.entity-team-name {
  font-size: .84rem;
  font-weight: 750;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}
/* Entity page overrides — needs more width than the default .page 900px */
.entity-page {
  max-width: 1200px;
  padding: 1.5rem 2rem;
}
.entity-command-strip {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.entity-project-grid,
.entity-team-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.entity-two-col {
  gap: .75rem;
}
/* Panel + section spacing */
.entity-work-grid > section > .entity-panel + .entity-panel,
.entity-work-grid > section > .entity-two-col,
.entity-work-grid > section > .entity-two-col + .entity-panel,
.entity-work-grid > aside   > .entity-panel + .entity-panel {
  margin-top: .85rem;
}
.entity-two-col > .entity-panel { margin-top: 0; }

@media (max-width: 1200px) {
  .entity-command-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entity-work-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .entity-hero { flex-direction: column; }
  .entity-actions { justify-content: flex-start; width: 100%; }
  .entity-page { padding: 1rem; }
  .entity-command-strip,
  .entity-two-col { grid-template-columns: 1fr; }
  .entity-project-grid,
  .entity-team-grid { grid-template-columns: 1fr; }
}

/* ─── Appearance / Wallpaper panel ───────────────────────────── */
#ap-toggle-btn {
  position: absolute;
  top: .55rem; right: .55rem;
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); padding: .28rem;
  border-radius: 6px; display: flex;
  align-items: center; justify-content: center;
  transition: color .12s, background .12s;
  line-height: 1;
}
#ap-toggle-btn:hover { color: var(--text); background: var(--gray-100); }

#appearance-panel {
  position: absolute;
  bottom: calc(100% + .4rem); left: .4rem; right: .4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .85rem;
  box-shadow: 0 8px 28px rgba(0,0,0,.13);
  z-index: 300;
}
.ap-heading {
  font-size: .7rem; font-weight: 700; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .6rem;
}
.ap-swatches {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem;
  margin-bottom: .7rem;
}
.ap-swatch {
  aspect-ratio: 1; border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer; font-size: .75rem;
  transition: border-color .12s, transform .1s;
  position: relative;
}
.ap-swatch:hover { transform: scale(1.06); }
.ap-swatch-active { border-color: var(--brand) !important; box-shadow: 0 0 0 2px rgba(37,99,235,.25); }
.ap-url-label { font-size: .7rem; color: var(--gray-400); margin-bottom: .3rem; }
.ap-url-row { display: flex; gap: .35rem; margin-bottom: .5rem; }
.ap-url-input {
  flex: 1; font-size: .76rem; padding: .35rem .55rem;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--text);
}
.ap-url-btn {
  background: var(--brand); color: #fff; border: none;
  border-radius: 7px; padding: .35rem .65rem;
  font-size: .76rem; cursor: pointer; white-space: nowrap;
}
.ap-url-btn:hover { opacity: .88; }
.ap-reset {
  width: 100%; background: none;
  border: 1px solid var(--border); border-radius: 7px;
  padding: .32rem; font-size: .72rem;
  color: var(--gray-400); cursor: pointer;
}
.ap-reset:hover { background: var(--bg); color: var(--text); }

/* When a wallpaper image is active, boost card contrast slightly */
body.has-wallpaper .sidebar { box-shadow: 2px 0 12px rgba(0,0,0,.08); }
body.has-wallpaper .main { background: transparent; }

/* ─── Sidebar toggle ──────────────────────────────────────── */
#sidebar-toggle-btn {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); padding: 4px 5px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .12s, color .12s;
}
#sidebar-toggle-btn:hover { background: var(--gray-100); color: var(--gray-600); }
#sidebar-toggle-btn svg { transition: transform .2s; }

/* Collapsed state */
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 1rem .5rem; }
.sidebar.collapsed .sidebar-logo .logo-icon { display: none; }
.sidebar.collapsed #sidebar-toggle-btn { margin-left: 0; }
.sidebar.collapsed #sidebar-toggle-btn svg { transform: rotate(180deg); }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .user-name,
.sidebar.collapsed #sidebar-search-btn span,
.sidebar.collapsed #sidebar-search-btn kbd,
.sidebar.collapsed #ap-toggle-btn { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; gap: 0; padding: .55rem; font-size: 0; }
.sidebar.collapsed .nav-item.active { box-shadow: none; background: var(--brand-light); }
.sidebar.collapsed .nav-item svg { flex-shrink: 0; }
.sidebar.collapsed .nav-item.entity-bu { padding-left: .55rem; }
.sidebar.collapsed #sidebar-search-btn { justify-content: center; padding: .55rem; gap: 0; }
.sidebar.collapsed .user-chip { justify-content: center; gap: 0; }
.sidebar.collapsed ~ .main { margin-left: 56px; }

/* ─── Section title ──────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  margin-bottom: .6rem;
}

/* ─── Project tab filter ─────────────────────────────────────── */
.proj-tab {
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 99px;
  cursor: pointer;
  color: var(--gray-400);
  text-transform: none;
  letter-spacing: 0;
  transition: background .1s, color .1s;
  margin-left: .1rem;
}
.proj-tab:hover  { background: var(--gray-100); color: var(--gray-700); }
.proj-tab.active { background: var(--brand); color: #fff; }

/* ─── Entity project card ────────────────────────────────────── */
.entity-proj-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  margin-bottom: .6rem;
  display: flex;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow .15s, transform .1s;
}
.entity-proj-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.entity-proj-bar { width: 5px; flex-shrink: 0; }

/* ─── Team workload grid ─────────────────────────────────────── */
.team-workload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .75rem;
}
.team-workload-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: .85rem 1rem;
  cursor: pointer;
  transition: box-shadow .15s;
}
.team-workload-card:hover { box-shadow: var(--shadow-md); }

/* ─── App Launcher ───────────────────────────────────────────── */
.app-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.25rem;
}
.app-cat-pill {
  font-size: .72rem;
  font-weight: 600;
  padding: .25rem .75rem;
  border-radius: 99px;
  border: 1.5px solid var(--gray-200);
  background: #fff;
  color: var(--gray-500);
  cursor: pointer;
  transition: background .1s, color .1s, border-color .1s;
}
.app-cat-pill:hover  { background: var(--gray-100); }
.app-cat-pill.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.app-scope-section { margin-bottom: 1.75rem; }
.app-scope-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

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

.app-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  position: relative;
}
.app-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.app-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
  overflow: hidden;
}
.app-card-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.app-card-body { flex: 1; min-width: 0; }
.app-card-name { font-size: .875rem; font-weight: 600; }
.app-card-desc {
  font-size: .72rem;
  color: var(--gray-400);
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-card-cat {
  font-size: .65rem;
  padding: .1rem .45rem;
  border-radius: 99px;
  font-weight: 600;
  margin-top: .2rem;
  display: inline-block;
}

.app-card-actions {
  display: none;
  gap: .3rem;
  flex-shrink: 0;
}
.app-card:hover .app-card-actions { display: flex; }

.app-empty {
  text-align: center;
  padding: 2.5rem;
  color: var(--gray-400);
  font-size: .85rem;
}

/* App launcher scope select */
#modal-scope-wrap { margin-bottom: .75rem; }
#modal-entity-wrap { margin-bottom: .75rem; }
.team-workload-card:hover { box-shadow: var(--shadow-md); }

/* ─── Action Items ───────────────────────────────────────────── */
.action-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}
.action-item:hover { background: var(--gray-50); }
.action-item:hover .action-del { opacity: 1; }
.action-item.action-done { opacity: .75; }

.action-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--gray-300);
  background: #fff;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, background .15s;
  color: #fff;
  padding: 0;
}
.action-check:hover { border-color: var(--brand); }
.action-done .action-check {
  background: var(--green);
  border-color: var(--green);
}

.action-title {
  flex: 1;
  font-size: .85rem;
  color: var(--gray-700);
  outline: none;
  border-radius: 4px;
  padding: .05rem .2rem;
  cursor: text;
  min-width: 0;
  word-break: break-word;
}
.action-title:focus { background: var(--gray-100); }

.action-del {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  border-radius: 6px;
  color: var(--gray-400);
  flex-shrink: 0;
  transition: opacity .15s, color .1s;
}
.action-del:hover { color: var(--red); }

/* ─── Task detail polish ───────────────────────────────────── */
.task-detail-page {
  max-width: 860px;
}
.task-shell {
  display: grid;
  gap: 1rem;
}
.task-topline {
  margin-bottom: 1.25rem;
}
.task-title-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.task-title-main {
  flex: 1;
  min-width: 0;
}
.task-title-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}
.task-project-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--text-muted);
  font-size: .75rem;
  text-decoration: none;
}
.task-project-link:hover { color: var(--brand); }
.task-project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}
.task-banner {
  border-radius: 10px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.task-banner-inner {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  flex-wrap: wrap;
}
.task-banner-content {
  flex: 1;
  min-width: 0;
}
.task-banner-title {
  color: var(--text);
  font-size: .9rem;
  font-weight: 760;
  margin-bottom: .25rem;
}
.task-banner-copy {
  color: var(--text-muted);
  font-size: .8rem;
  line-height: 1.45;
}
.task-banner-note {
  margin-top: .45rem;
  color: inherit;
  font-size: .78rem;
  font-style: italic;
  opacity: .86;
}
.task-banner-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.task-banner.review {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.task-banner.review .task-banner-title { color: #1e40af; }
.task-banner.review .task-banner-copy { color: #2563eb; }
.task-banner.reopen {
  background: #fff7ed;
  border-color: #fed7aa;
}
.task-banner.reopen .task-banner-title { color: #9a3412; }
.task-banner.reopen .task-banner-copy { color: #c2410c; }
.task-banner.done {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  border-color: transparent;
  color: #fff;
}
.task-banner.done .task-banner-title,
.task-banner.done .task-banner-copy { color: #fff; }
.task-banner.done .task-banner-copy { opacity: .86; }
.btn-soft-light {
  background: rgba(255,255,255,.16);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.34);
}
.btn-soft-light:hover { background: rgba(255,255,255,.24); }
.task-recap-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: 1rem;
}
.task-recap-tile {
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .65rem;
  text-align: center;
}
.task-recap-tile strong {
  display: block;
  color: var(--brand);
  font-size: 1.1rem;
  line-height: 1;
}
.task-recap-tile span {
  display: block;
  margin-top: .18rem;
  color: var(--text-muted);
  font-size: .62rem;
  line-height: 1.25;
}
.task-mini-section { margin-bottom: .8rem; }
.task-mini-heading {
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .45rem;
}
.task-chip-line {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.task-output-row,
.task-comment-row,
.task-file-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}
.task-output-row:last-child,
.task-comment-row:last-child,
.task-file-row:last-child { border-bottom: none; }
.task-output-title {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: .84rem;
  font-weight: 620;
}
.task-row-link {
  color: var(--brand);
  font-size: .74rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.task-icon-button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--gray-400);
  cursor: pointer;
  padding: .2rem;
  line-height: 1;
  transition: color .12s, background .12s;
}
.task-icon-button:hover {
  background: var(--gray-100);
  color: var(--red);
}
.task-comment-row { align-items: flex-start; }
.task-comment-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .2rem;
}
.task-comment-name {
  color: var(--text);
  font-size: .8rem;
  font-weight: 700;
}
.task-comment-time {
  color: var(--text-muted);
  font-size: .72rem;
}
.task-comment-body {
  color: var(--gray-700);
  font-size: .85rem;
  white-space: pre-wrap;
}
.task-file-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.task-file-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--panel-muted);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.task-file-type {
  color: var(--text-muted);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.task-file-name {
  color: var(--brand);
  display: block;
  font-size: .8rem;
  font-weight: 650;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-file-meta {
  color: var(--text-muted);
  font-size: .7rem;
  margin-top: .1rem;
}
.task-empty { color: var(--text-muted); font-size: .8rem; padding: .85rem 1rem; text-align: center; }
.task-empty.empty-state { margin: .7rem 1rem; padding: 1rem; }
.task-timing-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  border: 1px solid var(--border);
  padding: .22rem .6rem;
  font-size: .75rem;
  font-weight: 700;
}
.task-timing-badge.late { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }
.task-timing-badge.today { background: #fef9c3; border-color: #fde047; color: #92400e; }
.task-timing-badge.early { background: #dcfce7; border-color: #86efac; color: #14532d; }
.task-delay-badge {
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: .82rem;
  padding: .4rem .85rem;
}
.task-delay-badge.late { background:#fee2e2; border-color:#fecaca; color:#b91c1c; }
.task-delay-badge.today { background:#fef9c3; border-color:#fde047; color:#92400e; }
.task-delay-badge.early { background:#dcfce7; border-color:#86efac; color:#14532d; }
.task-report-grid-card,
.task-report-team-card,
.task-report-output-row {
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius: 10px;
}
.task-report-grid-card {
  padding: .9rem;
  text-align: center;
}
.task-report-grid-card strong {
  color:#1e40af;
  display:block;
  font-size:1.4rem;
  line-height:1;
}
.task-report-grid-card span {
  color:#64748b;
  display:block;
  font-size:.65rem;
  line-height:1.3;
  margin-top:.2rem;
}
.task-report-team-card {
  display:flex;
  align-items:center;
  gap:.45rem;
  padding:.35rem .65rem;
}
.task-report-team-name { font-size:.78rem; font-weight:700; }
.task-report-team-role { color:var(--gray-400); font-size:.65rem; }
.task-report-output-list { display:flex; flex-direction:column; gap:.4rem; }
.task-report-output-row {
  align-items:center;
  display:flex;
  gap:.5rem;
  padding:.45rem .75rem;
}
.task-report-output-title {
  flex:1;
  font-size:.82rem;
  font-weight:600;
  min-width:0;
  overflow-wrap:anywhere;
}
.task-report-output-link {
  color:#2563eb;
  font-size:.72rem;
  font-weight:700;
  text-decoration:none;
}
.done-report-overlay {
  backdrop-filter: blur(4px);
  background: rgba(0,0,0,.65);
  display: none;
  inset: 0;
  overflow-y: auto;
  padding: 2rem 1rem;
  position: fixed;
  z-index: 400;
}
.done-report-card {
  background:#fff;
  border-radius:20px;
  box-shadow:0 24px 80px rgba(0,0,0,.25);
  margin:0 auto;
  max-width:640px;
  overflow:hidden;
}
.done-report-header {
  background:linear-gradient(135deg,#1e40af,#3b82f6);
  color:#fff;
  padding:2rem;
  text-align:center;
}
.done-report-kicker {
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 99px;
  display: inline-flex;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: .65rem;
  padding: .18rem .55rem;
  text-transform: uppercase;
}
.done-report-title { font-size:1.25rem; font-weight:760; margin-bottom:.25rem; }
.done-report-task { font-size:.875rem; font-weight:500; opacity:.85; }
.done-report-project { font-size:.72rem; margin-top:.2rem; opacity:.65; }
.done-report-body { padding:1.75rem; }
.done-report-stats {
  display:grid;
  gap:.75rem;
  grid-template-columns:repeat(5,1fr);
  margin-bottom:1.5rem;
}
.done-report-delay { margin-bottom:1.5rem; }
.done-report-section { margin-bottom:1.5rem; }
.done-report-section-title {
  color:var(--gray-400);
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.08em;
  margin-bottom:.65rem;
  text-transform:uppercase;
}
.done-report-team { display:flex; flex-wrap:wrap; gap:.5rem; }
.done-report-actions { display:flex; flex-wrap:wrap; gap:.65rem; }
.done-report-primary { flex:1; min-width:160px; }
.done-report-footer {
  border-top:1px solid #e2e8f0;
  color:#94a3b8;
  display:none;
  font-size:.72rem;
  padding:1rem 1.75rem;
}
.btn-danger-outline { color:#dc2626; border-color:#fca5a5; }
.btn-warning-solid { background:#ea580c; }
.task-muted-empty { color:var(--gray-400); font-size:.8rem; padding:.5rem 0; }
.task-collab-empty {
  color:var(--gray-400);
  display:inline-flex;
  font-size:.78rem;
  padding:.2rem 0;
}
.task-remove-chip {
  background:none;
  border:0;
  color:var(--gray-400);
  cursor:pointer;
  font-size:.75rem;
  line-height:1;
  padding:0 0 0 .2rem;
}
.action-nudge {
  align-items:center;
  background:#fffbeb;
  border:1px solid #fde68a;
  border-radius:8px;
  color:#92400e;
  display:flex;
  font-size:.75rem;
  gap:.4rem;
  margin-bottom:.5rem;
  padding:.45rem .75rem;
}
.action-review-badge {
  border-radius: 7px;
  justify-content: flex-start;
  margin-top: .3rem;
  padding: .34rem .5rem;
  width: 100%;
}
.action-review-badge.pending {
  background:#fffbeb;
  border:1px solid #fde68a;
  color:#92400e;
}
.action-review-badge.rejected {
  background:#fef2f2;
  border:1px solid #fecaca;
  color:#b91c1c;
}
.action-review-text { flex: 1; font-size:.7rem; font-weight:600; min-width:0; }
.action-review-btn {
  border-radius:5px;
  cursor:pointer;
  font-family:inherit;
  font-size:.65rem;
  font-weight:800;
  padding:.15rem .45rem;
}
.action-review-btn.approve { background:#dcfce7; border:1px solid #86efac; color:#15803d; }
.action-review-btn.reject { background:#fee2e2; border:1px solid #fecaca; color:#b91c1c; }
.task-mini-badge {
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-size: .62rem;
  padding: .08rem .35rem;
}
.task-mini-badge.duration { background:#f3f4f6; border-color:#e5e7eb; color:#6b7280; }
.task-mini-badge.duration.d30 { background:#dcfce7; border-color:#86efac; color:#15803d; }
.task-mini-badge.duration.d60 { background:#dbeafe; border-color:#93c5fd; color:#1d4ed8; }
.task-mini-badge.duration.d120 { background:#fef9c3; border-color:#fde047; color:#a16207; }
.task-mini-badge.duration.d180 { background:#ffedd5; border-color:#fdba74; color:#c2410c; }
.task-mini-badge.due.overdue { background:#fee2e2; border-color:#fecaca; color:#b91c1c; }
@media (max-width: 760px) {
  .task-detail-page { max-width: none; }
  .task-title-row,
  .task-banner-inner { flex-direction: column; }
  .task-title-actions,
  .task-banner-actions { width: 100%; }
  .task-title-actions .btn,
  .task-banner-actions .btn { flex: 1; justify-content: center; }
  .task-recap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .done-report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .done-report-body { padding: 1.2rem; }
}

/* Action progress pill on task cards */
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .68rem;
  padding: .1rem .45rem;
  border-radius: 99px;
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-weight: 500;
}
.action-pill.all-done { background: #dcfce7; border-color: #86efac; color: #15803d; }

/* ─── Help page ──────────────────────────────────────────────── */
.help-hero {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  border-radius: 16px;
  padding: 2rem;
  color: #fff;
  margin-bottom: 1.5rem;
}
.help-hero h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .4rem; }
.help-hero p  { opacity: .85; font-size: .9rem; }

.help-hierarchy {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.help-hierarchy-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  flex: 1;
  min-width: 120px;
}
.help-hierarchy-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  border: 2px solid transparent;
}
.help-hierarchy-label { font-size: .82rem; font-weight: 700; }
.help-hierarchy-desc  { font-size: .72rem; color: var(--gray-400); text-align: center; line-height: 1.4; }
.help-hierarchy-arrow { font-size: 1.4rem; color: var(--gray-300); padding: 0 .5rem; flex-shrink: 0; align-self: center; }

.help-section-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.help-section-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.1rem;
  cursor: pointer;
  user-select: none;
  transition: background .1s;
}
.help-section-header:hover { background: var(--gray-50); }
.help-section-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.help-section-title { font-size: .9rem; font-weight: 700; flex: 1; }
.help-section-chevron { color: var(--gray-400); transition: transform .2s; }
.help-section-header.open .help-section-chevron { transform: rotate(180deg); }
.help-section-body {
  display: none;
  padding: .75rem 1.1rem 1rem;
  border-top: 1px solid var(--gray-100);
}
.help-section-body.show { display: block; }

.help-step {
  display: flex;
  gap: .75rem;
  margin-bottom: .85rem;
  align-items: flex-start;
}
.help-step-num {
  width: 24px; height: 24px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: .1rem;
}
.help-step-body h4 { font-size: .85rem; font-weight: 600; margin-bottom: .15rem; }
.help-step-body p  { font-size: .8rem; color: var(--gray-500); line-height: 1.5; }

.help-tip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: .65rem .9rem;
  font-size: .8rem;
  color: #1d4ed8;
  margin-top: .75rem;
  display: flex;
  gap: .5rem;
  align-items: flex-start;
}
.help-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}
.help-badge {
  font-size: .75rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-weight: 500;
  border: 1px solid var(--gray-200);
}

/* ============================================================
   Smart Input — @mention component
   ============================================================ */

.si-wrap {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--brand);
  border-radius: 12px;
  padding: .6rem .75rem;
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
  margin-bottom: 1rem;
}

.si-input-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.si-trigger-hint {
  font-size: .72rem;
  font-weight: 600;
  color: var(--gray-400);
  font-family: monospace;
  flex-shrink: 0;
  letter-spacing: .05em;
}

.si-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: .9rem;
  color: var(--gray-900);
  background: transparent;
  padding: .2rem 0;
  font-family: inherit;
}
.si-input::placeholder { color: var(--gray-400); }
.si-input.si-shake { animation: si-shake .35s ease; }
@keyframes si-shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

.si-btn-submit { font-size: .8rem; padding: .35rem .85rem; flex-shrink: 0; }
.si-btn-detail { font-size: .8rem; padding: .35rem .75rem; flex-shrink: 0; color: var(--brand); }
.si-btn-cancel {
  font-size: .8rem; padding: .3rem .5rem; flex-shrink: 0;
  color: var(--gray-400); border: none;
}
.si-btn-cancel:hover { color: var(--gray-700); }

/* chips row */
.si-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .5rem;
}

.si-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .18rem .5rem .18rem .3rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.si-chip-person  { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.si-chip-priority { background: #fef9c3; color: #92400e; border-color: #fde68a; }
.si-chip-date    { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.si-chip-project { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }

.si-chip-av {
  width: 16px; height: 16px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .55rem;
  font-weight: 700;
  flex-shrink: 0;
}
.si-chip-tag {
  font-size: .65rem;
  font-weight: 700;
  opacity: .7;
  margin-left: .1rem;
}
.si-chip-x {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .55;
  font-size: .85rem;
  padding: 0 0 0 .1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.si-chip-x:hover { opacity: 1; }

/* error */
.si-error-msg {
  font-size: .75rem;
  color: var(--red);
  margin-top: .3rem;
  min-height: 1rem;
}

/* dropdown */
.si-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 200;
  overflow: hidden;
  padding: .3rem 0;
}

.si-opt {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  cursor: pointer;
  font-size: .83rem;
  color: var(--gray-800);
  transition: background .1s;
}
.si-opt:hover, .si-opt.focused { background: var(--gray-50); }

.si-opt-av {
  width: 24px; height: 24px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .62rem;
  font-weight: 700;
  flex-shrink: 0;
}
.si-opt-ic { font-size: .9rem; flex-shrink: 0; width: 24px; text-align: center; }
.si-opt-label { flex: 1; }
.si-opt-sub {
  font-size: .7rem;
  color: var(--gray-400);
  margin-left: .25rem;
}

.si-sep {
  height: 1px;
  background: var(--gray-100);
  margin: .2rem .5rem;
}


/* --- Project detail kanban and gantt refinements --- */
.page.project-detail-mode .kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
  overflow: visible;
  padding-bottom: .5rem;
}
.page.project-detail-mode .kanban-col {
  width: auto;
  min-width: 0;
  max-width: none;
}
.gantt-row {
  display: grid;
  grid-template-columns: 260px minmax(420px, 1fr) 92px;
  gap: .75rem;
  align-items: stretch;
  border-bottom: 1px solid var(--gray-100);
  min-height: 38px;
}
.gantt-row:last-child { border-bottom: 0; }
.gantt-task-title {
  display: flex;
  align-items: center;
  font-size: .75rem;
  color: var(--gray-700);
  line-height: 1.3;
  padding: .45rem 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.gantt-task-title a {
  color: inherit;
  text-decoration: none;
}
.gantt-task-title a:hover { color: var(--brand); }
.gantt-track {
  position: relative;
  min-height: 38px;
}
.gantt-task-bar {
  position: absolute;
  top: 50%;
  height: 20px;
  transform: translateY(-50%);
  border-radius: 4px;
  z-index: 2;
}
.gantt-due {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  font-size: .7rem;
  text-align: right;
}
@media (max-width: 1180px) {
  .page.project-detail-mode .kanban {
    display: flex;
    overflow-x: auto;
  }
  .page.project-detail-mode .kanban-col {
    flex: 0 0 260px;
  }
}


/* --- Project deliverables --- */
.project-deliverables-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.deliverable-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.deliverable-progress {
  height: 7px;
  border-radius: 99px;
  background: var(--gray-100);
  overflow: hidden;
  margin-bottom: .8rem;
}
.deliverable-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #2563eb);
}
.deliverable-command {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(0, 1.5fr);
  gap: .75rem;
  margin-bottom: .85rem;
}
.deliverable-next {
  background: linear-gradient(135deg, #f8fafc 0%, #eef4ff 100%);
  border: 1px solid #dbe7ff;
  border-radius: 10px;
  padding: .85rem;
  min-width: 0;
}
.deliverable-next .label {
  color: var(--text-muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.deliverable-next .title {
  margin-top: .3rem;
  color: var(--text);
  font-size: .92rem;
  font-weight: 760;
  line-height: 1.3;
}
.deliverable-next .meta {
  margin-top: .25rem;
  color: var(--text-muted);
  font-size: .73rem;
}
.deliverable-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}
.deliverable-stat {
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .7rem .75rem;
}
.deliverable-stat span {
  display: block;
  color: var(--text-muted);
  font-size: .66rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.deliverable-stat strong {
  display: block;
  margin-top: .25rem;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
}
.deliverable-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1fr) 150px auto;
  gap: .5rem;
  align-items: center;
  margin-bottom: .5rem;
}
.deliverable-desc-input {
  min-height: 52px;
  margin-bottom: .75rem;
}
.deliverable-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .55rem;
}
.deliverable-item {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 9px;
  padding: .75rem;
  box-shadow: 0 6px 18px rgba(15,23,42,.035);
}
.deliverable-item.done {
  background: #f8fffb;
  border-color: #bbf7d0;
}
.deliverable-item.in_progress {
  background: #f8fbff;
  border-color: #bfdbfe;
}
.deliverable-main { min-width: 0; }
.deliverable-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.35;
}
.deliverable-desc {
  font-size: .74rem;
  color: var(--gray-500);
  margin-top: .25rem;
  line-height: 1.4;
}
.deliverable-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
  font-size: .7rem;
  color: var(--gray-500);
}
.deliverable-meta a { color: var(--brand); text-decoration: none; font-weight: 600; }
.deliverable-actions {
  display: flex;
  align-items: flex-start;
  gap: .25rem;
  flex-shrink: 0;
}
.deliverable-empty {
  border: 1px dashed var(--gray-200);
  border-radius: 9px;
  color: var(--gray-400);
  font-size: .8rem;
  padding: .85rem;
  text-align: center;
}
@media (max-width: 900px) {
  .deliverable-command { grid-template-columns: 1fr; }
  .deliverable-form { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .deliverable-stats { grid-template-columns: 1fr; }
}

/* --- Routine work / jobdesk --- */
.routine-command {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(280px, .9fr);
  gap: .85rem;
  margin-bottom: 1rem;
}
.routine-command-main {
  background: linear-gradient(135deg, #0f766e 0%, #2563eb 100%);
  border-radius: 10px;
  color: #fff;
  padding: 1rem;
  box-shadow: 0 16px 34px rgba(15,118,110,.16);
}
.routine-command-main .eyebrow { color: rgba(255,255,255,.72); }
.routine-command-main h2 {
  margin-top: .35rem;
  font-size: 1.1rem;
  line-height: 1.25;
  letter-spacing: 0;
}
.routine-command-main p {
  max-width: 720px;
  margin-top: .35rem;
  color: rgba(255,255,255,.78);
  font-size: .82rem;
  line-height: 1.45;
}
.routine-command-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
.routine-command-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .8rem;
  box-shadow: var(--shadow);
}
.routine-command-stat strong {
  display: block;
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
}
.routine-command-stat span {
  display: block;
  margin-top: .3rem;
  color: var(--text-muted);
  font-size: .72rem;
}
.routine-toolbar {
  display: flex;
  gap: .6rem;
  align-items: center;
  margin-bottom: 1rem;
}
.routine-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.routine-summary-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: .85rem 1rem;
}
.routine-summary-card span {
  display: block;
  color: var(--gray-400);
  font-size: .72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.routine-summary-card strong {
  display: block;
  margin-top: .25rem;
  font-size: 1.55rem;
  line-height: 1;
  color: var(--gray-900);
}
.routine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: .8rem;
}
.routine-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 1rem;
  min-width: 0;
}
.routine-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}
.routine-title {
  color: var(--gray-900);
  font-size: .92rem;
  font-weight: 750;
  line-height: 1.3;
}
.routine-entity {
  margin-top: .2rem;
  color: var(--gray-400);
  font-size: .74rem;
}
.routine-desc {
  margin-top: .75rem;
  color: var(--gray-600);
  font-size: .8rem;
  line-height: 1.45;
}
.routine-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .85rem;
}
.routine-meta span {
  border: 1px solid var(--gray-200);
  border-radius: 99px;
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: .68rem;
  font-weight: 650;
  padding: .14rem .5rem;
}
.routine-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px solid var(--gray-100);
  color: var(--gray-400);
  font-size: .74rem;
}
.routine-check {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  color: var(--gray-600);
  font-size: .82rem;
  line-height: 1.4;
}
.routine-check input {
  width: auto;
  margin-top: .15rem;
}
.routine-readonly {
  padding: .55rem .75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  color: var(--gray-700);
  font-size: .85rem;
  font-weight: 600;
}
@media (max-width: 720px) {
  .routine-command { grid-template-columns: 1fr; }
  .routine-toolbar,
  .routine-foot { align-items: stretch; flex-direction: column; }
  .routine-summary-grid { grid-template-columns: 1fr; }
}

/* --- Performance signals --- */
.perf-command {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(280px, .8fr);
  gap: .85rem;
  margin-bottom: 1rem;
}
.perf-command-main {
  background: linear-gradient(135deg, #172033 0%, #334155 100%);
  border-radius: 10px;
  color: #fff;
  padding: 1rem;
  box-shadow: 0 16px 34px rgba(23,32,51,.16);
}
.perf-command-main .eyebrow { color: rgba(255,255,255,.68); }
.perf-command-main h2 {
  margin-top: .35rem;
  font-size: 1.1rem;
  line-height: 1.25;
  letter-spacing: 0;
}
.perf-command-main p {
  max-width: 760px;
  margin-top: .35rem;
  color: rgba(255,255,255,.76);
  font-size: .82rem;
  line-height: 1.45;
}
.perf-command-side {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
}
.perf-coach-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .8rem;
  box-shadow: var(--shadow);
}
.perf-coach-card span {
  display: block;
  color: var(--text-muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.perf-coach-card strong {
  display: block;
  margin-top: .25rem;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.3;
}
.perf-coach-card p {
  margin-top: .2rem;
  color: var(--text-muted);
  font-size: .72rem;
  line-height: 1.35;
}
.perf-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.perf-summary-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: .9rem 1rem;
}
.perf-summary-card span {
  display: block;
  color: var(--gray-400);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.perf-summary-card strong {
  display: block;
  margin-top: .3rem;
  color: var(--gray-900);
  font-size: 1.55rem;
  line-height: 1;
}
.perf-list {
  display: grid;
  gap: .65rem;
  padding: .75rem;
}
.perf-row {
  display: grid;
  grid-template-columns: 36px minmax(180px, 1fr) 70px minmax(260px, 1.4fr) minmax(280px, 1fr);
  gap: .85rem;
  align-items: center;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
  padding: .85rem;
}
.perf-rank {
  color: var(--gray-400);
  font-size: .78rem;
  font-weight: 750;
  text-align: center;
}
.perf-person {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}
.perf-name {
  color: var(--gray-900);
  font-weight: 750;
  font-size: .86rem;
  line-height: 1.25;
}
.perf-sub {
  color: var(--gray-400);
  font-size: .72rem;
  margin-top: .15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.perf-score {
  border-radius: 12px;
  padding: .45rem .6rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  border: 1px solid var(--gray-200);
  background: #fff;
}
.perf-score.good { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.perf-score.cool { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.perf-score.warn { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.perf-score.hot { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.perf-bars {
  display: grid;
  gap: .32rem;
}
.perf-bars div {
  display: grid;
  grid-template-columns: 74px minmax(80px, 1fr) 28px;
  align-items: center;
  gap: .45rem;
  font-size: .68rem;
  color: var(--gray-500);
}
.perf-bars b {
  display: block;
  height: 6px;
  min-width: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, #2563eb, #10b981);
}
.perf-bars div::before {
  content: "";
  grid-column: 2;
  grid-row: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--gray-200);
}
.perf-bars b {
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
}
.perf-bars em {
  color: var(--gray-400);
  font-style: normal;
  text-align: right;
}
.perf-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  gap: .4rem;
}
.perf-metric {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: .45rem .5rem;
}
.perf-metric span {
  display: block;
  color: var(--gray-400);
  font-size: .62rem;
}
.perf-metric strong {
  color: var(--gray-900);
  font-size: .82rem;
}
@media (max-width: 1180px) {
  .perf-summary-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .perf-row { grid-template-columns: 32px minmax(180px, 1fr) 64px; }
  .perf-bars,
  .perf-metrics { grid-column: 2 / -1; }
}
@media (max-width: 720px) {
  .perf-command { grid-template-columns: 1fr; }
  .perf-summary-grid { grid-template-columns: 1fr 1fr; }
  .perf-row { grid-template-columns: 1fr; }
  .perf-rank { text-align: left; }
  .perf-bars,
  .perf-metrics { grid-column: auto; }
  .perf-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   LIQUID GLASS THEME
   Applies when <body class="theme-liquid-glass">
   ============================================================ */

/* ─── Aurora background + CSS variable overrides ─────────── */
body.theme-liquid-glass {
  background:
    radial-gradient(ellipse at 18% 28%, rgba(139,92,246,.18) 0%, transparent 50%),
    radial-gradient(ellipse at 82% 12%, rgba(59,130,246,.14) 0%, transparent 45%),
    radial-gradient(ellipse at 68% 82%, rgba(236,72,153,.12) 0%, transparent 48%),
    radial-gradient(ellipse at 22% 88%, rgba(20,184,166,.1)  0%, transparent 45%),
    linear-gradient(160deg, #f0eeff 0%, #f8f0ff 35%, #eef6ff 65%, #f0faff 100%);
  background-attachment: fixed;

  /* Glass primitives */
  --glx-fill:        rgba(255,255,255,.55);
  --glx-fill-strong: rgba(255,255,255,.72);
  --glx-fill-subtle: rgba(255,255,255,.35);
  --glx-border:      rgba(255,255,255,.65);
  --glx-blur:        blur(18px) saturate(160%);
  --glx-blur-strong: blur(28px) saturate(180%);
  --glx-shadow:      0 8px 32px rgba(80,50,180,.09), 0 1px 0 rgba(255,255,255,.75) inset;
  --glx-shadow-md:   0 16px 48px rgba(80,50,180,.13), 0 1px 0 rgba(255,255,255,.85) inset;

  /* Override design tokens */
  --bg:             transparent;
  --canvas:         transparent;
  --surface:        var(--glx-fill);
  --panel:          var(--glx-fill);
  --panel-muted:    var(--glx-fill-subtle);
  --border:         rgba(200,200,240,.35);
  --shadow:         var(--glx-shadow);
  --shadow-md:      var(--glx-shadow-md);
  --sidebar-bg:     rgba(255,255,255,.42);
  --sidebar-border: rgba(255,255,255,.55);
  --gray-100:       rgba(220,220,240,.4);
  --gray-200:       rgba(200,200,230,.45);
  --gray-50:        rgba(240,240,255,.5);
}

/* ─── Sidebar ─────────────────────────────────────────────── */
body.theme-liquid-glass .sidebar {
  background: rgba(255,255,255,.42) !important;
  backdrop-filter: var(--glx-blur-strong);
  -webkit-backdrop-filter: var(--glx-blur-strong);
  border-right: 1px solid rgba(255,255,255,.6) !important;
  box-shadow: 4px 0 40px rgba(80,50,180,.07) !important;
}
body.theme-liquid-glass .sidebar-logo {
  border-bottom: 1px solid rgba(255,255,255,.5) !important;
  background: rgba(255,255,255,.1);
}
body.theme-liquid-glass .sidebar-user {
  border-top: 1px solid rgba(255,255,255,.5) !important;
}
body.theme-liquid-glass .nav-item:hover {
  background: rgba(255,255,255,.55);
}
body.theme-liquid-glass .nav-item.active {
  background: rgba(37,99,235,.12);
  box-shadow: inset 3px 0 0 var(--brand), 0 2px 12px rgba(37,99,235,.12);
}
body.theme-liquid-glass #sidebar-search-btn {
  background: rgba(255,255,255,.4);
  border: 1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(80,50,180,.06);
}
body.theme-liquid-glass #sidebar-search-btn:hover {
  background: rgba(255,255,255,.65);
}
body.theme-liquid-glass .user-chip:hover {
  background: rgba(255,255,255,.5);
}
body.theme-liquid-glass #sidebar-user-menu {
  background: rgba(255,255,255,.82) !important;
  backdrop-filter: var(--glx-blur);
  -webkit-backdrop-filter: var(--glx-blur);
  border: 1px solid rgba(255,255,255,.7) !important;
  box-shadow: 0 12px 40px rgba(80,50,180,.13) !important;
}

/* ─── Main & page layout ──────────────────────────────────── */
body.theme-liquid-glass .main,
body.theme-liquid-glass .page { background: transparent; }

/* ─── Glass mixin — applied to all card/panel surfaces ─────── */
body.theme-liquid-glass .card,
body.theme-liquid-glass .surface,
body.theme-liquid-glass .surface-muted,
body.theme-liquid-glass .entity-panel,
body.theme-liquid-glass .project-card,
body.theme-liquid-glass .stat-card,
body.theme-liquid-glass .routine-card,
body.theme-liquid-glass .perf-card,
body.theme-liquid-glass .perf-member-row {
  background: var(--glx-fill) !important;
  backdrop-filter: var(--glx-blur);
  -webkit-backdrop-filter: var(--glx-blur);
  border: 1px solid var(--glx-border) !important;
  box-shadow: var(--glx-shadow) !important;
}
body.theme-liquid-glass .card-header,
body.theme-liquid-glass .entity-panel-header {
  border-bottom: 1px solid rgba(255,255,255,.5) !important;
  background: rgba(255,255,255,.1);
}
body.theme-liquid-glass .card-header { background: rgba(255,255,255,.15); }
body.theme-liquid-glass .project-card:hover {
  box-shadow: var(--glx-shadow-md) !important;
  border-color: rgba(37,99,235,.35) !important;
}
body.theme-liquid-glass .project-bar { opacity: .8; }

/* ─── Stat cards coloured backgrounds ────────────────────── */
body.theme-liquid-glass .stat-card[style*="background"] {
  backdrop-filter: var(--glx-blur);
  -webkit-backdrop-filter: var(--glx-blur);
  border: 1px solid rgba(255,255,255,.55) !important;
}

/* ─── Entity command strip ───────────────────────────────── */
body.theme-liquid-glass .entity-command-strip > * {
  background: rgba(255,255,255,.52) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.65) !important;
  box-shadow: 0 4px 16px rgba(80,50,180,.07) !important;
}
body.theme-liquid-glass .entity-command-strip > *:hover {
  background: rgba(255,255,255,.72) !important;
  border-color: rgba(37,99,235,.3) !important;
}

/* ─── Modals ─────────────────────────────────────────────── */
body.theme-liquid-glass .modal-overlay {
  background: rgba(60,30,120,.18) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
body.theme-liquid-glass .modal {
  background: var(--glx-fill-strong) !important;
  backdrop-filter: var(--glx-blur-strong);
  -webkit-backdrop-filter: var(--glx-blur-strong);
  border: 1px solid var(--glx-border) !important;
  box-shadow: var(--glx-shadow-md) !important;
}
body.theme-liquid-glass .modal-header {
  border-bottom: 1px solid rgba(255,255,255,.5) !important;
  background: rgba(255,255,255,.15);
}
body.theme-liquid-glass .modal-footer {
  border-top: 1px solid rgba(255,255,255,.5) !important;
  background: rgba(255,255,255,.08);
}

/* ─── Global search ──────────────────────────────────────── */
body.theme-liquid-glass #global-search-overlay {
  background: rgba(60,30,120,.2) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.theme-liquid-glass #gs-box {
  background: rgba(255,255,255,.78) !important;
  backdrop-filter: var(--glx-blur-strong);
  -webkit-backdrop-filter: var(--glx-blur-strong);
  border: 1px solid var(--glx-border);
  box-shadow: 0 24px 64px rgba(80,50,180,.16) !important;
}
body.theme-liquid-glass #gs-input-wrap {
  border-bottom: 1px solid rgba(255,255,255,.5) !important;
  background: rgba(255,255,255,.1);
}
body.theme-liquid-glass #gs-input {
  background: transparent !important;
}
body.theme-liquid-glass .gs-result-item:hover {
  background: rgba(37,99,235,.08) !important;
}

/* ─── Buttons ────────────────────────────────────────────── */
body.theme-liquid-glass .btn-secondary {
  background: rgba(255,255,255,.58) !important;
  border: 1px solid rgba(255,255,255,.72) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(80,50,180,.07), 0 1px 0 rgba(255,255,255,.9) inset;
}
body.theme-liquid-glass .btn-secondary:hover {
  background: rgba(255,255,255,.78) !important;
}
body.theme-liquid-glass .btn-ghost:hover {
  background: rgba(255,255,255,.5) !important;
}
body.theme-liquid-glass .btn-primary {
  box-shadow: 0 4px 16px rgba(37,99,235,.3), 0 1px 0 rgba(255,255,255,.25) inset !important;
}

/* ─── Form inputs ────────────────────────────────────────── */
body.theme-liquid-glass input:not([type=checkbox]):not([type=radio]):not([type=range]),
body.theme-liquid-glass select,
body.theme-liquid-glass textarea {
  background: rgba(255,255,255,.58) !important;
  border: 1px solid rgba(255,255,255,.65) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(80,50,180,.06) inset !important;
}
body.theme-liquid-glass input:focus,
body.theme-liquid-glass select:focus,
body.theme-liquid-glass textarea:focus {
  background: rgba(255,255,255,.8) !important;
  border-color: rgba(37,99,235,.4) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
}

/* ─── Tables ─────────────────────────────────────────────── */
body.theme-liquid-glass table {
  background: transparent;
}
body.theme-liquid-glass thead th {
  background: rgba(255,255,255,.48) !important;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.55) !important;
}
body.theme-liquid-glass tbody tr:nth-child(even) {
  background: rgba(255,255,255,.22);
}
body.theme-liquid-glass tbody tr:hover {
  background: rgba(255,255,255,.45) !important;
}

/* ─── Tabs ───────────────────────────────────────────────── */
body.theme-liquid-glass .tab-wrap,
body.theme-liquid-glass [class*="tab-bar"] {
  background: rgba(255,255,255,.35);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 10px;
  padding: .2rem;
}
body.theme-liquid-glass .tab {
  background: transparent;
  color: var(--text-muted);
}
body.theme-liquid-glass .tab.active {
  background: rgba(255,255,255,.75) !important;
  box-shadow: 0 2px 12px rgba(80,50,180,.1) !important;
  color: var(--text);
}

/* ─── Dropdowns / pickers ────────────────────────────────── */
body.theme-liquid-glass .mention-drop,
body.theme-liquid-glass .ref-drop,
body.theme-liquid-glass #notif-panel {
  background: rgba(255,255,255,.82) !important;
  backdrop-filter: var(--glx-blur);
  -webkit-backdrop-filter: var(--glx-blur);
  border: 1px solid rgba(255,255,255,.7) !important;
  box-shadow: 0 12px 40px rgba(80,50,180,.13) !important;
}

/* ─── Task rows ──────────────────────────────────────────── */
body.theme-liquid-glass .task-row-link {
  background: rgba(255,255,255,.45);
  border-bottom: 1px solid rgba(255,255,255,.4) !important;
}
body.theme-liquid-glass .task-row-link:hover {
  background: rgba(255,255,255,.65) !important;
}

/* ─── Appearance panel itself ────────────────────────────── */
body.theme-liquid-glass #appearance-panel {
  background: rgba(255,255,255,.82) !important;
  backdrop-filter: var(--glx-blur);
  -webkit-backdrop-filter: var(--glx-blur);
  border: 1px solid rgba(255,255,255,.72) !important;
}

/* ─── Page headers ───────────────────────────────────────── */
body.theme-liquid-glass .page-header h1 {
  text-shadow: 0 1px 8px rgba(80,50,180,.1);
}

/* ─── Notification bell ──────────────────────────────────── */
body.theme-liquid-glass #notif-bell {
  background: rgba(255,255,255,.48) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.65) !important;
}
body.theme-liquid-glass #notif-bell:hover {
  background: rgba(255,255,255,.68) !important;
}

/* ─── Appearance panel theme section ─────────────────────── */
.ap-section-label {
  font-size: .62rem; font-weight: 700; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: .07em;
  margin: .5rem 0 .3rem;
}
.ap-theme-cards {
  display: flex; gap: .45rem; margin-bottom: .5rem;
}
.ap-theme-card {
  flex: 1; height: 46px; border-radius: 8px;
  border: 2px solid transparent; cursor: pointer;
  font-size: .68rem; font-weight: 600; color: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; padding: .35rem .5rem;
  transition: all .15s; position: relative; overflow: hidden;
  text-shadow: 0 1px 3px rgba(255,255,255,.8);
}
.ap-theme-card:hover { border-color: rgba(37,99,235,.4); transform: translateY(-1px); }
.ap-theme-active { border-color: var(--brand) !important; box-shadow: 0 0 0 1px var(--brand); }
.ap-theme-check {
  position: absolute; top: 4px; right: 5px;
  font-size: .65rem; color: var(--brand); font-weight: 800;
}

/* ─── Liquid Glass — additional #fff elements ─────────────── */
body.theme-liquid-glass .task-command-stat,
body.theme-liquid-glass .detail-card,
body.theme-liquid-glass .focus-coach,
body.theme-liquid-glass .focus-queue,
body.theme-liquid-glass .kanban-card,
body.theme-liquid-glass .today-command-link.primary,
body.theme-liquid-glass .kanban-col {
  background: var(--glx-fill) !important;
  backdrop-filter: var(--glx-blur);
  -webkit-backdrop-filter: var(--glx-blur);
  border: 1px solid var(--glx-border) !important;
  box-shadow: var(--glx-shadow) !important;
}
body.theme-liquid-glass .kanban-card:hover {
  box-shadow: var(--glx-shadow-md) !important;
  border-color: rgba(37,99,235,.3) !important;
}
body.theme-liquid-glass .focus-chip {
  background: rgba(255,255,255,.55) !important;
  border-color: rgba(255,255,255,.65) !important;
  backdrop-filter: blur(8px);
}
/* Kanban column header */
body.theme-liquid-glass .kanban-col-head {
  background: rgba(255,255,255,.35) !important;
  border-bottom: 1px solid rgba(255,255,255,.45) !important;
  backdrop-filter: blur(10px);
}
