/* Trang quản lý: tông xanh dương doanh nghiệp */
:root {
  --brand: #2f6fdb; --brand-600: #255fc4; --brand-700: #1d4f9f; --brand-50: #ebf2fd; --brand-100: #d3e2fa;
  --bg: #f1f5fa; --line: #e2e8f0; --line-2: #edf1f6;
  --navy: #1b3a6b; --navy-2: #13294d;
}
body { background: var(--bg); }
.layout { display: flex; min-height: 100vh; }
.c-red { color: var(--danger); } .c-orange { color: var(--warn); }
.click { cursor: pointer; }
.list-row.click:hover { background: #f8fafc; }
.hide-sm { }
@media (max-width: 1200px) { .hide-sm { display: none; } }

/* ---- Sidebar ---- */
.side { width: 256px; flex-shrink: 0; background: linear-gradient(180deg, var(--navy) 0%, #1f4580 55%, var(--navy-2) 100%); color: #dbe6f7; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 12px; height: 72px; padding: 0 22px; font-weight: 800; font-size: 17px; color: #fff; }
.side-brand .logo { width: 40px; height: 40px; border-radius: 50%; background: #2f7fe8; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.side-brand .logo .ic { color: #fff; }
.side-brand small { display: block; font-size: 11px; font-weight: 500; color: #a9bfe0; }
.side nav { flex: 1; overflow: auto; padding: 8px 14px; }
.side .nav { display: flex; align-items: center; gap: 13px; width: 100%; border: 0; background: none; padding: 11px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14.5px; color: #e4ecf8; text-align: left; margin-bottom: 2px; }
.side .nav > .ic { width: 20px; height: 20px; color: #c3d4ee; }
.side .nav .arr { width: 16px; height: 16px; margin-left: auto; color: #8fa8cf; }
.side .nav:hover { background: rgba(255, 255, 255, .07); }
.side .nav.on { background: #2f7fe8; color: #fff; box-shadow: 0 4px 14px rgba(47, 127, 232, .35); }
.side .nav.on > .ic, .side .nav.on .arr { color: #fff; }
.side .nav .n { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; }
.subnav { margin: 0 0 6px 32px; }
.subnav button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: #c6d5ec; text-align: left; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.subnav button::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #8fa8cf; }
.subnav button:hover { color: #fff; }
.subnav button.on { color: #fff; font-weight: 700; background: rgba(255, 255, 255, .1); }
.subnav button.on::before { background: #5aa2ff; }
.side-foot { padding: 14px 22px; font-size: 11.5px; color: #8fa8cf; border-top: 1px solid rgba(255, 255, 255, .08); }

/* ---- Topbar ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 72px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.topbar .store { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.topbar .store select { border: 1px solid var(--line); border-radius: 8px; height: 40px; padding: 0 36px 0 12px; font-weight: 700; color: var(--text); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; min-width: 180px; cursor: pointer; }
.icon-btn.tb { width: 42px; height: 42px; }
.icon-btn.tb .ic { width: 22px; height: 22px; color: #3b4a5a; }
.reddot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.userbox { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 10px; margin-left: 6px; text-align: left; }
.userbox:hover { background: var(--line-2); }
.userbox small { display: block; font-size: 11px; color: var(--muted); }
.userbox b { font-size: 14px; }
.userbox .ic { width: 16px; height: 16px; color: var(--muted); }
.content { padding: 22px 26px 40px; }
.page-h { margin-bottom: 18px; }
.page-h .crumb { font-size: 12px; color: var(--muted); font-weight: 600; }
.page-h h1 { font-size: 22px; }
.menu-btn { display: none; }
@media (max-width: 1000px) {
  .side { position: fixed; left: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 10px; } .topbar .store span, .userbox span { display: none; } .topbar .store select { min-width: 0; }
  .content { padding: 14px 12px 30px; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 55; }
}

/* ---- Cards ---- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 3px rgba(20, 40, 80, .04); margin-bottom: 18px; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-h h3 { font-size: 16px; }
.card-h .sub { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.card-h .h-ic { color: var(--brand); display: inline-flex; }
.card-h .h-ic.red { color: var(--danger); }
.card-h a.small { font-weight: 700; }
.card-b { padding: 16px 18px; }
.cols { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .cols { grid-template-columns: 1fr 1fr; } .cols.c3 { grid-template-columns: 2fr 1fr; } }
.cols > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 18px; }
.stack > .card { margin-bottom: 0; }

/* ---- Dashboard ---- */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.hello h1 { font-size: 22px; }
.hello-ic { width: 46px; height: 46px; display: grid; place-items: center; color: var(--brand); }
.hello-ic .ic { width: 34px; height: 34px; }
.datebox.big { height: 46px; background: #fff; border-radius: 10px; padding: 0 4px; gap: 8px; box-shadow: 0 1px 3px rgba(20, 40, 80, .05); }
.datebox.big b { font-size: 15px; padding: 0 4px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kpis { grid-template-columns: 1fr; } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; gap: 14px; align-items: center; box-shadow: 0 1px 3px rgba(20, 40, 80, .04); }
.kpi[data-act] { cursor: pointer; }
.kpi[data-act]:hover { border-color: var(--brand-100); }
.kpi .ico { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex-shrink: 0; }
.kpi .ico .ic { width: 28px; height: 28px; }
.kpi .ico.red { background: var(--danger-bg); color: var(--danger); }
.kpi .ico.orange { background: var(--warn-bg); color: var(--warn); }
.kpi .ico.blue { background: var(--info-bg); color: var(--info); }
.kpi .k { font-size: 13px; color: var(--text-2); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 800; line-height: 1.2; }
.kpi .v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.ring { width: 62px; height: 62px; flex-shrink: 0; }
.ring text { font-size: 13px; font-weight: 800; fill: var(--text); font-family: var(--font); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; }
@media (max-width: 1250px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-grid .board-card { margin-bottom: 0; }
.score-pill { background: #e6f6ec; color: #1f8a4c; font-weight: 800; border-radius: 8px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.shortcuts { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; margin-top: 18px; }
@media (max-width: 1200px) { .shortcuts { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .shortcuts { grid-template-columns: repeat(2, 1fr); } }
.sc-tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 8px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 700; font-size: 13.5px; cursor: pointer; box-shadow: 0 1px 3px rgba(20, 40, 80, .04); transition: border-color .15s, transform .1s; }
.sc-tile .ic { width: 32px; height: 32px; color: var(--brand); stroke-width: 1.6; }
.sc-tile:hover { border-color: var(--brand-100); transform: translateY(-1px); }
.sc-tile:nth-child(6) .ic { color: #1e8e3e; }

/* ---- Bảng xếp ca (timeline) ---- */
.board-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; }
.selbox { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; height: 38px; padding: 0 4px 0 12px; font-size: 13px; color: var(--text-2); }
.selbox select { border: 0; outline: 0; background: transparent; font-weight: 700; height: 36px; cursor: pointer; }
.datebox { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; height: 38px; background: #fff; }
.datebox input { border: 0; outline: 0; height: 36px; padding: 0 4px; font-weight: 600; background: transparent; width: 130px; }
.datebox .dw { font-weight: 700; font-size: 13px; padding-right: 4px; }
.datebox .icon-btn { height: 36px; width: 32px; }
.icon-btn.bordered { border: 1px solid var(--line); height: 38px; width: 38px; }
.seg button.on { background: var(--brand); color: #fff; }
.tl-scroll { overflow: auto; max-height: calc(100vh - 360px); min-height: 280px; border-top: 1px solid var(--line-2); }
.fs-mode .tl-scroll { max-height: calc(100vh - 190px); }
.tl { font-size: 13px; }
.tl-head { display: flex; position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid var(--line); }
.tl-label { width: 140px; flex-shrink: 0; padding: 0 14px; display: flex; align-items: center; gap: 8px; font-weight: 600; position: sticky; left: 0; background: #fff; z-index: 2; border-right: 1px solid var(--line-2); }
.tl-label.person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-hours { flex: 1; display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.tl-h { font-size: 12px; font-weight: 700; color: var(--text-2); padding: 9px 0 9px 4px; border-left: 1px solid var(--line-2); }
.tl-area { display: flex; align-items: center; gap: 6px; background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: 13px; padding: 5px 12px; position: sticky; left: 0; border-bottom: 1px solid var(--line-2); }
.tl-area .ic { width: 15px; height: 15px; }
.tl-row { display: flex; min-height: 42px; border-bottom: 1px solid var(--line-2); }
.tl-row .tl-label { justify-content: flex-end; color: var(--text-2); font-size: 13px; }
.tl-track { flex: 1; position: relative; background-image: repeating-linear-gradient(to right, var(--line-2) 0 1px, transparent 1px 100%); background-size: calc(100% / var(--n, 15)) 100%; }
.tl-body { --n: 15; }
.tl-body .tl-track { background-size: calc(100% / var(--n)) 100%; }
.tl-zone { position: absolute; top: 4px; bottom: 4px; padding: 0 3px; display: flex; align-items: stretch; }
.tl-zone.over .tl-empty, .tl-zone.over .tl-bar { outline: 2px solid var(--brand); }
.tl.picking .tl-zone.drop { cursor: copy; }
.tl.picking .tl-zone.drop:hover .tl-empty { background: var(--brand-50); border-color: var(--brand); }
.tl-empty { flex: 1; border: 1.5px dashed #b9c8da; border-radius: 6px; display: grid; place-items: center; color: var(--brand); }
.tl-empty .ic { width: 18px; height: 18px; }
.tl-bar { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 0 10px 0 4px; border-radius: 6px; font-weight: 700; font-size: 13px; color: #1f2d3d; cursor: default; user-select: none; height: 100%; }
.tl-bar[draggable="true"] { cursor: grab; }
.tl-bar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-bar .star .ic { width: 14px; height: 14px; color: #f2b01e; fill: #f2b01e; }
.tl-bar.conf { background: #cfe2fb; }
.tl-bar.draft { background: #e3dcfa; }
.tl-bar.abs { background: #fbd9df; color: #b42343; }
.tl-bar.sel { outline: 2px solid var(--brand); outline-offset: 1px; }
.tl-bar.dragging { opacity: .4; }
.tl-bar[draggable="true"] { -webkit-touch-callout: none; -webkit-user-select: none; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; opacity: .92; box-shadow: 0 8px 22px rgba(20, 40, 70, .28); outline: 2px solid var(--brand); will-change: transform; }
body.touch-dragging { -webkit-user-select: none; user-select: none; }
.tl-zone .swap { position: absolute; top: -3px; left: 0; width: 16px; height: 16px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--warn); box-shadow: 0 0 0 1px var(--warn-bg); }
.tl-zone .swap .ic { width: 12px; height: 12px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 12.5px; color: var(--text-2); padding: 12px 18px; border-top: 1px solid var(--line-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .ic { width: 15px; height: 15px; }
.legend span:nth-child(5) .ic { color: #f2b01e; fill: #f2b01e; }
.legend span:nth-child(6) .ic { color: var(--warn); }
.lg-conf { background: #cfe2fb; } .lg-draft { background: #e3dcfa; } .lg-empty { border: 1.5px dashed #b9c8da; } .lg-abs { background: #fbd9df; }
.pool-h { display: flex; align-items: center; gap: 10px; padding: 12px 18px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pool-h .sub { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px 16px; min-height: 56px; }
.pool.over { background: var(--brand-50); }
.pool .tl-bar { flex: 0 0 auto; height: 34px; }
.pool .sc { font-size: 11px; background: #fff; border-radius: 99px; padding: 0 6px; color: var(--brand-700); }
.fs-mode { position: fixed; inset: 0; z-index: 100; background: var(--bg); padding: 12px; overflow: auto; }
.fs-mode .card { margin: 0; }

/* ---- Bảng / danh sách ---- */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-2); background: #f6f8fb; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f8fafd; }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl .input { height: 34px; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; font-weight: 600; }
.person span { font-size: 12px; color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.search { position: relative; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.search .input { padding-left: 34px; width: 280px; height: 38px; }
.alert-row, .list-row { display: flex; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line-2); }
.alert-row:last-child, .list-row:last-child { border-bottom: 0; }
.bar { height: 7px; background: var(--line-2); border-radius: 99px; overflow: hidden; width: 90px; }
.bar i { display: block; height: 100%; background: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.gallery a { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--line-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery span { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); color: #fff; font-size: 11px; padding: 14px 6px 4px; }
.perm td.c input { width: 17px; height: 17px; accent-color: var(--brand); }
.code { font-family: ui-monospace, Consolas, monospace; background: var(--line-2); padding: 2px 6px; border-radius: 5px; font-size: 13px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: .08em; background: var(--brand-50); color: var(--brand-700); padding: 10px 14px; border-radius: 8px; text-align: center; }
.notice-row { padding: 12px 18px; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; align-items: flex-start; }
.notice-row:last-child { border-bottom: 0; }

/* ---- Đăng nhập ---- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 52% 1fr; }
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; } .login-page .art { display: none; } }
.login-page .art {
  position: relative; overflow: hidden; color: #fff; padding: 40px 56px 56px; display: flex; flex-direction: column; min-height: 100vh;
  background:
    radial-gradient(ellipse 55% 45% at 78% 22%, rgba(120, 175, 255, .35), transparent 70%),
    radial-gradient(ellipse 60% 50% at 10% 90%, rgba(47, 127, 232, .45), transparent 70%),
    linear-gradient(160deg, #0b2e63 0%, #154a97 50%, #1f63c4 100%);
}
.login-page .art::before { content: ""; position: absolute; width: 820px; height: 820px; left: 36%; top: 12%; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .12); pointer-events: none; }
.art-photo { position: absolute; right: -7%; bottom: 0; height: 90%; max-width: 60%; object-fit: contain; object-position: right bottom; filter: drop-shadow(0 18px 40px rgba(0, 20, 60, .35)); pointer-events: none; }
.art-wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 26%; pointer-events: none; }
.glass { position: absolute; display: grid; place-items: center; border-radius: 22px; background: rgba(255, 255, 255, .14); border: 1.5px solid rgba(255, 255, 255, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0, 20, 60, .25); }
.glass .ic { color: #fff; stroke-width: 1.8; }
.g-cal { width: 118px; height: 118px; left: 26%; top: 22%; } .g-cal .ic { width: 62px; height: 62px; }
.g-bed { width: 94px; height: 94px; left: 42%; top: 13%; } .g-bed .ic { width: 50px; height: 50px; }
.g-users { width: 94px; height: 94px; left: 42%; top: 31%; } .g-users .ic { width: 50px; height: 50px; }
.login-page .art .brand-l { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 800; }
.login-page .art .brand-l .logo { width: 46px; height: 46px; border-radius: 50%; background: #2f7fe8; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.art-copy { position: relative; z-index: 2; margin-top: auto; max-width: 50%; padding-bottom: 6vh; text-shadow: 0 2px 12px rgba(0, 20, 60, .35); }
.login-page .art h2 { font-size: clamp(26px, 2.4vw, 36px); line-height: 1.25; }
.login-page .art p { opacity: .92; font-size: 15px; line-height: 1.6; }
.login-page .art ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; font-size: 14.5px; }
.login-page .art li { display: flex; gap: 12px; align-items: center; }
.login-page .art li .ic { background: rgba(255, 255, 255, .16); border-radius: 8px; padding: 7px; width: 36px; height: 36px; flex-shrink: 0; }
@media (max-width: 1250px) { .glass { display: none; } .art-copy { max-width: 60%; } }
.login-page .form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: #fff; }
.login-page form { width: 100%; max-width: 380px; }
.login-page form h1 { font-size: 26px; }
.login-page form .input { height: 46px; }
.err { background: var(--danger-bg); color: var(--danger); padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
