/* ═══ Lux98 Admin ═══ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #2563eb; --blue-dark: #1d4ed8; --blue-light: #eff6ff;
  --bg: #f4f6fb; --card: #ffffff; --border: #e5e9f2;
  --text: #1e293b; --muted: #64748b;
  --green: #16a34a; --green-bg: #dcfce7;
  --orange: #d97706; --orange-bg: #fef3c7;
  --red: #dc2626; --red-bg: #fee2e2;
  --purple: #7c3aed; --purple-bg: #f3e8ff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}
@font-face { font-family: 'Battambang'; src: url('/fonts/battambang-400.woff2') format('woff2'); font-weight: 400; }
@font-face { font-family: 'Battambang'; src: url('/fonts/battambang-700.woff2') format('woff2'); font-weight: 700; }
body.lang-km { font-family: 'Battambang', 'Segoe UI', system-ui, sans-serif; }
body.lang-km .nav-item { line-height: 1.8; }
.lang-toggle { font-size: 13px; font-weight: 700; color: var(--blue); }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }

/* ── Đăng nhập ── */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 40px; width: 100%; max-width: 420px; text-align: center; }
.login-logo { font-size: 48px; }
.login-logo img { width: 96px; height: 96px; object-fit: contain; }
.brand-logo img { width: 40px; height: 40px; object-fit: contain; vertical-align: middle; }
.login-card h1 { font-size: 26px; margin: 8px 0 4px; }
.login-sub { color: var(--muted); margin-bottom: 24px; }
.login-card form { text-align: left; }
.login-card label { display: block; font-weight: 600; margin: 14px 0 6px; }
.req { color: var(--red); }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; }
.login-card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.error-msg { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: 8px; margin-top: 14px; }

/* ── Layout ── */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid var(--border); }
.brand-logo { font-size: 28px; }
.brand b { font-size: 16px; display: block; }
.brand small { color: var(--muted); }
.sidebar nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; }
.nav-item { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; margin-bottom: 2px; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.sidebar-footer { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 14px; border-top: 1px solid var(--border); }
.me { flex: 1; min-width: 0; }
.me b, .me small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--muted); }
.sidebar-footer .btn-ghost { padding: 6px 6px; }
.main { flex: 1; padding: 28px 32px; max-width: 1200px; }
.view { display: none; }
.view.active { display: block; }
.view h2 { font-size: 22px; margin-bottom: 20px; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.view-head h2 { margin: 0; }

/* ── Cards & stats ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { font-size: 16px; }
.link { color: var(--blue); text-decoration: none; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-icon.blue { background: var(--blue-light); } .stat-icon.purple { background: var(--purple-bg); }
.stat-icon.orange { background: var(--orange-bg); } .stat-icon.green { background: var(--green-bg); }
.stat-icon.teal { background: #ccfbf1; }
.stat-num { font-size: 26px; font-weight: 700; }
.stat-label { color: var(--muted); }

/* ── Bảng ── */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--bg); }
.empty { text-align: center; color: var(--muted); padding: 32px; }

