/* MORA C-suite ảo — token theo bộ nhận diện MORA (mora.vn/brand/static/site.css): primary #0077B2, chữ Plus Jakarta Sans, wordmark MORA Tech. */
@font-face { font-family: "MORA Tech"; src: url("/static/fonts/MoraTech-Regular.woff2") format("woff2"); font-display: swap; }

:root {
  --blue: #0077B2; --blue2: #00669A; --blue3: #005681; --blue-soft: #E6F2F8;
  --ink: #1F2328; --ink2: #3B4252; --mute: #5B6478; --line: #E3E8EF; --line2: #D5DCE6;
  --bg: #F6F8FC; --surface: #FFFFFF; --surface2: #F1F4F9; --hover: #EEF3F9;
  --ok: #047857; --ok-soft: #E3F4EC; --warn: #B45309; --warn-soft: #FDF1E1; --err: #C8102E; --err-soft: #FCE8EC;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  --radius: 10px; --radius-sm: 7px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --blue: #3AA6DC; --blue2: #62B8E4; --blue3: #8CCBEC; --blue-soft: #11304A;
    --ink: #E6EBF3; --ink2: #C3CBD8; --mute: #98A3B8; --line: #243150; --line2: #2E3C5E;
    --bg: #0B1220; --surface: #121B2C; --surface2: #18233A; --hover: #1C2942;
    --ok: #34D399; --ok-soft: #0E3328; --warn: #F5B35C; --warn-soft: #3A2A12; --err: #F37A8E; --err-soft: #3D1620;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 12px; text-wrap: balance; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 18px 0 10px; }
h3 { font-size: 14px; margin: 14px 0 8px; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.small { font-size: 13px; }
.muted { color: var(--mute); }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.gap { gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: inline; }
.grow { flex: 1; min-height: 0; }
.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Nút và ô nhập */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 14px/1 var(--font); padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line2); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue2); }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--line2)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink2); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--ink2); cursor: pointer; font-size: 17px; position: relative; }
.icon-btn:hover { background: var(--hover); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--blue) 35%, transparent); border-color: var(--blue); }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.row > label { flex: 1; min-width: 140px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 13px; font-weight: 600; color: var(--ink2); padding: 0 4px; }
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface2); color: var(--ink2); white-space: nowrap; }
.pill.ok, .st-da_duyet, .st-active { background: var(--ok-soft); color: var(--ok); }
.pill.err, .st-tu_choi, .st-locked, .st-disabled { background: var(--err-soft); color: var(--err); }
.pill.warn, .st-cho_duyet, .st-can_bo_sung, .st-invited { background: var(--warn-soft); color: var(--warn); }
.st-nhap, .st-huy { background: var(--surface2); color: var(--mute); }
.alert { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--ink); font-size: 14px; }
.alert.ok { background: var(--ok-soft); } .alert.err { background: var(--err-soft); color: var(--err); } .alert.warn { background: var(--warn-soft); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

/* Thương hiệu */
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none !important; }
.brand .wm { font-family: "MORA Tech", var(--font); font-size: 21px; letter-spacing: .02em; color: var(--ink); }
.brand-sub { font-size: 13px; font-weight: 600; color: var(--mute); border-left: 1px solid var(--line2); padding-left: 8px; }

/* Trang đăng nhập / thông báo */
body.auth { display: grid; place-items: center; padding: 24px 16px; min-height: 100%; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.auth-card.wide { max-width: 620px; }
.auth-card .brand { margin-bottom: 8px; }
.qr { background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); align-self: flex-start; }
.secret { word-break: break-all; }
.steps { padding-left: 18px; margin: 0; }

/* Khung ứng dụng */
body.app { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 16px; height: 56px; flex: none; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.top-search { flex: 1; max-width: 520px; position: relative; margin-left: 12px; }
.top-search input { background: var(--surface2); border-color: transparent; }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; padding: 6px; }
.search-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px; border-radius: 6px; cursor: pointer; color: var(--ink); font: inherit; }
.search-results button:hover { background: var(--hover); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; position: relative; }
.badge { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--err); color: #fff; font: 700 10px/16px var(--font); }
.notif-pop { position: absolute; top: 46px; right: 40px; width: min(380px, 92vw); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 10; }
.notif { display: block; padding: 9px 10px; border-radius: 6px; color: var(--ink); font-size: 14px; }
.notif:hover { background: var(--hover); text-decoration: none; }
.notif.unread { background: var(--blue-soft); }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .menu { position: absolute; right: 0; top: 44px; min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; z-index: 10; }
.user-menu .menu a, .user-menu .menu button { display: block; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; width: 100%; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--hover); text-decoration: none; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }

