/* ============ Dental CRM — giao diện ============ */
:root {
  --bg: #f3f5fb; --card: #ffffff; --text: #141b2d; --muted: #67718a; --line: #e4e8f2;
  --primary: #3b5bfd; --primary-2: #7c3aed; --primary-soft: #e9edff; --accent: #06b6d4;
  --ok: #10935a; --ok-soft: #e0f6eb; --warn: #b26a00; --warn-soft: #fff1d6; --bad: #d92d4b; --bad-soft: #fde7ec;
  --side: #0b1020; --side-2: #141b34; --side-ink: #aeb7d3; --radius: 14px;
  --grad: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 60%, #db2777 120%);
  --shadow: 0 1px 2px rgba(20, 27, 45, .04), 0 8px 24px -12px rgba(20, 27, 45, .14);
  --shadow-hi: 0 2px 6px rgba(59, 91, 253, .08), 0 18px 40px -14px rgba(59, 91, 253, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.5 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text);
  background:
    radial-gradient(1200px 600px at 110% -10%, rgba(124, 58, 237, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(6, 182, 212, .08), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(59, 91, 253, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 700; }
h2 { font-size: .98rem; margin: 0 0 10px; font-weight: 650; }
h3 { font-size: .92rem; margin: 0 0 6px; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .tiny { font-size: .74rem; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.bad { color: var(--bad); }
.row { display: flex; gap: 12px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; }
.spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; }
.g-3col { grid-template-columns: 300px minmax(0, 1fr) 320px; }
@media (max-width: 1100px) { .g3, .g4, .g-side, .g-3col { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g2 { grid-template-columns: 1fr; } }
.page-h { margin-bottom: 14px; } .page-h h1 { margin: 0; }
kbd { font: 600 .68rem/1 inherit; padding: 3px 6px; border-radius: 6px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: inherit; opacity: .8; }

/* ---------- khung: thanh bên ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: linear-gradient(180deg, var(--side-2) 0%, var(--side) 55%); color: var(--side-ink);
  padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.04);
}
.side::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 220px; pointer-events: none; background: radial-gradient(240px 160px at 30% 0%, rgba(124,58,237,.35), transparent 70%); }
.side .brand { position: relative; color: #fff; display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; }
.side .brand:hover { text-decoration: none; }
.side .brand .logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: var(--grad); box-shadow: 0 6px 20px -4px rgba(124,58,237,.7); animation: float 6s ease-in-out infinite; }
.side .brand b { display: block; font-size: .92rem; line-height: 1.2; }
.side .brand small { display: block; font-weight: 400; color: var(--side-ink); font-size: .72rem; }
.side a, .side .all-btn { position: relative; display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 8px 10px; border-radius: 10px; margin-bottom: 2px; transition: background .2s, color .2s, transform .2s; }
.side a .ic, .side .all-btn .ic { width: 22px; text-align: center; filter: saturate(1.2); }
.side a:hover, .side .all-btn:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; transform: translateX(2px); }
.side a.on { color: #fff; background: linear-gradient(90deg, rgba(59,91,253,.9), rgba(124,58,237,.75)); box-shadow: 0 8px 22px -10px rgba(124,58,237,.9), inset 0 0 0 1px rgba(255,255,255,.12); }
.side a.on::after { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #c4b5fd; box-shadow: 0 0 12px #a78bfa; }
.side .sec { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: #6f7a99; margin: 10px 10px 6px; }
.side .pins a.dragging { opacity: .4; }
.side .pins a[draggable] { cursor: pointer; }
.side .all-btn { width: 100%; background: transparent; border: 1px dashed rgba(255,255,255,.12); cursor: pointer; font: inherit; margin-top: 6px; }
.side .all-btn kbd { margin-left: auto; }
.side .side-empty { color: #6f7a99; padding: 0 10px; }
.side .side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.06); }
.side .org-switch { padding: 0 8px 12px; position: relative; }
.side .org-switch select { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.1); padding: 6px 8px; }
.side .count { margin-left: auto; background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; border-radius: 999px; font-size: .68rem; padding: 0 7px; line-height: 18px; box-shadow: 0 0 0 0 rgba(244,63,94,.6); animation: ping 2.4s infinite; }

/* ---------- khung: thanh trên ---------- */
.main { min-width: 0; }
.top {
  background: rgba(255,255,255,.72); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid rgba(228,232,242,.8); display: flex; align-items: center; gap: 10px; padding: 9px 18px; position: sticky; top: 0; z-index: 30;
}
.top .search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; transition: box-shadow .2s, border-color .2s; }
.top .search:focus-within { border-color: #c7d0ff; box-shadow: 0 0 0 4px rgba(59,91,253,.12); }
.top .search input { border: 0; padding: 8px 0; background: transparent; outline: none; }
.hamb { display: none; background: none; border: 0; font-size: 1.3rem; cursor: pointer; }
.branch-pick { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 4px 0 10px; height: 34px; font-size: .82rem; }
.branch-pick.fixed { padding-right: 12px; }
.branch-pick select { border: 0; background: transparent; padding: 4px 4px; width: auto; font-weight: 600; cursor: pointer; outline: none; }
.shift { position: relative; }
.shift-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: 600 .8rem/1 inherit; cursor: pointer; transition: all .2s; }
.shift-btn:hover { border-color: #c7d0ff; box-shadow: var(--shadow-hi); transform: translateY(-1px); }
.shift-btn.on { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border-color: #a7f3d0; color: #065f46; }
.shift-menu { position: absolute; right: 0; top: 42px; width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: 0 24px 60px -20px rgba(20,27,45,.35); display: grid; gap: 6px; opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: all .18s; z-index: 40; }
.shift-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #10b981; display: inline-block; box-shadow: 0 0 0 0 rgba(16,185,129,.7); animation: ping 1.8s infinite; flex: none; }
.content { padding: 20px 22px 90px; animation: rise .45s ease both; }
.who { display: flex; align-items: center; gap: 8px; }
.who .r { font-size: .75rem; color: var(--muted); }

/* ---------- thẻ ---------- */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: box-shadow .25s, transform .25s, border-color .25s; }
.card::before, .wcard::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(124,58,237,.07), transparent 45%);
}
.card:hover::before, .wcard:hover::before { opacity: 1; }
a.card:hover, .card.glowy:hover { box-shadow: var(--shadow-hi); transform: translateY(-2px); border-color: #d5dbff; text-decoration: none; }
.card + .card { margin-top: 14px; }
.grid > .card + .card { margin-top: 0; }
.card.narrow { max-width: 460px; margin: 10vh auto; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-h h2 { margin: 0; }
.stat { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.list > * { padding: 9px 0; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 18px 6px; font-size: .86rem; }

/* ---------- biểu đồ ---------- */
.bar { display: grid; grid-template-columns: 120px 1fr 44px; gap: 8px; align-items: center; margin: 7px 0; font-size: .84rem; }
.bar .track { background: #eef1f8; border-radius: 99px; height: 10px; overflow: hidden; }
.bar .fill { height: 100%; width: var(--w, auto); background: var(--grad); border-radius: 99px; animation: grow 1s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; box-shadow: 0 0 12px rgba(124,58,237,.35); }
.bar .fill.ai { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 110px; }
.vbars > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: .72rem; color: var(--muted); }
.vbars span.b { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.vbars.fancy { height: calc(100% - 34px); min-height: 120px; }
.vbars.fancy span.b { height: var(--h); background: linear-gradient(180deg, #8b5cf6, #3b5bfd); border-radius: 8px 8px 3px 3px; animation: growy .9s cubic-bezier(.2,.8,.2,1) both; transform-origin: bottom; box-shadow: 0 6px 18px -6px rgba(59,91,253,.6); transition: filter .2s; }
.vbars.fancy > div:hover span.b { filter: brightness(1.15) saturate(1.2); }
.vbars.fancy em { font-style: normal; margin-top: 4px; }
.rbar { height: 8px; background: #eef1f8; border-radius: 99px; overflow: hidden; margin-bottom: 3px; }
.rbar span { display: block; height: 100%; background: var(--grad); border-radius: 99px; animation: grow 1s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#7c3aed calc(var(--p) * 1%), #eef1f8 0); }
.ring span { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: .7rem; font-weight: 700; }

/* ---------- nhãn ---------- */
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .73rem; background: #eef1f8; color: var(--muted); white-space: nowrap; font-weight: 500; }
.pill.hot, .pill.missed, .pill.overdue, .pill.no_show, .pill.cancelled, .pill.rejected, .pill.negative, .pill.lost { background: var(--bad-soft); color: var(--bad); }
.pill.warn, .pill.warm, .pill.requested, .pill.booked, .pill.pending, .pill.proposed, .pill.ringing, .pill.new { background: var(--warn-soft); color: var(--warn); }
.pill.confirmed, .pill.completed, .pill.done, .pill.paid, .pill.accepted, .pill.ended, .pill.positive, .pill.patient { background: var(--ok-soft); color: var(--ok); }
.pill.cold, .pill.checked_in, .pill.in_chair, .pill.in_progress, .pill.answered, .pill.in_treatment { background: var(--primary-soft); color: var(--primary); }
.tag { display: inline-block; background: #f0f2f7; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: .75rem; margin: 0 4px 4px 0; }
.ai-chip { background: linear-gradient(135deg, #f3edff, #fce7f3); color: #6d28d9; }

/* ---------- bảng ---------- */
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--muted); font-weight: 500; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
table.t tr { transition: background .15s; }
table.t tr:hover td { background: #f7f8ff; }
.num { text-align: right; white-space: nowrap; }

/* ---------- form, nút ---------- */
input, select, textarea, button { font: inherit; }
input, select, textarea { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: #fff; color: var(--text); width: 100%; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #c7d0ff; box-shadow: 0 0 0 4px rgba(59,91,253,.12); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
label { display: grid; gap: 3px; font-size: .8rem; color: var(--muted); }
label.inline { display: inline-flex; align-items: center; gap: 6px; }
.form { display: grid; gap: 10px; }
.form .row > * { flex: 1; }
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; background: var(--grad); background-size: 160% 160%; color: #fff; border: 0; border-radius: 10px; padding: 8px 14px;
  cursor: pointer; font-weight: 600; white-space: nowrap; box-shadow: 0 6px 16px -8px rgba(59,91,253,.8); transition: transform .15s, box-shadow .2s, background-position .5s, filter .2s;
}
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(124,58,237,.8); background-position: 100% 0; }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: #c7d0ff; box-shadow: 0 6px 16px -10px rgba(59,91,253,.6); }
.btn.ghost::after { background: linear-gradient(120deg, transparent 30%, rgba(59,91,253,.08) 50%, transparent 70%); }
.btn.ok { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 6px 16px -8px rgba(16,185,129,.8); }
.btn.bad { background: linear-gradient(135deg, #f43f5e, #be123c); box-shadow: 0 6px 16px -8px rgba(244,63,94,.8); }
.btn.warn { background: linear-gradient(135deg, #f59e0b, #b45309); }
.btn.glow { animation: glow 3s ease-in-out infinite; }
.btn.sm { padding: 4px 9px; font-size: .78rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
form.inline { display: inline; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; transition: color .2s; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.alert { padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; animation: rise .35s ease both; }
.alert.err { background: var(--bad-soft); color: var(--bad); } .alert.ok { background: var(--ok-soft); color: var(--ok); } .alert.warn { background: var(--warn-soft); color: var(--warn); }
.allergy { background: var(--bad); color: #fff; padding: 6px 10px; border-radius: 8px; font-weight: 600; margin-bottom: 12px; }

/* kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { min-width: 230px; max-width: 230px; background: #eaeef5; border-radius: var(--radius); padding: 8px; }
.kcol h3 { display: flex; justify-content: space-between; margin: 2px 4px 8px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; cursor: grab; }
.kcard.dragging { opacity: .5; }
.kcol.over { outline: 2px dashed var(--primary); }

/* inbox */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr) 300px; gap: 0; height: calc(100vh - 56px); }
.inbox .pane { overflow-y: auto; border-right: 1px solid var(--line); background: var(--card); }
.inbox .conv { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); color: inherit; }
.inbox .conv:hover { background: #f7f9fc; text-decoration: none; }
.inbox .conv.on { background: var(--primary-soft); }
.inbox .conv .unread { background: var(--primary); color: #fff; border-radius: 999px; padding: 0 6px; font-size: .7rem; }
.chat { display: flex; flex-direction: column; height: 100%; }
.chat .msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f7f9fc; }
.bubble { max-width: 75%; padding: 7px 11px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.bubble.out { align-self: flex-end; background: var(--primary); color: #fff; border: 0; }
.bubble.out .muted { color: #d6e6fb; }
.chat form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat textarea { flex: 1; }
@media (max-width: 1100px) { .inbox { grid-template-columns: 1fr; height: auto; } }

/* calendar */
.cal { display: grid; gap: 8px; }
.cal-head, .cal-body { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(150px, 1fr)); gap: 8px; }
.cal-head div { font-weight: 600; padding: 4px; }
.cal-hours { position: relative; height: 840px; }
.cal-hours div { height: 60px; font-size: .72rem; color: var(--muted); border-top: 1px solid var(--line); }
.cal-col { position: relative; height: 840px; background: repeating-linear-gradient(#fff 0 59px, var(--line) 59px 60px); border: 1px solid var(--line); border-radius: 8px; }
.appt { position: absolute; left: 4px; right: 4px; border-radius: 6px; padding: 3px 6px; font-size: .75rem; overflow: hidden; border-left: 4px solid var(--primary); background: var(--primary-soft); color: var(--text); }
.appt:hover { z-index: 3; overflow: visible; height: auto !important; min-height: 40px; box-shadow: 0 4px 14px rgba(0,0,0,.15); text-decoration: none; }
.appt.confirmed { border-color: var(--ok); background: var(--ok-soft); }
.appt.booked, .appt.requested { border-color: var(--warn); background: var(--warn-soft); }
.appt.checked_in, .appt.in_chair { border-color: #6a3fc8; background: #f3edff; }
.appt.completed { opacity: .65; }
.appt.no_show, .appt.cancelled { border-color: var(--bad); background: var(--bad-soft); opacity: .7; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; }

/* dental chart */
.teeth { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; margin-bottom: 6px; }
.teeth.primary { grid-template-columns: repeat(10, 1fr); max-width: 640px; margin-left: auto; margin-right: auto; }
.tooth { border: 1px solid var(--line); border-radius: 8px; text-align: center; padding: 4px 2px; cursor: pointer; background: #fff; user-select: none; }
.tooth .n { font-size: .72rem; color: var(--muted); }
.tooth svg { width: 30px; height: 30px; display: block; margin: 2px auto; }
.tooth.sel { outline: 2px solid var(--primary); }
.tooth.caries svg .c { fill: #f5b5b5; } .tooth.filled svg .c { fill: #9cc6f5; } .tooth.crown svg .c { fill: #f7d78b; }
.tooth.rct svg .c { fill: #cdb3f1; } .tooth.missing { opacity: .35; } .tooth.missing svg .c { fill: #ddd; }
.tooth.implant svg .c { fill: #8fd3b0; } .tooth.bridge svg .c { fill: #f7c79b; } .tooth.extraction_planned svg .c { fill: #f08080; }
.tooth.impacted svg .c { fill: #c9c9c9; }
.tooth svg .s.on { fill: #3a86e0; }
.midline { height: 1px; background: var(--muted); margin: 6px 0; }
.legend span { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; font-size: .75rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.progress { height: 8px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); }

/* popup cuộc gọi + toast */
#popups { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; width: 330px; }
.popup { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px; }
.popup.call { border-left: 5px solid var(--ok); }
.popup .x { float: right; cursor: pointer; color: var(--muted); }
#softphone { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
#softphone .dot { width: 8px; height: 8px; border-radius: 50%; background: #aaa; display: inline-block; }
#softphone .dot.on { background: var(--ok); }
.timeline .it { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline .ic { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #eef1f6; font-size: .8rem; }
body.plain { background: var(--bg); padding: 20px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; }
.pill.j-lead_moi, .pill.j-dang_tu_van { background: var(--warn-soft); color: var(--warn); }
.pill.j-da_dat_lich, .pill.j-dang_dieu_tri { background: var(--primary-soft); color: var(--primary); }
.pill.j-theo_doi_sau_dieu_tri { background: #f3e8ff; color: #6a3fc8; }
.pill.j-hoan_tat, .pill.j-tai_kham_dinh_ky { background: var(--ok-soft); color: var(--ok); }
.pill.j-mat { background: var(--bad-soft); color: var(--bad); }
.queue-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.queue-row:first-child { border-top: 0; }
.queue-row .qa { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.lg { display:inline-block; width:10px; height:10px; border-radius:2px; vertical-align:middle; margin:0 2px 0 8px; }

/* ============ mới: tổng quan kéo thả ============ */
.hero { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.hero > div:first-child { flex: 1; min-width: 260px; }
.hero-kicker { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.hero-title { font-size: 1.9rem; font-weight: 800; margin: 2px 0 2px; letter-spacing: -.02em; background: linear-gradient(90deg, #141b2d, #3b5bfd 55%, #7c3aed 80%, #db2777); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 8s linear infinite; }
.hero-title .wave { display: inline-block; -webkit-text-fill-color: initial; animation: wave 2.4s ease-in-out 1; transform-origin: 70% 70%; }
.hero-actions { display: flex; gap: 8px; }
.hint-new { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; margin-bottom: 12px; border-radius: 14px; background: linear-gradient(135deg, #eef2ff, #fdf4ff); border: 1px solid #e0e7ff; font-size: .84rem; }
.chip { border: 1px solid #c7d2fe; background: #fff; border-radius: 999px; padding: 3px 10px; cursor: pointer; font-size: .78rem; transition: all .2s; }
.chip:hover { background: var(--grad); color: #fff; border-color: transparent; }
.edit-bar { position: sticky; top: 60px; z-index: 20; display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: 10px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #1e1b4b, #4c1d95); box-shadow: 0 14px 30px -14px rgba(76,29,149,.8); }
.edit-bar .muted { color: #c4b5fd; }
.edit-bar .btn.ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.grid-stack { margin: 0 -8px; }
.grid-stack-item-content { overflow: visible !important; }
.wcard {
  position: relative; height: 100%; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow .25s, transform .25s, border-color .25s; animation: rise .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 60ms);
}
.wcard::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); opacity: .0; transition: opacity .3s; }
.wcard:hover { box-shadow: var(--shadow-hi); border-color: #d5dbff; transform: translateY(-2px); }
.wcard:hover::after { opacity: 1; }
.wh { display: flex; align-items: center; gap: 8px; padding: 12px 14px 6px; }
.wh h2 { margin: 0; font-size: .9rem; }
.wi { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #eef2ff, #f5f3ff); box-shadow: inset 0 0 0 1px #e0e7ff; flex: none; transition: transform .3s; }
.wcard:hover .wi { transform: rotate(-8deg) scale(1.08); }
.wb { flex: 1; min-height: 0; overflow: auto; padding: 4px 14px 12px; }
.wx { display: none; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--bad); }
body.editing .wx { display: block; }
body.editing .wh { cursor: move; background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(124,58,237,.04) 8px 16px); }
body.editing .wcard { outline: 2px dashed #c4b5fd; outline-offset: -2px; }
body.editing .wcard:hover { transform: none; }
.grid-stack-item.just-added .wcard { animation: pop .6s cubic-bezier(.2,.8,.2,1.4) both; }
.grid-stack > .grid-stack-item > .ui-resizable-se { filter: hue-rotate(40deg); }
.grid-stack-placeholder > .placeholder-content { border: 2px dashed #a78bfa !important; background: rgba(167,139,250,.08) !important; border-radius: 16px; }
.skel { height: 14px; border-radius: 8px; margin: 10px 0; background: linear-gradient(90deg, #eef1f8 0%, #f8f9fd 40%, #eef1f8 80%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel.s2 { width: 80%; } .skel.s3 { width: 60%; }
.wmeta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .76rem; color: var(--muted); margin-bottom: 6px; }
.wmeta a { margin-left: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); grid-auto-rows: minmax(max-content, 1fr); gap: 10px; height: auto; min-height: 100%; }
.kpis.finance-kpis { min-height: 0; margin-bottom: 10px; }
.wcard[data-w="kpis"] .wb { overflow: hidden; }
.wcard[data-w="kpis"] .kpis { min-height: 0; }
.kpi { position: relative; overflow: hidden; border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; color: #fff; isolation: isolate; transition: transform .25s; }
.kpi:hover { transform: translateY(-2px) scale(1.01); }
.kpi > * { flex-shrink: 0; overflow-wrap: anywhere; }
.kpi::before { content: ""; position: absolute; inset: -40%; z-index: -1; background: conic-gradient(from 0deg, transparent, rgba(255,255,255,.25), transparent 30%); animation: spin 7s linear infinite; opacity: .6; }
.kpi.k1 { background: linear-gradient(135deg, #3b5bfd, #6366f1); } .kpi.k2 { background: linear-gradient(135deg, #7c3aed, #c026d3); }
.kpi.k3 { background: linear-gradient(135deg, #059669, #10b981); } .kpi.k4 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.kpi .kl { font-size: .72rem; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.kpi b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.kpi .ks { font-size: .74rem; opacity: .9; } .kpi .ks a { color: #fff; text-decoration: underline; } .kpi .bad { color: #fff; font-weight: 700; }
.alist { display: grid; gap: 6px; }
.arow { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: #fafbff; border: 1px solid #eef0f8; border-left: 4px solid var(--primary); transition: transform .2s, box-shadow .2s; }
.arow:hover { transform: translateX(3px); box-shadow: 0 6px 18px -10px rgba(59,91,253,.5); }
.arow.confirmed { border-left-color: #10b981; } .arow.booked, .arow.requested { border-left-color: #f59e0b; } .arow.checked_in, .arow.in_chair { border-left-color: #8b5cf6; background: #faf7ff; }
.arow.completed { opacity: .6; } .arow.no_show, .arow.cancelled { border-left-color: var(--bad); opacity: .6; }
.arow .at { font-weight: 800; font-size: .95rem; color: #1e1b4b; }
.np-top { display: flex; gap: 10px; align-items: center; }
.np-name { font-size: 1.05rem; }
.avatar { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad); box-shadow: 0 6px 16px -6px rgba(124,58,237,.8); flex: none; }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: .8rem; }
.allergy-chip { margin: 10px 0 6px; padding: 6px 10px; border-radius: 10px; background: linear-gradient(135deg, #fff1f2, #ffe4e6); color: #be123c; font-weight: 700; font-size: .82rem; border: 1px solid #fecdd3; animation: blink 2.2s ease-in-out infinite; }
.np-note { margin: 6px 0; font-style: italic; }
.np-plan { font-size: .82rem; margin-top: 4px; }
.wn { padding: 6px 0 8px; border-bottom: 1px solid var(--line); } .wn:last-of-type { border-bottom: 0; }
.wn-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.wn-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; background: #ecfdf5; color: #065f46; font-size: .78rem; font-weight: 600; border: 1px solid #bbf7d0; }
.person small { color: #047857; font-weight: 400; }
.score { font-weight: 800; color: #be123c; background: linear-gradient(135deg, #ffe4e6, #fce7f3); border-radius: 10px; padding: 2px 8px; }
.tick { width: 26px; height: 26px; border-radius: 9px; border: 1.5px solid #c7d0ff; background: #fff; color: transparent; cursor: pointer; transition: all .2s; }
.tick:hover { background: var(--grad); color: #fff; border-color: transparent; transform: scale(1.1); }
table.bc td { vertical-align: middle; }
.drawer { position: fixed; inset: 0; z-index: 80; background: rgba(11,16,32,.35); backdrop-filter: blur(3px); display: flex; justify-content: flex-end; animation: fade .2s both; }
[hidden] { display: none !important; }
.drawer-box { width: min(520px, 100%); height: 100%; overflow: auto; background: #fff; padding: 18px; box-shadow: -20px 0 60px -20px rgba(11,16,32,.5); animation: slidein .3s cubic-bezier(.2,.8,.2,1) both; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cat { position: relative; text-align: left; display: grid; gap: 4px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: all .2s; font: inherit; }
.cat:hover { border-color: #c7d0ff; box-shadow: var(--shadow-hi); transform: translateY(-2px); }
.cat .cat-on { display: none; position: absolute; right: 10px; top: 10px; color: var(--ok); font-weight: 700; }
.cat.added { opacity: .55; pointer-events: none; } .cat.added .cat-on { display: block; }
.templates { margin-top: 26px; }
.tpl { display: grid; gap: 6px; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); transition: all .25s; }
.tpl:hover { transform: translateY(-3px); box-shadow: var(--shadow-hi); border-color: #d5dbff; }
.tpl.on { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box; border: 2px solid transparent; }
.tpl .btn { justify-self: start; }
.tpl-mini { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 6px; gap: 2px; padding: 6px; border-radius: 10px; background: #f5f6fb; height: 92px; overflow: hidden; }
.tpl-mini i { border-radius: 3px; background: linear-gradient(135deg, #c7d2fe, #ddd6fe); }
.tpl:hover .tpl-mini i { background: linear-gradient(135deg, #818cf8, #a78bfa); }

/* ============ ☰ Tất cả ============ */
.palette { position: fixed; inset: 0; z-index: 90; background: rgba(11,16,32,.45); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding-top: 10vh; animation: fade .15s both; }
.palette-box { width: min(620px, calc(100% - 24px)); max-height: 72vh; display: flex; flex-direction: column; background: rgba(255,255,255,.96); border-radius: 18px; border: 1px solid rgba(255,255,255,.6); box-shadow: 0 40px 100px -30px rgba(11,16,32,.6), 0 0 0 1px rgba(124,58,237,.08); animation: pop .25s cubic-bezier(.2,.8,.2,1.2) both; overflow: hidden; }
.palette-search { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.palette-search input { border: 0; font-size: 1rem; padding: 4px; box-shadow: none !important; }
.palette-search kbd { color: var(--muted); background: #f3f4f8; border-color: var(--line); }
.palette-list { overflow: auto; padding: 6px 8px 10px; }
.palette-h { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 10px 8px 4px; }
.palette-item { display: flex; align-items: center; border-radius: 10px; transition: background .12s; }
.palette-item a { flex: 1; display: flex; gap: 10px; align-items: center; padding: 8px 10px; color: var(--text); }
.palette-item a:hover { text-decoration: none; }
.palette-item .ic { width: 22px; text-align: center; }
.palette-item:hover, .palette-item.hl { background: linear-gradient(90deg, #eef2ff, #f5f3ff); }
.palette-item .pin { border: 0; background: none; cursor: pointer; font-size: .95rem; padding: 6px 10px; filter: grayscale(1); opacity: .35; transition: all .2s; }
.palette-item .pin:hover { opacity: .8; transform: rotate(-15deg); }
.palette-item .pin.on { filter: none; opacity: 1; }
.palette-item .pin.pop { animation: pop .4s cubic-bezier(.2,.8,.2,1.6); }
.palette-foot { padding: 8px 14px; border-top: 1px solid var(--line); }

/* ============ trợ lý nổi ============ */
.fab { position: fixed; right: 22px; bottom: 22px; z-index: 70; width: 58px; height: 58px; border-radius: 20px; border: 0; cursor: pointer; color: #fff; font-size: 1.5rem; background: var(--grad); background-size: 200% 200%; box-shadow: 0 16px 34px -10px rgba(124,58,237,.9), inset 0 0 0 1px rgba(255,255,255,.25); transition: transform .25s, border-radius .25s; animation: gradmove 6s ease infinite; }
.fab::before { content: ""; position: absolute; inset: -6px; border-radius: 24px; background: var(--grad); filter: blur(14px); opacity: .45; z-index: -1; animation: breathe 3s ease-in-out infinite; }
.fab:hover { transform: translateY(-3px) rotate(-6deg) scale(1.05); }
.fab.open { border-radius: 50%; transform: rotate(90deg); }
.fab span { display: inline-block; animation: twinkle 2.6s ease-in-out infinite; }
.assist { position: fixed; right: 22px; bottom: 92px; z-index: 70; width: min(400px, calc(100% - 24px)); height: min(560px, calc(100vh - 130px)); display: flex; flex-direction: column; background: rgba(255,255,255,.92); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid rgba(255,255,255,.7); border-radius: 22px; box-shadow: 0 40px 90px -30px rgba(76,29,149,.55), 0 0 0 1px rgba(124,58,237,.1); overflow: hidden; animation: pop .3s cubic-bezier(.2,.8,.2,1.2) both; transform-origin: bottom right; }
.assist[hidden] { display: none; }
.assist header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, #312e81, #6d28d9 60%, #be185d); }
.assist header a { color: #e9d5ff; } .assist header .tiny { opacity: .8; }
.assist .x { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; width: 26px; height: 26px; cursor: pointer; font-size: 1rem; }
.assist-log { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.assist-log .u { align-self: flex-end; max-width: 85%; } .assist-log .u span { display: inline-block; background: var(--grad); color: #fff; padding: 7px 12px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; box-shadow: 0 6px 16px -8px rgba(124,58,237,.8); }
.assist-log .a { align-self: flex-start; max-width: 90%; background: #fff; border: 1px solid var(--line); padding: 8px 12px; border-radius: 16px 16px 16px 4px; white-space: pre-wrap; animation: rise .3s both; }
.assist-log .st { font-size: .78rem; color: var(--muted); border-left: 3px solid #ddd6fe; padding: 2px 8px; }
.assist-log .st.err { border-color: var(--bad); color: var(--bad); }
.assist-log .st.need { border-color: var(--warn); color: inherit; background: var(--warn-soft); padding: 8px; border-radius: 10px; }
.assist-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.assist-sugg button { border: 1px solid #ddd6fe; background: #faf5ff; color: #5b21b6; border-radius: 999px; padding: 4px 10px; font-size: .76rem; cursor: pointer; transition: all .2s; }
.assist-sugg button:hover { background: var(--grad); color: #fff; border-color: transparent; transform: translateY(-1px); }
.assist form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: rgba(255,255,255,.8); }
.assist textarea { resize: none; border-radius: 14px; }
.assist .btn { border-radius: 14px; }
.dots { display: inline-flex; gap: 4px; } .dots b { width: 6px; height: 6px; border-radius: 50%; background: #a78bfa; animation: bounce 1s infinite; } .dots b:nth-child(2) { animation-delay: .15s; } .dots b:nth-child(3) { animation-delay: .3s; }
.st.typing { border: 0 !important; }
#popups { bottom: 96px !important; }

/* ============ chi nhánh, lịch làm việc ============ */
.branch-card { padding: 0; overflow: hidden; color: inherit; }
.branch-map { height: 170px; background: linear-gradient(135deg, #eef2ff, #f0fdfa); position: relative; }
.branch-map iframe, .map-card iframe { width: 100%; height: 100%; border: 0; display: block; filter: saturate(1.1); }
.branch-card .branch-map iframe { pointer-events: none; }
.map-card { padding: 0; overflow: hidden; height: 340px; }
.map-empty { height: 100%; display: grid; place-items: center; color: var(--muted); }
.map-empty.big { padding: 30px; text-align: center; }
.map-coords { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,.92); padding: 3px 8px; border-radius: 8px; }
.branch-body { padding: 14px 16px; }
.branch-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: .78rem; color: var(--muted); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week .day { background: #fafbff; border: 1px solid #eef0f8; border-radius: 12px; padding: 8px; display: grid; gap: 5px; align-content: start; min-height: 90px; }
.slot { display: inline-grid; gap: 0; padding: 4px 8px; border-radius: 10px; background: linear-gradient(135deg, #eef2ff, #f5f3ff); border: 1px solid #e0e7ff; font-size: .76rem; font-weight: 600; color: #3730a3; margin: 2px; }
.slot small { font-weight: 400; color: #6366f1; font-size: .68rem; }
.slot.away { opacity: .45; }
.sched td { vertical-align: middle; }
.dlg { border: 0; border-radius: 18px; padding: 18px; width: min(680px, calc(100% - 24px)); box-shadow: 0 40px 100px -30px rgba(11,16,32,.6); }
.dlg::backdrop { background: rgba(11,16,32,.45); backdrop-filter: blur(4px); }
.sch-line { margin: 6px 0; } .sch-line select, .sch-line input { width: auto; flex: 1; }
.roster { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.roster-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .78rem; font-weight: 600; }
.roster-chip i { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.roster-chip.on i { background: #10b981; box-shadow: 0 0 0 0 rgba(16,185,129,.7); animation: ping 1.8s infinite; }
.roster-chip.off { opacity: .45; } .roster-chip.off i { background: #cbd5e1; }
.roster-chip small { font-weight: 400; color: var(--muted); }
.cal-head .off, .cal-col.off { opacity: .45; }
.cal-col.off { background: repeating-linear-gradient(-45deg, #f8fafc 0 10px, #f1f5f9 10px 20px); }

/* ============ chuyển động ============ */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes growy { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes shine { from { background-position: 0% 0; } to { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); } 70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
@keyframes glow { 0%, 100% { box-shadow: 0 6px 16px -8px rgba(59,91,253,.8); } 50% { box-shadow: 0 8px 26px -6px rgba(219,39,119,.75); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
@keyframes blink { 0%, 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0); } 50% { box-shadow: 0 0 0 4px rgba(244,63,94,.18); } }
@keyframes gradmove { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes breathe { 0%, 100% { opacity: .35; transform: scale(.95); } 50% { opacity: .65; transform: scale(1.05); } }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.15) rotate(12deg); } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ============ điện thoại ============ */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 60; width: 260px; transform: translateX(-100%); transition: transform .3s; }
  body.side-open .side { transform: none; box-shadow: 30px 0 80px -20px rgba(0,0,0,.6); }
  .hamb { display: block; }
  .top { flex-wrap: wrap; padding: 8px 12px; }
  .top .search { order: 9; max-width: none; flex-basis: 100%; }
  #softphone, .top .pill { display: none; }
  .content { padding: 14px 16px 90px; }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: 1fr; }
  .arow { grid-template-columns: 48px minmax(0, 1fr); } .arow .pill, .arow .aa { grid-column: 2; justify-self: start; }
}

/* ============ đăng nhập ============ */
body.login { min-height: 100vh; display: grid; place-items: center; overflow: hidden; background: radial-gradient(1000px 700px at 80% 0%, #ede9fe, transparent 60%), radial-gradient(900px 600px at 0% 100%, #e0f2fe, transparent 60%), #f5f6fb; }
.login .orb { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 9s ease-in-out infinite; pointer-events: none; }
.login .o1 { width: 340px; height: 340px; background: #a78bfa; top: -80px; right: 8%; }
.login .o2 { width: 300px; height: 300px; background: #60a5fa; bottom: -60px; left: 6%; animation-delay: -3s; }
.login .o3 { width: 200px; height: 200px; background: #f472b6; top: 40%; left: 55%; animation-delay: -6s; opacity: .35; }
.login-card { position: relative; width: min(440px, calc(100% - 32px)); margin: 0 !important; padding: 28px; background: rgba(255,255,255,.82); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.7); border-radius: 22px; box-shadow: 0 40px 90px -30px rgba(76,29,149,.45); animation: pop .5s cubic-bezier(.2,.8,.2,1.2) both; }
.login-logo { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 1.7rem; background: var(--grad); box-shadow: 0 12px 30px -8px rgba(124,58,237,.8); margin-bottom: 10px; animation: float 6s ease-in-out infinite; }
.login-card .hero-title { font-size: 1.7rem; margin: 0 0 4px; }

/* ---------- demo tự tạo ---------- */
.demo-bar { font-size: .72rem; color: #c4b5fd; padding: 0 10px 10px; line-height: 1.4; }

/* nút chuyển trong ô (Của tôi / Cả chi nhánh) */
.seg { display: inline-flex; border: 1px solid var(--line, #e5e7eb); border-radius: 999px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: .72rem; padding: 2px 9px; border-radius: 999px; cursor: pointer; color: inherit; }
.seg button.on { background: linear-gradient(135deg, #7c3aed, #ec4899); color: #fff; }

/* Xem như nhân viên */
.viewas-bar { position: sticky; top: 0; z-index: 30; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 16px; background: #fef3c7; color: #78350f; border-bottom: 1px solid #fcd34d; font-size: .88rem; }

/* Keep the full-function menu label and shortcut on one line. */
.side .all-btn { gap:6px; padding:8px; }
.side .all-btn .lb { white-space:nowrap; font-size:.78rem; }
.side .all-btn kbd { white-space:nowrap; font-size:.6rem; }
