/* i8studio MGR — Component styling matching PDF Specification */

/* Badge & Chip */
/* Badge & Chip */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: color-mix(in srgb, var(--c, #64748b) 18%, transparent);
  color: color-mix(in srgb, var(--c, #64748b) 60%, #fff);
  border: 1px solid color-mix(in srgb, var(--c, #64748b) 35%, transparent);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c, #64748b);
  flex: none;
}
.badge.plain::before { display: none; }
.badge-done, .badge-green { --c: #10b981; }
.badge-doing, .badge-orange { --c: #f59e0b; }
.badge-todo, .badge-gray { --c: #64748b; }
.badge-locked { --c: #475569; }
.badge-blue { --c: #3b82f6; }
.badge-red { --c: #ef4444; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: #c3cad9;
  border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.08));
  white-space: nowrap;
}
.chip.blue { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); }
.chip.orange { background: rgba(249, 115, 22, 0.15); color: #fdba74; border-color: rgba(249, 115, 22, 0.35); }
.chip.red { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
.chip.green { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); }

/* Progress bar */
.prog { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; min-width: 60px; }
.prog span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #f97316, #fb923c); transition: width 0.4s ease; }
.prog.green span { background: linear-gradient(90deg, #10b981, #34d399); }
.prog.blue span { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.prog.red span { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  padding: 9px 12px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--panel-border); vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.tbl tr.locked-row { opacity: 0.45; background: rgba(0, 0, 0, 0.15); }

/* ========================================================
   MÀN HÌNH 1: TẠO MỚI DỰ ÁN 3D (PAGE 1)
   ======================================================== */
.new-project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 18px;
}
.section-box {
  background: #151a24;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.section-box-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.package-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #11141d;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  margin-bottom: 8px;
}
.package-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}
.team-tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.team-pill {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  background: #1e2434;
  border: 1px solid var(--panel-border);
  cursor: pointer;
  user-select: none;
  transition: 0.15s;
}
.team-pill:hover { border-color: var(--primary); }
.team-pill.active {
  background: rgba(0, 194, 255, 0.15);
  border-color: var(--primary);
  color: #fff;
}
.team-pill.active::before { content: '✕ '; font-size: 10px; color: var(--primary); }

/* ========================================================
   MÀN HÌNH 2: WATERFALL PLANNER (PAGE 2)
   ======================================================== */
.waterfall-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #12151f;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  font-size: 12.5px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.phase-section {
  margin-bottom: 18px;
  background: #161b26;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  overflow: hidden;
}
.phase-section-title {
  padding: 10px 14px;
  background: #1a202e;
  border-bottom: 1px solid var(--panel-border);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.milestone-bar {
  padding: 10px 14px;
  background: rgba(0, 194, 255, 0.05);
  border-top: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========================================================
   WATERFALL & MASTER TIMELINE ENHANCEMENTS
   ======================================================== */
.wf-project-hero {
  background: linear-gradient(180deg, #161b27 0%, #12151f 100%);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.wf-project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
}
.wf-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) {
  .wf-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wf-stat-grid { grid-template-columns: 1fr; }
}
.wf-stat-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.wf-stat-card .lbl {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.wf-stat-card .val {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wf-stat-card .sub {
  font-size: 11px;
  color: #64748b;
}

/* Master Timeline Controls & Gantt */
.wf-master-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #151a25;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  margin-bottom: 16px;
}
.wf-master-stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 990px) {
  .wf-master-stat-bar { grid-template-columns: repeat(2, 1fr); }
}
.wf-master-stat-card {
  background: #141824;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px 14px;
}
.wf-master-stat-card .lbl {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.wf-master-stat-card .val {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}
.wf-master-stat-card .sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.gantt-master-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  z-index: 1;
  transition: background 0.15s;
}
.gantt-master-row:hover {
  background: rgba(255, 255, 255, 0.02);
}
.gantt-master-lbl {
  overflow: hidden;
  padding-right: 8px;
}
.gantt-proj-track {
  position: relative;
  height: 28px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  overflow: hidden;
}
.gantt-proj-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
  white-space: nowrap;
}
.gantt-proj-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 194, 255, 0.4);
}

/* ========================================================
   MÀN HÌNH 3: MY WORKSPACE / ARTIST (PAGE 3)
   ======================================================== */
.deadline-alert-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-weight: 700;
  font-size: 12.5px;
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.active-timer-box {
  background: #151a24;
  border: 2px solid #10b981;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
  padding: 14px 18px;
  margin-bottom: 20px;
  position: relative;
}
.active-timer-box.paused {
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}
.active-timer-box.idle {
  border-color: #475569;
  box-shadow: none;
}
.timer-digital-clock {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 26px;
  font-weight: 800;
  color: #10b981;
  letter-spacing: 1px;
}
.active-timer-box.paused .timer-digital-clock { color: #f59e0b; }

/* ========================================================
   MÀN HÌNH 4: QC / DUYỆT TASK (PAGE 4)
   ======================================================== */
.job-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.5);
  border-radius: 4px;
  color: #f97316;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.25;
}

.qc-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1240px) {
  .qc-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .qc-side { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .qc-layout { grid-template-columns: 1fr; }
}

/* Cột 1: Chờ check */
.qc-list {
  background: var(--bg-card);
  border: 1px solid var(--panel-border);
  border-radius: var(--r);
  overflow: hidden;
}
.qc-list a.qc-item {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}
.qc-list a.qc-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.qc-list a.qc-item.active {
  background: rgba(249, 115, 22, 0.09);
  border-left-color: #f97316;
}
.qc-item-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #f8fafc;
  margin: 6px 0 8px;
  line-height: 1.35;
}

/* Cột 2: Panel trung tâm soi ảnh */
.qc-main-panel {
  background: var(--bg-card);
  border: 1px solid var(--panel-border);
  border-radius: var(--r);
  padding: 16px;
}
.qc-breadcrumb {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 4px;
  font-weight: 500;
}
.qc-main-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}
.qc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: #f97316;
  font-size: 11.5px;
  font-weight: 700;
}
.qc-round-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: #1e2638;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 600;
}

.qc-stage, .qc-stage-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: crosshair;
  user-select: none;
  border: 1px solid var(--panel-border);
  margin-top: 12px;
}
.qc-stage img, .qc-stage-wrap img {
  display: block;
  width: 100%;
  height: auto;
}
.qc-stage.ro, .qc-stage-wrap.ro {
  cursor: default;
}
.qc-pin, .pin {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -28px 0 0 -14px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: grid;
  place-items: center;
  background: #ef4444;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease;
  z-index: 10;
}
.qc-pin span, .pin span {
  transform: rotate(45deg);
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.qc-pin.fixed, .pin.fixed {
  background: #10b981;
}
.qc-pin:hover, .pin:hover {
  transform: rotate(-45deg) scale(1.2);
  z-index: 20;
}

/* Cột 3: Pin lỗi & Lịch sử */
.qc-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.qc-pin-card, .qc-history-card {
  background: var(--bg-card);
  border: 1px solid var(--panel-border);
  border-radius: var(--r);
  overflow: hidden;
}
.qc-empty-pins {
  text-align: center;
  padding: 36px 14px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
}
.qc-pin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qc-pin-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}
.qc-pin-item.fixed {
  opacity: 0.75;
}
.qc-pin-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex: none;
}
.qc-pin-num.fixed {
  background: #10b981;
}
.qc-pin-text {
  font-size: 12.5px;
  color: #f1f5f9;
  line-height: 1.35;
  word-break: break-word;
}
.qc-pin-item.fixed .qc-pin-text {
  color: #94a3b8;
  text-decoration: line-through;
}

