:root {
  --font: 'Tajawal', 'Segoe UI', Tahoma, 'Dubai', 'Noto Sans Arabic', Arial, sans-serif;
  --primary: #0d2137;
  --primary-mid: #1a3a5c;
  --primary-light: #2563a0;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #3b82f6;
  --info-light: #dbeafe;
  --bg: #f0f4f8;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --nav-h: 64px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
  --r: 10px;
  --r-sm: 6px;
  --r-lg: 16px;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.navbar {
  position: fixed;
  top: 0; right: 0; left: 0;
  height: var(--nav-h);
  background: var(--primary);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  gap: 16px;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.nav-brand span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  margin-left: 0;
}

.shift-btn {
  padding: 7px 16px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shift-btn.start { background: var(--success); color: #fff; }
.shift-btn.end   { background: var(--danger); color: #fff; }
.shift-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.shift-timer {
  color: #fff;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: 50px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.nav-user {
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.btn-logout {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
  padding: 5px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.82rem;
  transition: all 0.2s;
}
.btn-logout:hover { background: var(--danger); color: #fff; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
  margin-right: auto;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.8);
  border-radius: 2px;
  transition: all 0.3s;
}

.main {
  margin-top: var(--nav-h);
  padding: 20px;
  min-height: calc(100vh - var(--nav-h));
}

body.login-body {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
}
.login-logo h1 span { color: var(--accent); }
.login-logo p {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  direction: rtl;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,160,0.12);
}

textarea { resize: vertical; min-height: 80px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary-light); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-mid); }
.btn-accent  { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover:not(:disabled) { border-color: var(--primary-light); color: var(--primary-light); background: var(--info-light); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 6px 8px; }

.card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

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

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 20px; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.board-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.board-switch {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: #e2e8f0;
  border-radius: 50px;
}

.board-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.board-tab:hover { color: var(--primary); }

.board-tab.active {
  background: var(--primary-light);
  color: #fff;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger   { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning  { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info     { background: var(--info-light); color: #1e40af; border: 1px solid #93c5fd; }

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 6px;
  display: none;
}
.error-msg.show { display: block; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger  { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-gray    { background: #f1f5f9; color: var(--text-muted); }
.badge-count {
  background: var(--primary-light);
  color: #fff;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.kanban-container {
  overflow-x: auto;
  padding-bottom: 16px;
  margin: -4px;
  padding: 4px;
}

.kanban-board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-height: calc(100vh - var(--nav-h) - 100px);
}

.kanban-col {
  min-width: 280px;
  width: 280px;
  flex-shrink: 0;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--nav-h) - 80px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kanban-col.completed-col {
  background: #f0fdf4;
  border-color: #86efac;
}

.kanban-col.drag-over {
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
  background: #eff6ff;
}

.col-header {
  padding: 14px 14px 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  background: inherit;
  border-radius: var(--r) var(--r) 0 0;
  z-index: 1;
}

.completed-col .col-header { border-bottom-color: #86efac; }

.col-title {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
}

.col-body {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}

.col-add-btn {
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--r-sm);
  padding: 8px;
  width: calc(100% - 16px);
  margin: 4px 8px 8px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.col-add-btn:hover { border-color: var(--primary-light); color: var(--primary-light); background: var(--info-light); }

.task-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  position: relative;
}

.task-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  border-color: #cbd5e1;
}

.task-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
  transform: rotate(2deg) scale(0.98);
}

.task-card.no-drag { cursor: default; }
.task-card.no-drag:hover { transform: none; }

.task-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.3;
}

.task-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.task-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.task-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.completed-col .task-card {
  background: #f9fafb;
  opacity: 0.9;
  cursor: default;
}
.completed-col .task-card:hover { transform: none; box-shadow: none; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}

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

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

.modal-title { font-size: 1.05rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: all 0.2s;
  line-height: 1;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.move-options { display: flex; flex-direction: column; gap: 8px; }
.move-option {
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.move-option:hover { border-color: var(--primary-light); background: var(--info-light); }
.move-option.selected { border-color: var(--primary-light); background: var(--info-light); }
.move-option.complete-opt { border-color: #86efac; }
.move-option.complete-opt:hover, .move-option.complete-opt.selected { background: var(--success-light); border-color: var(--success); }
.move-option-name { font-weight: 600; font-size: 0.9rem; }

.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--card);
}

thead th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: right;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  font-size: 0.82rem;
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.shift-status-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  margin-bottom: 24px;
  transition: border-color 0.3s;
}

.shift-status-card.clocked-in { border-color: var(--success); background: #f0fdf4; }

.shift-status-icon { font-size: 3rem; margin-bottom: 12px; }
.shift-status-text { font-size: 1.1rem; font-weight: 600; color: var(--text-muted); }
.shift-live-timer {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  margin: 10px 0;
  letter-spacing: 2px;
}

.hours-ok td:first-child { border-right: 3px solid var(--success); }
.hours-short td:first-child { border-right: 3px solid var(--danger); }
.hours-active td:first-child { border-right: 3px solid var(--accent); }

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.user-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.user-card:hover { box-shadow: var(--shadow); }

.user-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.user-card-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.user-card-info { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 2px; }
.user-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.report-filters {
  background: var(--card);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.report-filters .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 160px;
}

.report-section {
  margin-bottom: 32px;
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--border);
  overflow: hidden;
}

.report-employee-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-employee-name { font-size: 1.1rem; font-weight: 800; }
.report-salary-summary {
  background: #f8fafc;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.salary-item { text-align: center; }
.salary-value { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.salary-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.salary-item.net .salary-value { color: var(--success); }
.salary-item.deduct .salary-value { color: var(--danger); }
.salary-item.absent-highlight .salary-value { color: var(--danger); font-size: 1.6rem; }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 10px; opacity: 0.5; }
.empty-state-text { font-size: 0.9rem; }

#toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: all;
  max-width: 320px;
}

.toast-success { background: var(--success); }
.toast-danger  { background: var(--danger); }
.toast-info    { background: var(--info); }

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

.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.gap-2 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }

@media print {
  .no-print { display: none !important; }
  .navbar { display: none !important; }
  .main { margin-top: 0 !important; padding: 0 !important; }
  body { background: #fff; font-size: 12pt; }
  .print-only { display: block !important; }
  .report-section { break-inside: avoid; page-break-inside: avoid; border: 1px solid #ccc; margin-bottom: 20pt; }
  .report-employee-header { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; }
  table { font-size: 10pt; }
  thead th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; }
  .salary-value { color: #000 !important; }
  .badge { border: 1px solid #ccc; }
}

.print-only { display: none; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    right: 0;
    width: 220px;
    background: var(--primary-mid);
    padding: 12px 8px;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    border-radius: 0 0 0 var(--r);
  }
  .hamburger { display: flex; }
  .nav-right { gap: 6px; }
  .shift-btn span { display: none; }
  .nav-user .name-text { display: none; }
  .btn-logout span { display: none; }
  .main { padding: 12px; }
  .kanban-board { gap: 10px; }
  .kanban-col { min-width: 260px; width: 260px; }
  .report-filters { flex-direction: column; }
  .user-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { max-width: 100%; margin: 0; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

.task-pipeline {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.pipe-step {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  border: 2px solid var(--border);
  position: relative;
  cursor: default;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.pipe-step:hover { transform: scale(1.15); z-index: 2; }
.pipe-step[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
  z-index: 99;
  pointer-events: none;
}

.pipe-step.done    { background: var(--success); color: #fff; border-color: var(--success); }
.pipe-step.active  { background: var(--info); color: #fff; border-color: var(--info);
  animation: pipePulse 2s ease-in-out infinite; }
.pipe-step.pending { background: #f1f5f9; color: #94a3b8; }
.pipe-step.finish  { background: #d1fae5; color: var(--success); border-color: var(--success); font-size: 0.9rem; }
.pipe-step.finish.done { background: var(--success); color: #fff; }

.pipe-arrow { color: #94a3b8; font-size: 0.8rem; flex-shrink: 0; }

@keyframes pipePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
  50%      { box-shadow: 0 0 0 5px rgba(59,130,246,0); }
}

.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 4px;
}
.dl-ok      { background: #d1fae5; color: #065f46; }
.dl-warn    { background: #fef3c7; color: #92400e; }
.dl-danger  { background: #fee2e2; color: #991b1b; animation: dlBlink 1.5s ease-in-out infinite; }
.dl-done    { background: #f1f5f9; color: #94a3b8; text-decoration: line-through; }

@keyframes dlBlink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.penalty-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  margin-top: 2px;
}

.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.task-card.overdue {
  border-color: var(--danger);
  border-width: 2px;
  background: #fef2f2;
  border-right: 4px solid var(--danger);
}
.task-card.overdue .task-title {
  color: var(--danger);
}
.task-card.penalized {
  border-color: #fca5a5;
  background: #fff5f5;
}

.sequence-builder {
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.seq-empty-hint {
  padding: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.seq-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  transition: background 0.15s;
}
.seq-item:last-child { border-bottom: none; }
.seq-item:hover { background: #f8fafc; }

.seq-arrow-row {
  padding: 2px 12px;
  font-size: 0.85rem;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.seq-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.seq-name { flex: 1; font-weight: 600; font-size: 0.88rem; }

.seq-up, .seq-down, .seq-remove {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 7px;
  font-size: 0.75rem;
  line-height: 1.5;
  transition: all 0.15s;
}
.seq-remove:hover { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.seq-up:hover, .seq-down:hover { background: var(--info-light); border-color: var(--info); color: var(--info); }

.seq-add-row {
  padding: 8px;
  background: #f8fafc;
  display: flex;
  gap: 6px;
}
.seq-add-row select { flex: 1; font-size: 0.85rem; }

.seq-finish-note {
  padding: 8px 12px;
  background: #f0fdf4;
  border-top: 1px solid #86efac;
  font-size: 0.82rem;
  color: #065f46;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