.avatar { --c: var(--blue); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; color: #fff; font-weight: 700; font-size: 13px;
  background: var(--c); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; vertical-align: middle; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.me { background: var(--ink2); }

.layout { flex: 1; display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: 0; position: relative; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-sec { padding: 12px 10px 6px; display: flex; flex-direction: column; min-height: 0; }
.side-sec.grow { flex: 1; border-top: 1px solid var(--line); }
.side-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding: 0 6px 6px; }
.side-title-row { padding-right: 4px; }
.exec-list { display: flex; flex-direction: column; gap: 2px; }
.exec-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--ink); text-decoration: none !important; border: 0; background: none; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.exec-item:hover { background: var(--hover); }
.exec-item.on { background: var(--blue-soft); }
.exec-item .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.exec-item .who b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exec-item .who span { font-size: 12px; color: var(--mute); }
.exec-item .paused { margin-left: auto; font-size: 11px; color: var(--warn); }
.conv-list { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; }
.conv-group { font-size: 12px; color: var(--mute); padding: 10px 8px 4px; }
.conv { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 7px; color: var(--ink); font-size: 14px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; font-family: inherit; }
.conv:hover { background: var(--hover); }
.conv.on { background: var(--surface2); font-weight: 600; }
.conv .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .x { opacity: 0; font-size: 13px; color: var(--mute); padding: 0 4px; }
.conv:hover .x { opacity: 1; }
.quota { padding: 8px 16px 12px; border-top: 1px solid var(--line); }
.meter { height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; width: var(--w, 0%); background: var(--blue); }

.main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.exec-head { display: flex; align-items: center; gap: 14px; padding: 14px 24px 10px; }
.exec-head .t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.exec-head .t .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exec-head .t b { font-size: 18px; }
.exec-head .ai-tag { font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: var(--blue-soft); color: var(--blue3); margin-left: 6px; vertical-align: 2px; }
.exec-head .meta { font-size: 13px; color: var(--mute); }
.exec-head .open-domain { margin-left: auto; flex: none; }
@media (max-width: 700px) { .exec-head .open-domain { display: none; } }
.tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; }
.tab { border: 0; background: none; font: 600 14px var(--font); color: var(--mute); padding: 10px 12px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--ink); border-bottom-color: var(--blue); }
.tab .count { font-size: 11px; background: var(--warn-soft); color: var(--warn); padding: 1px 6px; border-radius: 999px; }
.tab .count:empty { display: none; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; padding: 16px 24px; }
#pane-chat { padding: 0; overflow: hidden; }

