/* =====================================================
   DevTask — Responsive Stylesheet
   Mobile · Tablet · Laptop · Desktop
   ===================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --primary:      #4f46e5;
  --primary-dark: #3730a3;
  --sidebar-bg:   #1e1b4b;
  --sidebar-w:    250px;
  --topbar-h:     60px;
  --radius:       12px;
  --shadow:       0 1px 4px rgba(0,0,0,.08);
  --border:       #e5e7eb;
  --text:         #1f2937;
  --muted:        #6b7280;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  background: #f4f6fb;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  font-size: 14px;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); }
img { max-width: 100%; }

/* ---------- Login Page ---------- */
.login-body {
  background: linear-gradient(135deg, #4f46e5 0%, #1e1b4b 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-wrapper { width: 100%; }
.login-card {
  background: #fff;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 20px;
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand i   { font-size: 2.8rem; color: var(--primary); display: block; }
.login-brand img { max-height: 60px; margin-bottom: .5rem; }
.login-brand h4  { margin: .5rem 0 .25rem; font-weight: 800; font-size: 1.3rem; }
.login-demo {
  margin-top: 1.25rem;
  padding: .75rem 1rem;
  background: #f4f6fb;
  border-radius: 10px;
  font-size: .8rem;
  color: #4b5563;
}
.demo-row { margin-top: .35rem; font-size: .8rem; color: #4b5563; }
.demo-row .badge { min-width: 110px; text-align: center; margin-right: .4rem; }

/* ---------- App Layout ---------- */
.app-wrapper { display: flex; min-height: 100vh; position: relative; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #e5e7eb;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .25s ease;
  overflow-y: auto;
}
.sidebar-pm { background: #1c1917; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.1rem 1.25rem;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-brand i   { font-size: 1.5rem; color: #818cf8; }
.sidebar-brand img { height: 32px; width: 32px; border-radius: 8px; object-fit: cover; }
.sidebar-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { padding: .6rem; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem .9rem;
  border-radius: 9px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.sidebar-nav a i { width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.sidebar-nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.sidebar-nav a.active { background: var(--primary); color: #fff; }
.sidebar-pm .sidebar-nav a.active { background: #d97706; }

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}

/* ---------- Main content ---------- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 900;
  gap: .75rem;
}
.topbar h5 { margin: 0; font-size: .95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  flex-shrink: 0;
}
.topbar-user i { font-size: 1.4rem; color: var(--primary); }
.topbar-user span:first-of-type {
  display: none; /* hide name on small screens */
}

/* ---------- Page content ---------- */
.page-content { padding: 1.25rem; flex: 1; }
.page-footer {
  padding: .85rem 1.25rem;
  text-align: center;
  font-size: .78rem;
  color: #9ca3af;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* ---------- Cards ---------- */
.card-box {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-box-header {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid #f1f3f6;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}
.card-box-header i { color: var(--primary); margin-right: .3rem; }

/* ---------- Stat Cards ---------- */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  height: 100%;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.stat-value { font-size: 1.65rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .75rem; color: var(--muted); margin-top: 3px; }
.stat-blue .stat-icon   { background: #e0e7ff; color: #4f46e5; }
.stat-orange .stat-icon { background: #ffedd5; color: #ea580c; }
.stat-green .stat-icon  { background: #dcfce7; color: #16a34a; }
.stat-purple .stat-icon { background: #f3e8ff; color: #9333ea; }

/* ---------- Tables ---------- */
.table-responsive { -webkit-overflow-scrolling: touch; }
.table { font-size: .85rem; }
.table thead th {
  font-size: .7rem;
  text-transform: uppercase;
  color: var(--muted);
  background: #fafbfc;
  font-weight: 700;
  border-bottom-width: 1px;
  white-space: nowrap;
  padding: .6rem .75rem;
}
.table td { padding: .65rem .75rem; vertical-align: middle; }
.table tbody tr { cursor: default; }

/* Mobile table card mode */
@media (max-width: 575px) {
  .table-cards thead { display: none; }
  .table-cards tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: .75rem;
    padding: .75rem;
    background: #fff;
    box-shadow: var(--shadow);
  }
  .table-cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    padding: .3rem 0;
    font-size: .85rem;
  }
  .table-cards tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    font-size: .75rem;
    text-transform: uppercase;
    flex: 0 0 40%;
  }
}

/* ---------- Badges ---------- */
.badge { font-size: .72rem; font-weight: 700; padding: .3em .65em; }

/* ---------- Buttons ---------- */
.btn { font-size: .85rem; border-radius: 8px; }
.btn-sm { font-size: .8rem; padding: .3rem .7rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: .95rem; }
/* Touch-friendly minimum size */
@media (max-width: 767px) {
  .btn:not(.btn-sm) { padding: .5rem 1rem; }
  .btn-sm { min-height: 34px; }
}

/* ---------- Form Controls ---------- */
.form-control, .form-select {
  font-size: .88rem;
  border-radius: 8px;
  border-color: #d1d5db;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.form-label { font-size: .85rem; margin-bottom: .35rem; }

/* ---------- Work Notes ---------- */
.work-notes-box {
  white-space: pre-wrap;
  font-family: 'Segoe UI', sans-serif;
  font-size: .85rem;
  background: #f9fafb;
  border-radius: 8px;
  padding: .9rem;
  margin: 0;
  border: 1px solid #eef0f3;
  max-height: 300px;
  overflow-y: auto;
}

/* ---------- Settings logo ---------- */
.settings-logo-preview { height: 80px; width: 80px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.settings-logo-placeholder {
  height: 80px; width: 80px; border-radius: 12px;
  background: #f1f3f6; display: flex; align-items: center;
  justify-content: center; margin: 0 auto;
  font-size: 2rem; color: #9ca3af;
}
.section-heading {
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: #9ca3af; margin-bottom: .75rem;
}

/* ---------- Project Cards ---------- */
.proj-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .15s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.proj-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.1); transform: translateY(-2px); }
.proj-card-top {
  display: flex; align-items: center; gap: .7rem;
  padding: 14px 14px 12px;
  border-bottom: 1px solid;
  flex-shrink: 0;
}
.proj-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.proj-info { flex: 1; min-width: 0; }
.proj-name { font-weight: 700; font-size: .92rem; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-meta { display: flex; gap: .25rem; margin-top: 4px; flex-wrap: wrap; }
.proj-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.proj-desc { padding: 10px 14px; font-size: .82rem; color: var(--muted); flex: 1; }
.proj-footer { padding: 12px 14px; flex-shrink: 0; }
.proj-stats { display: flex; gap: .65rem; font-size: .76rem; color: var(--muted); flex-wrap: wrap; margin-bottom: 6px; }
.proj-stats i { margin-right: 2px; }

/* PM Badge */
.pm-badge {
  font-size: .76rem; font-weight: 600; color: #4f46e5;
  background: #eef2ff; border-radius: 20px;
  padding: 3px 10px; display: inline-flex; align-items: center; gap: 4px;
}
.pm-badge.unassigned { color: #9ca3af; background: #f3f4f6; }
.proj-detail-header {
  background: #fff; border-radius: 10px; padding: 16px;
  border: 1px solid var(--border); margin-bottom: 0;
}
.dev-chip {
  font-size: .78rem; background: #f0f4ff; color: #4f46e5;
  border-radius: 20px; padding: 2px 8px;
  display: inline-flex; align-items: center; gap: 3px;
}

/* ---------- Color Picker ---------- */
.color-picker-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 6px; }
.color-dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; padding: 0;
  transition: transform .15s, border-color .15s;
  flex-shrink: 0;
}
.color-dot:hover  { transform: scale(1.2); }
.color-dot.active { border-color: #111; transform: scale(1.15); }
.color-custom-input { width: 34px; height: 30px; padding: 1px; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer; }

/* ---------- Hours Picker ---------- */
.hours-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.hrs-preset {
  padding: 5px 11px; border-radius: 20px;
  font-size: .78rem; font-weight: 600;
  border: 1.5px solid #d1d5db;
  background: #f9fafb; color: #374151;
  cursor: pointer; font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}
.hrs-preset:hover  { border-color: var(--primary); color: var(--primary); background: #eef2ff; }
.hrs-preset.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.hours-display-label { font-size: .85rem; font-weight: 700; color: var(--primary); margin-top: 7px; min-height: 22px; }
.hours-custom-input  { margin-top: 7px; }
.hours-stat-val { font-size: 1.4rem; font-weight: 800; line-height: 1.1; }
.hours-stat-lbl { font-size: .7rem; color: #9ca3af; margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- File Attachments ---------- */
.file-list { display: flex; flex-direction: column; gap: .5rem; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .75rem;
  background: #f9fafb; border: 1px solid #eef0f3; border-radius: 8px;
  gap: .75rem;
}
.file-info { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.file-icon { font-size: 1.35rem; flex-shrink: 0; }
.file-meta { min-width: 0; }
.file-name { font-weight: 600; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.file-sub  { font-size: .72rem; color: #9ca3af; margin-top: 1px; }
.file-actions { display: flex; gap: .35rem; flex-shrink: 0; }

/* ---------- Drag & Drop Upload ---------- */
.drop-zone {
  position: relative; border: 2px dashed #d1d5db;
  border-radius: var(--radius); background: #f9fafb;
  text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
  overflow: hidden;
}
.drop-zone:hover, .drop-zone.drop-active { border-color: var(--primary); background: #eef2ff; }
.drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.drop-body  { padding: 1.5rem 1rem; pointer-events: none; position: relative; z-index: 1; }
.drop-icon  { font-size: 2.2rem; color: var(--primary); display: block; margin-bottom: .4rem; }
.drop-title { font-weight: 700; font-size: .95rem; color: #374151; }
.drop-sub   { font-size: .82rem; color: var(--muted); margin: .2rem 0 .4rem; }
.drop-link  { color: var(--primary); font-weight: 600; }
.drop-types, .drop-limit { font-size: .7rem; color: #9ca3af; }

/* ---------- Countdown ---------- */
#countdown span { display: inline-block; min-width: 32px; }

/* ---------- Pending Badge ---------- */
.pending-icon {
  width: 70px; height: 70px; background: #fff3cd; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; font-size: 2rem; color: #d97706;
}
.nav-pills .nav-link { color: #4b5563; font-size: .85rem; }
.nav-pills .nav-link.active { background: var(--primary); }
.table-warning td { background-color: #fffbeb !important; }

/* ---------- Markdown Renderer ---------- */
.md-content { font-size: .88rem; color: #374151; line-height: 1.7; }
.md-h1 { font-size: .95rem; font-weight: 800; color: #111827; margin: 12px 0 4px; border-bottom: 2px solid #e5e7eb; padding-bottom: 4px; }
.md-h2 { font-size: .88rem; font-weight: 700; color: #1f2937; margin: 10px 0 3px; }
.md-h3 { font-size: .8rem; font-weight: 700; color: #4b5563; margin: 8px 0 2px; text-transform: uppercase; letter-spacing: .04em; }
.md-p  { margin: 0 0 5px; }
.md-list { margin: 3px 0 7px 16px; padding: 0; }
.md-list li { margin-bottom: 3px; }
.md-br  { height: 5px; }
.md-content code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-size: .8rem; color: var(--primary); }

/* =====================================================
   RESPONSIVE BREAKPOINTS
   ===================================================== */

/* ---- Mobile (< 768px) ---- */
@media (max-width: 767.98px) {

  :root { --topbar-h: 56px; }

  /* Sidebar hidden by default on mobile */
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }

  /* Main content full width */
  .main-content { margin-left: 0; }

  /* Topbar adjustments */
  .topbar { padding: 0 .9rem; }
  .topbar h5 { font-size: .85rem; }

  /* Page content compact */
  .page-content { padding: .85rem; }

  /* Show user name hidden on small */
  .topbar-user span:first-of-type { display: none; }
  .topbar-user .badge { display: none; }

  /* Stat cards: 2 per row */
  .stat-card { padding: .85rem .75rem; gap: .65rem; }
  .stat-icon  { width: 40px; height: 40px; font-size: 1.1rem; }
  .stat-value { font-size: 1.3rem; }
  .stat-label { font-size: .7rem; }

  /* Card box header: stack if needed */
  .card-box-header { font-size: .85rem; }

  /* Project cards: full width on mobile */
  .proj-card-top { padding: 10px 12px; }
  .proj-name { font-size: .85rem; }

  /* Modal full screen on mobile */
  .modal-dialog { margin: 0; max-width: 100%; }
  .modal-content { border-radius: 0; min-height: 100dvh; }
  .modal-dialog.modal-lg { margin: 0; max-width: 100%; }

  /* Table - horizontal scroll */
  .table { font-size: .8rem; }
  .table td, .table thead th { padding: .5rem .6rem; }

  /* Hours presets - smaller */
  .hrs-preset { padding: 4px 9px; font-size: .75rem; }

  /* File name shorter */
  .file-name { max-width: 140px; }

  /* PM badge */
  .pm-badge { font-size: .72rem; padding: 2px 8px; }

  /* Login card */
  .login-card { padding: 1.5rem 1.25rem; }

  /* Project detail header */
  .proj-detail-header { padding: 12px; }
}

/* ---- Tablet (768px – 991px) ---- */
@media (min-width: 768px) and (max-width: 991.98px) {

  /* Sidebar hidden, hamburger visible */
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }

  .topbar-user span:first-of-type { display: inline; }

  /* Stat cards: 2 per row */
  .stat-card { gap: .75rem; }
  .stat-value { font-size: 1.45rem; }

  /* Modals: centered, not full screen */
  .modal-dialog { margin: 1.5rem auto; }
  .modal-content { border-radius: var(--radius); min-height: auto; }
}

/* ---- Laptop/Desktop (≥ 992px) ---- */
@media (min-width: 992px) {

  /* Sidebar always visible */
  .sidebar { transform: translateX(0) !important; }
  .sidebar-overlay { display: none !important; }
  .main-content { margin-left: var(--sidebar-w); }

  /* Sidebar toggle button hidden */
  #sidebarToggle { display: none !important; }

  /* Show username in topbar */
  .topbar-user span:first-of-type { display: inline; }

  /* Stat values larger */
  .stat-value { font-size: 1.7rem; }

  /* Modal: proper size */
  .modal-content { border-radius: var(--radius); min-height: auto; }
}

/* ---- Large Desktop (≥ 1400px) ---- */
@media (min-width: 1400px) {
  .page-content { padding: 1.75rem 2rem; }
  .stat-value { font-size: 1.85rem; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .page-footer, .btn,
  .card-box-header .btn-group, .proj-actions { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { font-size: 12px; }
}

/* ---------- Scroll to Top Button (mobile) ---------- */
.scroll-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.25rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(79,70,229,.4);
  z-index: 888;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background .2s;
}
.scroll-top-btn:hover { background: var(--primary-dark); }

/* ---------- Mobile-specific task/project tweaks ---------- */
@media (max-width: 575.98px) {
  /* Stat cards: always 2-col on very small */
  .row.g-3 > .col-sm-6 { flex: 0 0 50%; max-width: 50%; }

  /* Project cards: 1 col on very small */
  .row.g-3 > .col-sm-6.col-xl-4 { flex: 0 0 100%; max-width: 100%; }

  /* Card box header: stack */
  .card-box-header { flex-direction: column; align-items: flex-start; }
  .card-box-header > :last-child { align-self: flex-end; }

  /* Page title smaller */
  h4 { font-size: 1.05rem; }
  h5 { font-size: .95rem; }

  /* Topbar: show only icon for user */
  .topbar-user i { font-size: 1.6rem; }

  /* Login card: tighter */
  .login-card { padding: 1.25rem 1rem; }
  .login-brand h4 { font-size: 1.1rem; }

  /* Table action buttons: smaller */
  .table .btn-sm { padding: .25rem .45rem; }

  /* Hours presets: 4 per row max */
  .hours-presets { gap: 5px; }
  .hrs-preset { padding: 4px 8px; font-size: .73rem; }
}

/* ---------- Bottom nav bar (mobile only) ---------- */
@media (max-width: 767.98px) {
  .mobile-nav-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 950;
    box-shadow: 0 -2px 10px rgba(0,0,0,.08);
  }
  .mobile-nav-bar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .5rem .25rem .4rem;
    color: var(--muted);
    text-decoration: none;
    font-size: .6rem;
    font-weight: 600;
    gap: 2px;
    transition: color .15s;
  }
  .mobile-nav-bar a i { font-size: 1.25rem; }
  .mobile-nav-bar a.active,
  .mobile-nav-bar a:hover { color: var(--primary); }
  /* Add bottom padding to page content so bar doesn't overlap */
  .page-content { padding-bottom: 72px; }
  /* Hide scroll-to-top when mobile nav visible */
  .scroll-top-btn { bottom: 4.5rem; }
}

/* ---------- PM Work Cards (admin) ---------- */
.pm-work-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  box-shadow: var(--shadow);
}
.pm-work-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.1); transform: translateY(-2px); }
.pm-work-top {
  display: flex; align-items: center; gap: .75rem;
  padding: 14px 14px 12px;
  border-bottom: 1px solid #f1f3f6;
}
.pm-avatar {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800;
  flex-shrink: 0;
}
.pm-work-info { flex: 1; min-width: 0; }
.pm-work-name { font-weight: 700; font-size: .92rem; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-work-pos  { font-size: .75rem; color: var(--muted); }
.pm-work-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid #f1f3f6;
  padding: .5rem 0;
}
.pm-stat { text-align: center; padding: .5rem .25rem; }
.pm-stat-val { font-size: 1.15rem; font-weight: 800; }
.pm-stat-lbl { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

@media (max-width: 575px) {
  .pm-work-stats { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Admin Profile Avatar ---------- */
.admin-avatar {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(79,70,229,.35);
}

/* =====================================================
   Workflow Stepper
   ===================================================== */

.workflow-stepper {
  display: flex;
  align-items: flex-start;
  padding: 1.1rem 1rem;
  gap: 0;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wf-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 72px;
}

.wf-dot {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #f9fafb;
  color: #9ca3af;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: all .2s;
  position: relative;
  z-index: 1;
}
.wf-step.done .wf-dot {
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.wf-step.current .wf-dot {
  color: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,1), 0 0 0 6px currentColor;
  animation: pulse-ring 1.8s ease-in-out infinite;
}
.wf-step.upcoming .wf-dot { opacity: .45; }

.wf-label {
  font-size: .68rem;
  font-weight: 700;
  text-align: center;
  color: #6b7280;
  line-height: 1.2;
  max-width: 72px;
}
.wf-step.done    .wf-label { color: #374151; }
.wf-step.current .wf-label { color: var(--primary); }

.wf-line {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  margin: 19px 0 0;
  min-width: 20px;
  transition: background .3s;
}
.wf-line.done { background: #10b981; }

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 4px #fff, 0 0 0 6px rgba(79,70,229,.6); }
  70%  { box-shadow: 0 0 0 4px #fff, 0 0 0 10px rgba(79,70,229,.0); }
  100% { box-shadow: 0 0 0 4px #fff, 0 0 0 6px rgba(79,70,229,.6); }
}

/* Mobile stepper */
@media (max-width: 575px) {
  .wf-step  { min-width: 56px; }
  .wf-dot   { width: 32px; height: 32px; font-size: .82rem; }
  .wf-label { font-size: .6rem; max-width: 56px; }
  .wf-line  { min-width: 12px; }
}

/* =====================================================
   Status Badges (new workflow)
   ===================================================== */

.status-pending    { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.status-inprogress { background: #dbeafe; color: #1d4ed8; }
.status-review     { background: #ede9fe; color: #6d28d9; }
.status-qa         { background: #fef3c7; color: #b45309; }
.status-done       { background: #dcfce7; color: #166534; }

/* Workflow role info box */
.workflow-role-info {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .75rem 1rem;
  background: #f8faff;
  border-radius: 8px;
  border: 1px solid #e0e7ff;
  font-size: .8rem;
  margin-bottom: .75rem;
}
.wf-role-step {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: #4b5563;
}
.wf-role-step i { font-size: .9rem; }
.wf-arrow { color: #9ca3af; font-size: .75rem; }

/* =====================================================
   Priority Badges (Critical, High, Medium, Low)
   ===================================================== */
.priority-critical { background:#fef2f2; color:#991b1b; border:1px solid #fca5a5; }
.priority-high     { background:#fff1f2; color:#be123c; border:1px solid #fda4af; }
.priority-medium   { background:#fffbeb; color:#92400e; border:1px solid #fcd34d; }
.priority-low      { background:#f0fdf4; color:#166534; border:1px solid #86efac; }

/* Critical pulse animation on task rows */
.priority-critical-row { border-left: 3px solid #dc2626 !important; }

/* =====================================================
   Task Labels
   ===================================================== */
.labels-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 4px;
}
.label-chip-check input { display: none; }
.label-chip-check input:checked + .label-chip {
  opacity: 1;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px currentColor;
}
.label-chip {
  display: inline-flex;
  align-items: center;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  border: 1.5px solid;
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s, box-shadow .15s;
  user-select: none;
}
.label-chip:hover { opacity: .85; }

.label-tag {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
  border: 1px solid;
}

/* =====================================================
   Task Checklist
   ===================================================== */
.cl-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .45rem .5rem;
  border-radius: 8px;
  transition: background .15s;
  margin-bottom: 2px;
}
.cl-item:hover { background: #f9fafb; }
.cl-item.done .cl-title { text-decoration: line-through; color: #9ca3af; }
.cl-item.done .cl-check i { color: #16a34a; }

.cl-check {
  background: none; border: none; padding: 0;
  font-size: 1.1rem; color: #d1d5db; cursor: pointer;
  flex-shrink: 0; transition: color .15s;
  line-height: 1;
}
.cl-check:hover { color: #4f46e5; }

.cl-title { flex: 1; font-size: .88rem; color: #374151; }

.cl-delete {
  background: none; border: none; padding: 0 4px;
  font-size: .75rem; color: #d1d5db; cursor: pointer;
  opacity: 0; transition: opacity .15s, color .15s;
}
.cl-item:hover .cl-delete { opacity: 1; }
.cl-delete:hover { color: #dc2626; }

/* =====================================================
   Task Comments
   ===================================================== */
.comment-item {
  display: flex; gap: .75rem;
  margin-bottom: 1rem;
}
.comment-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 800; flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-header {
  display: flex; align-items: center; gap: .4rem;
  flex-wrap: wrap; margin-bottom: 4px;
}
.comment-name  { font-weight: 700; font-size: .85rem; color: #111827; }
.comment-role  { font-size: .68rem; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.comment-time  { font-size: .72rem; color: #9ca3af; }
.comment-text  { font-size: .86rem; color: #374151; line-height: 1.6; background:#f9fafb; padding:.6rem .8rem; border-radius:8px; }
.comment-del   {
  background:none;border:none;padding:2px 4px;font-size:.75rem;
  color:#d1d5db;cursor:pointer;opacity:0;transition:opacity .15s,color .15s;
}
.comment-item:hover .comment-del { opacity:1; }
.comment-del:hover { color:#dc2626; }

@media (max-width:575px) {
  .comment-avatar { width:30px;height:30px;font-size:.8rem; }
  .comment-text   { padding:.5rem .65rem;font-size:.82rem; }
}

/* =====================================================
   Developer Monitoring
   ===================================================== */

/* Online/Away/Offline dot */
.mon-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; border: 2px solid #fff;
  flex-shrink: 0;
}
.mon-dot.online  { background: #22c55e; box-shadow: 0 0 6px #22c55e88; }
.mon-dot.away    { background: #f59e0b; }
.mon-dot.offline { background: #d1d5db; }

/* Status pill */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 700;
}
.status-pill.online  { background: #dcfce7; color: #166534; }
.status-pill.away    { background: #fef3c7; color: #92400e; }
.status-pill.offline { background: #f3f4f6; color: #6b7280; }

.mon-status-text { font-size: .75rem; font-weight: 600; margin-top: 2px; }
.mon-status-text.online  { color: #16a34a; }
.mon-status-text.away    { color: #d97706; }
.mon-status-text.offline { color: #9ca3af; }

/* Monitoring card */
.mon-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: box-shadow .2s, transform .15s;
  box-shadow: var(--shadow);
}
.mon-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.1); transform: translateY(-2px); }

.mon-card-top {
  display: flex; align-items: center; gap: .75rem;
  padding: 14px;
  border-bottom: 1px solid #f1f3f6;
}
.mon-avatar-wrap { position: relative; flex-shrink: 0; }
.mon-avatar {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg,#4f46e5,#7c3aed);
  color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem; font-weight: 800;
}
.mon-avatar-wrap .mon-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 12px; height: 12px; border: 2px solid #fff;
}
.mon-card-info { flex: 1; min-width: 0; }
.mon-name { font-weight: 700; font-size: .9rem; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-pos  { font-size: .72rem; color: #9ca3af; }
.mon-score-badge {
  font-size: 1.3rem; font-weight: 900;
  padding: 4px 12px; border-radius: 10px;
  flex-shrink: 0;
}
.mon-stats-row {
  display: grid; grid-template-columns: repeat(4,1fr);
  border-bottom: 1px solid #f1f3f6; padding: .5rem 0;
}
.mon-stat { text-align: center; padding: .4rem .25rem; }
.mon-stat-v { font-size: 1.1rem; font-weight: 800; }
.mon-stat-l { font-size: .62rem; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; }

/* Timesheet rows */
.timesheet-row {
  display: grid; grid-template-columns: 100px 1fr 55px 90px;
  align-items: center; gap: .75rem;
  padding: .35rem 0;
  font-size: .8rem;
}
.timesheet-row.today { background: #f0f4ff; border-radius: 6px; padding: .35rem .5rem; }
.timesheet-day  { color: #374151; font-weight: 600; white-space: nowrap; }
.timesheet-bar-wrap { background: #f3f4f6; border-radius: 4px; height: 8px; overflow: hidden; }
.timesheet-bar  { height: 100%; border-radius: 4px; transition: width .4s ease; }
.timesheet-time { font-weight: 700; color: #4f46e5; text-align: right; }
.timesheet-range { color: #9ca3af; font-size: .72rem; }

@media (max-width: 575px) {
  .timesheet-row { grid-template-columns: 80px 1fr 45px; }
  .timesheet-range { display: none; }
  .mon-stats-row { grid-template-columns: repeat(4,1fr); }
}

/* =====================================================
   Notification Bell & Dropdown
   ===================================================== */

.notif-bell-wrap { position: relative; }
.notif-bell-btn {
  background: none; border: none; cursor: pointer;
  padding: .4rem .5rem; border-radius: 8px; position: relative;
  color: #6b7280; font-size: 1.15rem; transition: background .15s, color .15s;
}
.notif-bell-btn:hover { background: #f1f5f9; color: var(--primary); }

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

.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: -8px;
  width: 340px; max-height: 480px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  border: 1px solid var(--border);
  z-index: 9999;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.notif-dropdown-header {
  padding: .85rem 1rem .75rem;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: .88rem; flex-shrink: 0;
}
.notif-dropdown-footer {
  padding: .65rem 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .8rem; flex-shrink: 0;
}
.notif-dropdown-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* Scrollable list inside dropdown */
#notifList { overflow-y: auto; max-height: 360px; }

/* Single notification item */
.notif-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .75rem 1rem;
  text-decoration: none; color: inherit;
  border-bottom: 1px solid #f9fafb;
  position: relative; transition: background .12s;
}
.notif-item:hover { background: #f8faff; }
.notif-item.unread { background: #fafbff; }
.notif-item.read    { opacity: .75; }

.notif-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.notif-body   { flex: 1; min-width: 0; }
.notif-title  { font-size: .82rem; font-weight: 700; color: #111827; line-height: 1.3; }
.notif-msg    { font-size: .76rem; color: #6b7280; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time   { font-size: .7rem; color: #9ca3af; margin-top: 3px; }
.notif-unread-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #4f46e5;
  flex-shrink: 0; margin-top: 4px;
}
.notif-empty {
  padding: 2rem 1rem; text-align: center;
  color: #9ca3af; font-size: .85rem;
}

/* Full notifications page items */
.notif-page-item {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #f3f4f6;
  transition: background .12s;
}
.notif-page-item:last-child { border-bottom: none; }
.notif-page-item.unread { background: #fafbff; border-left: 3px solid #4f46e5; }
.notif-page-item:hover { background: #f8faff; }
.notif-page-item .notif-icon { width: 42px; height: 42px; border-radius: 12px; font-size: 1.05rem; }
.notif-page-item .notif-title { font-size: .88rem; }
.notif-page-item .notif-msg   { white-space: normal; }
.notif-page-item .notif-time  { font-size: .75rem; margin-top: 4px; }

/* Spin animation */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 1s linear infinite; }

/* Mobile: dropdown full width */
@media (max-width: 575px) {
  .notif-dropdown { width: calc(100vw - 1rem); right: -1rem; }
}

/* =====================================================
   Scope of Work (SOW)
   ===================================================== */

/* SOW Badge */
.sow-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 6px;
  font-size: .65rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  background: #4f46e5; color: #fff;
}
.sow-badge-dev { background: #7c3aed; }

/* ── Form Styles ─────────────────────────────────── */
.sow-form-wrap {
  border: 1.5px solid #e0e7ff; border-radius: 12px;
  overflow: hidden; margin-bottom: 1rem;
  background: #fafbff;
}
.sow-form-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; background: #f0f4ff;
  border-bottom: 1px solid #e0e7ff; gap: .5rem; flex-wrap: wrap;
}
.sow-form-label {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: .9rem; color: #1e1b4b;
}
.sow-form-actions { display: flex; gap: .4rem; }
.sow-hint {
  margin: .5rem 1rem .4rem; font-size: .78rem;
  color: #6b7280; line-height: 1.5;
}
.sow-editor {
  border: none !important; border-radius: 0 !important;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: .82rem; line-height: 1.7;
  resize: vertical; min-height: 220px;
  background: #fff;
  padding: .85rem 1rem !important;
  box-shadow: none !important;
}
.sow-editor:focus { box-shadow: none !important; outline: none; }
.sow-toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: .4rem .75rem;
  border-top: 1px solid #e0e7ff; background: #f8faff;
}
.sow-tb-btn {
  background: none; border: 1px solid #d1d5db;
  border-radius: 5px; width: 28px; height: 26px;
  cursor: pointer; font-size: .78rem; color: #374151;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.sow-tb-btn:hover { background: #e0e7ff; border-color: #a5b4fc; }
.sow-char-count { margin-left: auto; font-size: .7rem; color: #9ca3af; }
.sow-preview-box {
  padding: 1rem; min-height: 200px;
  border-top: 1px solid #e0e7ff; background: #fff;
}

/* ── Display Styles ──────────────────────────────── */
.sow-display-card {
  background: #fff; border: 1.5px solid #e0e7ff;
  border-radius: 12px; overflow: hidden;
  margin-bottom: 1rem; box-shadow: 0 1px 6px rgba(79,70,229,.06);
}
.sow-display-card.sow-dev-priority {
  border-color: #7c3aed;
  box-shadow: 0 2px 12px rgba(124,58,237,.12);
}
.sow-display-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  background: linear-gradient(135deg, #f0f4ff, #faf5ff);
  border-bottom: 1px solid #e0e7ff;
  gap: .5rem; flex-wrap: wrap;
}
.sow-display-title {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 700; font-size: .92rem; color: #1e1b4b;
}
.sow-display-body { padding: 1.25rem 1.1rem; }

/* SOW Markdown elements */
.sow-h1 { font-size: .95rem; font-weight: 800; color: #1e1b4b; margin: .75rem 0 .3rem; padding-bottom: 4px; border-bottom: 2px solid #e0e7ff; }
.sow-h2 { font-size: .85rem; font-weight: 700; color: #4f46e5; margin: .85rem 0 .25rem; text-transform: uppercase; letter-spacing: .04em; }
.sow-p  { font-size: .88rem; color: #374151; margin: 0 0 .4rem; line-height: 1.65; }
.sow-br { height: 6px; }

.sow-list { padding-left: 1.1rem; margin: .2rem 0 .6rem; }
.sow-list li { font-size: .88rem; color: #374151; line-height: 1.6; margin-bottom: 3px; }
.sow-checklist { list-style: none; padding-left: .25rem; }
.sow-check-item { display: flex; align-items: flex-start; gap: .5rem; }
.sow-cb { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }
.sow-cb.checked { color: #16a34a; }
.sow-cb:not(.checked) { color: #d1d5db; }
.sow-checked-text { text-decoration: line-through; color: #9ca3af; }
.sow-code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-size: .8rem; color: #4f46e5; }

/* Empty SOW state */
.sow-empty {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem;
  background: #fafbff; border: 1.5px dashed #c7d2fe;
  border-radius: 10px; margin-bottom: 1rem;
  font-size: .85rem; color: #6b7280;
}
.sow-empty i { font-size: 1.2rem; color: #a5b4fc; }

@media (max-width: 575px) {
  .sow-form-header { flex-direction: column; align-items: flex-start; }
  .sow-display-header { flex-direction: column; align-items: flex-start; }
}

/* =====================================================
   Professional Task Form (Jira/ClickUp Style)
   ===================================================== */

.task-form-topbar {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: .75rem 0; flex-wrap: wrap; gap: .5rem;
  position: sticky; top: 60px; z-index: 100;
  background: #f4f6fb;
  border-bottom: 1px solid var(--border);
  margin-bottom: .25rem;
}

.task-props-panel {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem;
  position: sticky; top: 110px;
}

/* Structured content editor */
.task-content-editor { display: flex; flex-direction: column; gap: .75rem; }
.tce-section {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: border-color .15s;
}
.tce-section:focus-within { border-color: #818cf8; }
.tce-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-bottom: 1px solid #f1f3f6;
  flex-wrap: wrap;
}
.tce-icon-wrap {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.tce-title { font-weight: 700; font-size: .9rem; color: #111827; }
.tce-hint  { font-size: .75rem; color: #9ca3af; }
.tce-textarea {
  width: 100%; border: none !important; outline: none;
  padding: .85rem 1rem; font-size: .88rem; line-height: 1.7;
  resize: vertical; background: transparent;
  box-shadow: none !important; border-radius: 0 !important;
  color: #374151;
}
.tce-bullet-editor { font-family: 'Segoe UI', sans-serif; }
.tce-editor-wrap { position: relative; }
.tce-preview-badge {
  position: absolute; bottom: 8px; right: 10px;
  font-size: .65rem; padding: 2px 8px; border-radius: 10px;
  background: #f3f4f6; color: #9ca3af; pointer-events: none;
}
.tce-prefix-btn {
  background: none; border: 1px solid #d1d5db;
  border-radius: 6px; padding: 3px 10px;
  font-size: .75rem; font-weight: 600; color: #374151;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.tce-prefix-btn:hover { background: #f0f4ff; border-color: #818cf8; color: #4f46e5; }
.tce-prefix-green:hover { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.tce-prefix-amber:hover { background: #fffbeb; border-color: #fcd34d; color: #d97706; }
.tce-section-notes { opacity: .85; }

/* =====================================================
   Task View — Professional Card Layout
   ===================================================== */

.task-view-header { padding: 0; }
.task-view-title  { font-size: 1.3rem; font-weight: 800; color: #111827; margin-top: .35rem; }

/* Section cards */
.task-section-card {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 12px; overflow: hidden;
  margin-bottom: .75rem; box-shadow: var(--shadow);
}
.ts-card-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-bottom: 1px solid #f1f3f6;
  flex-wrap: wrap;
}
.ts-icon-wrap {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.ts-title { font-weight: 700; font-size: .9rem; color: #111827; flex: 1; }
.ts-edit-btn {
  color: #9ca3af; text-decoration: none; font-size: .85rem;
  padding: 4px 8px; border-radius: 6px;
  transition: background .15s, color .15s;
}
.ts-edit-btn:hover { background: #f3f4f6; color: var(--primary); }
.ts-body { padding: 1rem 1.1rem; }
.ts-objective-text {
  font-size: .95rem; color: #1f2937; line-height: 1.75;
  font-weight: 500; margin: 0;
  background: linear-gradient(135deg,#f0f4ff,#faf5ff);
  padding: .85rem 1rem; border-radius: 8px; border-left: 3px solid #6366f1;
}
.ts-empty { color: #9ca3af; font-size: .85rem; margin: 0; }
.ts-empty i { margin-right: .3rem; }

/* Scope of Work bullets */
.sow-bullet-list { list-style: none; padding: 0; margin: 0; }
.sow-bullet-list li {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .3rem 0; font-size: .88rem; color: #374151; line-height: 1.55;
  border-bottom: 1px solid #f9fafb;
}
.sow-bullet-list li:last-child { border-bottom: none; }
.sow-bullet-list li::before {
  content: '•'; color: #7c3aed; font-weight: 900;
  font-size: 1rem; flex-shrink: 0; margin-top: 1px;
}

/* Deliverables */
.deliverable-list { list-style: none; padding: 0; margin: 0; }
.deliverable-list li {
  display: flex; align-items: flex-start; gap: .55rem;
  padding: .3rem 0; font-size: .88rem; color: #374151;
  border-bottom: 1px solid #f9fafb;
}
.deliverable-list li:last-child { border-bottom: none; }
.deliverable-list li i { color: #16a34a; font-size: .95rem; flex-shrink: 0; margin-top: 2px; }

/* Acceptance Criteria */
.ac-list { list-style: none; padding: 0; margin: 0; }
.ac-list li {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .35rem 0; font-size: .88rem; color: #374151;
  border-bottom: 1px solid #f9fafb;
}
.ac-list li:last-child { border-bottom: none; }
.ac-list li.ac-done span { text-decoration: line-through; color: #9ca3af; }
.ac-checked   { color: #16a34a; font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.ac-unchecked { color: #d1d5db; font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* Files section in form */
.ts-files { border-color: #e5e7eb; }

@media (max-width: 991px) {
  .task-props-panel { position: static; }
  .task-form-topbar { position: static; }
}
@media (max-width: 575px) {
  .task-view-title { font-size: 1.05rem; }
  .ts-body { padding: .75rem; }
}

/* =====================================================
   Professional Task Form & View
   ===================================================== */

/* Form topbar */
.pro-form-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 0; flex-wrap: wrap; gap: .5rem;
  border-bottom: 1px solid var(--border); margin-bottom: 1rem;
}

/* Props panel */
.pro-props-panel {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  position: sticky; top: 70px;
}
.pro-props-title {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: #9ca3af; margin-bottom: .85rem;
}
.pro-label { font-size: .78rem; font-weight: 700; color: #374151; margin-bottom: .3rem; display: block; }

/* Task Type grid */
.task-type-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.task-type-option input { display: none; }
.task-type-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px; font-size: .72rem;
  font-weight: 700; cursor: pointer; border: 1.5px solid transparent;
  background: var(--tb); color: var(--tc);
  transition: all .15s; opacity: .55;
}
.task-type-option input:checked + .task-type-chip { opacity: 1; border-color: var(--tc); }
.task-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 6px;
  font-size: .78rem; font-weight: 700;
}

/* Time tracking */
.pro-time-section { background: #f8faff; border-radius: 8px; padding: .85rem; }
.time-track-grid  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.time-track-label { font-size: .68rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; display: block; margin-bottom: 3px; }
.time-stat-val    { font-size: 1.1rem; font-weight: 800; }
.time-stat-lbl    { font-size: .65rem; color: #9ca3af; text-transform: uppercase; }

/* Pro form tabs */
.pro-form-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb; padding-bottom: 0; list-style: none; margin: 0; }
.pro-tab-btn {
  display: flex; align-items: center; gap: .4rem;
  padding: .6rem 1rem; border: none; background: none;
  font-size: .83rem; font-weight: 600; color: #6b7280;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  cursor: pointer; border-radius: 8px 8px 0 0; transition: all .15s;
  font-family: inherit;
}
.pro-tab-btn:hover { color: var(--primary); background: #f0f4ff; }
.pro-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }

.pro-tab-pane { display: none; }
.pro-tab-pane.active { display: block; }

/* Pro editor cards */
.pro-editor-card {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.pro-editor-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-bottom: 1px solid #f1f3f6;
  flex-wrap: wrap;
}
.pro-editor-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0; }
.pro-editor-title { font-weight: 700; font-size: .9rem; color: #111827; }
.pro-editor-hint  { font-size: .75rem; color: #9ca3af; }

/* Quill editor area */
.quill-editor-area { min-height: 140px; }
.quill-editor-area .ql-editor { min-height: 120px; font-size: .88rem; font-family: 'Segoe UI', sans-serif; }
.ql-toolbar.ql-snow { border: none; border-bottom: 1px solid #f1f3f6; background: #fafbfc; }
.ql-container.ql-snow { border: none; }

/* Sortable list items */
.sortable-list { display: flex; flex-direction: column; gap: 6px; min-height: 48px; }
.sow-item-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .5rem; background: #f9fafb;
  border: 1px solid #e5e7eb; border-radius: 8px;
  transition: background .15s;
}
.sow-item-row:hover { background: #f0f4ff; border-color: #c7d2fe; }
.drag-handle {
  cursor: grab; color: #9ca3af; font-size: 1rem; flex-shrink: 0;
  padding: 2px 4px;
}
.drag-handle:active { cursor: grabbing; }

/* Task view header */
.tv-header { padding: 0; }
.tv-title   { font-size: 1.4rem; font-weight: 800; color: #111827; line-height: 1.3; }
.tv-meta    { font-size: .75rem; color: #9ca3af; }

/* Activity Timeline */
.activity-timeline { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; gap: .75rem; padding: .5rem 0;
  border-bottom: 1px solid #f9fafb; align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .82rem;
}
.activity-body { flex: 1; min-width: 0; }
.activity-action { font-size: .83rem; color: #374151; line-height: 1.4; }
.activity-details { font-size: .76rem; color: #6b7280; margin-top: 2px; }
.activity-time  { font-size: .7rem; color: #9ca3af; margin-top: 2px; }

/* QA section */
.qa-notes-box { background: #f9fafb; border-radius: 8px; padding: .6rem .8rem; font-size: .82rem; color: #374151; margin-bottom: .75rem; border: 1px solid #e5e7eb; }
.qa-result-opt {
  flex: 1; text-align: center; padding: .4rem;
  border-radius: 8px; border: 1.5px solid #e5e7eb;
  cursor: pointer; font-size: .82rem; font-weight: 700;
  transition: all .15s;
}
.qa-result-opt:has(input:checked) { border-color: currentColor; }
.qa-pass { color: #16a34a; } .qa-pass:has(input:checked) { background: #dcfce7; }
.qa-fail { color: #dc2626; } .qa-fail:has(input:checked) { background: #fee2e2; }

/* Dependencies */
.dep-item { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid #f9fafb; }
.dep-item:last-child { border-bottom: none; }
.dep-info { flex: 1; min-width: 0; }
.dep-title { font-size: .82rem; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-search-results { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; max-height: 180px; overflow-y: auto; }
.dep-result-item { padding: .5rem .75rem; cursor: pointer; font-size: .82rem; border-bottom: 1px solid #f9fafb; display: flex; align-items: center; }
.dep-result-item:hover { background: #f0f4ff; }
.dep-result-item:last-child { border-bottom: none; }
.dep-no-result { padding: .75rem; text-align: center; color: #9ca3af; font-size: .82rem; }

/* Comment replies */
.replies-list { border-left: 2px solid #e0e7ff; }
.reply-item { display: flex; gap: .5rem; padding: .35rem 0; }
.reply-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; flex-shrink: 0; }
.reply-body { flex: 1; }
.reply-form { background: #f8faff; border-radius: 8px; padding: .5rem; }

@media (max-width: 991px) {
  .pro-props-panel { position: static; }
  .task-type-grid { gap: 4px; }
  .tv-title { font-size: 1.1rem; }
  .time-track-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 575px) {
  .pro-form-tabs { flex-wrap: wrap; }
  .pro-tab-btn { padding: .45rem .7rem; font-size: .78rem; }
  .tv-title { font-size: 1rem; }
}

/* ── SOW Interactive Checkboxes (Developer) ──────────── */
.sow-interactive { list-style: none; padding: 0; margin: 0; }
.sow-item {
  display: flex; padding: .35rem .1rem;
  border-bottom: 1px solid #f9fafb; transition: background .15s;
}
.sow-item:last-child { border-bottom: none; }
.sow-item:hover { background: #f8faff; border-radius: 6px; }
.sow-item.sow-done .sow-cb-text { text-decoration: line-through; color: #9ca3af; }

.sow-check-label {
  display: flex; align-items: flex-start; gap: .6rem;
  cursor: pointer; margin: 0; width: 100%;
}
.sow-check-label input[type=checkbox] { display: none; }
.sow-cb-box {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  border: 2px solid #d1d5db; background: #fff; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; color: #fff; transition: all .15s;
}
.sow-cb-input:checked ~ .sow-cb-box {
  background: #7c3aed; border-color: #7c3aed;
}
.sow-check-label:hover .sow-cb-box { border-color: #7c3aed; }
.sow-cb-text { font-size: .88rem; color: #374151; line-height: 1.5; flex: 1; }
.sow-dev-progress { background: #faf5ff; border-radius: 8px; padding: .5rem .75rem; }

/* ── SOW Checklist (Developer) ───────────────────────── */
.sow-cl-list { list-style:none; padding:0; margin:0; }
.sow-cl-item {
  padding:.4rem .25rem; border-bottom:1px solid #f3f4f6; transition:background .1s;
}
.sow-cl-item:last-child { border-bottom:none; }
.sow-cl-item:hover { background:#f8f5ff; border-radius:6px; }
.sow-cl-done .sow-cl-text { text-decoration:line-through; color:#9ca3af; }
.sow-cl-label {
  display:flex; align-items:flex-start; gap:.65rem;
  cursor:pointer; margin:0; width:100%; user-select:none;
}
.sow-cl-box {
  width:22px; height:22px; border-radius:6px; flex-shrink:0;
  border:2px solid #c4b5fd; background:#fff; margin-top:1px;
  display:flex; align-items:center; justify-content:center;
  font-size:.8rem; color:#fff; transition:all .15s;
}
.sow-cl-box.checked { background:#7c3aed; border-color:#7c3aed; }
.sow-cl-label:hover .sow-cl-box { border-color:#7c3aed; background:#ede9fe; }
.sow-cl-text { font-size:.88rem; color:#374151; line-height:1.5; flex:1; }
.sow-cl-foot {
  display:flex; align-items:center; gap:.6rem;
  background:#faf5ff; border-radius:8px; padding:.45rem .75rem; margin-top:.6rem;
}
.sow-cl-count { font-size:.75rem; font-weight:700; color:#7c3aed; white-space:nowrap; }

/* ── Simple task form ─────────────────────────────────── */
.task-simple-form { max-width: 720px; margin: 0 auto; padding-bottom: 2rem; }
.task-simple-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.task-simple-head-title { font-size: 1.35rem; font-weight: 800; color: #111827; vertical-align: middle; }
.task-simple-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 1.15rem 1.25rem; margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.task-simple-label {
  display: block; font-size: .72rem; font-weight: 800; color: #6b7280;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem;
}
.task-markdown-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem; line-height: 1.5; border-color: #c7d2fe !important;
  min-height: 280px;
}
.task-simple-foot {
  display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap;
  padding-top: .5rem;
}
.task-simple-more {
  margin-bottom: 1rem; font-size: .85rem; color: #6b7280;
}
.task-simple-more summary {
  cursor: pointer; font-weight: 600; color: #4f46e5; margin-bottom: .5rem;
}
.ai-dev-copy-card {
  border: 1px solid #c7d2fe;
  background: #f8faff;
  padding: .65rem 1rem;
}
.ai-dev-prompt { white-space: pre-wrap; word-break: break-word; }

/* ── Live chat ──────────────────────────────────────── */
.live-chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 1050;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: #059669; color: #fff; box-shadow: 0 4px 18px rgba(5,150,105,.45);
  font-size: 1.35rem; cursor: pointer;
}
.live-chat-fab-badge {
  position: absolute; top: -2px; right: -2px;
  background: #dc2626; color: #fff; font-size: .65rem; font-weight: 800;
  min-width: 20px; height: 20px; border-radius: 10px; line-height: 20px; text-align: center;
}
.live-chat-panel {
  position: fixed; right: 22px; bottom: 88px; z-index: 1049;
  width: min(420px, calc(100vw - 24px)); height: min(520px, calc(100vh - 120px));
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
  transform: translateY(12px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.live-chat-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.live-chat-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid #f1f3f6; background: #f0fdf4;
  border-radius: 14px 14px 0 0;
}
.live-chat-panel-title { font-weight: 800; color: #065f46; }
.live-chat-layout { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.live-chat-sidebar { display: none; }
.live-chat-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.live-chat-messages {
  flex: 1; overflow-y: auto; padding: .75rem 1rem; background: #fafafa;
}
.live-chat-msg { margin-bottom: .65rem; max-width: 92%; }
.live-chat-msg.mine { margin-left: auto; text-align: right; }
.live-chat-bubble {
  display: inline-block; padding: .45rem .65rem; border-radius: 12px;
  background: #fff; border: 1px solid #e5e7eb; font-size: .85rem; text-align: left;
  white-space: pre-wrap; word-break: break-word;
}
.live-chat-msg.mine .live-chat-bubble { background: #dcfce7; border-color: #86efac; }
.live-chat-time { font-size: .65rem; color: #9ca3af; margin-top: 2px; }
.live-chat-compose {
  display: flex; gap: .4rem; padding: .6rem .75rem; border-top: 1px solid #e5e7eb;
}
.live-chat-compose textarea { resize: none; flex: 1; }
.live-chat-empty { color: #9ca3af; font-size: .82rem; text-align: center; padding: 1rem .5rem; }
.mon-card-actions .btn { font-size: .78rem; }
.task-deadline-hint { background: #f8fafc; border-radius: 8px; padding: .5rem .65rem; }

@media (min-width: 768px) {
  .live-chat-panel { width: min(680px, calc(100vw - 40px)); }
  .live-chat-layout { flex-direction: row; }
  .live-chat-sidebar {
    display: flex; flex-direction: column; width: 38%; border-right: 1px solid #f1f3f6;
    max-height: 100%; overflow-y: auto;
  }
  .live-chat-sidebar-label { font-size: .68rem; font-weight: 800; color: #9ca3af; padding: .5rem .65rem; text-transform: uppercase; }
  .live-chat-thread {
    display: block; width: 100%; text-align: left; border: none; background: transparent;
    padding: .45rem .65rem; border-bottom: 1px solid #f9fafb; cursor: pointer;
  }
  .live-chat-thread:hover, .live-chat-thread.active { background: #ecfdf5; }
  .live-chat-thread-name { display: block; font-weight: 700; font-size: .82rem; color: #111827; }
  .live-chat-thread-preview { display: block; font-size: .72rem; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .live-chat-thread-badge { float: right; background: #dc2626; color: #fff; font-size: .65rem; padding: 1px 6px; border-radius: 8px; }
}
