/* ===== QLCV - giao dien ===== */
:root {
  --qc-primary: #4f46e5;
  --qc-primary-2: #7c3aed;
  --qc-bg: #f4f6fb;
  --qc-card: #ffffff;
  --qc-ink: #1f2937;
  --qc-muted: #6b7280;
  --qc-line: #e7e9f2;
  --qc-side-1: #1e1b4b;
  --qc-side-2: #312e81;
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: #4338ca;
  --bs-body-font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
body { background: var(--qc-bg); color: var(--qc-ink); font-size: .935rem; }
.btn-primary { --bs-btn-bg: var(--qc-primary); --bs-btn-border-color: var(--qc-primary); --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca; --bs-btn-active-bg: #3730a3; }
.btn-outline-primary { --bs-btn-color: var(--qc-primary); --bs-btn-border-color: var(--qc-primary); --bs-btn-hover-bg: var(--qc-primary); --bs-btn-hover-border-color: var(--qc-primary); }
.text-primary { color: var(--qc-primary) !important; }
.bg-primary { background-color: var(--qc-primary) !important; }
.progress-bar { background: linear-gradient(90deg, var(--qc-primary), var(--qc-primary-2)); }
.progress-bar.bg-success { background: linear-gradient(90deg, #10b981, #059669) !important; }
.progress-bar.bg-danger { background: linear-gradient(90deg, #f87171, #dc2626) !important; }
a { text-decoration: none; }

/* ----- Bo cuc: thanh ben + noi dung ----- */
.sidebar { background: linear-gradient(180deg, var(--qc-side-1), var(--qc-side-2)); color: #c7d2fe; width: 260px; }
@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; }
  .app-main { margin-left: 260px; }
}
.sidebar .offcanvas-body { display: flex; flex-direction: column; height: 100%; padding: 0; }
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.3rem 1.25rem 1rem; color: #fff; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem;
  background: linear-gradient(135deg, #818cf8, #c084fc); box-shadow: 0 6px 18px rgba(129, 140, 248, .45); color: #fff; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; line-height: 1.1; }
.brand-sub { font-size: .72rem; color: #a5b4fc; }
.side-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #818cf8; padding: 1rem 1.4rem .35rem; }
.side-link { display: flex; align-items: center; gap: .75rem; margin: 2px .75rem; padding: .6rem .8rem; border-radius: 10px; color: #c7d2fe; font-weight: 500; }
.side-link i { font-size: 1.1rem; width: 1.2rem; text-align: center; }
.side-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-link.active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 3px 0 0 #a5b4fc; }
.side-link .badge { margin-left: auto; }
.side-user { margin-top: auto; padding: 1rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; align-items: center; gap: .7rem; }
.side-user .name { color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.2; }
.side-user .role { color: #a5b4fc; font-size: .75rem; }

.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(244, 246, 251, .85); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: .75rem; padding: .85rem 1.5rem; border-bottom: 1px solid var(--qc-line); }
.topbar h1 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.topbar .today { color: var(--qc-muted); font-size: .82rem; }
.content { padding: 1.5rem; max-width: 1400px; }
@media (max-width: 576px) { .content { padding: 1rem; } .topbar { padding: .75rem 1rem; } }

/* ----- The (card) ----- */
.card { border: 1px solid var(--qc-line); border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card-title-sm { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.card-title-sm i { color: var(--qc-primary); }

/* ----- O thong ke ----- */
.stat { position: relative; overflow: hidden; border: 0; color: #fff; border-radius: 16px; padding: 1.1rem 1.2rem; min-height: 150px; }
.stat .num { font-size: 2.1rem; font-weight: 800; line-height: 1; }
.stat .lbl { font-weight: 600; opacity: .95; }
.stat .ico { position: absolute; right: -6px; top: -10px; font-size: 5rem; opacity: .18; }
.stat a { color: #fff; }
.stat .mini { font-size: .8rem; opacity: .92; border-top: 1px solid rgba(255, 255, 255, .25); padding-top: .3rem; margin-top: .3rem;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-red { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.stat-amber { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.stat-sky { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.stat-violet { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-green { background: linear-gradient(135deg, #10b981, #047857); }

/* ----- Nhan trang thai mem ----- */
.st { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.st-MOI_GIAO { background: #eef2f7; color: #475569; }
.st-DANG_THUC_HIEN { background: #e0e7ff; color: #4338ca; }
.st-CHO_KIEM_TRA { background: #fef3c7; color: #b45309; }
.st-HOAN_THANH { background: #d1fae5; color: #047857; }
.st-TAM_DUNG { background: #e5e7eb; color: #374151; }
.st-DA_HUY { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }
.ut { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 700; padding: .2rem .5rem; border-radius: 6px; }
.ut-QUAN_TRONG { background: #ffedd5; color: #c2410c; }
.ut-KHAN { background: #fee2e2; color: #b91c1c; }
.han-qua { color: #e11d48; font-weight: 600; }
.han-gan { color: #d97706; font-weight: 600; }

/* ----- Anh dai dien chu cai ----- */
.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none;
  width: 32px; height: 32px; font-size: .85rem; box-shadow: 0 0 0 2px #fff; }
.av-sm { width: 26px; height: 26px; font-size: .72rem; }
.av-lg { width: 42px; height: 42px; font-size: 1.05rem; }
.av-stack .av + .av { margin-left: -8px; }
.person { display: inline-flex; align-items: center; gap: .45rem; }

/* ----- Bang ----- */
.table-modern { margin: 0; }
.table-modern thead th { background: #f8f9fd; color: var(--qc-muted); font-weight: 600; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .04em; border-bottom: 1px solid var(--qc-line); padding: .7rem .75rem; white-space: nowrap; }
.table-modern td { padding: .75rem; border-color: var(--qc-line); }
.table-modern tbody tr { transition: background .15s; }
.table-modern tbody tr:hover { background: #f8f8ff; }
.table-modern tr.row-late td:first-child { box-shadow: inset 3px 0 0 #e11d48; }
.task-name { font-weight: 600; color: var(--qc-ink); }
.task-name:hover { color: var(--qc-primary); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: .76rem; color: var(--qc-muted); }
.pbar { height: 6px; border-radius: 99px; background: #eceef6; }

/* ----- Tab vai ----- */
.pill-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill-tabs a { padding: .45rem .9rem; border-radius: 999px; color: var(--qc-muted); font-weight: 600; font-size: .85rem; background: #fff; border: 1px solid var(--qc-line); }
.pill-tabs a.active { background: var(--qc-primary); border-color: var(--qc-primary); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .3); }
.pill-tabs .count { display: inline-block; min-width: 1.4rem; padding: 0 .35rem; margin-left: .3rem; border-radius: 99px; background: rgba(0, 0, 0, .08); font-size: .75rem; text-align: center; }
.pill-tabs a.active .count { background: rgba(255, 255, 255, .25); }

/* ----- Kanban ----- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.kcol { background: #eceffa; border-radius: 14px; padding: .75rem; min-height: 200px; border-top: 4px solid #94a3b8; }
.kcol-MOI_GIAO { border-top-color: #94a3b8; }
.kcol-DANG_THUC_HIEN { border-top-color: #6366f1; }
.kcol-CHO_KIEM_TRA { border-top-color: #f59e0b; }
.kcol-HOAN_THANH { border-top-color: #10b981; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .88rem; padding: 0 .25rem .6rem; }
.kcol-head .n { background: #fff; border-radius: 99px; padding: 0 .55rem; font-size: .78rem; color: var(--qc-muted); }
.kcard { display: block; background: #fff; border-radius: 12px; padding: .75rem; margin-bottom: .6rem; color: var(--qc-ink);
  border: 1px solid transparent; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); transition: transform .12s, box-shadow .12s, border-color .12s; }
.kcard:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79, 70, 229, .12); border-color: #c7d2fe; color: var(--qc-ink); }
.kcard.late { border-left: 4px solid #e11d48; }
.kcard .t { font-weight: 600; font-size: .88rem; margin: .35rem 0 .5rem; line-height: 1.35; }

/* ----- Trang chi tiet ----- */
.hero { background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #a855f7); color: #fff; border-radius: 18px; padding: 1.4rem 1.5rem; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero h2 { font-weight: 700; font-size: 1.35rem; margin: .25rem 0 .6rem; position: relative; z-index: 1; }
.hero .code { color: #e0e7ff; }
.hero .st, .hero .ut { box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }
.hero-actions { position: relative; z-index: 1; }
.steps { display: flex; gap: 0; margin-top: 1rem; position: relative; z-index: 1; }
.step { flex: 1; text-align: center; font-size: .74rem; color: #c7d2fe; position: relative; }
.step .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .3rem; background: rgba(255, 255, 255, .18); color: #fff; position: relative; z-index: 1; }
.step::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: rgba(255, 255, 255, .25); }
.step:first-child::before { display: none; }
.step.done .dot { background: #34d399; }
.step.done::before, .step.now::before { background: #34d399; }
.step.now .dot { background: #fff; color: var(--qc-primary); box-shadow: 0 0 0 4px rgba(255, 255, 255, .3); }
.step.done, .step.now { color: #fff; font-weight: 600; }

.action-bar { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-act { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; border-radius: 10px; padding: .5rem .9rem; }
.btn-light-hero { background: rgba(255, 255, 255, .15); color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.btn-light-hero:hover { background: rgba(255, 255, 255, .25); color: #fff; }

.alert-soft { border: 0; border-radius: 12px; display: flex; gap: .75rem; align-items: flex-start; }
.alert-soft > i { font-size: 1.3rem; }

.doc { display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem; border: 1px solid var(--qc-line); border-radius: 12px; margin-bottom: .5rem; background: #fff; }
.doc:hover { border-color: #c7d2fe; background: #fafaff; }
.doc .fi { font-size: 1.7rem; }
.doc .meta { font-size: .75rem; color: var(--qc-muted); }
.drive-chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 6px; }
.drive-chip.DRIVE { background: #e0f2fe; color: #0369a1; }
.drive-chip.LINK { background: #e0f2fe; color: #0369a1; }
.drive-chip.MAY_CHU { background: #fef3c7; color: #92400e; }

.check-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 8px; }
.check-item:hover { background: #f6f7fd; }
.check-item button { border: 0; background: none; padding: 0; font-size: 1.25rem; line-height: 1; color: #a5b4fc; }
.check-item.done button { color: #10b981; }
.check-item.done .txt { text-decoration: line-through; color: var(--qc-muted); }

.timeline { position: relative; }
.tl-item { display: flex; gap: .75rem; padding: .6rem 0; }
.tl-body { flex: 1; background: #f8f9fd; border-radius: 12px; padding: .6rem .8rem; border: 1px solid var(--qc-line); }
.tl-body .who { font-weight: 600; font-size: .85rem; }
.tl-body .when { color: var(--qc-muted); font-size: .75rem; }
.tl-NHAC_NHO .tl-body { background: #fffbeb; border-color: #fcd34d; }
.tl-TRA_LAI .tl-body { background: #fef2f2; border-color: #fca5a5; }
.tl-DUYET .tl-body { background: #ecfdf5; border-color: #6ee7b7; }
.tl-NOP .tl-body { background: #f0f9ff; border-color: #7dd3fc; }
.tl-GIA_HAN .tl-body { background: #eef2ff; border-color: #a5b4fc; }
.tl-tag { font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; background: #fff; }

.info-row { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-bottom: 1px dashed var(--qc-line); gap: .75rem; }
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--qc-muted); font-size: .82rem; white-space: nowrap; }

.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--c, #6366f1) calc(var(--p) * 1%), #eceef6 0); }
.ring::before { content: attr(data-label); width: 92px; height: 92px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  font-size: 1.6rem; font-weight: 800; color: var(--qc-ink); }

.modal-content { border: 0; border-radius: 16px; }
.modal-header { border-bottom: 1px solid var(--qc-line); }
.modal-title i { margin-right: .4rem; }

/* ----- Dang nhap ----- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: linear-gradient(135deg, #1e1b4b, #4f46e5 55%, #a855f7); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-hero::before, .auth-hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.auth-hero::before { width: 380px; height: 380px; right: -120px; top: -100px; }
.auth-hero::after { width: 260px; height: 260px; left: -80px; bottom: -90px; }
.auth-hero h1 { font-weight: 800; font-size: 2.3rem; }
.auth-hero .feat { display: flex; gap: .75rem; align-items: center; margin-top: .9rem; color: #e0e7ff; }
.auth-hero .feat i { width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; font-size: 1.1rem; }
.auth-form { display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { padding: 2rem; } .auth-hero .feat { display: none; } }

.empty { text-align: center; padding: 2rem 1rem; color: var(--qc-muted); }
.empty i { font-size: 2.4rem; color: #c7d2fe; display: block; margin-bottom: .4rem; }
.toast-flash { border-radius: 12px; border: 0; box-shadow: 0 6px 20px rgba(16, 24, 40, .08); }
.min-w-0 { min-width: 0; }

/* O thong ke bam duoc */
.stat-link { cursor: pointer; transition: transform .15s, box-shadow .15s; color: #fff; }
.stat-link:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(30, 27, 75, .22); color: #fff; }
.stat-link.active { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--qc-primary), 0 12px 24px rgba(30, 27, 75, .25); }