/* ── Badge trạng thái ── */
.badge { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.pending { background: var(--orange-bg); color: var(--orange); }
.badge.approved { background: var(--green-bg); color: var(--green); }
.badge.rejected { background: var(--red-bg); color: var(--red); }
.badge.cancelled { background: var(--border); color: var(--muted); }
.badge.role-admin { background: var(--purple-bg); color: var(--purple); }
.badge.role-director { background: #fef9c3; color: #a16207; }
.badge.role-manager { background: var(--blue-light); color: var(--blue); }
.badge.role-employee { background: var(--border); color: var(--muted); }
.badge.brand-vera_premium { background: #fef3c7; color: #92400e; }
.badge.brand-vera_beauty { background: #fce7f3; color: #be185d; }
.badge.brand-skinlab { background: #dbeafe; color: #1e40af; }
.badge.tg-linked { background: var(--green-bg); color: var(--green); }
.badge.tg-none { background: var(--border); color: var(--muted); }
.badge.inactive { background: var(--red-bg); color: var(--red); }

/* ── Buttons ── */
.btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-block { width: 100%; margin-top: 18px; padding: 13px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--muted); font-size: 18px; }
.btn-ghost:hover { color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-approve { background: var(--green); color: #fff; }
.btn-reject { background: var(--red-bg); color: var(--red); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.actions { display: flex; gap: 8px; }

/* ── Filters ── */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input, .filters select { padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--card); font-family: inherit; }
.filters input { flex: 1; min-width: 220px; }

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 22px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hr-details { border: 1px dashed var(--border); border-radius: 10px; padding: 8px 12px; }
.hr-details summary { cursor: pointer; font-weight: 700; }
.hr-details textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 13px; }
.badge.ms-probation_end { background: #ede9fe; color: #6d28d9; }
.badge.ms-contract_end { background: var(--orange-bg); color: var(--orange); }
.badge.ms-birthday { background: #fce7f3; color: #be185d; }
.badge.ms-anniversary { background: #dcfce7; color: #15803d; }
.table tr.warn td { background: #fff7ed; }
.table td.ok, .table th.ok { background: #f0fdf4; font-weight: 700; }
.modal-body label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; }
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus { outline: none; border-color: var(--blue); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.detail-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.detail-row b { text-align: right; }
.log-item { padding: 8px 0; border-bottom: 1px dashed var(--border); color: var(--muted); font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Kanban công việc ── */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.kanban-col { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; padding: 2px 4px 12px; }
.kanban-count { background: var(--bg); border-radius: 99px; padding: 2px 10px; font-size: 12px; color: var(--muted); }
.task-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: pointer; background: #fff; }
.task-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.task-title { font-weight: 600; margin-bottom: 6px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.task-meta .badge { font-size: 11px; padding: 2px 8px; }
.badge.prio-high { background: var(--red-bg); color: var(--red); }
.badge.prio-medium { background: var(--orange-bg); color: var(--orange); }
.badge.prio-low { background: var(--green-bg); color: var(--green); }
.badge.overdue { background: var(--red); color: #fff; }
.task-actions { display: flex; gap: 6px; margin-top: 10px; }
.kanban-empty { color: var(--muted); text-align: center; padding: 14px 0; font-size: 13px; }
@media (max-width: 1000px) { .kanban { grid-template-columns: 1fr; } }

/* ── Lịch làm việc ── */
.brand-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.brand-tab { padding: 8px 16px; border: 1px solid var(--border); border-radius: 99px; background: var(--card); cursor: pointer; font-weight: 600; font-size: 13px; font-family: inherit; }
.brand-tab:hover { border-color: var(--blue); }
.brand-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
#view-schedule input[type=month] { padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 14px; }
.today-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.sch-namelist { list-style: none; margin-top: 6px; }
.sch-namelist li { padding: 4px 0; border-bottom: 1px dashed var(--border); }
.sch-legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sch-legend .lg { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 20px; border-radius: 5px; font-weight: 700; font-size: 11px; margin-left: 8px; }
.sch-table { border-collapse: collapse; font-size: 12px; }
.sch-table th, .sch-table td { border: 1px solid var(--border); width: 30px; min-width: 30px; height: 34px; text-align: center; padding: 0; color: var(--muted); }
.sch-table thead th { background: var(--bg); font-weight: 600; }
.sch-table .sticky-col { position: sticky; left: 0; background: var(--card); text-align: left; min-width: 160px; padding: 5px 10px; z-index: 2; }
.sch-table thead .sticky-col { z-index: 3; }
.sch-table td.wknd, .sch-table th.wknd { background: #f8fafc; }
.sch-table th.today, .sch-table td.today { outline: 2px solid var(--blue); outline-offset: -2px; }
/* Nhóm vai trò trên bảng lịch: hàng tiêu đề nhóm + cột tên tô màu theo vị trí */
.sch-table tr.sch-group-row td { background: var(--grpbg); color: var(--grp); font-weight: 700; text-align: left; padding: 6px 10px; font-size: 12px; height: 30px; white-space: nowrap; border-left: 4px solid var(--grp); }
.sch-table tr.sch-group-row .sticky-col { background: var(--grpbg); }
.sch-table td.sch-emp-col { border-left: 4px solid var(--grp); background: var(--grpbg); color: var(--text, #1e293b); }
.sch-table td.m-off { background: var(--orange-bg); color: var(--orange); font-weight: 700; }
.sch-table td.m-trip { background: #dbeafe; color: #1e40af; font-weight: 700; }
.sch-table td.m-late { background: #fef9c3; color: #a16207; font-weight: 700; }
.m-off { background: var(--orange-bg); color: var(--orange); }
.m-trip { background: #dbeafe; color: #1e40af; }
.m-late { background: #fef9c3; color: #a16207; }

/* ── Thông báo toàn công ty / phòng ban ── */
.ann-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px; }
.ann-row:hover { background: var(--bg); }
.ann-targets { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 8px 0; }
.ann-tgt { display: inline-flex !important; align-items: center; gap: 6px; flex-direction: row !important; font-weight: 400; cursor: pointer; white-space: nowrap; }
.ann-tgt input { width: auto !important; }

/* ── Đánh giá tay nghề KTV ── */
.kr-progress-row { display: flex; justify-content: space-between; align-items: center; }
.kr-bar { height: 8px; background: var(--bg); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.kr-bar-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.kr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.kr-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--card); transition: transform .1s, box-shadow .1s; }
.kr-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.kr-card.done { border-color: #86efac; background: #f0fdf4; }
.kr-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.kr-card.done .kr-avatar { background: var(--green, #16a34a); }
.kr-badge { margin-top: 5px; font-size: 12px; font-weight: 600; }
.kr-badge.done { color: var(--green, #16a34a); }
.kr-badge.todo { color: var(--orange, #d97706); }
.kr-section { margin-top: 12px; padding: 10px; background: var(--bg); border-radius: 10px; }
.kr-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.kr-item:last-child { border-bottom: none; }
.kr-stars { white-space: nowrap; }
.kr-star { font-size: 22px; color: #d1d5db; cursor: pointer; padding: 0 1px; user-select: none; }
.kr-star.on { color: #f59e0b; }
.kr-star:hover { transform: scale(1.15); display: inline-block; }

/* ── Form trong card (ngoài modal) — vd trang Kho tài liệu AI ── */
.card .form-grid { margin-top: 4px; }
.card .form-grid label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.card .form-grid input, .card .form-grid select, .card .form-grid textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.card .form-grid input:focus, .card .form-grid select:focus { outline: none; border-color: var(--blue); }
.card .form-grid input[type=file] { padding: 8px; background: var(--bg); cursor: pointer; }

/* Khung kết quả test hỏi thử AI */
#rag-ask-result { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-family: inherit; font-size: 13.5px; color: var(--text); line-height: 1.7; min-height: 20px; }
#rag-ask-result:empty { display: none; }

/* ── Hướng dẫn ── */
.guide-list { padding-left: 20px; line-height: 1.9; }
.guide-list li { margin-bottom: 6px; }
.view code, .modal-body code { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 13px; }
.view .card h3 { margin-bottom: 10px; }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--text); color: #fff; padding: 13px 20px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); z-index: 200; }
.toast.error { background: var(--red); }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .main { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ── Sắp ca trực ── */
.sch-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sch-mode, .sch-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge.lock-on { background: var(--red-bg); color: var(--red); }
.badge.lock-off { background: var(--green-bg); color: var(--green); }
.sch-wrap { overflow: auto; max-height: 72vh; }
.sch-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.sch-table th, .sch-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); width: 34px; min-width: 34px; height: 36px; text-align: center; padding: 0; color: var(--muted); position: relative; }
.sch-table thead th { background: var(--bg); font-weight: 600; position: sticky; top: 0; z-index: 4; padding: 3px 0; line-height: 1.1; text-transform: none; letter-spacing: 0; font-size: 12px; }
.sch-table thead th small { font-weight: 400; font-size: 10px; }
.sch-table .sticky-col { position: sticky; left: 0; background: var(--card); text-align: left; min-width: 190px; padding: 5px 10px; z-index: 3; }
.sch-table thead .sticky-col { z-index: 5; }
.sch-table td.wknd, .sch-table th.wknd { background: #f8fafc; }
.sch-table th.today, .sch-table td.today { box-shadow: inset 0 0 0 2px var(--blue); }
.sch-table tr.sch-group-row td { background: var(--grpbg); color: var(--grp); font-weight: 700; text-align: left; padding: 6px 10px; font-size: 12px; height: 30px; white-space: nowrap; border-left: 4px solid var(--grp); }
.sch-table tr.sch-group-row .sticky-col { background: var(--grpbg); }
.sch-table td.sch-emp-col { border-left: 4px solid var(--grp); background: var(--grpbg); color: var(--text); }
.sch-emp { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; }
.sch-emp-chk { width: 14px; height: 14px; margin: 0; cursor: pointer; }
.sch-table td.sc.ed { cursor: pointer; }
.sch-table td.sc.ed:hover { background: var(--blue-light); }
.sch-table td.sc.sel { background: #dbeafe !important; box-shadow: inset 0 0 0 2px var(--blue); }
.sch-table td.sc.unset.ed::after { content: '·'; color: #cbd5e1; font-size: 18px; line-height: 0; }
.sch-table td.sc.unset.ed.sel::after, .sch-table td.sc.unset.ed:hover::after { content: '+'; color: var(--blue); font-size: 14px; }
.sch-table td.tot { min-width: 40px; width: 40px; background: var(--bg); font-weight: 700; color: var(--text); }
.sch-table th.tot { min-width: 40px; width: 40px; }
.sch-table td.tot.has-ot, .has-ot { color: var(--orange); }
.sch-table tfoot tr.cov td { height: 26px; font-size: 11px; background: #fafbfe; color: var(--muted); border-top: 1px solid var(--border); }
.sch-table tfoot tr.cov td.sticky-col { font-weight: 600; color: var(--text); }
.sch-table tfoot tr.unset-row td { color: var(--orange); font-weight: 600; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 6px; font-weight: 800; font-size: 11px; color: #fff; background: var(--c, #64748b); font-family: inherit; border: none; cursor: inherit; }
.chip.offc { background: var(--orange-bg); color: var(--orange); }
.chip.big { flex-direction: column; min-width: 58px; height: 46px; cursor: pointer; gap: 1px; font-size: 15px; border: 2px solid transparent; }
.chip.big small { font-weight: 500; font-size: 9.5px; opacity: .9; }
.chip.big.cur { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }
.chip.big:hover { filter: brightness(1.08); }
.sch-table b.ot { position: absolute; right: 1px; bottom: 1px; font-size: 9px; line-height: 1; background: var(--orange); color: #fff; border-radius: 4px; padding: 1px 3px; font-weight: 800; }
.sch-legend b.ot { font-size: 10px; background: var(--orange); color: #fff; border-radius: 4px; padding: 1px 4px; }
.sch-table b.ot.early { background: var(--red); right: auto; left: 1px; }
.sch-legend b.ot.early { background: var(--red); }
.sch-table td.tot small.early-tot { display: block; font-size: 9.5px; color: var(--red); font-weight: 700; line-height: 1.1; }
.has-early { color: var(--red); }
.sch-table i.otr { position: absolute; right: 1px; bottom: 1px; font-size: 8.5px; line-height: 1; border: 1px dashed var(--orange); color: var(--orange); border-radius: 4px; padding: 1px 2px; font-style: normal; background: #fff; }
i.mk { position: absolute; left: 1px; top: 1px; font-size: 8.5px; line-height: 1; font-style: normal; font-weight: 800; border-radius: 3px; padding: 1px 3px; white-space: nowrap; max-width: calc(100% - 2px); overflow: hidden; }
.sch-legend i.mk { position: static; font-size: 10px; margin: 0 2px 0 6px; }
i.mk.mk-off { background: var(--orange-bg); color: var(--orange); }
i.mk.mk-trip { background: #dbeafe; color: #1e40af; }
i.mk.mk-late { background: #fef9c3; color: #a16207; }
.sch-table i.nt { position: absolute; right: 2px; top: 1px; font-size: 9px; font-style: normal; color: var(--purple); }
.sch-table.week th, .sch-table.week td { width: 120px; min-width: 120px; height: 58px; }
.sch-table.week td.sc small { display: block; font-size: 10px; line-height: 1.2; margin-top: 2px; color: var(--muted); }
.sch-table.week td.tot, .sch-table.week th.tot { width: 44px; min-width: 44px; }
.sch-legend .lg { margin-left: 8px; }
#sch-legend { margin: -6px 0 10px; line-height: 2; }
.sch-legend small { color: var(--muted); margin-right: 4px; }
.sch-pop { position: fixed; z-index: 90; width: 340px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 12px 14px; font-size: 13px; }
.pop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pop-shifts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pop-row { display: grid; grid-template-columns: 60px 1fr; gap: 6px 8px; align-items: center; margin-bottom: 10px; }
.pop-row label { font-weight: 600; font-size: 12px; }
.pop-row input { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 13px; width: 100%; }
.pop-ot { display: flex; align-items: center; gap: 6px; }
.pop-ot input { width: 64px; flex: none; }
.pop-ot select { padding: 7px 6px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 13px; background: var(--card); color: inherit; }
.pop-ot span { font-size: 12px; color: var(--muted, #64748b); }
.pop-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lock-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.chk-row { display: flex; gap: 14px; flex-wrap: wrap; }
.chk-row label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.chk-row input { width: auto; }
.rp-grid { grid-template-columns: repeat(4, 1fr); }
.rp-table td.warn { background: var(--orange-bg); color: var(--orange); font-weight: 700; }
tr.inactive td { opacity: .5; }
.tg-preview { background: #eff6ff; border-radius: 12px; padding: 14px 16px; font-size: 13.5px; line-height: 1.55; white-space: normal; font-family: 'Battambang', 'Segoe UI', system-ui, sans-serif; }

/* ── Đa đơn vị: bộ chọn + dải "Đang thao tác" (màu theo từng đơn vị qua --org) ── */
.org-switch { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.org-switch:empty { display: none; }
.org-switch-label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.org-select { width: 100%; padding: 8px 6px; font-size: 12.5px; border: 2px solid var(--org, var(--blue)); border-radius: 8px; font-weight: 700; color: var(--text); background: var(--card); }
.org-pill { border-left: 4px solid var(--org, var(--blue)); padding: 6px 10px; border-radius: 6px; background: var(--blue-light); font-weight: 700; font-size: 13px; }
.org-banner { position: sticky; top: 0; z-index: 20; margin: -28px -32px 20px; padding: 9px 32px; background: var(--card); border-bottom: 3px solid var(--org, var(--blue)); font-size: 14px; }
.org-banner:empty { display: none; }
.org-banner small { color: var(--muted); }
.org-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--org, var(--blue)); vertical-align: middle; }
.row-guest td { background: #fafafa; color: var(--muted); }
.row-warn td { background: var(--orange-bg); }
@media (max-width: 860px) { .org-banner { margin: -18px -18px 14px; padding: 8px 18px; } }
