@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

:root {
  --primary: #1d6ff2; --primary-600: #155fd6; --primary-50: #eaf2ff; --primary-100: #d6e5ff;
  --navy: #0e2a4d; --navy-2: #12355f;
  --text: #0f1f38; --muted: #64748b; --border: #e3e8f0; --bg: #f4f7fb; --card: #ffffff;
  --danger: #e5484d; --danger-50: #fdecec; --warn: #f59e0b; --warn-50: #fff5e6;
  --success: #16a34a; --success-50: #e7f7ee; --purple: #9333ea; --purple-50: #f3e8ff;
  --radius: 12px; --shadow: 0 1px 2px rgba(15, 31, 56, .06), 0 4px 16px rgba(15, 31, 56, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack > * + * { margin-top: 12px; }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 500; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: #c9d3e1; background: #f8fafc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 52px; font-size: 16px; font-weight: 600; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
label.lbl { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
label.lbl .req { color: var(--danger); }
.input, select.input, textarea.input { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: #fff; outline: none; transition: .15s; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input[readonly] { background: #f6f8fb; }
.field { margin-bottom: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ---------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef2f7; color: #475569; }
.badge.blue { background: var(--primary-50); color: var(--primary); }
.badge.green { background: var(--success-50); color: var(--success); }
.badge.red { background: var(--danger-50); color: var(--danger); }
.badge.orange { background: var(--warn-50); color: #c2410c; }
.badge.purple { background: var(--purple-50); color: var(--purple); }
.badge.dark { background: #1e293b; color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- card / table */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card h3 { font-size: 16px; margin-bottom: 12px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 13px; color: #334155; font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #fafbfd; white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #f9fbff; }
.tbl-wrap { overflow-x: auto; }

/* ---------- toast / modal */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f1f38; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; animation: pop .2s; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 31, 56, .45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.modal.wide { max-width: 860px; }
.modal-h { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal-h h3 { font-size: 17px; }
.modal-b { padding: 20px; overflow: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.alert { padding: 12px 14px; border-radius: 10px; background: var(--primary-50); color: #1e40af; font-size: 13px; }
.alert.red { background: var(--danger-50); color: #b42318; }
.alert.orange { background: var(--warn-50); color: #9a3412; }
.alert.green { background: var(--success-50); color: #166534; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ================================================================ LOGIN */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #e7efff, #f5f8ff); }
.login-shell { width: 100%; max-width: 1200px; min-height: 640px; border-radius: 22px; overflow: hidden; display: grid; grid-template-columns: 1.15fr 1fr .55fr; box-shadow: 0 30px 80px rgba(14, 42, 77, .25); position: relative;
  background: radial-gradient(circle at 20% 90%, rgba(255,255,255,.12), transparent 40%), linear-gradient(160deg, #1a5fd0 0%, #154ca8 45%, #0e2a4d 100%); }
.login-shell::after { content: ''; position: absolute; inset: 0; pointer-events: none; background:
  repeating-linear-gradient(90deg, transparent 0 58px, rgba(255,255,255,.035) 58px 60px),
  linear-gradient(to top, rgba(8,24,48,.7), transparent 45%); }
.login-left { position: relative; z-index: 1; color: #fff; padding: 36px 40px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 52px; height: 52px; }
.brand b { display: block; font-size: 22px; letter-spacing: .5px; }
.brand span { font-size: 15px; letter-spacing: 3px; opacity: .9; }
.login-left h1 { font-size: 42px; line-height: 1.25; font-weight: 600; margin-top: 60px; }
.login-left p { font-size: 17px; opacity: .92; line-height: 1.7; margin-top: 18px; }
.login-pills { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; width: 180px; }
.login-pills div { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,.14); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.2); }
.login-pills i { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.2); display: inline-flex; align-items: center; justify-content: center; font-style: normal; }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 190px; z-index: 0; opacity: .5; }
.login-card { position: relative; z-index: 2; background: #fff; margin: 28px 0; border-radius: 18px; padding: 40px 36px; box-shadow: 0 20px 50px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.login-card h2 { font-size: 30px; margin-bottom: 14px; }
.login-card .foot { margin-top: auto; padding-top: 28px; font-size: 12px; color: var(--muted); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-right { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 16px; padding: 28px 22px; justify-content: center; }
.feat { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(8px); border-radius: 16px; padding: 18px 12px; color: #fff; text-align: center; }
.feat i { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%; background: #fff; color: var(--primary); display: flex; align-items: center; justify-content: center; font-style: normal; }
.feat b { display: block; font-size: 15px; }
.feat span { font-size: 12px; opacity: .85; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 8px; top: 7px; border: 0; background: none; cursor: pointer; color: var(--muted); }
.demo-acc { margin-top: 14px; font-size: 12px; color: var(--muted); background: #f6f8fb; border-radius: 10px; padding: 10px 12px; }
.demo-acc code { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; cursor: pointer; }
@media (max-width: 1000px) {
  .login-shell { grid-template-columns: 1fr; min-height: 0; }
  .login-left { padding: 26px 22px 10px; }
  .login-left h1 { font-size: 28px; margin-top: 20px; }
  .login-left p, .login-pills, .login-right, .skyline { display: none; }
  .login-card { margin: 12px; padding: 28px 22px; }
}

/* ================================================================ WEB APP LAYOUT */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex-shrink: 0; background: linear-gradient(180deg, var(--navy) 0%, #0b2140 100%); color: #cfdcf0; padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 6px 22px; color: #fff; }
.sidebar .brand img { width: 40px; height: 40px; }
.sidebar .brand b { font-size: 16px; }
.sidebar .brand span { font-size: 11px; }
.nav a { display: flex; align-items: center; gap: 12px; color: #cfdcf0; padding: 11px 12px; border-radius: 10px; margin-bottom: 4px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(29,111,242,.35); }
.nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav .cnt { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.sidebar .sb-foot { margin-top: auto; font-size: 11px; opacity: .6; padding: 8px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 68px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.search { flex: 1; max-width: 460px; position: relative; }
.search input { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: #f6f8fb; padding: 0 12px 0 38px; outline: none; }
.search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--muted); }
.bell { position: relative; cursor: pointer; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.bell:hover { background: #f1f5f9; }
.bell .n { position: absolute; top: 3px; right: 3px; background: var(--danger); color: #fff; font-size: 10px; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 10px; }
.user-chip:hover { background: #f1f5f9; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #1d6ff2, #0e2a4d); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.user-chip b { display: block; font-size: 14px; }
.user-chip span { font-size: 12px; color: var(--muted); }
.content { padding: 24px; flex: 1; }
.page-h { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 26px; font-weight: 700; }
.page-h p { margin: 4px 0 0; color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { border: 0; background: #eef2f7; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; color: #334155; }
.tabs button.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 0 18px; height: 38px; cursor: pointer; font-weight: 500; }
.seg button.active { background: var(--primary); color: #fff; }
.pager { display: flex; gap: 6px; }
.pager button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.menu-pop { position: absolute; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(15,31,56,.15); z-index: 200; min-width: 200px; padding: 6px; }
.menu-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.menu-pop button:hover { background: #f1f5f9; }
.notif-pop { width: 380px; max-height: 480px; overflow: auto; padding: 0; }
.notif-item { padding: 12px 14px; border-bottom: 1px solid #eef1f6; cursor: pointer; }
.notif-item.unread { background: #f5f9ff; }
.notif-item.urgent b { color: var(--danger); }
.notif-item b { display: block; font-size: 13px; }
.notif-item p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px; display: flex; gap: 12px; align-items: center; }
.kpi .ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi b { font-size: 24px; display: block; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: 12px; }

/* stepper */
.stepper { display: flex; align-items: flex-start; margin: 18px 0 22px; }
.stepper .st { flex: 1; text-align: center; position: relative; color: var(--muted); font-size: 13px; }
.stepper .st i { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; font-style: normal; font-weight: 600; position: relative; z-index: 1; }
.stepper .st::before { content: ''; position: absolute; top: 16px; left: -50%; right: 50%; height: 2px; background: #e2e8f0; }
.stepper .st:first-child::before { display: none; }
.stepper .st.active { color: var(--text); font-weight: 600; }
.stepper .st.active i, .stepper .st.done i { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper .st.done::before, .stepper .st.active::before { background: var(--primary); }

/* ---------- CALENDAR */
.cal-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.queue { padding: 14px; position: sticky; top: 84px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.queue-list { overflow: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; }
.qcard { border: 1px solid var(--border); border-left: 4px solid #94a3b8; border-radius: 10px; padding: 10px 12px; background: #fff; cursor: grab; font-size: 13px; }
.qcard:active { cursor: grabbing; }
.qcard.gap { border-left-color: var(--danger); }
.qcard.cao { border-left-color: #f97316; }
.qcard.thuong { border-left-color: var(--primary); }
.qcard b { font-size: 13px; }
.qcard .l { color: var(--muted); font-size: 12px; }
.cal { overflow: auto; }
.cal-grid { display: grid; min-width: 820px; }
.cal-grid .hd { background: #fafbfd; border-bottom: 1px solid var(--border); border-right: 1px solid #eef1f6; padding: 10px 6px; text-align: center; font-size: 13px; font-weight: 600; position: sticky; top: 0; z-index: 2; }
.cal-grid .hd.today { color: var(--primary); background: var(--primary-50); }
.cal-grid .tech { padding: 10px; border-right: 1px solid var(--border); border-bottom: 1px solid #eef1f6; display: flex; gap: 10px; align-items: center; background: #fff; position: sticky; left: 0; z-index: 1; }
.cal-grid .tech b { font-size: 13px; display: block; }
.cal-grid .cell { border-right: 1px solid #eef1f6; border-bottom: 1px solid #eef1f6; min-height: 96px; padding: 5px; display: flex; flex-direction: column; gap: 5px; transition: background .1s; }
.cal-grid .cell.off { background: repeating-linear-gradient(45deg, #fafbfd, #fafbfd 6px, #f3f5f9 6px, #f3f5f9 12px); }
.cal-grid .cell.over { background: var(--primary-50); outline: 2px dashed var(--primary); outline-offset: -3px; }
.job { border-radius: 8px; padding: 6px 8px; font-size: 12px; cursor: pointer; border: 1px solid transparent; position: relative; }
.job b { display: block; font-size: 12px; }
.job .t { font-weight: 600; }
.job.lap_dat { background: #e3edff; border-color: #bcd3ff; }
.job.sua_chua { background: #dcf5e5; border-color: #b4e6c6; }
.job.bao_tri { background: #efe4ff; border-color: #d9c2ff; }
.job.di_doi { background: #fff0d9; border-color: #ffd89c; }
.job.khao_sat, .job.other { background: #e8ebf0; border-color: #cfd5de; }
.job.gap::after { content: 'GẤP'; position: absolute; right: 4px; top: 4px; font-size: 9px; font-weight: 700; background: var(--danger); color: #fff; padding: 0 4px; border-radius: 4px; }
.job.late { box-shadow: 0 0 0 2px var(--danger) inset; }
.job.done { opacity: .6; }
.job .prog { font-size: 10px; margin-top: 2px; opacity: .85; }
.legend { display: flex; gap: 18px; justify-content: center; padding: 14px; flex-wrap: wrap; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
/* day view */
.day-grid { position: relative; min-width: 900px; }
.day-row { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid #eef1f6; }
.day-track { position: relative; height: 74px; background-image: linear-gradient(90deg, #eef1f6 1px, transparent 1px); }
.day-track.over { background-color: var(--primary-50); }
.day-track .job { position: absolute; top: 6px; bottom: 6px; overflow: hidden; }
.day-hours { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid var(--border); background: #fafbfd; position: sticky; top: 0; z-index: 2; }
.day-hours .hs { position: relative; height: 36px; }
.day-hours .hs span { position: absolute; top: 9px; font-size: 12px; color: var(--muted); transform: translateX(-50%); }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
/* month */
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-grid .hd { padding: 10px; text-align: center; font-weight: 600; font-size: 13px; background: #fafbfd; border-bottom: 1px solid var(--border); }
.month-grid .md { min-height: 104px; border-right: 1px solid #eef1f6; border-bottom: 1px solid #eef1f6; padding: 6px; cursor: pointer; }
.month-grid .md:hover { background: #f9fbff; }
.month-grid .md.dim { background: #fafbfd; color: #a0aec0; }
.month-grid .md.today .dn { background: var(--primary); color: #fff; }
.month-grid .dn { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.month-grid .mc { font-size: 11px; margin-top: 4px; padding: 2px 6px; border-radius: 6px; }

/* drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(15,31,56,.35); z-index: 900; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 520px; max-width: 100%; background: #fff; z-index: 901; box-shadow: -10px 0 40px rgba(0,0,0,.15); display: flex; flex-direction: column; animation: slide .2s; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-h { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.drawer-b { padding: 20px; overflow: auto; flex: 1; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.sec-t { font-weight: 700; font-size: 14px; margin: 20px 0 10px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; }
.timeline { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 14px; }
.timeline div { position: relative; padding-bottom: 12px; font-size: 13px; }
.timeline div::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline small { color: var(--muted); display: block; }
.sugg { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.sugg:hover { border-color: var(--primary); }
.sugg.sel { border-color: var(--primary); background: var(--primary-50); }
.sugg .sc { margin-left: auto; font-weight: 700; color: var(--primary); }
.chips-box { display: flex; flex-wrap: wrap; gap: 6px; min-height: 42px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfd; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 500; }
.chip.lead { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary); }
.chip a[data-rm] { color: var(--muted); cursor: pointer; font-size: 11px; margin-left: 2px; }
.chip a[data-rm]:hover { color: var(--danger); }
.sugg .cb { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #cbd5e1; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.sugg.sel .cb { background: var(--primary); border-color: var(--primary); }
.team-tag { font-size: 10px; font-weight: 700; background: rgba(15,31,56,.1); border-radius: 6px; padding: 0 5px; }
.team-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef1f6; }
.team-row:last-child { border-bottom: 0; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); height: 100%; justify-content: flex-end; }
.bars .b .col { width: 100%; max-width: 36px; border-radius: 6px 6px 0 0; background: var(--primary-100); position: relative; }
.bars .b .col i { position: absolute; bottom: 0; left: 0; right: 0; background: var(--primary); border-radius: 6px 6px 0 0; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 2000; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }

@media (max-width: 1100px) {
  .cal-wrap { grid-template-columns: 1fr; }
  .queue { position: static; max-height: 320px; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -260px; z-index: 300; transition: left .2s; }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex !important; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .user-chip div { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .notif-pop { width: 92vw; right: 4vw !important; }
}
.menu-toggle { display: none !important; }
/* logo công ty */
.brand img { object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.card-logo { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto 22px; }
/* biểu đồ 3 cột (dashboard) */
.bars3 { display: flex; align-items: flex-end; gap: 10px; height: 190px; }
.bars3 .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; font-size: 11px; color: var(--muted); }
.bars3 .cols { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border); }
.bars3 .cols i { width: 22%; max-width: 14px; min-height: 2px; border-radius: 4px 4px 0 0; }
.dropzone { border: 2px dashed #c9d3e1; border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; background: #fafbfd; color: var(--muted); }
.dropzone b, .dropzone u { color: var(--primary); }
.dropzone.over { border-color: var(--primary); background: var(--primary-50); }
.thumbs .th { position: relative; display: inline-block; }
.thumbs .th button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 11px; }
/* ---------- Đăng nhập: ô nhập có biểu tượng + bố cục điện thoại (theo mẫu 01) */
.in-ic { position: relative; }
.in-ic > svg { position: absolute; left: 12px; top: 12px; width: 18px; height: 18px; color: #94a3b8; pointer-events: none; }
.in-ic > .input { padding-left: 40px; }
.login-slogan, .login-mfoot { display: none; }
@media (max-width: 1000px) {
  .login-page { padding: 0; align-items: stretch; background: linear-gradient(180deg, #e6efff 0%, #f3f7ff 45%, #ffffff 100%); }
  .login-shell { display: flex; flex-direction: column; min-height: 100vh; background: none; box-shadow: none; border-radius: 0; max-width: 480px; margin: 0 auto; }
  .login-shell::after, .login-left, .login-right { display: none; }
  .login-card { background: transparent; box-shadow: none; margin: 0; padding: 28px 18px 0; flex: 1; border-radius: 0; }
  .login-card > h2, .login-card > p.muted, .login-card > .foot { display: none; }
  .card-logo { max-width: 230px; margin-bottom: 14px; }
  .login-slogan { display: block; text-align: center; font-style: italic; font-weight: 600; font-size: 22px; line-height: 1.35; color: #1e40af; margin-bottom: 20px; }
  .login-box { background: #fff; border-radius: 18px; padding: 20px 16px 18px; box-shadow: 0 12px 34px rgba(14, 42, 77, .10); border: 1px solid #e8eef8; }
  .login-box .field { margin-bottom: 12px; }
  .login-box .divider { margin: 16px 0 12px; }
  .login-box #gg { height: 46px; }
  .demo-acc { margin-top: 12px; }
  .login-mfoot { display: block; margin: 22px -18px 0; }
  .login-mfoot .art { position: relative; height: 180px; overflow: hidden; }
  .login-mfoot .art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
  .login-mfoot .tag { position: absolute; right: 18px; top: 26px; color: #fff; text-align: right; font-size: 15px; line-height: 1.35; text-shadow: 0 2px 8px rgba(0,0,0,.25); }
  .login-mfoot .tag b { font-size: 24px; }
  .login-mfoot .copy { background: #0b2140; color: #cfdcf0; text-align: center; font-size: 12px; padding: 12px 10px calc(12px + env(safe-area-inset-bottom)); }
}
/* câu khẩu hiệu đăng nhập + lời chào dashboard */
.login-slogan { display: block; text-align: center; font-weight: 700; font-size: 17px; line-height: 1.45; color: #1e40af; margin: 0 0 18px; }
.login-slogan small { display: block; margin-top: 8px; font-size: 13px; font-weight: 500; font-style: normal; color: var(--muted); }
.greet { background: linear-gradient(90deg, var(--primary-50), #fff); border: 1px solid var(--primary-100); color: #1e3a8a; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 500; }
@media (max-width: 1000px) { .login-slogan { font-size: 19px; font-style: italic; margin-bottom: 20px; } .login-slogan small { font-style: normal; } }
.login-slogan .nw { white-space: nowrap; }
/* khối "Vì sao nên sử dụng app?" trên trang đăng nhập */
.why { margin-top: 18px; }
.why-t { display: flex; align-items: center; gap: 12px; color: #64748b; font-size: 14px; margin-bottom: 12px; }
.why-t::before, .why-t::after { content: ''; flex: 1; height: 1px; background: #dbe3ee; }
.why-g { display: grid; grid-template-columns: repeat(4, 1fr); background: #f4f8ff; border: 1px solid #e1eafa; border-radius: 16px; padding: 14px 6px; }
.why-i { text-align: center; padding: 4px 6px; position: relative; }
.why-i + .why-i::before { content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 1px; background: #dde6f3; }
.why-i i { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.why-i i svg { width: 24px; height: 24px; }
.why-i b { display: block; font-size: 13px; color: var(--text); line-height: 1.3; }
.why-i span { display: block; font-size: 11.5px; color: #64748b; line-height: 1.4; margin-top: 3px; }
/* 1 hàng 4 cột như mẫu — thu gọn để vừa khung đăng nhập hẹp */
.why { margin-left: -8px; margin-right: -8px; }
.why-g { grid-template-columns: repeat(4, 1fr); padding: 12px 2px; }
.why-i { padding: 2px 4px; }
.why-i i { width: 40px; height: 40px; margin-bottom: 6px; }
.why-i i svg { width: 21px; height: 21px; }
.why-i b { font-size: 12px; }
.why-i span { font-size: 10.5px; }
/* ===== Đăng nhập trên điện thoại: vừa khít 1 màn hình, không cuộn ===== */
@media (max-width: 1000px) {
  html:has(.login-page), body:has(.login-page) { height: 100%; overflow: hidden; overscroll-behavior: none; }
  .login-page { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .login-shell { height: 100%; min-height: 0; }
  .login-card { display: flex; flex-direction: column; min-height: 0; padding: 12px 16px 0; overflow: hidden; }
  .card-logo { max-width: 170px; margin: 0 auto 6px; flex-shrink: 0; }
  .login-slogan { font-size: 15px; line-height: 1.35; margin-bottom: 10px; flex-shrink: 0; }
  .login-slogan small { font-size: 12px; margin-top: 4px; }
  .login-box { padding: 12px 14px 10px; flex-shrink: 0; }
  .login-box .field { margin-bottom: 8px; }
  .login-box label.lbl { font-size: 12px; margin-bottom: 4px; }
  .login-box .input { height: 40px; }
  .login-box .in-ic > svg { top: 11px; }
  .login-box .pw-wrap button { top: 7px; }
  .login-box #f > .row { margin-bottom: 10px !important; font-size: 13px; }
  .login-box .btn.lg { height: 44px; }
  .login-box .alert { padding: 8px 10px; margin-bottom: 8px !important; }
  .why { margin-top: 10px; }
  .why-t { font-size: 12.5px; margin-bottom: 7px; }
  .why-g { padding: 8px 2px; }
  .why-i i { width: 34px; height: 34px; margin-bottom: 4px; }
  .why-i i svg { width: 18px; height: 18px; }
  .why-i b { font-size: 11.5px; }
  .why-i span { font-size: 10px; margin-top: 2px; }
  .demo-acc { display: none !important; }
  /* dải minh họa cuối trang co giãn để lấp phần còn lại */
  .login-mfoot { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin: 10px -16px 0; }
  .login-mfoot .art { flex: 1 1 auto; height: auto; min-height: 0; }
  .login-mfoot .tag { top: 50%; transform: translateY(-50%); font-size: 13px; }
  .login-mfoot .tag b { font-size: 20px; }
  .login-mfoot .copy { flex-shrink: 0; padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); font-size: 11px; }
}
/* màn hình thấp (iPhone SE, máy Android nhỏ): bỏ dòng mô tả nhỏ + minh họa để vẫn vừa 1 màn hình */
@media (max-width: 1000px) and (max-height: 700px) {
  .why-i span { display: none; }
  .login-slogan small { display: none; }
  .login-mfoot .tag { display: none; }
}
@media (max-width: 1000px) and (max-height: 600px) {
  .login-mfoot .art { display: none; }
  .why { display: none; }
}
/* bỏ hình minh họa thành phố; canh giữa nội dung, © nhỏ ở đáy trên nền sáng */
@media (max-width: 1000px) {
  .login-card { justify-content: center; }
  .login-mfoot { flex: 0 0 auto; margin: 0 -16px; position: absolute; left: 16px; right: 16px; bottom: 0; }
  .login-mfoot .art { display: none; }
  .login-mfoot .copy { background: none; color: #94a3b8; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .login-shell { position: relative; }
  .login-card { padding-bottom: 36px; }
}
/* không còn hình minh họa → đủ chỗ, hiện lại mô tả trên máy màn hình thấp */
@media (max-width: 1000px) and (max-height: 700px) {
  .why-i span { display: block; }
  .login-slogan small { display: block; }
}
/* logo lớn hơn + giãn cách đều cho giao diện điện thoại */
@media (max-width: 1000px) {
  .login-card { padding: 14px 18px 34px; }
  .card-logo { max-width: 210px; margin-bottom: 12px; }
  .login-slogan { font-size: 15.5px; margin-bottom: 16px; }
  .login-slogan small { margin-top: 6px; }
  .login-box { padding: 16px 15px 14px; }
  .login-box .field { margin-bottom: 10px; }
  .login-box #f > .row { margin-bottom: 12px !important; }
  .why { margin-top: 14px; }
  .why-t { margin-bottom: 9px; }
  .why-g { padding: 10px 2px; }
}
/* máy màn hình thấp: logo vừa phải để vẫn đủ chỗ */
@media (max-width: 1000px) and (max-height: 700px) {
  .card-logo { max-width: 180px; margin-bottom: 8px; }
  .login-slogan { font-size: 14.5px; margin-bottom: 12px; }
  .login-box { padding: 13px 14px 11px; }
  .login-box .field { margin-bottom: 8px; }
  .why { margin-top: 11px; }
}
