/* ============================================================
   TaskFlow Pro — Modern Design System v2
   Dark sidebar + Indigo accent, mobile-first
   ============================================================ */

/* ── Google Fonts Extra Weights ──────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ───────────────────────────────────────── */
:root,
[data-theme="light"] {
  --bg-body:         #f1f5f9;
  --bg-sidebar:      #0f172a;
  --bg-sidebar-h:    rgba(22,105,166,0.15);
  --bg-card:         #ffffff;
  --bg-card-alt:     #f8fafc;
  --bg-input:        #ffffff;
  --bg-topbar:       #ffffff;
  --border-color:    #e2e8f0;
  --text-primary:    #0f172a;
  --text-secondary:  #475569;
  --text-muted:      #94a3b8;
  --text-sidebar:    rgba(255,255,255,0.65);
  --text-sidebar-h:  #ffffff;
  --accent:          #1669a6;
  --accent-hover:    #125890;
  --accent-light:    rgba(22,105,166,0.1);
  --success:         #10b981;
  --warning:         #f59e0b;
  --danger:          #ef4444;
  --info:            #06b6d4;
  --shadow-sm:       0 1px 2px rgba(0,0,0,0.05);
  --shadow:          0 1px 3px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-md:       0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg:       0 12px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-inset:    inset 0 1px 2px rgba(0,0,0,0.04);
  --radius-sm:       0.5rem;
  --radius:          0.875rem;
  --radius-lg:       1.25rem;
  --sidebar-width:   260px;
  --topbar-h:        64px;
  --transition:      0.2s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg-body:         #020617;
  --bg-sidebar:      #0a0f1e;
  --bg-sidebar-h:    rgba(22,105,166,0.2);
  --bg-card:         #0f172a;
  --bg-card-alt:     #1e293b;
  --bg-input:        #1e293b;
  --bg-topbar:       #0f172a;
  --border-color:    #1e293b;
  --text-primary:    #f1f5f9;
  --text-secondary:  #94a3b8;
  --text-muted:      #475569;
  --text-sidebar:    rgba(255,255,255,0.55);
  --text-sidebar-h:  #ffffff;
  --accent:          #1669a6;
  --accent-hover:    #1669a6;
  --accent-light:    rgba(22,105,166,0.1);
  --success:         #34d399;
  --warning:         #fbbf24;
  --danger:          #f87171;
  --info:            #22d3ee;
  --shadow-sm:       0 1px 2px rgba(0,0,0,0.3);
  --shadow:          0 1px 4px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
  --shadow-md:       0 4px 16px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.3);
  --shadow-lg:       0 12px 32px rgba(0,0,0,0.5);
  --shadow-inset:    inset 0 1px 2px rgba(0,0,0,0.3);
  --bg-topbar:       #0f172a;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }

/* ── Layout ──────────────────────────────────────────────── */
.layout-wrapper {
  display: block;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-sidebar);
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.main-content {
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page-content {
  flex: 1;
  padding: 1.75rem 2rem;
  max-width: 1400px;
  width: 100%;
}

/* ── Sidebar Brand ───────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.375rem 1.375rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, #1669a6 100%);
  border-radius: 10px;
  display: grid; place-items: center;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(22,105,166,0.4);
}
.brand-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.brand-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  margin-top: 1px;
}

/* ── Sidebar Nav ─────────────────────────────────────────── */
.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
}
.sidebar-section {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 0.5rem 0.75rem 0.4rem;
  margin-top: 0.25rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  color: var(--text-sidebar);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  margin-bottom: 2px;
}
.sidebar-link .nav-icon {
  width: 20px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.sidebar-link:hover {
  background: var(--bg-sidebar-h);
  color: var(--text-sidebar-h);
}
.sidebar-link:hover .nav-icon { opacity: 1; }
.sidebar-link.active {
  background: var(--bg-sidebar-h);
  color: var(--accent);
}
.sidebar-link.active .nav-icon { opacity: 1; color: var(--accent); }
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.badge-count {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  animation: pulse-badge 2s infinite;
  min-width: 20px;
  text-align: center;
}

/* ── Sidebar Footer ──────────────────────────────────────── */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  margin-top: auto;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #1669a6 100%);
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.8rem;
  color: white;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  text-transform: capitalize;
}
.sidebar-footer .logout-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: rgba(255,255,255,0.35);
  font-size: 0.85rem;
  transition: all var(--transition);
  flex-shrink: 0;
  text-decoration: none;
}
.sidebar-footer .logout-btn:hover {
  background: rgba(239,68,68,0.15);
  color: #f87171;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  height: var(--topbar-h);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.topbar-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all var(--transition);
  position: relative;
  flex-shrink: 0;
}
.btn-icon:hover {
  background: var(--bg-card-alt);
  color: var(--text-primary);
}
.notif-bell .badge-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-topbar);
  animation: pulse-bell 2s infinite;
}
@keyframes pulse-bell {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}
@keyframes pulse-icon {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

/* ── Notification Dropdown ───────────────────────────────── */
.notif-dropdown-menu {
  width: 340px;
  max-height: 480px;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
  padding: 0;
  z-index: 9999;
}
.topbar { overflow: visible; }
@media (max-width: 480px) {
  .notif-dropdown-menu { width: calc(100vw - 1rem); }
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}
.breadcrumb-item {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  color: var(--text-muted);
  opacity: 0.5;
}
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 500; }

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-body { padding: 1.25rem; }
.card-footer {
  background: var(--bg-card-alt);
  border-top: 1px solid var(--border-color);
  padding: 0.875rem 1.25rem;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.375rem 1.5rem;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #1669a6);
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card:hover::before { opacity: 1; }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1.125rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}
/* When used inline with rgba bg, text color may be colored not white */
.stat-icon[style*="color"] { /* already has color */ }
.stat-icon.bg-indigo   { background: linear-gradient(135deg, #1669a6, #1669a6); }
.stat-icon.bg-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.stat-icon.bg-amber    { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.stat-icon.bg-green    { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.bg-rose     { background: linear-gradient(135deg, #f43f5e, #ec4899); }
.stat-icon.bg-cyan     { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-link {
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5625rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #125890 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(22,105,166,0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #125890 100%);
  box-shadow: 0 4px 16px rgba(22,105,166,0.45);
  transform: translateY(-1px);
  color: white;
}
.btn-secondary {
  background: var(--bg-card-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-color);
  color: var(--text-primary);
}
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16,185,129,0.4);
  color: white;
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(239,68,68,0.4);
  color: white;
}
.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.btn-warning:hover { transform: translateY(-1px); color: white; }
.btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.btn-outline-secondary:hover {
  background: var(--bg-card-alt);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
}
.btn-outline-danger:hover {
  background: rgba(239,68,68,0.08);
  border-color: var(--danger);
  color: var(--danger);
}
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.btn-xs { padding: 0.25rem 0.625rem; font-size: 0.75rem; border-radius: 0.375rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; border-radius: var(--radius-sm); }
.btn-icon-only {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}
.form-label .text-danger { color: var(--danger); }
.form-control,
.form-select {
  display: block;
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.5625rem 0.875rem;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22,105,166,0.12);
  outline: none;
  background: var(--bg-input);
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.8; }
.form-text { font-size: 0.775rem; color: var(--text-muted); margin-top: 0.25rem; }
textarea.form-control { resize: vertical; min-height: 7rem; }
.form-select-sm,
.form-control-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
}
.input-group {
  display: flex;
}
.input-group .form-control,
.input-group .form-select {
  border-radius: 0;
  flex: 1;
}
.input-group > :first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group > :last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group > :only-child  { border-radius: var(--radius-sm); }
.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.5625rem 0.875rem;
  font-size: 0.875rem;
  background: var(--bg-card-alt);
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
}

/* ── Badges / Pills ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* Bootstrap text-bg variants */
.text-bg-danger  { background: rgba(239,68,68,0.12);  color: #dc2626; }
.text-bg-success { background: rgba(16,185,129,0.12); color: #059669; }
.text-bg-warning { background: rgba(245,158,11,0.12); color: #d97706; }
.text-bg-info    { background: rgba(6,182,212,0.12);  color: #0891b2; }
.text-bg-primary { background: rgba(22,105,166,0.12); color: #125890; }
.text-bg-secondary { background: rgba(100,116,139,0.12); color: #64748b; }

/* Priority badges */
.badge-priority-low      { background: rgba(16,185,129,0.1);  color: #059669; }
.badge-priority-medium   { background: rgba(59,130,246,0.1);  color: #2563eb; }
.badge-priority-high     { background: rgba(245,158,11,0.1);  color: #d97706; }
.badge-priority-urgent   { background: rgba(239,68,68,0.1);   color: #dc2626; }
.badge-priority-critical { background: rgba(124,17,17,0.12);  color: #991b1b; }

/* Status badges */
.badge-status-open        { background: rgba(59,130,246,0.1);  color: #2563eb; }
.badge-status-assigned    { background: rgba(22,105,166,0.1);  color: #1669a6; }
.badge-status-in_progress { background: rgba(245,158,11,0.1);  color: #d97706; }
.badge-status-completed   { background: rgba(16,185,129,0.1);  color: #059669; }
.badge-status-closed      { background: rgba(100,116,139,0.08);color: #64748b; }
.badge-status-on_hold     { background: rgba(236,72,153,0.1);  color: #be185d; }
.badge-status-cancelled   { background: rgba(239,68,68,0.08);  color: #dc2626; }
.badge-status-review      { background: rgba(22,105,166,0.1);  color: #125890; }

/* ── Tables ──────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text-primary);
  font-size: 0.875rem;
}
.table thead tr {
  background: var(--bg-card-alt);
  border-bottom: 2px solid var(--border-color);
}
.table th {
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid var(--border-color);
}
.table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.table tbody tr {
  transition: background var(--transition);
}
.table tbody tr:hover { background: var(--accent-light); }
.table tbody tr:last-child td { border-bottom: none; }
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}
.table-responsive .table { margin: 0; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid transparent;
  margin-bottom: 1rem;
}
.alert-success { background: rgba(16,185,129,0.08);  border-color: rgba(16,185,129,0.2);  color: #065f46; }
.alert-danger  { background: rgba(239,68,68,0.08);   border-color: rgba(239,68,68,0.2);   color: #991b1b; }
.alert-warning { background: rgba(245,158,11,0.08);  border-color: rgba(245,158,11,0.2);  color: #92400e; }
.alert-info    { background: rgba(6,182,212,0.08);   border-color: rgba(6,182,212,0.2);   color: #0c4a6e; }
[data-theme="dark"] .alert-success { color: #6ee7b7; }
[data-theme="dark"] .alert-danger  { color: #fca5a5; }
[data-theme="dark"] .alert-warning { color: #fcd34d; }
[data-theme="dark"] .alert-info    { color: #67e8f9; }

/* ── Dropdowns ───────────────────────────────────────────── */
.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.375rem;
  min-width: 180px;
  font-size: 0.875rem;
  animation: dropIn 0.15s ease-out;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  transition: all var(--transition);
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--accent-light);
  color: var(--accent);
}
.dropdown-item.text-danger:hover { background: rgba(239,68,68,0.08); color: var(--danger); }
.dropdown-divider {
  border-color: var(--border-color);
  margin: 0.25rem 0;
}
.dropdown-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.75rem 0.25rem;
}

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.filter-bar .form-control,
.filter-bar .form-select {
  flex-shrink: 0;
  background: var(--bg-body);
  border-color: var(--border-color);
}
.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
  background: var(--bg-input);
}

/* ── Timeline ────────────────────────────────────────────── */
.timeline {
  list-style: none;
  padding: 0 0 0 2.25rem;
  margin: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0.6rem;
  top: 14px; bottom: 14px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  opacity: 0.2;
  border-radius: 2px;
}
.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-icon {
  position: absolute;
  left: -2.5rem;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.7rem;
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.timeline-icon.success   { background: linear-gradient(135deg, #10b981, #059669); }
.timeline-icon.primary   { background: linear-gradient(135deg, #1669a6, #125890); }
.timeline-icon.warning   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.timeline-icon.danger    { background: linear-gradient(135deg, #ef4444, #dc2626); }
.timeline-icon.info      { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.timeline-icon.secondary { background: linear-gradient(135deg, #64748b, #475569); }
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.timeline-card:hover { box-shadow: var(--shadow); }
.timeline-title { font-weight: 600; color: var(--text-primary); font-size: 0.875rem; }
.timeline-body  { color: var(--text-secondary); font-size: 0.875rem; margin-top: 0.375rem; white-space: pre-wrap; }
.timeline-meta  { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.375rem; }

/* ── Notification Cards ──────────────────────────────────── */
.notif-card {
  border-left: 3px solid transparent;
  transition: all var(--transition);
  border-radius: var(--radius-sm);
}
.notif-card.unread {
  border-left-color: var(--accent);
  background: var(--accent-light);
}
.notif-card:hover { background: var(--bg-card-alt); }
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse-bell 2s infinite;
  flex-shrink: 0;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.125rem 1.375rem;
}
.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.375rem;
  gap: 0.5rem;
}
.modal-body { padding: 1.375rem; }
.modal-title { font-weight: 700; font-size: 1rem; }
.btn-close { filter: var(--bs-btn-close-filter, none); }
[data-theme="dark"] .btn-close { filter: invert(1); }

/* ── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  background: var(--bg-body);
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent) 0%, #1669a6 100%);
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  font-size: 1.375rem;
  color: white;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(22,105,166,0.35);
}
.login-logo h4 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}
.text-accent { color: var(--accent); }

/* ── Tabs (Settings) ─────────────────────────────────────── */
.nav-tabs {
  border-bottom: 2px solid var(--border-color);
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-tabs .nav-link {
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.75rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  white-space: nowrap;
  transition: all var(--transition);
}
.nav-tabs .nav-link:hover { color: var(--text-primary); background: transparent; }
.nav-tabs .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
  font-weight: 600;
}
.tab-content { padding-top: 1.25rem; }

/* ── Choices.js (single selects via .tf-choices) ─────────── */
.choices { width: 100%; margin: 0; }
.tf-choices { width: 100%; }
.tf-choices .choices__inner {
  background: var(--bg-input); border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 0.45rem 0.75rem;
  min-height: 2.75rem; font-size: 0.9rem; color: var(--text-primary);
  display: flex; align-items: center; cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tf-choices.is-focused .choices__inner,
.tf-choices.is-open .choices__inner {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
.tf-choices .choices__list--single { padding: 0; }
.tf-choices .choices__list--single .choices__item { color: var(--text-primary); font-size: 0.9rem; }
.tf-choices .choices__placeholder { color: var(--text-muted); }
.tf-choices .choices__list--dropdown {
  background: var(--bg-card); border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  margin-top: 0.375rem; z-index: 1050;
}
.tf-choices .choices__list--dropdown .choices__item {
  color: var(--text-primary); padding: 0.6rem 0.875rem; font-size: 0.875rem;
  transition: all var(--transition);
}
.tf-choices .choices__list--dropdown .choices__item--selectable:hover,
.tf-choices .choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: var(--accent-light); color: var(--accent);
}
.tf-choices .choices__list--dropdown .choices__item--selected {
  font-weight: 600; color: var(--accent);
}
.tf-choices .choices__input {
  background: var(--bg-card-alt) !important; color: var(--text-primary);
  border: none !important; border-bottom: 1px solid var(--border-color) !important;
  padding: 0.5rem 0.875rem !important; font-size: 0.875rem; font-family: inherit;
  width: 100% !important;
}

/* ── Choices.js Multi-select ─────────────────────────────── */
.choices { width: 100%; margin: 0; }
.choices.form-select-wrapper .choices__inner {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.625rem;
  min-height: 2.75rem;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: flex-start;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.choices.form-select-wrapper.is-focused .choices__inner {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22,105,166,0.12);
}
.choices.form-select-wrapper .choices__list--multiple .choices__item {
  background: linear-gradient(135deg, var(--accent), #125890);
  border: none;
  color: white;
  border-radius: 100px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  animation: badgePop 0.15s ease-out;
  box-shadow: 0 2px 6px rgba(22,105,166,0.25);
}
@keyframes badgePop {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
.choices.form-select-wrapper .choices__button {
  background: rgba(255,255,255,0.25);
  border: none;
  color: white;
  padding: 0 0.3rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background var(--transition);
  border-radius: 50%;
}
.choices.form-select-wrapper .choices__button:hover { background: rgba(255,255,255,0.45); }
.choices.form-select-wrapper .choices__list--dropdown {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  margin-top: 0.5rem;
  z-index: 1050;
  max-height: 280px;
  overflow: hidden;
}
.choices.form-select-wrapper .choices__list--dropdown .choices__item {
  color: var(--text-primary);
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  transition: all var(--transition);
}
.choices.form-select-wrapper .choices__list--dropdown .choices__item--selectable:hover,
.choices.form-select-wrapper .choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: var(--accent-light);
  color: var(--accent);
}
.choices.form-select-wrapper .choices__input {
  background: transparent !important;
  color: var(--text-primary);
  border: none !important;
  padding: 0.2rem 0.25rem;
  font-size: 0.875rem;
  min-width: 120px;
  font-family: inherit;
}
.choices.form-select-wrapper .choices__placeholder { color: var(--text-muted); }
.choices.form-select-wrapper .choices__search-duplicate,
.choices.form-select-wrapper .choices__search {
  border-bottom: 1px solid var(--border-color) !important;
  padding: 0.625rem 0.875rem !important;
  background: var(--bg-card-alt) !important;
}

/* ── Sidebar Mobile Overlay ──────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.6);
  z-index: 998;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ── Utilities ───────────────────────────────────────────── */
.d-flex             { display: flex !important; }
.d-grid             { display: grid !important; }
.d-none             { display: none !important; }
.d-block            { display: block !important; }
.d-inline-flex      { display: inline-flex !important; }
.flex-1             { flex: 1; }
.flex-wrap          { flex-wrap: wrap; }
.flex-column        { flex-direction: column; }
.gap-1              { gap: 0.25rem; }
.gap-2              { gap: 0.5rem; }
.gap-3              { gap: 1rem; }
.gap-4              { gap: 1.5rem; }
.align-items-center { align-items: center; }
.align-items-start  { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center  { justify-content: center; }
.justify-content-end     { justify-content: flex-end; }
.ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.p-0  { padding: 0; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.text-muted     { color: var(--text-muted) !important; }
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-accent    { color: var(--accent) !important; }
.text-danger    { color: var(--danger) !important; }
.text-success   { color: var(--success) !important; }
.text-warning   { color: var(--warning) !important; }
.text-white     { color: #fff !important; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-bold { font-weight: 700; }
.small  { font-size: 0.8125rem; }
.text-center { text-align: center; }
.text-end    { text-align: right; }
.text-start  { text-align: left; }
.text-uppercase { text-transform: uppercase; }
.text-decoration-none { text-decoration: none; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.w-100 { width: 100%; }
.rounded { border-radius: var(--radius-sm); }
.rounded-full { border-radius: 100px; }
.overflow-hidden { overflow: hidden; }
.position-relative { position: relative; }

/* ── Bootstrap Grid — let Bootstrap CDN handle all col-* ─── */
/* Only override row gap spacing to match our design tokens */
.row.g-3 > * { padding: 0.75rem; }
.row.g-4 > * { padding: 1rem; }

.d-lg-none { display: block; }
@media (min-width: 992px) {
  .d-lg-none  { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex  { display: flex !important; }
}

/* ── Settings Sidebar Nav ────────────────────────────────── */
.settings-nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.settings-nav-link i {
  width: 18px;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.6;
  flex-shrink: 0;
}
.settings-nav-link:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.settings-nav-link:hover i { opacity: 1; }
.settings-nav-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.settings-nav-link.active i { opacity: 1; }

/* ── Mobile Responsive ───────────────────────────────────── */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.show {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-content {
    margin-left: 0;
  }
  .layout-wrapper {
    grid-template-columns: 1fr;
  }
  .page-content {
    padding: 1.25rem 1rem;
  }
  .page-header h1 { font-size: 1.375rem; }
  .notif-dropdown-menu { width: 300px; }
  .filter-bar {
    padding: 0.875rem 1rem;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .filter-bar input[type="text"] { min-width: 150px; }
}

@media (max-width: 575px) {
  .page-content { padding: 1rem 0.875rem; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header .btn { justify-content: center; }
  .stat-card { padding: 1rem 1.125rem; }
  .stat-value { font-size: 1.625rem; }
  .card-body { padding: 1rem; }
  .login-card { padding: 2rem 1.375rem; }
  .table th, .table td { padding: 0.625rem 0.75rem; }
}

/* ── Two-Column Detail Layout ────────────────────────────── */
.two-col-detail {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 1100px) {
  .two-col-detail { grid-template-columns: 1fr; }
}

/* ── Detail Tabs ─────────────────────────────────────────── */
.detail-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-card);
  padding: 0 1.25rem;
  gap: 0;
}
.detail-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.detail-tab:hover { color: var(--text-primary); }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.detail-tab .tab-count {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.detail-tab.active .tab-count { background: var(--accent-light); border-color: transparent; color: var(--accent); }

/* ── Timeline Date Separator ─────────────────────────────── */
.timeline-date-sep {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.timeline-date-sep::before,
.timeline-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}
.timeline-date-sep span {
  background: var(--bg-card-alt);
  padding: 0.2rem 0.75rem;
  border-radius: 100px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

/* ── Comment Items ───────────────────────────────────────── */
.comment-item {
  display: flex;
  gap: 0.875rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border-color);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1669a6);
  display: grid; place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}
.comment-content { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.375rem; flex-wrap: wrap; justify-content: space-between; }
.comment-author { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.comment-role {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent);
}
.comment-time { font-size: 0.75rem; color: var(--text-muted); }
.comment-body { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.comment-internal-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: rgba(245,158,11,0.12);
  color: #d97706;
  font-weight: 600;
}
.comment-input-area {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card-alt);
}
.comment-input-area .comment-avatar { margin-top: 2px; }
.comment-input-box {
  flex: 1;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: inherit;
  resize: none;
  min-height: 40px;
  transition: border-color var(--transition);
}
.comment-input-box:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(22,105,166,0.1); }
.comment-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--accent), #125890);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  margin-top: 2px;
}
.comment-send-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22,105,166,0.3); }

/* ── Task Info Grid ───────────────────────────────────────── */
.task-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1rem;
}
.task-info-field {}
.task-info-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}
.task-info-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.task-info-value .mini-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1669a6);
  display: grid; place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.task-info-full { grid-column: 1 / -1; }

/* ── Status Pill Button (inline change) ──────────────────── */
.status-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem 0.3rem 0.5rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.status-pill-btn .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-pill-btn .caret { font-size: 0.65rem; opacity: 0.7; }

/* ── Time Info Grid ──────────────────────────────────────── */
.time-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.time-info-field {}
.time-info-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.time-info-label i { font-size: 0.75rem; }
.time-info-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}
.duration-badge {
  display: inline-block;
  padding: 0.2rem 0.625rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(16,185,129,0.12);
  color: #059669;
}

/* ── Assign / Approval Items ─────────────────────────────── */
.assign-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border-color);
}
.assign-item:last-child { border-bottom: none; }
.assign-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1669a6, #1669a6);
  display: grid; place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.assign-info { flex: 1; min-width: 0; }
.assign-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.assign-dates { font-size: 0.75rem; color: var(--text-muted); }
.assign-current {
  font-size: 0.7rem;
  padding: 0.2rem 0.625rem;
  border-radius: 100px;
  background: rgba(16,185,129,0.12);
  color: #059669;
  font-weight: 700;
}
.approval-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border-color);
}
.approval-item:last-child { border-bottom: none; }
.approval-status-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.approval-status-icon.approved { background: rgba(16,185,129,0.15); color: #059669; }
.approval-status-icon.pending  { background: rgba(245,158,11,0.15); color: #d97706; }
.approval-status-icon.rejected { background: rgba(239,68,68,0.15);  color: #dc2626; }

/* ── Attachment Items ────────────────────────────────────── */
.attachment-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border-color);
}
.attachment-item:last-child { border-bottom: none; }
.attachment-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  display: grid; place-items: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.attachment-info { flex: 1; min-width: 0; }
.attachment-name { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ── Info Section (legacy rows) ──────────────────────────── */
.info-section {}
.info-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); min-width: 120px; flex-shrink: 0; }
.info-value { font-size: 0.875rem; color: var(--text-primary); flex: 1; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 2rem; display: block; margin-bottom: 0.75rem; opacity: 0.3; }
.empty-state p { font-size: 0.875rem; margin: 0; }

/* ── User Picker ─────────────────────────────────────────── */
.user-picker { }
.user-search-wrap { position: relative; margin-bottom: 0.625rem; }
.user-search-wrap .search-icon {
  position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.75rem; pointer-events: none;
}
.user-search-input {
  width: 100%; padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text-primary); font-size: 0.875rem;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.user-search-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
.user-list {
  max-height: 224px; overflow-y: auto;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.user-option {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem; cursor: pointer;
  border-bottom: 1px solid var(--border-color); transition: background 0.12s;
  user-select: none;
}
.user-option:last-child { border-bottom: none; }
.user-option:hover { background: var(--bg-card-alt); }
.user-checkbox { display: none; }
.user-option:has(.user-checkbox:checked) { background: var(--accent-light); }
.user-option:has(.user-checkbox:checked) .user-check-icon { opacity: 1; transform: scale(1); }
.user-option:has(.user-checkbox:checked) .user-avatar-sm {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.user-avatar-sm {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff;
  text-transform: uppercase; transition: all 0.15s;
}
.user-info-sm { flex: 1; min-width: 0; }
.user-name-sm {
  display: block; font-size: 0.875rem; font-weight: 600;
  color: var(--text-primary); line-height: 1.2; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.user-emp-sm { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }
.user-check-icon {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; flex-shrink: 0; opacity: 0;
  transform: scale(0.6); transition: opacity 0.15s, transform 0.15s;
}
.selected-chips-wrap {
  display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.625rem; min-height: 0;
}
.selected-chips-wrap:empty { display: none; }
.user-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--accent-light); border: 1px solid var(--accent);
  color: var(--accent); border-radius: 999px;
  padding: 0.2rem 0.6rem 0.2rem 0.35rem; font-size: 0.72rem; font-weight: 600;
}
.user-chip .chip-avatar {
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; font-weight: 800;
}
.assign-none { padding: 1rem; text-align: center; font-size: 0.8rem; color: var(--text-muted); display: none; }

/* ── Attach Drop Zone ─────────────────────────────────────── */
.attach-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 2rem; border: 2px dashed var(--border-color);
  border-radius: var(--radius); background: var(--bg-card-alt);
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
  text-align: center;
}
.attach-drop:hover, .attach-drop.dragover {
  border-color: var(--accent); background: var(--accent-light);
}
.attach-drop input[type="file"] { display: none; }
.attach-drop-icon { font-size: 1.75rem; color: var(--text-muted); }
.attach-drop:hover .attach-drop-icon { color: var(--accent); }
.attach-drop-text { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); }
.attach-drop-hint { font-size: 0.78rem; color: var(--text-muted); }
.file-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.file-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--bg-card-alt); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 0.3rem 0.6rem;
  font-size: 0.78rem; color: var(--text-secondary);
}
.file-chip i { color: var(--accent); }

/* ── Priority Radio Pills ─────────────────────────────────── */
.priority-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.priority-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 0.8rem;
  font-weight: 600; cursor: pointer; border: 2px solid transparent;
  transition: all 0.15s; user-select: none;
}
.priority-pill input[type="radio"] { display: none; }
.priority-pill.p-low    { background: rgba(16,185,129,0.1);  color: #059669;  border-color: transparent; }
.priority-pill.p-medium { background: rgba(245,158,11,0.1);  color: #d97706;  border-color: transparent; }
.priority-pill.p-high   { background: rgba(239,68,68,0.08);  color: #dc2626;  border-color: transparent; }
.priority-pill.p-urgent { background: rgba(220,38,38,0.12);  color: #b91c1c;  border-color: transparent; }
.priority-pill.p-critical { background: rgba(127,29,29,0.1); color: #7f1d1d;  border-color: transparent; }
.priority-pill.active.p-low    { border-color: #059669; }
.priority-pill.active.p-medium { border-color: #d97706; }
.priority-pill.active.p-high   { border-color: #dc2626; }
.priority-pill.active.p-urgent { border-color: #b91c1c; }
.priority-pill.active.p-critical { border-color: #7f1d1d; }

/* hidden radio group (used with priority pills) */
input[name="priority"].priority-radio { display: none; }

/* ── Card header icon accent ──────────────────────────────── */
.card-header-icon {
  width: 26px; height: 26px; border-radius: 0.375rem;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; flex-shrink: 0;
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .sidebar-overlay { display: none; }
  .main-content { margin-left: 0; }
  .page-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ══════════════════════════════════════════════════════════
   DARK THEME — Full override of Bootstrap + browser defaults
   ══════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  color-scheme: dark;

  /* ── Bootstrap CSS variable overrides ── */
  --bs-body-bg:          #020617;
  --bs-body-color:       #f1f5f9;
  --bs-card-bg:          #0f172a;
  --bs-card-border-color:#1e293b;
  --bs-border-color:     #1e293b;
  --bs-table-bg:         transparent;
  --bs-table-striped-bg: rgba(255,255,255,0.03);
  --bs-table-hover-bg:   rgba(22,105,166,0.08);
  --bs-table-color:      #f1f5f9;
  --bs-modal-bg:         #0f172a;
  --bs-modal-color:      #f1f5f9;
  --bs-modal-border-color:#1e293b;
  --bs-dropdown-bg:      #0f172a;
  --bs-dropdown-color:   #f1f5f9;
  --bs-dropdown-border-color:#1e293b;
  --bs-dropdown-link-color:#94a3b8;
  --bs-dropdown-link-hover-bg:rgba(22,105,166,0.1);
  --bs-dropdown-link-hover-color:#f1f5f9;
  --bs-nav-tabs-border-color:#1e293b;
  --bs-nav-link-color:   #94a3b8;
  --bs-form-select-bg:   #1e293b;
  --bs-input-bg:         #1e293b;
  --bs-input-color:      #f1f5f9;
  --bs-input-border-color:#1e293b;
  --bs-input-placeholder-color:#475569;
  --bs-badge-color:      #f1f5f9;
}

/* ── Form controls: hard override ── */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] input[type="password"]:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] input[type="tel"]:focus,
[data-theme="dark"] input[type="search"]:focus,
[data-theme="dark"] input[type="url"]:focus,
[data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] input[type="time"]:focus,
[data-theme="dark"] input[type="month"]:focus,
[data-theme="dark"] input[type="datetime-local"]:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #1669a6 !important;
  box-shadow: 0 0 0 3px rgba(22,105,166,0.15) !important;
  outline: none !important;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] textarea::placeholder,
[data-theme="dark"] input::placeholder {
  color: #475569 !important;
  opacity: 1 !important;
}

/* ── Browser autofill fix (chrome/safari inject white) ── */
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] input:-webkit-autofill:active,
[data-theme="dark"] textarea:-webkit-autofill,
[data-theme="dark"] select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #1e293b inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  caret-color: #f1f5f9 !important;
  border-color: #334155 !important;
}

/* ── input[type="color"] ── */
[data-theme="dark"] input[type="color"] {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

/* ── input[type="file"] — browser "Choose file" button ── */
[data-theme="dark"] input[type="file"] {
  background-color: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}
[data-theme="dark"] input[type="file"]::file-selector-button {
  background-color: #334155 !important;
  color: #f1f5f9 !important;
  border: 1px solid #475569 !important;
  border-radius: 6px !important;
  padding: 4px 12px !important;
  cursor: pointer !important;
  transition: background .15s !important;
}
[data-theme="dark"] input[type="file"]::file-selector-button:hover {
  background-color: #475569 !important;
}
[data-theme="dark"] input[type="file"]::-webkit-file-upload-button {
  background-color: #334155 !important;
  color: #f1f5f9 !important;
  border: 1px solid #475569 !important;
  border-radius: 6px !important;
  padding: 4px 12px !important;
  cursor: pointer !important;
}

/* ── Tables ── */
[data-theme="dark"] .table {
  color: #f1f5f9 !important;
  --bs-table-bg: transparent;
  --bs-table-color: #f1f5f9;
}
[data-theme="dark"] .table thead tr,
[data-theme="dark"] .table > thead {
  background-color: #1e293b !important;
}
[data-theme="dark"] .table th {
  background-color: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #1e293b !important;
}
[data-theme="dark"] .table td {
  background-color: transparent !important;
  color: #f1f5f9 !important;
  border-color: #1e293b !important;
}
[data-theme="dark"] .table tbody tr:hover td {
  background-color: rgba(22,105,166,0.06) !important;
}
[data-theme="dark"] .table-responsive {
  border-color: #1e293b !important;
}

/* ── Cards & modals ── */
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  border-color: #1e293b !important;
  background-color: #0f172a !important;
}
[data-theme="dark"] .modal-body {
  background-color: #0f172a !important;
}

/* ── Bootstrap nav-tabs ── */
[data-theme="dark"] .nav-tabs {
  border-color: #1e293b !important;
}
[data-theme="dark"] .nav-tabs .nav-link {
  color: #475569 !important;
}
[data-theme="dark"] .nav-tabs .nav-link:hover {
  color: #f1f5f9 !important;
  border-color: transparent !important;
}
[data-theme="dark"] .nav-tabs .nav-link.active {
  color: #1669a6 !important;
  border-bottom-color: #1669a6 !important;
  background: transparent !important;
}

/* ── Dropdowns ── */
[data-theme="dark"] .dropdown-menu {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}
[data-theme="dark"] .dropdown-item {
  color: #94a3b8 !important;
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background-color: rgba(22,105,166,0.1) !important;
  color: #f1f5f9 !important;
}

/* ── Input groups ── */
[data-theme="dark"] .input-group-text {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

/* ── Form check (checkboxes / switches) ── */
[data-theme="dark"] .form-check-input {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .form-check-input:checked {
  background-color: #1669a6 !important;
  border-color: #1669a6 !important;
}
[data-theme="dark"] .form-check-label {
  color: #94a3b8 !important;
}

/* ── Badges ── */
[data-theme="dark"] .text-bg-success { background: rgba(52,211,153,0.15) !important; color: #34d399 !important; }
[data-theme="dark"] .text-bg-danger  { background: rgba(248,113,113,0.15) !important; color: #f87171 !important; }
[data-theme="dark"] .text-bg-warning { background: rgba(251,191,36,0.15)  !important; color: #fbbf24 !important; }
[data-theme="dark"] .text-bg-info    { background: rgba(34,211,238,0.15)  !important; color: #22d3ee !important; }
[data-theme="dark"] .text-bg-primary { background: rgba(22,105,166,0.15) !important; color: #1669a6 !important; }
[data-theme="dark"] .text-bg-secondary { background: rgba(148,163,184,0.12) !important; color: #94a3b8 !important; }
[data-theme="dark"] .bg-secondary { background-color: #334155 !important; }

/* ── Misc Bootstrap elements ── */
[data-theme="dark"] .list-group-item {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] hr,
[data-theme="dark"] .dropdown-divider {
  border-color: #1e293b !important;
  opacity: 1 !important;
}
[data-theme="dark"] code {
  background: rgba(22,105,166,0.12) !important;
  color: #a5b4fc !important;
  padding: 1px 5px;
  border-radius: 4px;
}
[data-theme="dark"] .text-dark  { color: #f1f5f9 !important; }
[data-theme="dark"] .bg-white   { background-color: #0f172a !important; }
[data-theme="dark"] .bg-light   { background-color: #1e293b !important; }
[data-theme="dark"] .border     { border-color: #1e293b !important; }