.btn-qc-pass {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border-radius: 6px;
  background: #10b981;
  border: 1px solid #10b981;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.btn-qc-pass:hover:not(:disabled) {
  background: #059669;
  border-color: #059669;
  transform: translateY(-1px);
}
.btn-qc-pass:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-qc-fix {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border-radius: 6px;
  background: #25121b;
  border: 1px solid #9f1239;
  color: #fb7185;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.btn-qc-fix:hover:not(:disabled) {
  background: #341423;
  border-color: #e11d48;
  color: #f43f5e;
  transform: translateY(-1px);
}
.btn-qc-fix:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qc-cond-note {
  margin-top: 10px;
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.45;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  position: relative;
  padding: 0 0 14px 20px;
  font-size: 12.5px;
  line-height: 1.4;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f97316;
}
.timeline li::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 15px;
  bottom: 0;
  width: 1px;
  background: var(--panel-border);
}
.timeline li:last-child::after {
  display: none;
}

.qc-note-card {
  background: #11151f;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.qc-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* ========================================================
   MÀN HÌNH 5: THỐNG KÊ KPI & NĂNG SUẤT (PAGE 5)
   ======================================================== */
.kpi-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: #151a24;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px 18px;
  text-align: center;
}
.kpi-card .lbl {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.kpi-card .val {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
}

/* ========================================================
   MÀN HÌNH 6: ỨNG DỤNG DI ĐỘNG (PAGE 6)
   ======================================================== */
.mobile-mockup-wrapper {
  display: flex;
  gap: 36px;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 0;
  flex-wrap: wrap;
}
.mobile-device {
  width: 320px;
  height: 640px;
  background: #000;
  border-radius: 38px;
  border: 4px solid #2d3748;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.mobile-statusbar {
  height: 36px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex: none;
}
.mobile-content {
  flex: 1;
  background: #0e121a;
  overflow-y: auto;
  padding: 14px;
  font-size: 12px;
}
.mobile-bottom-tabs {
  height: 48px;
  background: #11151f;
  border-top: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex: none;
  font-size: 10px;
  color: var(--text-muted);
}
.mobile-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.mobile-tab-btn.active { color: var(--primary); }

/* ========================================================
   MÀN HÌNH 8/9: KANBAN TIẾN ĐỘ JOBS (PAGE 9)
   ======================================================== */
.kanban-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.team-tab-btn {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  background: #161b26;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  cursor: pointer;
}
.team-tab-btn:hover { color: #fff; }
.team-tab-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

.kanban-board-5col {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 12px;
  overflow-x: auto;
  align-items: start;
}
.kanban-column {
  background: #131722;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  min-height: 480px;
}
.kanban-col-head {
  padding: 10px 12px;
  background: #181d2a;
  border-bottom: 1px solid var(--panel-border);
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.kanban-job-card {
  background: #1c2232;
  border: 1px solid #283348;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: grab;
  transition: 0.15s;
}
.kanban-job-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.kanban-job-card.active-timer-card {
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* ========================================================
   PHỤC HỒI: MODAL, TOAST, FORM (bị mất khi đổi giao diện)
   ======================================================== */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(3px); overflow-y: auto; }
.modal.show { display: flex; animation: fadeIn .15s ease; }
.modal-card { width: 100%; max-width: 560px; background: #161b26; border: 1px solid var(--panel-border); border-radius: 10px; box-shadow: var(--shadow); animation: popIn .18s ease; }
.modal-card.wide { max-width: 1080px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--panel-border); }
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 16px; max-height: 76vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--panel-border); }
.icon-btn { background: transparent; border: 0; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

#toasts { position: fixed; top: 68px; right: 20px; z-index: 1200; display: flex; flex-direction: column; gap: 10px; max-width: 380px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 8px; background: #182030; border: 1px solid rgba(255,255,255,0.12); border-left: 5px solid #10b981; box-shadow: 0 12px 30px rgba(0,0,0,0.6); font-size: 13px; color: #f8fafc; animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; transition: opacity 0.35s ease, transform 0.35s ease; }
@keyframes toastSlideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.err { border-left-color: #ef4444; }
.toast.warn { border-left-color: #f59e0b; }
.toast.info { border-left-color: #00c2ff; }
.toast.out { opacity: 0; transform: translateX(110%); }
.toast-ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.1); flex: none; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.btn.ghost { background: transparent; }
.btn.xs { padding: 2px 8px; font-size: 11px; }
.btn.blue { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }
.chip.purple { background: rgba(168,85,247,.15); color: #d8b4fe; border-color: rgba(168,85,247,.3); }
.chip.yellow { background: rgba(245,158,11,.15); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 11px; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.user-avatar .avatar { width: 28px; height: 28px; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.live { color: #10b981; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.empty { text-align: center; padding: 20px; color: var(--text-muted); }
.empty-ic { font-size: 24px; margin-bottom: 6px; }
.callout, .callout-info { padding: 10px 14px; border-radius: 6px; background: rgba(0,194,255,.06); border: 1px solid rgba(0,194,255,.3); margin-bottom: 14px; font-size: 12.5px; }
.callout.red { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.4); color: #fca5a5; }
.warn-txt { color: #ef4444; } .ok-txt { color: #10b981; } .or-txt { color: #f59e0b; }
.mt-s { margin-top: 6px; }

/* ========================================================
   THÀNH PHẦN LIÊN KẾT GIỮA CÁC TAB
   ======================================================== */
.fix-box { background: rgba(239,68,68,.06); border: 1px solid rgba(239,68,68,.45); border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }
.qc-queue { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 12px; background: #12151f; border: 1px solid var(--panel-border); border-radius: 6px; }
.qc-q-item { padding: 5px 10px; border-radius: 5px; border: 1px solid var(--panel-border); background: #181d2a; color: #e2e8f0; font-size: 12px; }
.qc-q-item:hover { border-color: var(--primary); }
.qc-q-item.on { border-color: #f97316; background: rgba(249,115,22,.12); }
.qc-stage-wrap.ro { cursor: default; }
.phase-ready-box { padding: 8px 12px; margin-bottom: 12px; border: 1px solid rgba(16,185,129,.45); background: rgba(16,185,129,.07); border-radius: 6px; font-size: 12.5px; }
.task-history { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.kcard.dragging { opacity: .4; }
.kcol.over { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
/* project cards & list */
.pcard {
  overflow: hidden;
  cursor: pointer;
  background: #111625;
  border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pcard:hover {
  transform: translateY(-3px);
  border-color: rgba(249, 115, 22, .45);
  box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .5);
}
.pcard .cover {
  height: 132px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.pcard .cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 16, 32, 0.1) 0%, rgba(11, 16, 32, 0.4) 40%, rgba(11, 16, 32, 0.95) 100%);
  pointer-events: none;
}
.pcard .cover .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  backdrop-filter: blur(8px);
  background: rgba(11, 16, 32, 0.82) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.pcard .cover .no {
  position: absolute;
  bottom: 10px;
  left: 14px;
  z-index: 2;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.pcard .body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pcard .code {
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  line-height: 1.3;
}
.pcard .code small {
  display: block;
  font-weight: 400;
  color: #94a3b8;
  font-size: 12.5px;
  margin-top: 2px;
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 800; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .inp { width: auto; min-width: 140px; }
.tbl-wrap { overflow-x: auto; }
.thumb { width: 56px; height: 38px; border-radius: 7px; object-fit: cover; border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.1)); }
.dash-sub { font-size: 12px; font-weight: 700; color: #94a3b8; margin-bottom: 10px; }
.bar-lbl { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; white-space: nowrap; }
.m-card { background: #151a24; border: 1px solid #283348; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; text-align: left; }
.m-title { font-weight: 800; font-size: 13px; color: #fff; margin-bottom: 10px; text-transform: uppercase; }
.gantt { display: flex; flex-direction: column; gap: 4px; overflow: hidden; position: relative; padding-bottom: 6px; }
.gantt-row { display: grid; grid-template-columns: 240px 1fr; gap: 10px; align-items: center; min-height: 24px; position: relative; z-index: 1; }
.gantt-phase { margin-top: 8px; border-top: 1px solid var(--panel-border); padding-top: 6px; }
.gantt-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-track { position: relative; height: 16px; background: rgba(255,255,255,.03); border-radius: 4px; }
.gantt-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.gantt-grid { position: absolute; left: 250px; right: 0; top: 0; bottom: 0; pointer-events: none; z-index: 0; }
.gg-col { position: absolute; top: 0; bottom: 0; background: rgba(255,255,255,.035); }
.gg-col.today { background: rgba(239,68,68,.07); }
.gantt-today { position: absolute; top: 0; bottom: 0; border-left: 2px dashed #ef4444; z-index: 3; pointer-events: none; }
.gantt-today span { position: absolute; bottom: 2px; left: 4px; font-size: 10px; color: #ef4444; white-space: nowrap; background: #0f131c; padding: 0 4px; border-radius: 3px; }
.gantt-head { align-items: stretch; margin-bottom: 4px; }
.gantt-head .gantt-lbl { white-space: normal; line-height: 1.5; align-self: center; }
.gantt-dates { position: relative; height: 52px; border-bottom: 1px solid var(--panel-border); }
.gd-months, .gd-days { position: absolute; left: 0; right: 0; }
.gd-months { top: 0; height: 18px; }
.gd-days { top: 20px; height: 32px; }
.gd-month { position: absolute; top: 0; height: 18px; font-size: 11px; font-weight: 800; color: #00c2ff; border-left: 1px solid rgba(0,194,255,.35); padding-left: 6px; white-space: nowrap; overflow: hidden; letter-spacing: .3px; }
.gd-cell { position: absolute; top: 0; height: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-left: 1px solid rgba(255,255,255,.05); line-height: 1.15; overflow: hidden; }
.gd-wd { font-size: 9px; color: #64748b; font-weight: 600; }
.gd-d { font-size: 11px; color: #cbd5e1; font-weight: 700; }
.gd-cell.we .gd-wd, .gd-cell.we .gd-d { color: #f59e0b; }
.gd-cell.today { background: #ef4444; border-radius: 4px; }
.gd-cell.today .gd-wd, .gd-cell.today .gd-d { color: #fff; }

/* ========================================================
   BẢNG CHẤM CÔNG & QUẢN TRỊ THỜI GIAN (TIMESHEET & LEAVE)
   ======================================================== */
.ts-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; background: #10141f; padding: 6px; border: 1px solid var(--panel-border); border-radius: 8px; }
.ts-tab { padding: 8px 16px; border-radius: 6px; font-weight: 700; font-size: 13px; color: #94a3b8; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: all .15s ease; border: 1px solid transparent; }
.ts-tab:hover { color: #f1f5f9; background: rgba(255,255,255,.04); }
.ts-tab.active { color: #fff; background: #2563eb; border-color: #3b82f6; box-shadow: 0 2px 10px rgba(37,99,235,.4); }
.ts-tab .cnt { background: #ef4444; color: #fff; padding: 1px 6px; border-radius: 10px; font-size: 11px; font-weight: 800; }

.ts-top-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; padding: 10px 14px; background: #131722; border: 1px solid var(--panel-border); border-radius: 8px; }
.ts-month-ctrl { display: flex; align-items: center; gap: 8px; }
.ts-month-label { min-width: 140px; text-align: center; font-size: 15px; font-weight: 800; color: #fff; letter-spacing: .5px; }

.ts-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.ts-stat-card { background: #151a24; border: 1px solid var(--panel-border); border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; justify-content: space-between; }
.ts-stat-card .lbl { font-size: 11px; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.ts-stat-card .val { font-size: 20px; font-weight: 900; color: #fff; margin-bottom: 4px; font-family: 'JetBrains Mono', monospace; }
.ts-stat-card .sub { font-size: 11.5px; color: #64748b; }

.ts-main-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .ts-main-grid { grid-template-columns: 1fr; } .ts-stat-grid { grid-template-columns: repeat(2, 1fr); } }

.ts-cal-card { background: #151a24; border: 1px solid var(--panel-border); border-radius: 8px; padding: 14px; }
.ts-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ts-dh { text-align: center; padding: 8px 4px; font-size: 11.5px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .5px; }
.ts-dh.we { color: #f59e0b; }

.ts-day { min-height: 88px; background: #0f131c; border: 1px solid #232d3f; border-radius: 6px; padding: 6px 7px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; transition: all .15s ease; user-select: none; }
.ts-day:hover { border-color: #00c2ff; background: #162030; transform: translateY(-1px); }
.ts-day.active { border-color: #00c2ff; background: #152238; box-shadow: 0 0 12px rgba(0,194,255,.3); }
.ts-day.today { border-color: #ef4444; }
.ts-day.off { background: rgba(255,255,255,.015); border-color: rgba(255,255,255,.04); }
.ts-day.empty { background: transparent; border: none; cursor: default; }

.ts-day-head { display: flex; justify-content: space-between; align-items: center; }
.ts-day-num { font-size: 13px; font-weight: 800; color: #cbd5e1; }
.ts-day.off .ts-day-num { color: #64748b; }
.ts-day.today .ts-day-num { color: #ef4444; }
.ts-day-body { text-align: center; margin: 4px 0; }
.ts-day-hours { font-size: 13.5px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.ts-day-hours.ok { color: #10b981; }
.ts-day-hours.warn { color: #f59e0b; }
.ts-day-missing { font-size: 9.5px; font-weight: 700; color: #ef4444; background: rgba(239,68,68,.12); padding: 1px 4px; border-radius: 3px; display: inline-block; }
.ts-day-chips { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.ts-mini-chip { font-size: 9px; font-weight: 800; padding: 1px 4px; border-radius: 3px; }
.ts-mini-chip.h { background: rgba(59,130,246,.15); color: #93c5fd; }
.ts-mini-chip.ot { background: rgba(249,115,22,.15); color: #fdba74; }
.ts-mini-chip.ot2 { background: rgba(168,85,247,.15); color: #d8b4fe; }
.ts-mini-chip.leave { background: rgba(16,185,129,.15); color: #6ee7b7; }
.ts-mini-chip.hol { background: rgba(239,68,68,.18); color: #fca5a5; }

.ts-detail-card { background: #151a24; border: 1px solid var(--panel-border); border-radius: 8px; overflow: hidden; }
.ts-detail-head { padding: 12px 16px; background: #11151f; border-bottom: 1px solid var(--panel-border); display: flex; justify-content: space-between; align-items: center; }
.ts-detail-title { font-size: 14px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }
.ts-entry-row { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.04); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ts-entry-row:hover { background: rgba(255,255,255,.02); }
.ts-entry-time { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 700; color: #00c2ff; min-width: 95px; }
.ts-entry-code { display: inline-flex; align-items: center; gap: 4px; }
.ts-entry-task { flex: 1; font-size: 12px; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ts-form-box { padding: 14px 16px; background: #10141f; border-top: 1px solid var(--panel-border); }
.ts-form-title { font-size: 12px; font-weight: 800; color: #00c2ff; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

/* Legacy fallback classes for old timesheet refs */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; background: #10141f; padding: 6px; border: 1px solid var(--panel-border); border-radius: 8px; }
.tabs a { padding: 8px 16px; border-radius: 6px; font-weight: 700; font-size: 13px; color: #94a3b8; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.tabs a:hover { color: #fff; background: rgba(255,255,255,.04); }
.tabs a.on { color: #fff; background: #2563eb; }
.tabs a .cnt { background: #ef4444; color: #fff; padding: 1px 6px; border-radius: 10px; font-size: 11px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dh { text-align: center; padding: 6px; font-weight: 800; font-size: 11.5px; color: #64748b; }
.cal .d { min-height: 80px; background: #0f131c; border: 1px solid #232d3f; border-radius: 6px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; }
.cal .d.sel { border-color: #00c2ff; background: #152238; }
.cal .d.today { border-color: #ef4444; }
.cal .d.off { background: rgba(255,255,255,.015); }
.grid.g-main { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.warn-txt { color: #ef4444; font-weight: 700; }

/* ========================================================
   1. LƯỚI 6 CỘT & CARD DỰ ÁN COMPACT (Page 1)
   ======================================================== */
.grid.g6 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1600px) { .grid.g6 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .grid.g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid.g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid.g6 { grid-template-columns: 1fr; } }

.pcard.compact {
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.pcard.compact .cover {
  height: 96px;
}
.pcard.compact .cover .badge {
  top: 6px;
  left: 6px;
  font-size: 10px;
  padding: 2px 7px;
}
.pcard.compact .cover .no {
  bottom: 6px;
  left: 9px;
  font-size: 17px;
}
.pcard.compact .body {
  padding: 8px 10px 10px;
  gap: 1px;
}
.pcard.compact .code {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcard.compact .code small {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.pcard.compact .chip {
  padding: 1px 5px;
  font-size: 10px;
}

/* ========================================================
   2. CỘT CẢNH BÁO BÊN PHẢI (RIGHT ALERT PANEL)
   ======================================================== */
.proj-main-layout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.proj-main-content {
  flex: 1;
  min-width: 0;
}
.proj-alert-sidebar {
  width: 320px;
  flex: none;
  position: sticky;
  top: 70px;
}
@media (max-width: 1180px) {
  .proj-main-layout { flex-direction: column; }
  .proj-alert-sidebar { width: 100%; position: static; }
}

.alert-panel {
  background: #131826;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.alert-panel-header {
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
  border-bottom: 1px solid rgba(239, 68, 68, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.alert-panel-title {
  font-size: 13px;
  font-weight: 800;
  color: #fca5a5;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.alert-list {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
.alert-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.alert-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.alert-item.urgent {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
}
.alert-item.near-due {
  background: rgba(245, 158, 11, 0.06);
  border-left: 3px solid #f59e0b;
}
.alert-item.qc-wait {
  background: rgba(59, 130, 246, 0.06);
  border-left: 3px solid #3b82f6;
}
.alert-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.alert-item-meta {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========================================================
   3. DUYỆT QC - KHOANH VÙNG & TAG LỖI (Page 4)
   ======================================================== */
.qc-mode-toolbar {
  display: inline-flex;
  background: #111522;
  padding: 3px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  gap: 4px;
}
.qc-mode-btn {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.15s;
}
.qc-mode-btn.active {
  background: #00c2ff;
  color: #0b101c;
}
.qc-box-pin {
  position: absolute;
  border: 2px dashed #f59e0b;
  background: rgba(245, 158, 11, 0.16);
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.qc-box-pin:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.28);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}
.qc-box-pin.fixed {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}
.qc-box-pin .box-num {
  position: absolute;
  top: -10px;
  left: -2px;
  background: #f59e0b;
  color: #0b101c;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.qc-box-pin.fixed .box-num {
  background: #10b981;
  color: #fff;
}
.qc-drag-selection {
  position: absolute;
  border: 2px dashed #00c2ff;
  background: rgba(0, 194, 255, 0.2);
  pointer-events: none;
  z-index: 20;
}
.chip.qc-tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.chip.qc-tag.mat { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; border-color: rgba(168, 85, 247, 0.4); }
.chip.qc-tag.arch { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.chip.qc-tag.light { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
.chip.qc-tag.detail { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border-color: rgba(59, 130, 246, 0.4); }

/* ========================================================
   4. BADGE DỰ ÁN MẸ - CON (GIAI ĐOẠN TIẾP THEO)
   ======================================================== */
.chip.parent-link {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.4);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ========================================================
   5. NOTIFICATION RIGHT DRAWER (Thanh thông báo trượt)
   ======================================================== */
.notif-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1050;
  animation: fadeIn 0.2s ease;
}
.notif-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 90vw;
  background: #141926;
  border-left: 1px solid var(--panel-border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  animation: drawerSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.notif-drawer-head {
  padding: 16px 18px;
  background: #111520;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-drawer-head h3 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notif-drawer-item {
  padding: 10px 14px;
  border-radius: 8px;
  background: #192030;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.15s;
}
.notif-drawer-item:hover {
  background: #20293d;
  border-color: rgba(0, 194, 255, 0.3);
}
.notif-drawer-item.unread {
  background: rgba(0, 194, 255, 0.09);
  border-left: 4px solid #00c2ff;
}
.notif-drawer-foot {
  padding: 12px 18px;
  background: #111520;
  border-top: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========================================================
   CẢNH BÁO DEADLINE GÓC PHẢI TRÊN MY WORKSPACE
   ======================================================== */
.workspace-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.workspace-user-meta {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.workspace-deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22) 0%, rgba(185, 28, 28, 0.35) 100%);
  border: 1px solid rgba(239, 68, 68, 0.7);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3), inset 0 0 10px rgba(239, 68, 68, 0.15);
  font-size: 12.5px;
  color: #fff;
  animation: alertGlow 2.5s infinite alternate;
  max-width: 580px;
}
@keyframes alertGlow {
  0% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.25); border-color: rgba(239, 68, 68, 0.6); }
  100% { box-shadow: 0 0 22px rgba(239, 68, 68, 0.6); border-color: #ef4444; }
}
.workspace-deadline-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  flex: none;
  animation: pulseDot 1.2s infinite;
}
@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}
.workspace-deadline-badge .badge-title {
  font-weight: 800;
  color: #fca5a5;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.workspace-deadline-badge .badge-tasks {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-deadline-badge .task-link {
  color: #fff;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  transition: color 0.15s;
}
.workspace-deadline-badge .task-link:hover {
  color: #67e8f9;
}
.workspace-deadline-badge .task-link b {
  color: #00c2ff;
}

tr.row-due-today {
  background: rgba(239, 68, 68, 0.08) !important;
  border-left: 3px solid #ef4444 !important;
}

/* Precut Structure Packages (Screen 1) */
.precut-pkg-card {
  background: #131926;
  border: 1px solid #232e44;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}
.precut-pkg-card.active {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.05);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.1);
}
.precut-pkg-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #fff;
  font-size: 13.5px;
  cursor: pointer;
}
.precut-pkg-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Waterfall Approval Milestone Buttons (Screen 2) */
.btn-approve-cb {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid #38bdf8;
  box-shadow: 0 2px 12px rgba(2, 132, 199, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-approve-cb:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}
.btn-approve-cb.cb2 {
  background: linear-gradient(135deg, #059669, #047857);
  border-color: #34d399;
  box-shadow: 0 2px 12px rgba(5, 150, 105, 0.4);
}
.btn-approve-cb.cb2:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  box-shadow: 0 4px 18px rgba(52, 211, 153, 0.5);
}

/* CAD & 3D Timber Preview Interactive Pins (Screen 4) */
.cad-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.8), 0 2px 6px rgba(0, 0, 0, 0.6);
  border: 2px solid #fff;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.15s ease;
}
.cad-pin:hover {
  transform: scale(1.2);
}
.cad-pin::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #ef4444;
  opacity: 0.6;
  animation: cadPulse 1.5s infinite;
}
@keyframes cadPulse {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}
.cad-pin.fixed {
  background: #10b981;
  border-color: #d1fae5;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
}
.cad-pin.fixed::after {
  border-color: #10b981;
}

/* Deadline blink banner (Screen 3) */
.deadline-blink-banner {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid #ef4444;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  color: #fca5a5;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: blinkAlert 2s infinite ease-in-out;
}
@keyframes blinkAlert {
  0%, 100% { background: rgba(239, 68, 68, 0.14); border-color: #ef4444; }
  50% { background: rgba(239, 68, 68, 0.28); border-color: #f87171; box-shadow: 0 0 16px rgba(239, 68, 68, 0.4); }
}