/* Hội thoại */
.messages { flex: 1; overflow: auto; padding: 20px 24px 8px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; max-width: 860px; width: 100%; margin: 0 auto; }
.msg .body { flex: 1; min-width: 0; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--blue-soft); padding: 10px 14px; border-radius: 14px 14px 4px 14px; max-width: 78%; white-space: pre-wrap; word-wrap: break-word; }
.msg.note { justify-content: center; }
.msg.note .bubble { font-size: 13px; color: var(--mute); background: var(--surface2); padding: 6px 12px; border-radius: 999px; }
.msg .name { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.md { word-wrap: break-word; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md h3, .md h4 { margin: 12px 0 6px; font-size: 15px; }
.md pre { background: var(--surface2); padding: 10px 12px; border-radius: 8px; overflow: auto; font: 13px/1.5 var(--mono); }
.md code { background: var(--surface2); padding: 1px 5px; border-radius: 4px; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; margin: 6px 0 12px; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.md blockquote { border-left: 3px solid var(--line2); margin: 0 0 10px; padding: 2px 12px; color: var(--ink2); }
.cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; font-size: 11px; font-weight: 700; border-radius: 5px; background: var(--blue-soft); color: var(--blue3); vertical-align: 2px; cursor: help; border: 0; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.source { font-size: 12px; background: var(--surface2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 6px; color: var(--ink2); }
.msg-actions { display: flex; gap: 4px; margin-top: 6px; opacity: .75; }
.msg-actions button { border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--mute); padding: 3px 6px; border-radius: 6px; font-family: inherit; }
.msg-actions button:hover, .msg-actions button.on { background: var(--hover); color: var(--ink); }
.card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.card .card-title { font-size: 13px; font-weight: 700; color: var(--ink2); }
.card pre { white-space: pre-wrap; font: 14px/1.5 var(--font); margin: 0; background: var(--surface2); padding: 8px 10px; border-radius: 6px; max-height: 240px; overflow: auto; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--mute); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; } }
.empty-chat { max-width: 720px; margin: 6vh auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-chat .avatar { width: 72px; height: 72px; font-size: 24px; }
.empty-chat h2 { margin: 6px 0 0; font-size: 20px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.quick button { border: 1px solid var(--line2); background: var(--surface); border-radius: 999px; padding: 7px 13px; font: 500 14px var(--font); color: var(--ink); cursor: pointer; }
.quick button:hover { border-color: var(--blue); color: var(--blue); }
.composer { padding: 10px 24px 14px; flex: none; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; max-width: 860px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); }
.composer-row:focus-within { border-color: var(--blue); }
.composer textarea { border: 0; resize: none; max-height: 220px; padding: 8px 6px; background: transparent; }
.composer textarea:focus { outline: none; }
.composer-foot { max-width: 860px; margin: 6px auto 0; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 860px; margin: 0 auto 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 10px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--mute); font-size: 14px; }
.chip.loading { opacity: .6; }
.attach { cursor: pointer; }

/* Đề xuất, tệp */
.seg { display: inline-flex; background: var(--surface2); border-radius: 9px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 7px; font: 600 13px var(--font); color: var(--mute); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.plist, .flist { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pitem { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); width: 100%; }
.pitem:hover { border-color: var(--line2); background: var(--hover); }
.pitem .code { font: 600 12px var(--mono); color: var(--mute); }
.pitem .title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem .sub { grid-column: 2 / 4; font-size: 12px; color: var(--mute); }
.fitem { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.fitem .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficon { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; background: var(--surface2); font: 700 10px var(--font); color: var(--ink2); flex: none; text-transform: uppercase; }

/* Ngăn chi tiết đề xuất */
.drawer { width: min(480px, 100vw); background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 15; box-shadow: -8px 0 28px rgba(10,16,30,.18); }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head .t { flex: 1; min-width: 0; }
.drawer-body { flex: 1; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.drawer .sec-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); margin-bottom: 6px; }
.drawer .pbody { white-space: pre-wrap; font-size: 14px; background: var(--surface2); border-radius: 8px; padding: 10px 12px; }
.people { display: flex; flex-direction: column; gap: 6px; }
.person { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.person .role { margin-left: auto; font-size: 12px; color: var(--mute); }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.cmt { display: flex; gap: 8px; }
.cmt .b { flex: 1; min-width: 0; }
.cmt .h { font-size: 12px; color: var(--mute); }
.cmt .h b { color: var(--ink); }
.cmt .txt { font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.cmt.event .txt { color: var(--mute); font-size: 13px; }
.mention { color: var(--blue3); background: var(--blue-soft); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.cbox { position: relative; }
.suggest { position: absolute; bottom: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 240px; overflow: auto; margin-bottom: 4px; z-index: 3; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.suggest button:hover, .suggest button.on { background: var(--hover); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Lịch */
.cal-wrap { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-grid .dow { font-size: 11px; text-align: center; color: var(--mute); font-weight: 700; padding: 2px 0; }
.day { aspect-ratio: 1; border: 0; border-radius: 7px; background: none; font: 500 13px var(--font); color: var(--ink); cursor: pointer; position: relative; display: grid; place-items: center; }
.day:hover { background: var(--hover); }
.day.out { visibility: hidden; }
.day.today { outline: 1.5px solid var(--blue); }
.day.sel { background: var(--blue); color: #fff; }
.day.has::after { content: ""; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.day.lv2::after { width: 7px; height: 7px; } .day.lv3::after { width: 9px; height: 9px; }
.day.sel::after { background: #fff; }
.jump select { margin-top: 4px; }
.day-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.day-item { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; text-align: left; width: 100%; font: inherit; color: var(--ink); }
.day-item:hover { background: var(--hover); }
.day-item .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); width: 72px; flex: none; }
.day-item .tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-item .tm { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }

.dialog { border: 0; border-radius: 14px; padding: 22px; width: min(620px, 94vw); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(10,16,30,.45); }
.dialog h2 { margin-top: 0; }
.pf-files { max-height: 160px; overflow: auto; }
.pf-files label { flex-direction: row; align-items: center; font-weight: 500; }
.pf-files input { width: auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 9px; font-size: 14px; z-index: 50; box-shadow: var(--shadow); max-width: 90vw; }

.only-mobile { display: none; }
@media (max-width: 900px) {
  .only-mobile { display: inline-grid; }
  .only-desktop { display: none; }
  .brand-sub { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 56px; bottom: 0; left: 0; width: 290px; z-index: 20; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .drawer { position: fixed; top: 56px; z-index: 21; }
  .exec-head, .pane { padding-left: 16px; padding-right: 16px; }
  .messages, .composer { padding-left: 12px; padding-right: 12px; }
  .cal-wrap { grid-template-columns: 1fr; }
  .msg.user .bubble { max-width: 92%; }
  .top-search { margin-left: 0; }
}

/* Trang cài đặt */
body.admin { min-height: 100%; }
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100% - 56px); }
.admin-nav { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { color: var(--ink2); padding: 8px 10px; border-radius: 7px; font-size: 14px; font-weight: 500; }
.admin-nav a:hover { background: var(--hover); text-decoration: none; }
.admin-nav a.on { background: var(--blue-soft); color: var(--blue3); font-weight: 700; }
.admin-main { padding: 22px 28px 48px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 700; color: var(--mute); background: var(--surface2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.tile b { font-size: 20px; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 26px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.bar i { display: block; height: var(--h, 0%); min-height: 2px; background: var(--blue); border-radius: 4px 4px 0 0; }
.bar span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--mute); }
.tree { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tree li { padding-left: calc(var(--d) * 20px); font-size: 14px; }
.copy { font-family: var(--mono); font-size: 13px; }
textarea.mono { font: 13px/1.5 var(--mono); }
.inline-details { display: inline-block; margin-left: 6px; }
@media (max-width: 800px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-main { padding: 16px; }
  .two { grid-template-columns: 1fr; }
}
